/* KIS Workflow System — Design System (iOS 2026-inspired) */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --kis-primary:        #007AFF;
    --kis-primary-dark:   #0056CC;
    --kis-primary-light:  #E8F1FF;
    --kis-success:        #34C759;
    --kis-warning:        #FF9500;
    --kis-danger:         #FF3B30;
    --kis-info:           #5AC8FA;

    --kis-bg:             #F2F2F7;
    --kis-surface:        #FFFFFF;
    --kis-surface-2:      #F9F9FB;
    --kis-surface-alt:    #F5F5F7;
    --kis-sidebar-bg:     #1C1C1E;
    --kis-sidebar-text:   #EBEBF5;
    --kis-sidebar-active: rgba(255,255,255,0.12);
    --kis-topbar-bg:      rgba(255,255,255,0.85);
    --kis-overlay:        rgba(0,0,0,0.4);

    --kis-text:           #1C1C1E;
    --kis-text-secondary: #6D6D72;
    --kis-text-tertiary:  #AEAEB2;
    --kis-border:         #E5E5EA;
    --kis-separator:      #C6C6C8;

    --kis-radius-sm:      8px;
    --kis-radius:         12px;
    --kis-radius-lg:      16px;
    --kis-radius-xl:      20px;
    --kis-radius-full:    9999px;

    --kis-shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --kis-shadow:         0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --kis-shadow-lg:      0 12px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
    --kis-shadow-modal:   0 24px 64px rgba(0,0,0,0.16);

    --kis-font:           -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    --kis-font-mono:      'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

    --kis-sidebar-w:      260px;
    --kis-topbar-h:       64px;
    --kis-transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body.kis-page {
    font-family: var(--kis-font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--kis-text);
    background: var(--kis-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.kis-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 50%, #1C1C1E 100%);
    padding: 24px;
}

.kis-login-card {
    background: var(--kis-surface);
    border-radius: var(--kis-radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--kis-shadow-modal);
}

.kis-login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.kis-login-logo img {
    height: 48px;
    width: auto;
}

/* v1.211.0 — Branding: login background video / photo + uploaded logo. */
.kis-login-wrap.has-bg { position: relative; overflow: hidden; background: #0d1420; }
.kis-login-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.kis-login-wrap.has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
}
.kis-login-wrap.has-bg .kis-login-card { position: relative; z-index: 2; }
.kis-login-logo img.kis-login-logo-img {
    display: block;
    height: auto;
    max-height: 72px;
    max-width: 200px;
    margin: 0 auto 12px;
    object-fit: contain;
}
@media (prefers-reduced-motion: reduce) { video.kis-login-bg { display: none; } }

.kis-login-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--kis-text);
    margin-top: 12px;
    letter-spacing: -0.3px;
}

.kis-login-logo p {
    font-size: 13px;
    color: var(--kis-text-secondary);
    margin-top: 4px;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.kis-app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.kis-sidebar {
    width: var(--kis-sidebar-w);
    background: var(--kis-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--kis-transition);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.kis-sidebar::-webkit-scrollbar { width: 4px; }
.kis-sidebar::-webkit-scrollbar-track { background: transparent; }
.kis-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.kis-sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.kis-sidebar-brand {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kis-sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--kis-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* v1.211.0 — Branding: an uploaded sidebar logo replaces the 🔷 tile. */
.kis-sidebar-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}
.kis-sidebar-brand > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }

.kis-nav {
    padding: 12px 12px;
    flex: 1;
}

.kis-nav-section {
    margin-bottom: 4px;
}

.kis-nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.35);
    padding: 16px 8px 6px;
}

.kis-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--kis-radius-sm);
    color: var(--kis-sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    transition: background var(--kis-transition), color var(--kis-transition);
    cursor: pointer;
    margin-bottom: 2px;
    opacity: 0.8;
}

.kis-nav-item:hover {
    background: rgba(255,255,255,0.08);
    opacity: 1;
}

.kis-nav-item.active {
    background: var(--kis-primary);
    color: #FFFFFF;
    opacity: 1;
    font-weight: 500;
}

.kis-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Topbar */
.kis-topbar {
    position: fixed;
    top: 0;
    left: var(--kis-sidebar-w);
    right: 0;
    height: var(--kis-topbar-h);
    background: var(--kis-topbar-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--kis-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 99;
    transition: left var(--kis-transition);
}

.kis-topbar-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    /* Full height + shrinkable so the module-tab strip can fill the bar and
       scroll instead of pushing the bell/user menu out. */
    align-self: stretch;
    min-width: 0;
}

.kis-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kis-company-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--kis-surface-2);
    border: 1px solid var(--kis-border);
    border-radius: var(--kis-radius);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--kis-text);
    transition: background var(--kis-transition);
    min-width: 180px;
}

.kis-company-switcher:hover {
    background: var(--kis-border);
}

.kis-company-switcher select {
    background: none;
    border: none;
    outline: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.kis-page-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--kis-text);
    letter-spacing: -0.2px;
}

.kis-notification-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: var(--kis-radius);
    background: var(--kis-surface-2);
    border: 1px solid var(--kis-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background var(--kis-transition);
    text-decoration: none;
    color: var(--kis-text);
}

.kis-notification-btn:hover { background: var(--kis-border); }

.kis-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--kis-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--kis-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--kis-surface);
}

.kis-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--kis-radius);
    background: var(--kis-surface-2);
    border: 1px solid var(--kis-border);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--kis-text);
    position: relative;
    transition: background var(--kis-transition);
}

.kis-user-menu:hover { background: var(--kis-border); }

.kis-avatar {
    width: 28px;
    height: 28px;
    background: var(--kis-primary);
    border-radius: var(--kis-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* Main content */
.kis-main {
    margin-left: var(--kis-sidebar-w);
    margin-top: var(--kis-topbar-h);
    flex: 1;
    min-width: 0;
    padding: 28px 28px;
    transition: margin-left var(--kis-transition);
}

/* Mobile menu toggle */
.kis-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: var(--kis-radius-sm);
    cursor: pointer;
    font-size: 20px;
    color: var(--kis-text);
    background: none;
    border: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.kis-card {
    background: var(--kis-surface);
    border-radius: var(--kis-radius-lg);
    box-shadow: var(--kis-shadow-sm);
    border: 1px solid var(--kis-border);
    overflow: hidden;
}

.kis-card-header {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kis-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--kis-text);
    letter-spacing: -0.2px;
}

.kis-card-body {
    padding: 20px 24px 24px;
}

.kis-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--kis-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--kis-surface-2);
}

/* Stat cards */
.kis-stat-card {
    background: var(--kis-surface);
    border-radius: var(--kis-radius-lg);
    border: 1px solid var(--kis-border);
    box-shadow: var(--kis-shadow-sm);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kis-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--kis-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kis-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--kis-text);
    letter-spacing: -1px;
    line-height: 1;
}

.kis-stat-sub {
    font-size: 13px;
    color: var(--kis-text-secondary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.kis-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--kis-radius);
    font-family: var(--kis-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
    transition: background var(--kis-transition), opacity var(--kis-transition), transform var(--kis-transition);
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.kis-btn:active { transform: scale(0.97); }
.kis-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.kis-btn:disabled:active { transform: none; }

.kis-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--kis-radius-sm);
}

.kis-btn-lg {
    padding: 13px 24px;
    font-size: 16px;
}

.kis-btn-primary {
    /* Dashboard-derived accent: blue -> indigo gradient (matches the KPI cards) */
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(88,86,214,0.30);
}
.kis-btn-primary:hover {
    background: linear-gradient(135deg, #0068DB 0%, #4A48C0 100%);
    box-shadow: 0 4px 16px rgba(88,86,214,0.40);
    transform: translateY(-1px);
}

.kis-btn-secondary {
    background: var(--kis-surface-2);
    color: var(--kis-text);
    border: 1px solid var(--kis-border);
}
.kis-btn-secondary:hover { background: var(--kis-border); }

.kis-btn-danger {
    background: var(--kis-danger);
    color: #fff;
}
.kis-btn-danger:hover { background: #D70015; }

/* Same red styling as .kis-btn-danger, but for non-destructive actions (e.g. Require Revision) —
   must NOT be swept up by the "hide all delete UI for non-super-admins" rule in wrapper.php */
.kis-btn-caution {
    background: var(--kis-danger);
    color: #fff;
}
.kis-btn-caution:hover { background: #D70015; }

.kis-btn-ghost {
    background: transparent;
    color: var(--kis-primary);
    border: 1px solid var(--kis-primary);
}
.kis-btn-ghost:hover { background: var(--kis-primary-light); }

.kis-btn-xs {
    padding: 4px 10px;
    font-size: 13px;
    border-radius: var(--kis-radius-sm);
    min-width: 30px;
    height: 30px;
}

.kis-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--kis-radius-sm);
    background: var(--kis-surface-2);
    color: var(--kis-text-secondary);
    border: 1px solid var(--kis-border);
    font-size: 16px;
}
.kis-btn-icon:hover { background: var(--kis-border); color: var(--kis-text); }

/* ============================================================
   FORMS
   ============================================================ */
.kis-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grid layouts */
.kis-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 24px;
}

.kis-form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 24px;
}

/* When form-grid is a direct child of a card (no card-body wrapper), add padding */
.kis-card > form > .kis-form-grid,
.kis-card > form > .kis-form-grid-3 {
    padding: 24px;
}

/* Full-width field spanning both columns */
.kis-field-full,
.kis-field.full-width {
    grid-column: 1 / -1;
}

/* Form section with a title */
.kis-form-section {
    grid-column: 1 / -1;
    margin-top: 8px;
}

.kis-form-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--kis-text);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-bottom: 10px;
    /* Dashboard accent: gradient underline drawn as a background strip (reliable) */
    background: linear-gradient(90deg, #007AFF 0%, #5856D6 55%, #AF52DE 100%) no-repeat bottom / 100% 2px;
    margin-bottom: 0;
}

/* Dashboard accent on boxed form section headers. `.kis-form-section-header` is
   defined inline per-form; this nested selector (specificity 0,2,0) overrides
   those inline rules. Only colours change — padding/size untouched, no shift. */
.kis-form-section .kis-form-section-header {
    background: linear-gradient(90deg, rgba(88,86,214,0.10) 0%, rgba(175,82,222,0.05) 100%);
    box-shadow: inset 3px 0 0 0 #5856D6;
    border-bottom-color: rgba(88,86,214,0.25);
}

/* Individual field */
.kis-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Label */
.kis-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--kis-text-secondary);
    letter-spacing: 0.1px;
}

.kis-label .required {
    color: var(--kis-danger);
    margin-left: 2px;
}

/* Inputs, selects, textareas */
.kis-input,
.kis-select,
.kis-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--kis-border);
    border-radius: var(--kis-radius);
    font-family: var(--kis-font);
    font-size: 14px;
    color: var(--kis-text);
    background: var(--kis-surface);
    outline: none;
    transition: border-color var(--kis-transition), box-shadow var(--kis-transition), background var(--kis-transition);
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.5;
}

.kis-input:hover:not(:focus):not([readonly]):not(:disabled),
.kis-select:hover:not(:focus):not(:disabled),
.kis-textarea:hover:not(:focus):not([readonly]):not(:disabled) {
    border-color: var(--kis-separator);
}

.kis-input:focus,
.kis-select:focus,
.kis-textarea:focus {
    border-color: #5856D6;
    box-shadow: 0 0 0 3px rgba(88,86,214,0.16);
    background: var(--kis-surface);
}

.kis-input::placeholder,
.kis-textarea::placeholder { color: var(--kis-text-tertiary); }

/* Readonly / computed fields */
.kis-input[readonly],
.kis-input[style*="background:var(--kis-surface-alt)"] {
    background: var(--kis-surface-alt) !important;
    color: var(--kis-text-secondary);
    cursor: default;
    border-color: var(--kis-border);
}

/* Select arrow */
.kis-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236D6D72' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

/* Textarea */
.kis-textarea {
    resize: vertical;
    min-height: 90px;
}

/* Hint & error text */
.kis-field-hint {
    font-size: 12px;
    color: var(--kis-text-secondary);
    margin-top: 1px;
}

.kis-field-error {
    font-size: 12px;
    color: var(--kis-danger);
    margin-top: 1px;
}

.kis-input.error,
.kis-select.error,
.kis-textarea.error {
    border-color: var(--kis-danger);
    box-shadow: 0 0 0 3px rgba(255,59,48,0.08);
}

/* File input */
input[type="file"].kis-input,
input[type="file"] {
    padding: 9px 14px;
    border: 1.5px dashed var(--kis-border);
    border-radius: var(--kis-radius);
    background: var(--kis-surface-alt);
    font-size: 13px;
    color: var(--kis-text-secondary);
    cursor: pointer;
    width: 100%;
    transition: border-color var(--kis-transition);
}

input[type="file"]:hover {
    border-color: var(--kis-primary);
    color: var(--kis-text);
}

/* Form actions bar */
.kis-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--kis-border);
    background: var(--kis-surface-2);
}

/* Attachment list */
.kis-attachment-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.kis-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--kis-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--kis-radius-sm);
    background: var(--kis-primary-light);
    transition: background var(--kis-transition);
}

.kis-attachment-link:hover {
    background: rgba(0,122,255,0.15);
}

/* Detail view label (used in view.php) */
.kis-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--kis-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 3px;
}

/* Line items table (quotes) */
.kis-line-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 4px;
}

.kis-line-items th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--kis-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--kis-surface-alt);
    border-bottom: 1px solid var(--kis-border);
}

.kis-line-items td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--kis-border);
    vertical-align: middle;
}

.kis-line-items tr:last-child td { border-bottom: none; }

.kis-line-items .kis-input {
    padding: 7px 10px;
    border-radius: var(--kis-radius-sm);
    font-size: 13px;
}

/* v1.201.0 — Quote line items (quotes/form.php). A FIXED layout: every column keeps
   the width its <col> gives it, so the Unit / Qty / Price / Disc boxes can never be
   squeezed to a sliver again; Description takes the rest. Below min-width the
   .kis-table-wrap scrolls sideways instead. Tight cell + box padding is what gives
   the text its room — the 16px cell and 14px box padding of .kis-table/.kis-input
   left ~15px of a 78px column.
   ⚠ Every selector carries `.kis-table-wrap .kis-table.kis-qli` ON PURPOSE: the generic
   `.kis-table td` (16px padding) and `.kis-table-wrap .kis-table { min-width: max-content }`
   rules come LATER in this file at equal specificity, and silently won over the first
   version of these rules. */
.kis-table-wrap .kis-table.kis-qli { table-layout: fixed; width: 100%; min-width: 1044px; }
.kis-table-wrap .kis-table.kis-qli > thead > tr > th,
.kis-table-wrap .kis-table.kis-qli > tbody > tr > td { padding: 8px 6px; }
.kis-table-wrap .kis-table.kis-qli > thead > tr > th { font-size: 11.5px; letter-spacing: .02em; }
.kis-table-wrap .kis-table.kis-qli td .kis-input { width: 100%; min-width: 0; box-sizing: border-box; padding: 7px 8px; font-size: 13px; border-radius: var(--kis-radius-sm); }
.kis-table-wrap .kis-table.kis-qli td textarea.kis-input { padding: 8px 10px; }
.kis-table-wrap .kis-table.kis-qli td input[type="number"].kis-input { text-align: right; font-variant-numeric: tabular-nums; }
.kis-table-wrap .kis-table.kis-qli .kis-qli-serial { text-align: center; padding-left: 4px; padding-right: 4px; }
.kis-table-wrap .kis-table.kis-qli .kis-qli-num { text-align: right; }
.kis-table-wrap .kis-table.kis-qli .kis-qli-money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }

/* P&L totals summary */
.kis-totals-box {
    background: var(--kis-surface-2);
    border: 1px solid var(--kis-border);
    border-radius: var(--kis-radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
}

.kis-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--kis-text-secondary);
}

.kis-totals-row.total {
    font-weight: 700;
    font-size: 16px;
    color: var(--kis-text);
    padding-top: 8px;
    border-top: 1.5px solid var(--kis-separator);
    margin-top: 4px;
}

/* Toggle / checkbox */
.kis-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.kis-toggle {
    position: relative;
    width: 44px;
    height: 26px;
    background: var(--kis-border);
    border-radius: var(--kis-radius-full);
    transition: background var(--kis-transition);
    flex-shrink: 0;
}

.kis-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: var(--kis-radius-full);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform var(--kis-transition);
}

input:checked + .kis-toggle {
    background: var(--kis-primary);
}

input:checked + .kis-toggle::after {
    transform: translateX(18px);
}

/* ============================================================
   BADGES
   ============================================================ */
.kis-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--kis-radius-full);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.kis-badge-green  { background: rgba(52,199,89,0.12);   color: #1A7F37; }
.kis-badge-amber  { background: rgba(255,149,0,0.12);   color: #B25000; }
.kis-badge-red    { background: rgba(255,59,48,0.12);   color: #C00; }
.kis-badge-blue   { background: rgba(0,122,255,0.12);   color: var(--kis-primary); }
.kis-badge-grey,
.kis-badge-gray   { background: rgba(142,142,147,0.12); color: var(--kis-text-secondary); }
.kis-badge-purple { background: rgba(175,82,222,0.12);  color: #7A00CC; }

/* ============================================================
   TABLES
   ============================================================ */
.kis-table-wrap {
    overflow: auto;
    border-radius: var(--kis-radius-lg);
    border: 1px solid var(--kis-border);
    background: var(--kis-surface);
    /* Grid viewport (v1.126.0): the wrap used to grow as tall as its data, which
       parked the horizontal scrollbar below the last row — on a long list you had
       to scroll to the bottom before you could scroll sideways. Capping the height
       keeps BOTH scrollbars on screen. kisSizeGrid() (kis-main.js) replaces this
       with the real space left under the wrap; this calc is the pre-JS fallback.
       Opt a single grid out with class="kis-table-wrap kis-no-viewport". */
    max-height: calc(100vh - 260px);
}

.kis-table-wrap.kis-no-viewport { max-height: none; }

.kis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Content-fit tables: size every column to its content so nothing wraps or
   gets squished; the .kis-table-wrap (overflow-x:auto) scrolls sideways when
   the table is wider than its container. Matches the Employees table look. */
.kis-table-wrap .kis-table {
    min-width: max-content;
}

/* ── Frozen header + frozen leading column(s) (v1.126.0) ───────────────────
   Companion to the height cap above: inside a capped pane the header row would
   scroll out of view and, on a wide table, you would lose track of which row you
   were reading once you scrolled right. thead sticks to the top of the pane here;
   the leading identity column(s) are pinned by kisFreezeGrid() (kis-main.js),
   which sets position/left inline and tags the cells .kis-frz (+ .kis-frz-edge on
   the last pinned one). Opt out with class="kis-table-wrap kis-no-freeze".
   The header keeps a box-shadow copy of its bottom rule because border-collapse
   tables drop a sticky cell's own border while scrolling. */
.kis-table-wrap .kis-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: inset 0 -2px 0 rgba(88,86,214,0.50);
}

/* Pinned cells need an opaque background or the columns underneath show through.
   Rows carry the background and the pinned cell inherits it, so row hover, the
   selected-row tint and any per-row inline tint all follow for free. */
.kis-table tbody tr { background: var(--kis-surface); }
.kis-table tbody td.kis-frz { background: inherit; z-index: 2; }
.kis-table > thead > tr > th.kis-frz,
.kis-table > tfoot > tr > td.kis-frz { z-index: 4; }
.kis-table tfoot td.kis-frz { background: var(--kis-surface); }

/* Separator on the last pinned column. Without a line, the columns sliding
   underneath just read as chopped-off text. Chrome does NOT paint box-shadow on
   cells of a border-collapse table (it does paint their borders), so the line is
   a border and the depth cue when the pane is actually scrolled sideways is a
   pseudo-element gradient — .kis-grid-scrolled is toggled by the scroll handler
   in kisSizeGrid(). The pseudo-element anchors to the cell because position:sticky
   makes it a containing block. */
.kis-table .kis-frz-edge { border-right: 1px solid var(--kis-border); }

.kis-table .kis-frz-edge::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: -9px;
    width: 9px;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--kis-transition);
    background: linear-gradient(to right, rgba(0,0,0,0.16), rgba(0,0,0,0));
}
.kis-table-wrap.kis-grid-scrolled .kis-frz-edge::after { opacity: 1; }

.kis-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #3A3A3C;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    /* Dashboard-derived accent: indigo-tinted header + indigo accent line */
    background: linear-gradient(180deg, #ECEBFA 0%, #E1E0F4 100%);
    border-bottom: 2px solid rgba(88,86,214,0.50);
    white-space: nowrap;
}

.kis-table td {
    padding: 13px 16px;
    color: var(--kis-text);
    border-bottom: 1px solid var(--kis-border);
    vertical-align: middle;
}

.kis-table tr:last-child td { border-bottom: none; }

.kis-table tbody tr {
    transition: background var(--kis-transition);
    cursor: default;
}

.kis-table tbody tr:hover { background: #F6F5FE; }
.kis-table tbody tr.kis-row-selected { background: #eff6ff; }
.kis-table tbody tr.kis-row-selected:hover { background: #dbeafe; }

.kis-table .actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.kis-action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.kis-btn-outline {
    background: transparent;
    border: 1.5px solid var(--kis-primary);
    color: var(--kis-primary);
}
.kis-btn-outline:hover {
    background: var(--kis-primary);
    color: #fff;
}

/* ============================================================
   CONTEXT MENU (right-click)
   ============================================================ */
.kis-ctx-menu {
    position: fixed;
    z-index: 99999;
    background: var(--kis-surface);
    border: 1px solid var(--kis-border);
    border-radius: var(--kis-radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    padding: 6px 0;
    min-width: 180px;
    user-select: none;
}
.kis-ctx-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--kis-text);
    transition: background var(--kis-transition);
}
.kis-ctx-menu-item:hover { background: var(--kis-surface-2); }
.kis-ctx-menu-item.danger { color: var(--kis-danger); }
.kis-ctx-menu-item.danger:hover { background: #fff1f2; }

.kis-view-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.kis-view-table th,
.kis-view-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--kis-border);
    text-align: left;
    vertical-align: top;
}
.kis-view-table th {
    width: 38%;
    color: var(--kis-text-muted);
    font-weight: 500;
    white-space: nowrap;
}
.kis-view-table td {
    color: var(--kis-text);
}

/* ============================================================
   MODALS
   ============================================================ */
/* .kis-modal-backdrop was written by hand in a few views that never had a rule
   here, so those modals rendered inline in the document flow — top-left, unpadded,
   under the grid (v1.156.0). The views were corrected; this alias keeps any
   straggler centred instead of failing silently. */
.kis-modal-overlay,
.kis-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--kis-overlay);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: kisOverlayIn 0.15s ease;
}

@keyframes kisOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.kis-modal {
    background: var(--kis-surface);
    border-radius: var(--kis-radius-xl);
    box-shadow: var(--kis-shadow-modal);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: kisModalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.kis-modal-lg { max-width: 760px; }
.kis-modal-xl { max-width: 960px; }

@keyframes kisModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.kis-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--kis-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.kis-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--kis-text);
    letter-spacing: -0.3px;
}

.kis-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--kis-radius-sm);
    background: var(--kis-surface-2);
    border: 1px solid var(--kis-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--kis-text-secondary);
    transition: background var(--kis-transition);
    line-height: 1;
}
.kis-modal-close:hover { background: var(--kis-border); }

.kis-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.kis-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--kis-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--kis-surface-2);
    flex-shrink: 0;
}

/* Typeahead result list that must escape a scrolling modal body.
   .kis-modal-body { overflow-y:auto } clips absolutely-positioned dropdowns
   regardless of z-index, so these lists are fixed-positioned instead —
   viewport coordinates + max-height come from kisDropStyle() at open time. */
.kis-typeahead-drop {
    position: fixed;
    z-index: 3000;
    background: var(--kis-surface, #fff);
    border: 1px solid var(--kis-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    overflow-y: auto;
}

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.kis-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.kis-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--kis-radius-lg);
    background: var(--kis-sidebar-bg);
    color: #fff;
    font-size: 14px;
    font-weight: 450;
    box-shadow: var(--kis-shadow-lg);
    pointer-events: all;
    animation: kisToastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 280px;
    max-width: 400px;
}

@keyframes kisToastIn {
    from { opacity: 0; transform: translateX(20px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.kis-toast-success { background: #1A7F37; }
.kis-toast-error   { background: #C00; }
.kis-toast-warning { background: #B25000; }

.kis-alert {
    padding: 14px 16px;
    border-radius: var(--kis-radius);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.kis-alert-error   { background: rgba(255,59,48,0.08);  color: #C00;     border: 1px solid rgba(255,59,48,0.2); }
.kis-alert-success { background: rgba(52,199,89,0.08);  color: #1A7F37;  border: 1px solid rgba(52,199,89,0.2); }
.kis-alert-warning { background: rgba(255,149,0,0.08);  color: #B25000;  border: 1px solid rgba(255,149,0,0.2); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.kis-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.kis-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--kis-text);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.kis-page-header p {
    font-size: 14px;
    color: var(--kis-text-secondary);
    margin-top: 4px;
}

/* ============================================================
   SEARCH & FILTERS
   ============================================================ */
.kis-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* A toolbar that IS the whole card header (grid lists: filter selects + action
   buttons, no title) must span the header. .kis-card-header is itself a flex
   row, so as a flex item the toolbar otherwise hugs its content (fit-content):
   the action cluster's margin-left:auto has no free space to absorb — its
   buttons sit jammed mid-card right against ⧩ Filter — and the exact-fit width
   makes line-breaking fragile, dropping Filter/Print onto a second line for no
   visible reason (v1.77.8, Accounts → HRM Salaries reports). */
.kis-card-header > .kis-toolbar:only-child { flex: 1 1 auto; min-width: 0; }

/* Right-aligned action-button cluster inside a toolbar. Keeps CSV/Import/Columns/
   Print/Add together and pushed to the right; if the row is too tight the whole
   cluster wraps to the next line as a unit and stays right-aligned — instead of
   individual buttons dropping to a second line left-aligned. */
.kis-toolbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Desktop (v1.77.7): the toolbar WRAPS when the row is genuinely too tight — the
   action cluster (margin-left:auto) drops to the next line as one unit and stays
   right-aligned. Do NOT bring back `flex-wrap:nowrap !important` here: forcing one
   row has no safe escape at tight widths — a shrinkable cluster (min-width:0)
   squeezes below its widest button and its flex-end lines overhang LEFT into the
   ⧩ Filter button, while a floored one (min-width:min-content) pushes buttons
   off-screen because Chrome computes a wrap flex container's min-content as ONE
   line. Both were shipped and reverted on 2026-07-19 (v1.5x–v1.77.6). When
   everything fits, this still renders as the single desktop row. */
@media (min-width: 769px) {
    .kis-toolbar > .kis-search-wrap { min-width: 120px; }
    .kis-toolbar > .kis-input { flex: 0 1 auto; min-width: 90px; }
    .kis-toolbar-actions { flex: 0 1 auto; min-width: 0; }
}

/* v1.204.0 — ONE-ROW toolbars (Kareem 2026-10-01). The classes below are set
   ONLY by the toolbar code at the end of kis-main.js, which is the "safe escape"
   the note above asks for: it forces one row (kis-tb-fit), moves the buttons
   that do not fit into a "More ▾" menu, and hands the row back to wrapping
   (kis-tb-wraps) when even that is not enough. With no JS, nothing here applies
   and the toolbar wraps exactly as before.
   ⚠ !important on flex-wrap: several views set flex-wrap:wrap inline. */
.kis-toolbar.kis-tb-fit { flex-wrap: nowrap !important; min-width: 0; }
.kis-toolbar.kis-tb-fit > .kis-toolbar-actions { flex: 0 0 auto; flex-wrap: nowrap !important; }
.kis-toolbar.kis-tb-fit > .kis-btn,
.kis-toolbar.kis-tb-fit > .kis-toolbar-actions > .kis-btn,
.kis-toolbar.kis-tb-fit .kis-gf > .kis-btn,
.kis-toolbar.kis-tb-fit .kis-att-grpwrap > .kis-btn,
.kis-toolbar.kis-tb-fit .kis-grpwrap > .kis-btn { white-space: nowrap; flex-shrink: 0; }
/* While measuring, nothing may shrink: the row is judged at its natural widths. */
.kis-toolbar.kis-tb-measure > * { flex-shrink: 0 !important; }
.kis-toolbar.kis-tb-fit.kis-tb-wraps { flex-wrap: wrap !important; }
.kis-toolbar.kis-tb-fit.kis-tb-wraps > .kis-toolbar-actions { flex: 0 1 auto; flex-wrap: wrap !important; }

.kis-tb-more { position: relative; flex: 0 0 auto; }
.kis-tb-more[hidden] { display: none; }
.kis-tb-more-btn { white-space: nowrap; }
.kis-tb-count:empty { display: none; }
.kis-tb-count {
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--kis-accent, #007AFF);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}
/* A filter / grouping in force inside the menu shows on the More button itself. */
.kis-tb-more-btn.kis-tb-more-on { border-color: var(--kis-accent, #007AFF); color: var(--kis-accent, #007AFF); }
/* position:fixed — a .kis-card clips its overflow and would cut the menu off. */
.kis-tb-menu {
    position: fixed;
    z-index: 9990;
    min-width: 200px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--kis-surface, #fff);
    border: 1px solid var(--kis-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.kis-tb-menu[hidden] { display: none; }
.kis-tb-menu > .kis-btn,
.kis-tb-menu > .kis-gf > .kis-btn,
.kis-tb-menu > .kis-att-grpwrap > .kis-btn,
.kis-tb-menu > .kis-grpwrap > .kis-btn {
    width: 100%;
    justify-content: flex-start;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    white-space: nowrap;
    text-decoration: none;
}
.kis-tb-menu > .kis-btn:hover,
.kis-tb-menu > .kis-gf > .kis-btn:hover,
.kis-tb-menu > .kis-att-grpwrap > .kis-btn:hover { background: var(--kis-surface-2, #f3f4f6); transform: none; }
/* A view switch keeps its own look inside the menu. */
.kis-tb-menu > .kis-seg { align-self: flex-start; margin: 4px 6px; }
/* The menu sits at the right edge: a panel opened from inside it grows leftwards. */
.kis-tb-menu .kis-att-grppanel { left: auto; right: 0; }

.kis-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.kis-search-icon {
    display: none;
}

.kis-search-input {
    padding-left: var(--kis-input-padding-x, 14px);
}

/* ============================================================
   TABS
   ============================================================ */
.kis-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--kis-border);
    margin-bottom: 24px;
}

.kis-tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--kis-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--kis-transition), border-color var(--kis-transition);
    white-space: nowrap;
}

.kis-tab:hover { color: var(--kis-text); }

.kis-tab.active {
    color: var(--kis-text);
    font-weight: 600;
    background: linear-gradient(90deg, #007AFF 0%, #5856D6 55%, #AF52DE 100%) no-repeat bottom / 100% 3px;
}

/* Secondary tab buttons (.kis-tab-btn) used in Estimation & Employees sub-tabs.
   These were previously unstyled default buttons — give them the same flat-tab
   look as .kis-tab so every module's tabs are consistent, with the same
   dashboard-derived accent (black text + blue->indigo->purple underline). */
.kis-tab-btn {
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--kis-text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--kis-transition), border-color var(--kis-transition);
}
.kis-tab-btn:hover { color: var(--kis-text); }
.kis-tab-btn.active {
    color: var(--kis-text);
    font-weight: 600;
    background: linear-gradient(90deg, #007AFF 0%, #5856D6 55%, #AF52DE 100%) no-repeat bottom / 100% 3px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.kis-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 13px;
    color: var(--kis-text-secondary);
    gap: 12px;
    flex-wrap: wrap;
}

/* HRM secondary sub-tab row (under the top-level group tabs) */
.kis-hrm-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 2px 0;
    margin: -8px 0 18px;
    border-bottom: 1px solid var(--kis-border);
}
.kis-hrm-subtab {
    padding: 7px 15px;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--kis-text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
    transition: background .15s, color .15s;
}
.kis-hrm-subtab:hover {
    background: var(--kis-surface-alt, #f4f4f7);
    color: var(--kis-text);
}
.kis-hrm-subtab.active {
    color: var(--kis-primary, #4f46e5);
    background: var(--kis-surface, #fff);
    border-color: var(--kis-border);
    border-bottom-color: var(--kis-surface, #fff);
}

/* ── Segmented "filter" strip (v1.50.0 HRM redesign) ─────────────────────────
   Replaces the second tab row: the active group's sub-views read as filters,
   not navigation. Same links (?tab=…) as before — chrome only. */
.kis-hrm-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    margin: -6px 0 18px;
    background: var(--kis-surface-alt, #f4f4f7);
    border: 1px solid var(--kis-border);
    border-radius: 10px;
    max-width: 100%;
}
.kis-hrm-seg-btn {
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--kis-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.kis-hrm-seg-btn:hover {
    color: var(--kis-text);
}
.kis-hrm-seg-btn.active {
    color: var(--kis-primary, #4f46e5);
    background: var(--kis-surface, #fff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}
/* v1.209.0 — HRM: the strip + a slot beside it (the employees Category dropdown). */
.kis-hrm-segrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: -6px 0 18px;
}
.kis-hrm-segrow .kis-hrm-seg { margin: 0; }

/* ⚙ Settings gear tab — pushed to the far right of the one tab row. */
.kis-crm-tab.kis-tab-gear {
    margin-left: auto;
    font-size: 16px;
    color: var(--kis-text-tertiary, #9a9aa2);
}
.kis-crm-tab.kis-tab-gear.active,
.kis-crm-tab.kis-tab-gear:hover {
    color: var(--kis-text);
}

/* ── Module tab row in-page (HRM v1.52.0, CRM v1.53.0, Job Operations v1.54.0,
   Estimation v1.55.0, Vehicles v1.56.0, Job Management v1.57.0) — out of the
   topbar, flush to the top of the content, tight. Applied per-module (HRM + CRM +
   Job Operations + Estimation + Vehicles + Job Management so far); modules not yet
   redesigned keep the topbar tabs. Cancels .kis-main padding (28 default /
   20·16 ≤1024 / 16·12 ≤768) so it sits edge-to-edge. ── */
.kis-hrm-tabbar,
.kis-crm-tabbar,
.kis-ops-tabbar,
.kis-est-tabbar,
.kis-veh-tabbar,
.kis-jm-tabbar,
.kis-inv-tabbar,
.kis-art-tabbar,
.kis-sup-tabbar,
.kis-bud-tabbar,
.kis-acc-tabbar,
.kis-rep-tabbar {
    display: flex;
    align-items: stretch;
    gap: 2px;
    margin: -28px -28px 22px;
    padding: 0 20px;
    background: var(--kis-surface);
    border-bottom: 1px solid var(--kis-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.kis-hrm-tabbar::-webkit-scrollbar,
.kis-crm-tabbar::-webkit-scrollbar,
.kis-ops-tabbar::-webkit-scrollbar,
.kis-est-tabbar::-webkit-scrollbar,
.kis-veh-tabbar::-webkit-scrollbar,
.kis-jm-tabbar::-webkit-scrollbar,
.kis-inv-tabbar::-webkit-scrollbar,
.kis-art-tabbar::-webkit-scrollbar,
.kis-sup-tabbar::-webkit-scrollbar,
.kis-bud-tabbar::-webkit-scrollbar,
.kis-acc-tabbar::-webkit-scrollbar,
.kis-rep-tabbar::-webkit-scrollbar { display: none; }
.kis-hrm-tabbar .kis-crm-tab,
.kis-crm-tabbar .kis-crm-tab,
.kis-ops-tabbar .kis-crm-tab,
.kis-est-tabbar .kis-crm-tab,
.kis-veh-tabbar .kis-crm-tab,
.kis-jm-tabbar .kis-crm-tab,
.kis-inv-tabbar .kis-crm-tab,
.kis-art-tabbar .kis-crm-tab,
.kis-sup-tabbar .kis-crm-tab,
.kis-bud-tabbar .kis-crm-tab,
.kis-acc-tabbar .kis-crm-tab,
.kis-rep-tabbar .kis-crm-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 13px 15px;
    margin: 0;
    border: 0;
    border-bottom: 2.5px solid transparent;
    background: none;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--kis-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: color .12s;
}
.kis-hrm-tabbar .kis-crm-tab:hover,
.kis-crm-tabbar .kis-crm-tab:hover,
.kis-ops-tabbar .kis-crm-tab:hover,
.kis-est-tabbar .kis-crm-tab:hover,
.kis-veh-tabbar .kis-crm-tab:hover,
.kis-jm-tabbar .kis-crm-tab:hover,
.kis-inv-tabbar .kis-crm-tab:hover,
.kis-art-tabbar .kis-crm-tab:hover,
.kis-sup-tabbar .kis-crm-tab:hover,
.kis-bud-tabbar .kis-crm-tab:hover,
.kis-acc-tabbar .kis-crm-tab:hover,
.kis-rep-tabbar .kis-crm-tab:hover { color: var(--kis-text); }
.kis-hrm-tabbar .kis-crm-tab.active,
.kis-crm-tabbar .kis-crm-tab.active,
.kis-ops-tabbar .kis-crm-tab.active,
.kis-est-tabbar .kis-crm-tab.active,
.kis-veh-tabbar .kis-crm-tab.active,
.kis-jm-tabbar .kis-crm-tab.active,
.kis-inv-tabbar .kis-crm-tab.active,
.kis-art-tabbar .kis-crm-tab.active,
.kis-sup-tabbar .kis-crm-tab.active,
.kis-bud-tabbar .kis-crm-tab.active,
.kis-acc-tabbar .kis-crm-tab.active,
.kis-rep-tabbar .kis-crm-tab.active {
    color: var(--kis-primary);
    border-bottom-color: var(--kis-primary);
    background: none;
}
.kis-hrm-tabbar .kis-crm-tab.kis-tab-gear,
.kis-crm-tabbar .kis-crm-tab.kis-tab-gear,
.kis-ops-tabbar .kis-crm-tab.kis-tab-gear,
.kis-est-tabbar .kis-crm-tab.kis-tab-gear,
.kis-veh-tabbar .kis-crm-tab.kis-tab-gear,
.kis-jm-tabbar .kis-crm-tab.kis-tab-gear,
.kis-inv-tabbar .kis-crm-tab.kis-tab-gear,
.kis-art-tabbar .kis-crm-tab.kis-tab-gear { margin-left: auto; font-size: 16px; color: var(--kis-text-tertiary); }
.kis-hrm-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-hrm-tabbar .kis-crm-tab.kis-tab-gear:hover,
.kis-crm-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-crm-tabbar .kis-crm-tab.kis-tab-gear:hover,
.kis-ops-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-ops-tabbar .kis-crm-tab.kis-tab-gear:hover,
.kis-est-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-est-tabbar .kis-crm-tab.kis-tab-gear:hover,
.kis-veh-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-veh-tabbar .kis-crm-tab.kis-tab-gear:hover,
.kis-jm-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-jm-tabbar .kis-crm-tab.kis-tab-gear:hover,
.kis-inv-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-inv-tabbar .kis-crm-tab.kis-tab-gear:hover,
.kis-art-tabbar .kis-crm-tab.kis-tab-gear.active,
.kis-art-tabbar .kis-crm-tab.kis-tab-gear:hover { color: var(--kis-text); }
@media (max-width: 1024px) { .kis-hrm-tabbar, .kis-crm-tabbar, .kis-ops-tabbar, .kis-est-tabbar, .kis-veh-tabbar, .kis-jm-tabbar, .kis-inv-tabbar, .kis-art-tabbar, .kis-sup-tabbar, .kis-bud-tabbar, .kis-acc-tabbar, .kis-rep-tabbar { margin: -20px -16px 20px; padding: 0 12px; } }
@media (max-width: 768px)  { .kis-hrm-tabbar, .kis-crm-tabbar, .kis-ops-tabbar, .kis-est-tabbar, .kis-veh-tabbar, .kis-jm-tabbar, .kis-inv-tabbar, .kis-art-tabbar, .kis-sup-tabbar, .kis-bud-tabbar, .kis-acc-tabbar, .kis-rep-tabbar { margin: -16px -12px 18px; padding: 0 8px; } }

/* Infinite scroll indicators (replaces page-by-page pagination) */
.kis-infinite-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 13px;
    color: var(--kis-text-secondary);
}
.kis-infinite-status .kis-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}
.kis-infinite-end {
    text-align: center;
    padding: 14px 0;
    font-size: 12px;
    color: var(--kis-text-muted);
}
/* Serial-number column (auto-numbered, restarts at 1 on each filter) */
.kis-serial-col { width: 48px; text-align: center; }
td.kis-serial-col { color: var(--kis-text-secondary); }

.kis-pagination-pages {
    display: flex;
    gap: 4px;
}

.kis-page-btn {
    min-width: 32px;
    height: 32px;
    border-radius: var(--kis-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--kis-border);
    background: var(--kis-surface);
    color: var(--kis-text);
    transition: background var(--kis-transition);
    padding: 0 8px;
}

.kis-page-btn:hover  { background: var(--kis-surface-2); }
.kis-page-btn.active { background: var(--kis-primary); color: #fff; border-color: var(--kis-primary); }
.kis-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   LOADING STATE
   ============================================================ */
.kis-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(0,122,255,0.2);
    border-top-color: var(--kis-primary);
    border-radius: 50%;
    animation: kisSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes kisSpin {
    to { transform: rotate(360deg); }
}

.kis-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--kis-text-secondary);
    font-size: 14px;
}

.kis-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--kis-text-secondary);
}

.kis-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.kis-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--kis-text);
    margin-bottom: 6px;
}

/* ============================================================
   EXPIRY BADGE DOTS
   ============================================================ */
.kis-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.kis-dot-green  { background: var(--kis-success); }
.kis-dot-amber  { background: var(--kis-warning); }
.kis-dot-red    { background: var(--kis-danger); }

/* ============================================================
   PERMISSION MATRIX
   ============================================================ */
.kis-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.kis-matrix-table th,
.kis-matrix-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--kis-border);
    text-align: left;
}

.kis-matrix-table th {
    background: var(--kis-surface-2);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--kis-text-secondary);
    text-align: center;
}

.kis-matrix-table th:first-child {
    text-align: left;
}

.kis-matrix-table td:not(:first-child) {
    text-align: center;
}

.kis-matrix-table tr:last-child td { border-bottom: none; }

/* ============================================================
   UTILITY
   ============================================================ */
.kis-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.kis-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.kis-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

.kis-flex { display: flex; align-items: center; gap: 10px; }
.kis-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kis-text-right { text-align: right; }
.kis-text-center { text-align: center; }
.kis-mt-1 { margin-top: 4px; }
.kis-mt-2 { margin-top: 8px; }
.kis-mt-3 { margin-top: 16px; }
.kis-mt-4 { margin-top: 24px; }
.kis-mb-1 { margin-bottom: 4px; }
.kis-mb-2 { margin-bottom: 8px; }
.kis-mb-3 { margin-bottom: 16px; }
.kis-mb-4 { margin-bottom: 24px; }
.kis-hidden { display: none !important; }
/* v1.241.0 — form field whose column is hidden for this user (set by kis-main.js) */
.kis-field-hidden { display: none !important; }
.kis-divider { border: none; border-top: 1px solid var(--kis-border); margin: 24px 0; }

/* Truncate long text */
.kis-truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ============================================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .kis-grid-4 { grid-template-columns: repeat(2,1fr); }
    .kis-form-grid-3 { grid-template-columns: repeat(2,1fr); }
    .kis-main { padding: 20px 16px; }
}

/* ============================================================
   WORDPRESS ADMIN BAR COMPENSATION
   WP admin bar is position:fixed at top:0 — 32px desktop, 46px ≤782px
   ============================================================ */
body.admin-bar .kis-topbar {
    top: 32px;
}

body.admin-bar .kis-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}

body.admin-bar .kis-fullscreen-modal {
    inset: 32px 0 0 0 !important;
}

body.admin-bar .kis-main {
    margin-top: calc(var(--kis-topbar-h) + 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .kis-topbar {
        top: 46px;
    }
    body.admin-bar .kis-sidebar {
        top: 46px;
        height: calc(100vh - 46px);
    }
    body.admin-bar .kis-fullscreen-modal {
        inset: 46px 0 0 0 !important;
    }
    body.admin-bar .kis-main {
        margin-top: calc(var(--kis-topbar-h) + 46px);
    }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    .kis-sidebar {
        transform: translateX(-100%);
    }

    .kis-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--kis-shadow-modal);
    }

    .kis-topbar {
        left: 0;
    }

    .kis-main {
        margin-left: 0;
        padding: 16px 12px;
    }

    .kis-menu-toggle { display: flex; }

    .kis-grid-2,
    .kis-grid-3,
    .kis-grid-4 { grid-template-columns: 1fr; }

    .kis-form-grid,
    .kis-form-grid-3 { grid-template-columns: 1fr; }

    .kis-card-header { padding: 16px 16px 0; }
    .kis-card-body   { padding: 16px; }

    .kis-modal { max-width: 100%; border-radius: var(--kis-radius-lg) var(--kis-radius-lg) 0 0; margin-top: auto; }
    .kis-modal-overlay,
    .kis-modal-backdrop { align-items: flex-end; padding: 0; }

    .kis-page-header { flex-direction: column; }
}

/* ============================================================
   CRM TABS
   ============================================================ */
.kis-crm-tabs-wrap {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--kis-border);
}

.kis-crm-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.kis-crm-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--kis-text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--kis-transition), border-color var(--kis-transition);
}

.kis-crm-tab:hover {
    color: var(--kis-text);
}

.kis-crm-tab.active {
    color: var(--kis-text);
    font-weight: 600;
    /* Dashboard-derived accent: blue -> indigo -> purple gradient underline drawn
       as a background strip inside the padding box (not on the border), so it
       always renders and is never clipped by the tab row's overflow-x:auto.
       No layout shift — padding/border/margin are unchanged. */
    background: linear-gradient(90deg, #007AFF 0%, #5856D6 55%, #AF52DE 100%) no-repeat bottom / 100% 3px;
}

/* ============================================================
   TOPBAR MODULE TABS
   Tabbed modules (CRM/HRM/JM/Job Ops/Art Directory/Reports) show
   their group tabs inside the topbar on desktop, replacing the
   module title. ≤900px reverts to today's layout: title in the
   topbar, tabs in the in-page .kis-tabs-fallback row. Exactly one
   copy is ever visible.
   ============================================================ */
.kis-topbar-tabs {
    align-self: stretch;
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none; /* strip scrolls; the bar never grows or wraps */
}
.kis-topbar-tabs::-webkit-scrollbar { display: none; }

.kis-topbar-tabs .kis-crm-tab {
    /* Full-height tab so the active gradient sits on the bar's bottom edge */
    padding: 0 16px;
    margin-bottom: 0;
    border-bottom: none;
}

/* Desktop: in-page copy and module title stand down */
.kis-tabs-fallback { display: none; }
.kis-page-title.kis-title-mobile-only { display: none; }

@media (max-width: 900px) {
    .kis-topbar-tabs { display: none; }
    .kis-tabs-fallback { display: block; }
    .kis-page-title.kis-title-mobile-only { display: inline; }
}

/* ============================================================
   WORKFLOW CHECKLIST (Enquiries list — Progress column)
   ============================================================ */
.kis-workflow-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
}
.kis-wf-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--kis-text-secondary);
    user-select: none;
    padding: 2px 0;
    white-space: nowrap;
}
.kis-wf-item:hover { color: var(--kis-text); }
.kis-wf-check {
    width: 13px;
    height: 13px;
    border: 1.5px solid var(--kis-border-strong, #c0c0c0);
    border-radius: 3px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kis-surface);
    transition: background 0.15s, border-color 0.15s;
}
.kis-wf-check.kis-wf-checked {
    background: var(--kis-primary);
    border-color: var(--kis-primary);
}
.kis-wf-check.kis-wf-checked::after {
    content: '';
    display: block;
    width: 7px;
    height: 4px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

/* ============================================================
   GRID FILTER (Airtable-style, Phase E) — partials/grid-filter.php
   ============================================================ */
/* .kis-card clips overflow (rounded corners) which would hide the dropdown
   panel behind the next card. Any card hosting the filter must carry this. */
.kis-card.kis-gf-host { overflow: visible; }
.kis-gf-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 300;
    width: 660px;
    max-width: min(660px, 92vw);
    background: var(--kis-surface, #fff);
    border: 1px solid var(--kis-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    padding: 14px;
}
.kis-gf-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.kis-gf-row .kis-input {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}
.kis-gf-join {
    flex: 0 0 70px !important;
    font-size: 13px;
    color: var(--kis-text-secondary, #6b7280);
    text-align: right;
}
select.kis-gf-join { text-align: left; }
/* "is any of" / "is none of" — Airtable-style dropdown with on/off option rows */
.kis-gf-multiwrap {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}
.kis-gf-multibtn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    text-align: left;
    background: var(--kis-surface, #fff);
}
.kis-gf-multitext {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kis-gf-multitext.muted { color: var(--kis-text-muted, #9ca3af); }
.kis-gf-multicaret { flex: 0 0 auto; font-size: 10px; color: var(--kis-text-muted, #9ca3af); }
.kis-gf-multidrop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--kis-surface, #fff);
    border: 1px solid var(--kis-border, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}
.kis-gf-multiopt {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 13px;
    color: var(--kis-text-secondary, #6b7280);
    cursor: pointer;
    text-align: left;
}
.kis-gf-multiopt:hover { background: var(--kis-surface-alt, #f3f4f6); }
/* v1.202.0 — long option lists (Attendance → Employee, ~200 names) wrapped each
   name onto three lines at the value box's width. Grow leftwards instead. */
.kis-gf-multidrop { left: auto; min-width: 100%; width: max-content; max-width: 340px; }
/* v1.202.0 — search box pinned at the top of a long "is any of" list. */
.kis-gf-multidrop .kis-gf-multisearch {
    position: sticky;
    top: -4px;
    z-index: 1;
    width: 100%;
    margin: 0 0 4px;
    padding: 6px 8px;
    font-size: 13px;
}
.kis-gf-multinone { padding: 6px 8px; font-size: 12px; color: var(--kis-text-muted, #9ca3af); }
.kis-gf-multiopt.on {
    color: var(--kis-primary, #2563eb);
    font-weight: 600;
}
.kis-gf-tick {
    flex: 0 0 14px;
    width: 14px;
    color: var(--kis-primary, #2563eb);
}
.kis-gf-x {
    background: none;
    border: none;
    color: var(--kis-text-muted, #9ca3af);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    line-height: 1;
}
.kis-gf-x:hover { color: var(--kis-danger, #ef4444); }
.kis-gf-empty {
    font-size: 13px;
    color: var(--kis-text-muted, #9ca3af);
    margin: 2px 0 10px;
}
/* Super-Admin-locked filter: read-only, always in force for other users. */
.kis-gf-lock {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
}
.kis-gf-lock-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #92400e;
}
.kis-gf-lock-head .kis-btn {
    margin-left: 6px;
}
.kis-gf-lock-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    font-size: 13px;
    color: #78350f;
}
.kis-gf-lock-list li {
    padding: 2px 0;
}
.kis-gf-lock-list .kis-gf-join {
    color: #b45309;
    font-style: italic;
    margin-right: 4px;
}
.kis-gf-lock-note {
    font-size: 12px;
    color: #a16207;
    margin: 6px 0 0;
}
.kis-gf-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.kis-gf-views {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--kis-border, #e5e7eb);
}
.kis-gf-view {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--kis-surface-alt, #f3f4f6);
    border: 1px solid var(--kis-border, #e5e7eb);
    border-radius: 14px;
    padding: 2px 4px 2px 10px;
    font-size: 12px;
}
.kis-gf-view a { text-decoration: none; }
.kis-gf-view-name {
    flex: 0 1 160px !important;
    font-size: 12px;
    padding: 4px 8px;
}
.kis-gf-btn-active {
    border-color: var(--kis-primary, #2563eb) !important;
    color: var(--kis-primary, #2563eb) !important;
    background: #eff6ff !important;
}
@media (max-width: 720px) {
    .kis-gf-panel { position: fixed; left: 4vw; right: 4vw; width: auto; max-width: none; top: 18vh; }
    .kis-gf-row { flex-wrap: wrap; }
    .kis-gf-join { text-align: left; }
}

/* ============================================================
   ALPINE.JS CLOAK
   ============================================================ */
[x-cloak] { display: none !important; }

/* ============================================================
   v1.192.0 — pinned grid totals (Attendance)
   "Bottom": a Total row that sticks to the bottom of the capped grid pane.
   "Top":    a strip of tiles above the pane (outside it, so always visible).
   Sticky cells lose their collapsed borders while scrolling, so the rule
   above the row is an inset shadow — same trick as the sticky header.
   ============================================================ */
.kis-table-wrap .kis-table > tfoot.kis-sticky-foot > tr > td {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: var(--kis-surface-alt, #F5F5F7);
    font-weight: 700;
    white-space: nowrap;
    box-shadow: inset 0 2px 0 var(--kis-separator, #C6C6C8);
}
.kis-table-wrap .kis-table > tfoot.kis-sticky-foot > tr > td.kis-frz { z-index: 5; }
/* v1.199.0 — Invoices "Totals: Top" hides the Subtotal row by class (Print has no app CSS, so it keeps it). */
.kis-table > tfoot.kis-foot-off { display: none; }
.kis-totals-strip { padding: 10px 14px 12px; border-bottom: 1px solid var(--kis-border); background: var(--kis-surface); flex-direction: column; gap: 8px; }
.kis-totals-strip:not([style*="display: none"]) { display: flex; }
.kis-totals-strip-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--kis-text-secondary); }
.kis-totals-strip-head strong { color: var(--kis-text); font-size: 14px; }
.kis-totals-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.kis-totals-tile { background: var(--kis-surface-alt, #F5F5F7); border-radius: var(--kis-radius-sm); padding: 8px 11px; display: flex; flex-direction: column; gap: 2px; }
.kis-totals-tile span { font-size: 11px; font-weight: 700; color: var(--kis-text-secondary); text-transform: uppercase; letter-spacing: .3px; line-height: 1.3; }
.kis-totals-tile strong { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--kis-text); }
.kis-totals-tile.is-net { background: var(--kis-primary-light, #E8F1FF); }
.kis-totals-tile.is-net strong { color: var(--kis-primary-dark, #0056CC); }
.kis-totals-tile strong.is-neg { color: var(--kis-danger, #FF3B30); }
/* v1.209.0 — filter dropdowns beside the sub-tab strip: the "Totals: Top" breakdowns
   (partials/totals-strip.php, one per "By …" group — they replace the v1.201.0 rows of
   pills) and the Employees Category picker. A button + a vertical list; a pick FILTERS
   the grid and tints its button. The slot is built by kis-main.js. */
.kis-ts-slot, #kis-emp-cat-slot { display: contents; }
.kis-ts-dds { display: contents; } /* each dropdown wraps on its own in the row */
.kis-hrm-segrow.kis-segrow-solo { margin: 0; }
.kis-segrow-solo .kis-ts-dds > * { margin-bottom: 14px; } /* an empty line (Totals: Hidden) takes no room */
.kis-dd { position: relative; }
.kis-dd-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px; border: 1px solid var(--kis-border); border-radius: 10px; background: var(--kis-surface); color: var(--kis-text); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; max-width: 100%; transition: border-color .12s, box-shadow .12s; }
.kis-dd-btn:hover, .kis-dd-btn.open, .kis-dd-btn.picked { border-color: var(--kis-primary); }
.kis-dd-btn.open { box-shadow: 0 0 0 3px rgba(0, 122, 255, .12); }
.kis-dd-btn.picked { background: var(--kis-primary-light, #E8F1FF); }
.kis-dd-btn .lbl { color: var(--kis-text-secondary); }
.kis-dd-btn .sel { color: var(--kis-primary); font-weight: 700; max-width: 220px; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
.kis-dd-btn .chev { font-size: 11px; color: var(--kis-text-secondary); transition: transform .12s; }
.kis-dd-btn.open .chev { transform: rotate(180deg); }
.kis-dd-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 10px; background: rgba(0, 0, 0, .08); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kis-dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 270px; max-width: min(420px, 92vw); max-height: min(62vh, 460px); overflow-y: auto; padding: 6px; border: 1px solid var(--kis-border); border-radius: 12px; background: var(--kis-surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
.kis-dd-menu.is-right { left: auto; right: 0; }
.kis-dd-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--kis-text); font-family: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; white-space: nowrap; }
.kis-dd-item:hover { background: var(--kis-surface-alt, #F5F5F7); }
.kis-dd-item .tick { width: 14px; flex: none; color: var(--kis-primary); font-weight: 700; visibility: hidden; }
.kis-dd-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
.kis-dd-item .amt { font-size: 11.5px; font-weight: 500; color: var(--kis-text-secondary); font-variant-numeric: tabular-nums; }
.kis-dd-item.is-none .nm { font-style: italic; color: var(--kis-text-secondary); }
.kis-dd-item.active { background: rgba(0, 122, 255, .08); color: var(--kis-primary); font-weight: 700; }
.kis-dd-item.active .tick { visibility: visible; }
.kis-dd-sep { height: 1px; margin: 5px 4px; background: var(--kis-border); }
.kis-ts-clear { border: 1px solid var(--kis-primary); background: var(--kis-primary-light, #E8F1FF); color: var(--kis-primary-dark, #0056CC); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap; }
/* v1.248.0 — sub-tab strips are ONE dropdown pill (partials/sub-tab-dropdown.php) on the same
   row as the breakdown pills; the in-card view / type / mode switches use the same pill. */
.kis-subtab { margin: -6px 0 18px; }
.kis-hrm-segrow .kis-subtab { margin: 0; }
.kis-segrow-solo > #kis-inv-view-slot > .kis-dd { margin-bottom: 14px; } /* same baseline as the breakdown pills beside it */
.kis-dd-menu a.kis-dd-item { text-decoration: none; }
.kis-dd-item .kis-dd-count { margin-left: auto; }
.kis-toolbar > .kis-dd, .kis-toolbar.kis-tb-fit > .kis-dd { flex: 0 0 auto; }
.kis-toolbar.kis-tb-fit > .kis-dd > .kis-dd-btn { white-space: nowrap; }
/* v1.249.0 — the ⧩ Filter panel is a form: a title row with its own ✕ (it no longer closes on an outside click). */
.kis-gf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--kis-border); font-size: 13px; }
.kis-gf-head .kis-gf-close { font-size: 14px; }

/* ============================================================
   v1.192.0 — Payroll company view + breakdown pop-up
   ============================================================ */
.kis-seg { display: inline-flex; border: 1px solid var(--kis-border); border-radius: var(--kis-radius); overflow: hidden; background: var(--kis-surface); flex-shrink: 0; }
.kis-seg-btn { border: none; background: transparent; padding: 0 12px; min-height: 38px; font: inherit; font-size: 13px; font-weight: 600; color: var(--kis-text-secondary); cursor: pointer; white-space: nowrap; }
.kis-seg-btn + .kis-seg-btn { border-left: 1px solid var(--kis-border); }
.kis-seg-btn:hover { background: var(--kis-surface-alt, #F5F5F7); }
.kis-seg-btn.is-on { background: var(--kis-primary-light, #E8F1FF); color: var(--kis-primary-dark, #0056CC); }
.kis-link-btn { all: unset; cursor: pointer; color: var(--kis-primary-dark, #0056CC); font-weight: 600; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; }
.kis-link-btn:hover { text-decoration: underline; background: var(--kis-primary-light, #E8F1FF); }
.kis-link-btn:focus-visible { outline: 2px solid var(--kis-primary); outline-offset: 1px; }
.kis-co-table td { vertical-align: middle; }
.kis-cp-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.kis-cp-chip { background: var(--kis-surface-alt, #F5F5F7); border: 1px solid var(--kis-border); border-radius: var(--kis-radius-sm); padding: 6px 10px; font-size: 12.5px; color: var(--kis-text-secondary); }
.kis-cp-chip strong { color: var(--kis-text); font-variant-numeric: tabular-nums; }
.kis-cp-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.kis-combo { position: relative; min-width: 0; }
/* v1.193.3 — only stretch inside a row toolbar (payroll pop-up); in a form column
   flex-basis would become HEIGHT and leave a 280px gap under the field. */
.kis-cp-tools .kis-combo { flex: 1 1 280px; }
.kis-combo .kis-input { width: 100%; padding-right: 34px; box-sizing: border-box; }
.kis-combo-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; cursor: pointer; color: var(--kis-text-muted, #8E8E93); font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.kis-combo-list { list-style: none; margin: 4px 0 0; padding: 6px; position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--kis-surface); border: 1px solid var(--kis-border); border-radius: var(--kis-radius); box-shadow: var(--kis-shadow-lg); max-height: 280px; overflow: auto; }
.kis-combo-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.kis-combo-list li small { color: var(--kis-text-muted, #8E8E93); }
.kis-combo-list li.is-active { background: var(--kis-primary-light, #E8F1FF); }

/* ============================================================
   v1.192.4 — topbar notification bell panel
   ============================================================ */
.kis-notif-wrap { position: relative; }
button.kis-notification-btn { font: inherit; cursor: pointer; padding: 0; color: inherit; }
.kis-notif-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 360px; max-width: calc(100vw - 24px); background: var(--kis-surface); border: 1px solid var(--kis-border); border-radius: var(--kis-radius-lg); box-shadow: var(--kis-shadow-lg); z-index: 1000; overflow: hidden; }
.kis-notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--kis-border); font-size: 14px; }
.kis-notif-link { border: none; background: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--kis-primary-dark, #0056CC); padding: 2px 4px; border-radius: 6px; }
.kis-notif-link:hover { text-decoration: underline; }
.kis-notif-body { max-height: 420px; overflow: auto; }
.kis-notif-empty { padding: 22px 14px; text-align: center; color: var(--kis-text-muted, #8E8E93); font-size: 13px; }
.kis-notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--kis-border-light, var(--kis-border)); text-decoration: none; color: var(--kis-text); font-size: 13px; line-height: 1.4; }
.kis-notif-item:last-child { border-bottom: none; }
.kis-notif-item:hover { background: var(--kis-surface-alt, #F5F5F7); }
.kis-notif-item.is-unread { background: var(--kis-primary-light, #E8F1FF); }
.kis-notif-item.is-unread:hover { filter: brightness(.98); }
.kis-notif-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--kis-primary); margin-top: 6px; }
.kis-notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kis-notif-text small { color: var(--kis-text-muted, #8E8E93); font-size: 11.5px; text-transform: capitalize; }

/* v1.200.0 — Searchable dropdowns (kis-main.js kisSSOpen): every <select> with 8+ options
   turns into a type-in box IN PLACE while open. Box + list are fixed-positioned and
   appended to <body> so modal bodies can't clip them; above modals (2000). */
.kis-ss-wrap { position: fixed; z-index: 3501; }
.kis-ss-field {
    width: 100%; height: 100%; box-sizing: border-box; margin: 0;
    background: var(--kis-surface, #fff);
    border: 1px solid var(--kis-primary, #007AFF);
    box-shadow: 0 0 0 3px var(--kis-primary-light, #E8F1FF);
    outline: none;
}
.kis-ss-clear, .kis-ss-caret {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: var(--kis-text-secondary, #6D6D72); font-size: 12px; line-height: 1; cursor: pointer;
}
.kis-ss-caret { right: 10px; }
.kis-ss-clear { right: 26px; border: 0; background: none; padding: 4px; color: var(--kis-danger, #FF3B30); }
.kis-ss-panel {
    position: fixed;
    z-index: 3500;
    display: flex;
    flex-direction: column;
    background: var(--kis-surface, #fff);
    border: 1px solid var(--kis-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    overflow: hidden;
}
.kis-ss-list { overflow-y: auto; flex: 1 1 auto; padding: 4px 0; }
.kis-ss-list .kis-ss-opt { display: block; } /* plain option text: the ✓ sits right before it */
.kis-ss-opt { padding: 7px 12px; cursor: pointer; font-size: 13px; line-height: 1.35; color: var(--kis-text); display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.kis-ss-opt.is-hi { background: var(--kis-primary-light, #E8F1FF); }
.kis-ss-opt.is-sel { font-weight: 600; color: var(--kis-primary, #007AFF); }
.kis-ss-list .kis-ss-opt.is-sel::before, .kis-typeahead-drop .kis-ss-opt.is-sel .kis-ss-main::before { content: "\2713\00a0"; }
.kis-ss-opt.is-dis { color: var(--kis-text-tertiary, #9ca3af); cursor: default; }
.kis-ss-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kis-ss-sub { color: var(--kis-text-secondary, #6D6D72); font-size: 12px; font-weight: 400; margin-left: 6px; }
.kis-ss-val { color: var(--kis-text-secondary, #6D6D72); font-size: 12px; font-weight: 400; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kis-ss-group { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--kis-text-secondary, #6b7280); }
.kis-ss-none { padding: 8px 12px; font-size: 12px; color: var(--kis-text-secondary, #6b7280); }
@media print { .kis-ss-panel, .kis-ss-wrap { display: none !important; } }

/* v1.200.0 — multi-select chip field (Invoice → Job Orders). */
.kis-chip-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; height: auto; min-height: 40px; padding: 4px 8px; cursor: text; }
.kis-chip-input:focus-within { border-color: var(--kis-primary, #007AFF); box-shadow: 0 0 0 3px var(--kis-primary-light, #E8F1FF); }
.kis-chip-input input, .kis-chip-input input[type="text"] { flex: 1 1 160px; min-width: 120px; width: auto; height: auto; margin: 0; border: 0 !important; outline: 0; box-shadow: none !important; background: transparent !important; font: inherit; color: inherit; padding: 4px; }
.kis-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--kis-primary-light, #E8F1FF); color: var(--kis-primary-dark, #0056CC); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.kis-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; padding: 3px 5px; border-radius: 999px; }
.kis-chip button:hover { background: rgba(0,0,0,.08); }
.kis-inv-part { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--kis-text-secondary, #6D6D72); white-space: nowrap; }

/* ── v1.225.0 — employee pickers with a face: row, chip photo, large hover card ─────────── */
.kis-ep-list { display:grid; gap:6px; }
.kis-ep-row { position:relative; display:flex; align-items:center; gap:12px; padding:8px 10px; border:1px solid var(--kis-border); border-radius:12px; background:var(--kis-surface); cursor:pointer; }
.kis-ep-row:hover, .kis-ep-row.on { border-color:var(--kis-primary); background:var(--kis-primary-light); }
.kis-ep-row .kis-ep-bx { width:18px; height:18px; border:1.5px solid var(--kis-text-tertiary); border-radius:5px; flex:none; position:relative; background:#fff; }
.kis-ep-row.on .kis-ep-bx { background:var(--kis-primary); border-color:var(--kis-primary); }
.kis-ep-row.on .kis-ep-bx::after { content:""; position:absolute; left:5px; top:1px; width:4px; height:9px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.kis-ep-photo { flex:none; width:48px; height:48px; border-radius:10px; object-fit:cover; background:#e5e7eb; display:block; }
.kis-ep-photo.none { display:grid; place-items:center; border:1px dashed var(--kis-border); background:var(--kis-surface-alt); color:var(--kis-text-tertiary); font-size:10px; text-align:center; line-height:1.2; padding:2px; }
.kis-ep-photo.sm { width:26px; height:26px; border-radius:50%; font-size:0; }
.kis-ep-photo.big { width:180px; height:180px; border-radius:14px; font-size:12px; }
.kis-ep-txt { min-width:0; flex:1; }
.kis-ep-nm { font-weight:600; font-size:14px; line-height:1.25; }
.kis-ep-ln { font-size:12px; color:var(--kis-text-secondary); }
.kis-ep-ln b { color:var(--kis-text); font-weight:600; }
.kis-ep-tags { display:flex; gap:4px; flex-wrap:wrap; margin-left:auto; }
.kis-ep-host { position:relative; }
.kis-ep-card { display:none; position:absolute; right:12px; top:-8px; z-index:60; background:var(--kis-surface); border:1px solid var(--kis-border); border-radius:14px; box-shadow:0 14px 40px rgba(0,0,0,.18); padding:12px; grid-template-columns:auto 1fr; gap:12px; min-width:320px; max-width:min(420px, calc(100vw - 48px)); color:var(--kis-text); cursor:default; text-align:left; font-weight:400; white-space:normal; font-size:13px; line-height:1.4; }
.kis-ep-host:hover > .kis-ep-card, .kis-ep-host:focus-within > .kis-ep-card, .kis-ep-host.show > .kis-ep-card { display:grid; }
.kis-ep-card .t { display:grid; gap:3px; align-content:start; }
.kis-ep-card .t b { font-size:16px; }
.kis-ep-card .t code { font-size:13px; }
.kis-ep-card .cap { grid-column:1 / -1; font-size:11px; color:var(--kis-text-tertiary); border-top:1px dashed var(--kis-border); padding-top:6px; }
.kis-ep-chip { display:inline-flex; align-items:center; gap:6px; }
@media (max-width:700px) { .kis-ep-card { position:fixed; left:12px; right:12px; top:auto; bottom:12px; min-width:0; max-width:none; } }
/* v1.225.0 — prefilled, editable figure (the department may change it on the row) */
.kis-inp-pre { background:#FFFBEA !important; border-color:#F2C94C !important; }
.kis-wl-table td, .kis-wl-table th { white-space:nowrap; }
.kis-wl-table input.kis-input { padding:4px 8px; font-size:13px; min-height:0; height:32px; }
.kis-wl-table input[type=time].kis-input { width:96px; }
.kis-wl-table input[type=number].kis-input { width:84px; text-align:right; }
.kis-wl-num { text-align:right; font-variant-numeric:tabular-nums; }
.kis-seg { display:inline-flex; border:1px solid var(--kis-border); border-radius:10px; overflow:hidden; }
.kis-seg button { appearance:none; border:0; background:var(--kis-surface); color:var(--kis-text-secondary); padding:7px 14px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.kis-seg button.on { background:var(--kis-primary-light); color:var(--kis-primary); }
.kis-tiles6 { display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px; }
.kis-tile6 { padding:12px 14px; border-radius:12px; color:#fff; background:linear-gradient(135deg,#007AFF,#5856D6); }
.kis-tile6:nth-child(2) { background:linear-gradient(135deg,#5856D6,#AF52DE); } .kis-tile6:nth-child(3) { background:linear-gradient(135deg,#FF9500,#FF3B30); }
.kis-tile6:nth-child(4) { background:linear-gradient(135deg,#34C759,#30B0C7); } .kis-tile6:nth-child(5) { background:linear-gradient(135deg,#30B0C7,#007AFF); } .kis-tile6:nth-child(6) { background:linear-gradient(135deg,#1C1C1E,#5856D6); }
.kis-tile6 small { display:block; opacity:.85; font-size:11px; text-transform:uppercase; letter-spacing:.4px; }
.kis-tile6 b { font-size:18px; font-variant-numeric:tabular-nums; }
.kis-dept-tick { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--kis-border); border-radius:10px; font-size:13px; cursor:pointer; user-select:none; background:var(--kis-surface); }
.kis-dept-tick.on { border-color:var(--kis-primary); background:var(--kis-primary-light); font-weight:600; }

/* ── v1.242.0 · ⚙ My View panel (saved to the login) — Access Manager Phase 13 ── */
.kis-mv-overlay { position: fixed; inset: 0; z-index: 99998; background: rgba(28,28,30,0.18); opacity: 0; transition: opacity .18s ease; }
.kis-mv-overlay.open { opacity: 1; }
.kis-mv-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999; width: 340px; max-width: 100vw;
    display: flex; flex-direction: column; background: var(--kis-surface, #fff);
    box-shadow: -8px 0 32px rgba(0,0,0,0.14); transform: translateX(100%); transition: transform .2s ease;
    font-size: 13px; color: var(--kis-text);
}
.kis-mv-panel.open { transform: translateX(0); }
.kis-mv-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px;
    background: linear-gradient(135deg, #007AFF, #5856D6); color: #fff; flex-shrink: 0;
}
.kis-mv-head b { display: block; font-size: 14px; }
.kis-mv-head span { font-size: 12px; opacity: .9; }
.kis-mv-close { border: 0; background: rgba(255,255,255,0.18); color: #fff; width: 28px; height: 28px; min-width: 0; padding: 0; margin: 0; flex: 0 0 28px; border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1; }
.kis-mv-close:hover { background: rgba(255,255,255,0.3); }
.kis-mv-body { flex: 1 1 auto; overflow-y: auto; }
.kis-mv-sec { padding: 12px 16px; border-bottom: 1px solid var(--kis-border); }
.kis-mv-sec:last-child { border-bottom: 0; }
.kis-mv-lbl { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--kis-text-secondary); margin-bottom: 6px; }
.kis-mv-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.kis-mv-row label { flex: 1; display: flex; gap: 8px; align-items: center; cursor: pointer; margin: 0; font-weight: 400; }
.kis-mv-row input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: #5856D6; margin: 0; }
.kis-mv-row.lock { color: var(--kis-text-secondary); }
.kis-mv-row.lock label { cursor: not-allowed; }
.kis-mv-note { color: var(--kis-text-secondary); font-size: 12px; margin-top: 6px; }
.kis-mv-foot {
    display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap;
    padding: 12px 16px; border-top: 1px solid var(--kis-border); background: var(--kis-surface-2); flex-shrink: 0;
}
.kis-mv-toast { font-weight: 700; color: #17803d; font-size: 12.5px; }
.kis-mv-toast.bad { color: #c42f2f; }
@media (max-width: 480px) { .kis-mv-panel { width: 100vw; } }
@media print { .kis-mv-panel, .kis-mv-overlay { display: none !important; } }

/* v1.243.0 — ⚙ My View panel options (order arrows, selects, saved-filter chips) + row height */
.kis-table.kis-mv-compact th { padding: 7px 12px; }
.kis-table.kis-mv-compact td { padding: 6px 12px; }
.kis-mv-row .kis-mv-ar { border: 1px solid var(--kis-border); background: var(--kis-surface, #fff); color: var(--kis-text); border-radius: 6px; width: 26px; height: 24px; min-width: 0; flex: 0 0 26px; padding: 0; margin: 0; cursor: pointer; font-size: 12px; line-height: 1; }
.kis-mv-row .kis-mv-ar:hover:not(:disabled) { background: #ecebfa; color: #3f3db8; border-color: #c9c8ee; }
.kis-mv-row .kis-mv-ar:disabled { opacity: .35; cursor: not-allowed; }
.kis-mv-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kis-mv-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kis-mv-field label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--kis-text-secondary); margin: 0; }
.kis-mv-field select { font: inherit; font-size: 13px; color: var(--kis-text); background: var(--kis-surface, #fff); border: 1px solid var(--kis-border); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 100%; }
.kis-mv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kis-mv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #ecebfa; color: #3f3db8; font-weight: 600; font-size: 12.5px; border: 1px solid transparent; cursor: pointer; }
.kis-mv-chip:hover { border-color: #c9c8ee; }
.kis-mv-chip button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 0 0 2px; margin: 0; min-width: 0; font-weight: 700; font-size: 12px; line-height: 1; }
.kis-mv-chip.off { background: var(--kis-surface-2); color: var(--kis-text-secondary); border-color: var(--kis-border); }
.kis-mv-savefilter { display: flex; gap: 6px; margin-top: 8px; }
.kis-mv-savefilter[hidden] { display: none; }
.kis-mv-savefilter .kis-input { flex: 1 1 auto; min-width: 0; }
.kis-mv-savefilter .kis-btn { flex: 0 0 auto; }

/* v1.243.0 — My View Settings page */
.kis-mvs { padding: 0; overflow: hidden; }
.kis-mvs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 16px; padding: 18px 20px 6px; }
.kis-mvs-title { margin: 0; font-size: 18px; font-weight: 800; }
.kis-mvs-sub { font-size: 12.5px; color: var(--kis-text-secondary); margin-top: 2px; }
.kis-mvs-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kis-mvs-confirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.kis-mvs-lead { margin: 0; padding: 0 20px 12px; font-size: 13px; color: var(--kis-text-secondary); max-width: 80ch; }
.kis-mvs-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--kis-border); border-bottom: 1px solid var(--kis-border); background: var(--kis-surface-2); font-size: 13px; color: var(--kis-text-secondary); }
.kis-mvs-stats b { color: var(--kis-text); }
.kis-mvs-toast { margin-left: auto; font-weight: 700; color: #17803d; font-size: 12.5px; }
.kis-mvs-toast.bad { color: #c42f2f; }
.kis-mvs-table td a { color: #3f3db8; text-decoration: none; font-weight: 600; }
.kis-mvs-table td a:hover { text-decoration: underline; }
.kis-mvs-changed td:first-child { box-shadow: inset 3px 0 0 #5856D6; }
.kis-mvs-what { color: var(--kis-text); font-size: 13px; }
.kis-mvs-default { color: var(--kis-text-secondary); font-style: italic; font-size: 13px; }
@media (max-width: 720px) { .kis-mv-grid2 { grid-template-columns: 1fr; } }

/* ============================================================
   v1.254.0 — RESPONSIVE LAYER (phone / tablet / laptop / desktop)
   One set of widths for the whole app, appended last so it wins over
   the older 720 / 768 / 782 / 900 / 1024 rules above by source order:
     phone   <= 600px   drawer sidebar, 56px solid header, 16px gutter
     tablet  601-1024   drawer sidebar, 64px solid header, 20px gutter
     laptop  1025-1440  fixed 240px sidebar, 24px gutter
     desktop >= 1441    fixed 260px sidebar, 28px gutter (unchanged look)
   The WordPress toolbar is hidden on KIS pages <=1024 (WordPress makes it
   scroll away on phones, which left the header pinned 46px down with the
   page scrolling through the gap). Its html margin bump is switched off in
   KIS_Core (admin-bar theme support callback) because the fixed shell already
   compensates with the body.admin-bar rules above.
   ============================================================ */

/* Guards at every width: a wide table or chart scrolls inside its own card
   and can never stretch the page wider than the screen (the dashboard mid row
   laid the phone out at 653px). */
.kis-grid-2 > *, .kis-grid-3 > *, .kis-grid-4 > *,
.kis-form-grid > *, .kis-form-grid-3 > *,
.kis-main [style*="display:grid"] > *, .kis-main [style*="display: grid"] > *,
.kis-main [style*="grid-template-columns"] > * { min-width: 0; }
.kis-table-wrap { min-width: 0; max-width: 100%; }
.kis-sidebar { height: 100dvh; }
.kis-sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 1000; background: var(--kis-overlay); }

/* -- Laptop <=1440 ------------------------------------------ */
@media (max-width: 1440px) {
    :root { --kis-sidebar-w: 240px; }
    .kis-main { padding: 24px; }
}

/* -- Tablet <=1024 (and phone) ------------------------------ */
@media (max-width: 1024px) {
    #wpadminbar { display: none; }
    html { margin-top: 0 !important; }

    .kis-sidebar, body.admin-bar .kis-sidebar {
        top: 0; height: 100vh; height: 100dvh; z-index: 1001;
        transform: translateX(-100%);
    }
    .kis-sidebar.open, body.admin-bar .kis-sidebar.open { transform: translateX(0); box-shadow: var(--kis-shadow-modal); }
    body.kis-drawer-open .kis-sidebar-backdrop { display: block; }
    body.kis-drawer-open { overflow: hidden; }

    .kis-topbar, body.admin-bar .kis-topbar {
        top: 0; left: 0; padding: 0 20px; gap: 10px;
        background: var(--kis-surface);
        backdrop-filter: none; -webkit-backdrop-filter: none;
    }
    .kis-main, body.admin-bar .kis-main {
        margin-left: 0; margin-top: var(--kis-topbar-h); padding: 20px;
        overflow-x: clip;
    }
    body.admin-bar .kis-fullscreen-modal { inset: 0 !important; }

    .kis-menu-toggle { display: flex; width: 44px; height: 44px; margin-left: -8px; }
    .kis-notification-btn { width: 44px; height: 44px; }
    .kis-user-menu { min-height: 44px; }

    /* Module tabs leave the header; the in-page row scrolls sideways. */
    .kis-topbar-tabs { display: none; }
    .kis-tabs-fallback { display: block; }
    .kis-page-title.kis-title-mobile-only { display: inline; }
    .kis-hrm-tabbar, .kis-crm-tabbar, .kis-ops-tabbar, .kis-est-tabbar, .kis-veh-tabbar, .kis-jm-tabbar, .kis-inv-tabbar, .kis-art-tabbar, .kis-sup-tabbar, .kis-bud-tabbar, .kis-acc-tabbar, .kis-rep-tabbar { margin: -20px -20px 20px; padding: 0 12px; }

    .kis-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kis-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kis-form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Pop-ups stay centred on tablet (the old <=768 bottom-sheet rule stands down). */
    .kis-modal-overlay, .kis-modal-backdrop { align-items: center; padding: 16px; }
    .kis-modal { margin-top: 0; border-radius: var(--kis-radius-xl); }

    /* Touch targets */
    .kis-dd-btn { min-height: 44px; }
    .kis-toolbar .kis-btn, .kis-card-footer .kis-btn, .kis-modal-footer .kis-btn, .kis-page-header .kis-btn { min-height: 44px; }
    .kis-toolbar .kis-input, .kis-toolbar .kis-select, .kis-toolbar .kis-search-input { min-height: 44px; }
    .kis-mv-panel { width: 360px; }
}

/* -- Phone <=600 -------------------------------------------- */
@media (max-width: 600px) {
    :root { --kis-topbar-h: 56px; }
    .kis-topbar, body.admin-bar .kis-topbar { padding: 0 16px; gap: 8px; }
    .kis-topbar-right { gap: 8px; }
    .kis-user-menu { padding: 4px; border-radius: var(--kis-radius-full); gap: 0; min-height: 0; }
    .kis-user-menu > span { display: none; }
    .kis-avatar { width: 34px; height: 34px; }
    .kis-page-title { font-size: 16px; }

    .kis-main, body.admin-bar .kis-main { padding: 16px; }
    .kis-hrm-tabbar, .kis-crm-tabbar, .kis-ops-tabbar, .kis-est-tabbar, .kis-veh-tabbar, .kis-jm-tabbar, .kis-inv-tabbar, .kis-art-tabbar, .kis-sup-tabbar, .kis-bud-tabbar, .kis-acc-tabbar, .kis-rep-tabbar { margin: -16px -16px 16px; padding: 0 8px; }
    .kis-crm-tabs-wrap { margin-bottom: 16px; }
    .kis-crm-tab { padding: 10px 14px; }

    .kis-grid-2, .kis-grid-3, .kis-grid-4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .kis-form-grid, .kis-form-grid-3 { grid-template-columns: minmax(0, 1fr); }

    .kis-card-header { padding: 16px 16px 0; }
    .kis-card-body { padding: 16px; }
    .kis-card-footer { padding: 12px 16px; flex-wrap: wrap; }
    .kis-stat-card { padding: 16px; }
    .kis-stat-value { font-size: 26px; }
    .kis-page-header { flex-direction: column; margin-bottom: 16px; gap: 12px; }
    .kis-page-header h1 { font-size: 20px; }

    /* Inputs: 16px stops iOS zooming into the field; 44px is the touch floor. */
    .kis-input, .kis-select, select.kis-input, textarea.kis-input, .kis-search-input { font-size: 16px; min-height: 44px; }

    /* Toolbars: search full width, dates side by side, buttons full width in one row. */
    .kis-toolbar > .kis-search-wrap, .kis-toolbar > .kis-search-input { flex: 1 1 100%; min-width: 0; }
    .kis-toolbar > .kis-input[type="date"] { flex: 1 1 40%; min-width: 0; }
    .kis-toolbar-actions { margin-left: 0; width: 100%; flex-wrap: nowrap; }
    .kis-toolbar-actions > .kis-btn { flex: 1 1 auto; min-width: 0; }
    .kis-toolbar.kis-tb-wraps .kis-toolbar-actions { flex-wrap: nowrap; }

    /* Sub-tab pill spans the row. */
    .kis-subtab { width: 100%; }
    .kis-subtab .kis-dd-btn { width: 100%; justify-content: space-between; }
    .kis-subtab .kis-dd-btn .sel { max-width: none; flex: 1; min-width: 0; }

    /* Pop-ups become full-screen sheets: header and buttons pinned, body scrolls. */
    .kis-modal-overlay, .kis-modal-backdrop { padding: 0; align-items: stretch; }
    .kis-modal { max-width: none !important; width: 100% !important; height: 100%; max-height: none; border-radius: 0; margin: 0; animation: none; }
    .kis-modal-header { padding: 14px 16px; }
    .kis-modal-body { padding: 16px; }
    .kis-modal-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; }
    .kis-modal-footer .kis-btn { flex: 1 1 auto; }
    .kis-modal-close { width: 40px; height: 40px; }

    /* Side panels and the filter panel use the whole width. */
    .kis-mv-panel { width: 100vw; }
    .kis-gf-panel { left: 16px; right: 16px; top: calc(var(--kis-topbar-h) + 12px); }

    /* Toasts across the bottom with the page gutter. */
    .kis-toast-container { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .kis-toast { width: 100%; }

    /* Login */
    .kis-login-wrap { padding: 16px; }
    .kis-login-card { padding: 32px 24px; border-radius: var(--kis-radius-lg); }
}

/* ============================================================
   v1.254.0 — DEVICE ACCESS (Branding > Devices that can open KIS Workflow)
   wrapper.php adds body.kis-dev-off-<device> for every device the Super
   Admin switched off (never for the Super Admin). The matching width
   shows the block screen and hides the app; resizing into an allowed
   width lifts it. The login page is never blocked.
   ============================================================ */
.kis-device-block {
    display: none; position: fixed; inset: 0; z-index: 100000;
    align-items: center; justify-content: center; padding: 24px;
    background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 50%, #1C1C1E 100%);
}
.kis-device-card {
    background: var(--kis-surface); color: var(--kis-text);
    border-radius: var(--kis-radius-xl); padding: 32px 24px; width: 100%; max-width: 360px;
    text-align: center; display: grid; gap: 10px; justify-items: center;
    box-shadow: var(--kis-shadow-modal);
}
.kis-device-icon { width: 56px; height: 56px; border-radius: 16px; background: #FFF4E5; color: var(--kis-warning); display: flex; align-items: center; justify-content: center; }
.kis-device-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kis-device-msg { display: none; }
.kis-device-msg h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -0.3px; }
.kis-device-msg p { margin: 6px 0 0; font-size: 14px; color: var(--kis-text-secondary); }
.kis-device-card .kis-btn { width: 100%; min-height: 44px; margin-top: 8px; }
.kis-device-card small { font-size: 12px; color: var(--kis-text-tertiary); }
@media (max-width: 600px) {
    body.kis-dev-off-phone .kis-device-block { display: flex; }
    body.kis-dev-off-phone .kis-app, body.kis-dev-off-phone .kis-toast-container, body.kis-dev-off-phone .kis-sidebar-backdrop { display: none; }
    .kis-device-msg-phone { display: block; }
}
@media (min-width: 601px) and (max-width: 1024px) {
    body.kis-dev-off-tablet .kis-device-block { display: flex; }
    body.kis-dev-off-tablet .kis-app, body.kis-dev-off-tablet .kis-toast-container, body.kis-dev-off-tablet .kis-sidebar-backdrop { display: none; }
    .kis-device-msg-tablet { display: block; }
}
@media (min-width: 1025px) and (max-width: 1440px) {
    body.kis-dev-off-laptop .kis-device-block { display: flex; }
    body.kis-dev-off-laptop .kis-app, body.kis-dev-off-laptop .kis-toast-container { display: none; }
    .kis-device-msg-laptop { display: block; }
}
@media (min-width: 1441px) {
    body.kis-dev-off-desktop .kis-device-block { display: flex; }
    body.kis-dev-off-desktop .kis-app, body.kis-dev-off-desktop .kis-toast-container { display: none; }
    .kis-device-msg-desktop { display: block; }
}

/* ── v1.258.0 — pop-up window controls: — Minimize and ▢ Maximize on every pop-up ─────────
   Buttons are injected by kis-main.js (kisWmScan) beside the ✕ of .kis-modal-header /
   .kis-pro-modal-head. State lives on the overlay: .kis-wm-max fills the window,
   .kis-wm-min docks the header bottom-right as a bar and lets the page through.
   Appended after the responsive layer on purpose: the phone rules above set
   width/max-width with !important and these must win over them. */
.kis-wm { display: inline-flex; gap: 4px; margin-left: auto; margin-right: 6px; align-self: center; flex-shrink: 0; }
.kis-wm-btn {
    width: 32px; height: 32px; padding: 0; border-radius: var(--kis-radius-sm);
    background: var(--kis-surface-2); border: 1px solid var(--kis-border); color: var(--kis-text-secondary);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 15px; line-height: 1; transition: background var(--kis-transition);
}
.kis-wm-btn:hover { background: var(--kis-border); color: var(--kis-text); }
.kis-wm-btn[hidden] { display: none; }   /* the Maximize button is hidden on a minimized bar (kisWmPaint) */
.kis-wm-btn:focus-visible { outline: 2px solid var(--kis-primary); outline-offset: 1px; }
.kis-pro-modal-head .kis-wm-btn { width: 28px; height: 28px; font-size: 14px; }
.kis-pro-modal-head .kis-wm { margin-right: 4px; }

/* Maximized: the pop-up fills the window, its scrolling body takes the height. */
.kis-modal-overlay.kis-wm-max, .kis-modal-backdrop.kis-wm-max, .kis-pro-modal-overlay.kis-wm-max { padding: 6px; align-items: stretch; justify-content: center; }
.kis-wm-max .kis-modal, .kis-wm-max .kis-pro-modal {
    max-width: none !important; width: 100% !important; height: 100%; max-height: none; margin: 0;
    border-radius: var(--kis-radius-lg); animation: none;
}
.kis-wm-max .kis-modal-body, .kis-wm-max .kis-pro-modal-body { flex: 1 1 auto; min-height: 0; }
/* v1.284.0 — the WordPress admin bar (admins; hidden at <=1024px) covers the top 32px:
   a maximized pop-up starts below it instead of hiding its title under the bar. */
@media (min-width: 1025px) {
    body.admin-bar .kis-modal-overlay.kis-wm-max, body.admin-bar .kis-modal-backdrop.kis-wm-max, body.admin-bar .kis-pro-modal-overlay.kis-wm-max { padding-top: 38px; }
}

/* Minimized: no backdrop, the page is usable, the header is a bar docked bottom-right.
   Several parked pop-ups line up leftwards through --kis-wm-i (set by kisWmStack). */
.kis-modal-overlay.kis-wm-min, .kis-modal-backdrop.kis-wm-min, .kis-pro-modal-overlay.kis-wm-min {
    background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none;
    padding: 0; align-items: flex-end; justify-content: flex-end; overflow: visible; animation: none;
}
.kis-wm-min .kis-modal, .kis-wm-min .kis-pro-modal {
    pointer-events: auto; width: 320px !important; max-width: calc(100vw - 24px) !important;
    height: auto; max-height: none; margin: 0 calc(12px + var(--kis-wm-i, 0) * 332px) calc(12px + env(safe-area-inset-bottom, 0px)) 0;
    border-radius: var(--kis-radius-lg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28); animation: none; overflow: hidden;
}
.kis-wm-min .kis-modal-body, .kis-wm-min .kis-modal-footer, .kis-wm-min .kis-pro-modal-toolbar, .kis-wm-min .kis-pro-modal-body, .kis-wm-min .kis-pro-modal-count { display: none !important; }
.kis-wm-min .kis-modal-header, .kis-wm-min .kis-pro-modal-head { border-bottom: 0; cursor: pointer; padding: 10px 12px; gap: 8px; }
.kis-wm-min .kis-modal-title, .kis-wm-min .kis-pro-modal-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 600px) {
    .kis-wm-b-max { display: none; }   /* a phone pop-up already fills the screen */
}


/* =============================================================================
   v1.266.0 — ⊞ Group on every grid (partials/group-by.php + group-row.php,
   kisGroupBy() in kis-main.js). Was the Attendance-only .kis-att-grp* set (v1.202.0).
   One <tbody class="kis-grp-item"> per drawn item, so .kis-table's "tr:last-child td
   {border-bottom:none}" would strip every row's rule — put it back here.
   ============================================================================= */
.kis-table > tbody.kis-grp-item > tr > td { border-bottom: 1px solid var(--kis-border); }
.kis-grpwrap { position: relative; }
.kis-grpbtn-on { border-color: var(--kis-primary, #4f46e5); color: var(--kis-primary, #4f46e5); }
.kis-grpbtn-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--kis-primary, #4f46e5); color: #fff; font-size: 11px; font-weight: 700; }
.kis-grppanel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(480px, calc(100vw - 40px)); background: var(--kis-surface, #fff); border: 1px solid var(--kis-border, #e5e7eb); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); padding: 14px; }
.kis-grppanel-title { font-size: 12px; font-weight: 700; color: var(--kis-text-secondary, #6b7280); margin-bottom: 10px; }
.kis-grppanel-empty { font-size: 13px; color: var(--kis-text-muted, #9ca3af); margin: 0 0 10px; }
.kis-grppanel-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kis-grppanel-row select:first-of-type { flex: 1 1 0; min-width: 0; }
.kis-grppanel-join { width: 52px; flex: none; font-size: 12px; color: var(--kis-text-muted, #9ca3af); }
.kis-grppanel-dir { width: 96px; flex: none; }
.kis-grppanel-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--kis-border, #e5e7eb); padding-top: 10px; margin-top: 4px; }
.kis-table tr.kis-grp > td { background: #eef2f7; font-size: 13px; cursor: pointer; padding-top: 9px; padding-bottom: 9px; white-space: nowrap; }
.kis-table tr.kis-grp.kis-grp-l1 > td { background: #f5f7fa; }
.kis-table tr.kis-grp.kis-grp-l2 > td { background: #fafbfc; }
.kis-table tr.kis-grp:hover > td { background: #e4eaf2; }
.kis-grp-caret { display: inline-block; width: 16px; color: var(--kis-text-secondary, #6b7280); }
.kis-grp-field { color: var(--kis-text-secondary, #6b7280); margin-right: 4px; }
.kis-grp-meta { margin-left: 10px; font-size: 12px; color: var(--kis-text-muted, #9ca3af); }
.kis-grp-net { margin-left: 14px; font-size: 12px; color: var(--kis-text-secondary, #6b7280); }
.kis-grp-net strong { color: var(--kis-text, #111827); }
.kis-grp-net strong.is-neg { color: var(--kis-danger, #ef4444); }
