:root {
    /* ==========================================================================
       OpsVault Design System - Technical Neutral Identity with Orange Actions
       ========================================================================== */

    /* Primary Brand & Action CTA (Restrained - Buttons & Branding Only) */
    --primary: #F2842F;            /* Main action / CTA button color & logo mark */
    --primary-hover: #D96F20;      /* Button hover / pressed state */
    --primary-soft: #FFF3E9;       /* Subtle warm tint for active navigation badge */
    --primary-border: #F3D6C0;     /* Subtle border tint for active navigation */
    --primary-dark: var(--primary-hover);

    /* Normal Icons & Icon Containers (Neutral Gray / Slate) */
    --icon-color: #5F655F;         /* Neutral icon glyph color */
    --icon-bg: #F2F3F0;            /* Neutral icon container background */
    --icon-border: #E2E4DE;        /* Neutral icon container border */
    --icon-color-hover: #1C1D1A;   /* Neutral icon hover */

    /* Neutrals: 95% Calm, Technical, Infrastructure Tone */
    --bg: #F7F7F3;
    --panel: #FFFFFF;
    --surface: #FFFFFF;
    --sidebar: #F7F7F3;

    --line: #E3E4DD;
    --line-soft: #EDEDE6;
    --border: #E3E4DD;
    --border-subtle: #EDEDE6;

    /* Typography Hierarchy (Dark Neutral Text - Not Orange) */
    --text: #1C1D1A;
    --text-primary: #1C1D1A;
    --text-secondary: #63655F;
    --muted: #8A8C86;
    --text-muted: #8A8C86;

    /* Semantic Status - Subtle, Restrained & Purposeful (2%) */
    --status-active: #2E6930;
    --status-active-bg: #EDF5EE;
    --status-active-border: #C6E1C8;

    --status-warning: #8A5E00;
    --status-warning-bg: #FDF6E2;
    --status-warning-border: #F5E2B3;

    --status-danger: #9E2A2B;
    --status-danger-bg: #FDF0F0;
    --status-danger-border: #F7CACA;

    --status-neutral: #63655F;
    --status-neutral-bg: #F2F3F0;
    --status-neutral-border: #E2E4DE;

    /* Component Compat Aliases */
    --danger: #9E2A2B;
    --danger-bg: #FDF0F0;
    --danger-border: #F7CACA;
    --warning: #8A5E00;
    --warning-bg: #FDF6E2;
    --warning-text: #8A5E00;
    --warning-border: #F5E2B3;
    --ok-bg: #EDF5EE;
    --ok-text: #2E6930;
    --ok-border: #C6E1C8;

    /* Controlled Radii - Flat Architecture */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;

    /* Flat / Subtle Shadows */
    --shadow-sm: 0 1px 2px rgba(29, 33, 24, 0.04);
    --shadow-md: 0 2px 4px rgba(29, 33, 24, 0.05);
    --shadow-lg: 0 6px 16px rgba(29, 33, 24, 0.08);

    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: light; }

body {
    margin: 0;
    min-width: 320px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--primary);
    text-decoration: underline;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-shell {
    min-height: 100vh;
    position: relative;
    background: var(--bg);
}

.sidebar-removed { display: none !important; }

/* ==========================================================================
   Sidebar Navigation (Floating Island in Left Empty Space)
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 74px;
    bottom: 20px;
    height: calc(100vh - 94px);
    width: 200px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(29, 33, 24, 0.05), 0 6px 16px rgba(29, 33, 24, 0.04);
    display: flex;
    flex-direction: column;
    z-index: 45;
    overflow: hidden;
    left: max(16px, calc(50vw - 740px - 200px - 16px));
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.sidebar-header {
    height: 52px;
    min-height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.sidebar-header-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}


.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }

.brand-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand .brand-name {
    font-size: 14.5px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-brand .brand-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #FFFFFF;
    background: var(--primary);
    border-radius: var(--radius-sm);
}
.brand-mark svg { width: 15px; height: 15px; stroke-width: 2.2; }

.sidebar-close-btn {
    display: none;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.sidebar-close-btn:hover {
    color: var(--text-primary);
    background: var(--icon-bg);
}
.sidebar-close-btn svg { width: 16px; height: 16px; }

/* Sidebar Search */
.sidebar-search {
    padding: 12px 14px 4px;
}
.sidebar-search-btn {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sidebar-search-btn:hover {
    background: #FFFFFF;
    border-color: #CBD0C5;
    color: var(--text-primary);
}
.sidebar-search-text {
    flex: 1;
    text-align: left;
}
.sidebar-search-btn kbd {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Sidebar Scrollable Nav */
.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-nav-scroll::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: var(--line-soft);
    border-radius: 4px;
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-group-title {
    padding: 0 10px 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
    transition: all 0.12s ease;
    border: 1px solid transparent;
}
.sidebar-nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-nav-item:hover {
    color: var(--text-primary);
    background: var(--icon-bg);
    text-decoration: none;
}
.sidebar-nav-item.active {
    color: var(--text-primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
    font-weight: 600;
}
.sidebar-nav-item .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--icon-color);
    transition: color 0.12s ease;
}
.sidebar-nav-item:hover .nav-icon {
    color: var(--text-primary);
}
.sidebar-nav-item.active .nav-icon {
    color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: #FFFFFF;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-card .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 1px;
}

.sidebar-logout-form {
    margin: 0;
    flex-shrink: 0;
}

.sidebar-logout-btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.sidebar-logout-btn:hover {
    background: var(--status-danger-bg);
    border-color: var(--status-danger-border);
    color: var(--status-danger);
}
.sidebar-logout-btn svg {
    width: 15px;
    height: 15px;
}

/* Sidebar Backdrop (Mobile) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 14, 0.45);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Main Area */
.main {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Topbar (Clean Utility Header)
   ========================================================================== */
.topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    height: 62px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    width: 100%;
    max-width: min(1480px, calc(100vw - 460px));
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
}
.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    height: 38px;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-primary);
    text-decoration: none;
    user-select: none;
    transition: opacity 0.15s ease;
}
.topbar-brand:hover {
    opacity: 0.8;
    text-decoration: none;
}
.audit-target-link {
    transition: color 0.15s ease;
}
.audit-target-link:hover {
    color: var(--primary) !important;
    text-decoration: underline !important;
}
.topbar-brand .brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}
.topbar-brand .brand-mark svg {
    width: 13px;
    height: 13px;
}
.topbar-brand .brand-name {
    font-size: 14.5px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.topbar-logo {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}
@media (max-width: 640px) {
    .topbar-logo {
        height: 24px;
        max-width: 120px;
    }
}
.mobile-sidebar-toggle {
    display: none;
    width: 38px;
    height: 38px;
    padding: 0;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(29, 33, 24, 0.04);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.mobile-sidebar-toggle svg { width: 17px; height: 17px; }

.topbar-center {
    display: flex;
    justify-content: center;
    width: 100%;
    min-width: 340px;
    max-width: 480px;
    justify-self: center;
}
.topbar-search-btn {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(29, 33, 24, 0.04);
    color: var(--muted);
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}
.topbar-search-btn:hover {
    border-color: #CBD0C5;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(29, 33, 24, 0.07);
}
.topbar-search-btn svg {
    flex-shrink: 0;
}
.topbar-search-btn .search-label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-search-btn kbd {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
}

.topbar-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-notifications-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(29, 33, 24, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.topbar-notifications-btn:hover {
    color: var(--text-primary);
    border-color: #CBD0C5;
    box-shadow: 0 2px 4px rgba(29, 33, 24, 0.07);
}
.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--status-danger);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    border-radius: 9px;
    border: 2px solid var(--bg);
}

/* ==========================================================================
   Notifications Panel (Floating Right-Side Island & Drawer)
   ========================================================================== */
.notifications-panel {
    position: fixed;
    top: 74px;
    bottom: 20px;
    height: calc(100vh - 94px);
    width: 210px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(29, 33, 24, 0.05), 0 6px 16px rgba(29, 33, 24, 0.04);
    display: flex;
    flex-direction: column;
    z-index: 45;
    overflow: hidden;
    right: max(16px, calc(50vw - 740px - 210px - 16px));
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.notifications-panel.closed {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

/* Header */
.notifications-panel-header {
    height: 52px;
    min-height: 52px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: #FFFFFF;
}
.notifications-panel-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.notifications-panel-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--icon-bg);
    color: var(--primary);
}
.notifications-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.notifications-panel-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: #FEE2E2;
    color: #991B1B;
}
.notifications-close-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.notifications-close-btn:hover {
    color: var(--text-primary);
    background: var(--icon-bg);
    border-color: var(--border);
}

/* Filter Tabs (Matching Server Details / Enterprise Page Tabs Style) */
.notifications-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 10px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
}
.notifications-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 8px;
    font-size: 12px;
    font-weight: 550;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    margin-bottom: -1px;
    white-space: nowrap;
    text-align: center;
}
.notifications-tab:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}
.notifications-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 650;
    background: transparent;
}
.notifications-tab .tab-count-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 0 5px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.notifications-tab.active .tab-count-badge {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-border);
}

/* List container */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notifications-list::-webkit-scrollbar {
    width: 5px;
}
.notifications-list::-webkit-scrollbar-thumb {
    background: var(--line-soft);
    border-radius: 4px;
}

/* Notification Card */
.notification-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 9px 10px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}
.notification-card:hover {
    border-color: #CBD0C5;
    box-shadow: 0 2px 6px rgba(29, 33, 24, 0.06);
    text-decoration: none;
    transform: translateY(-1px);
}
.notification-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.notification-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 5px;
    border-radius: 4px;
}
.notification-card-badge.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}
.notification-card-badge.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}
.notification-card-badge.badge-info {
    background: #E0E7FF;
    color: #3730A3;
}
.notification-card-badge.badge-ok {
    background: #DCFCE7;
    color: #166534;
}
.notification-card-time {
    font-size: 10.5px;
    color: var(--muted);
    font-family: var(--font-mono);
}
.notification-card-title {
    font-size: 12px;
    font-weight: 650;
    color: var(--text-primary);
    line-height: 1.3;
}
.notification-card-msg {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
}
.notification-card-read {
    opacity: 0.55;
}
.notification-card-read:hover {
    opacity: 0.8;
}

/* Footer */
.notifications-panel-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: #FAFAF8;
}
.notifications-footer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.12s ease;
}
.notifications-footer-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Empty / Loading State */
.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 14px;
    text-align: center;
    color: var(--muted);
    gap: 8px;
}
.notifications-empty svg {
    width: 28px;
    height: 28px;
    color: var(--line-soft);
}
.notifications-empty-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Backdrop */
.notifications-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 14, 0.45);
    z-index: 92;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.notifications-backdrop.active {
    display: block;
    opacity: 1;
}

/* Drawer mode for screens <= 1200px */
@media (max-width: 1200px) {
    .notifications-panel {
        top: 0;
        bottom: 0;
        right: 0;
        height: 100vh;
        max-height: 100vh;
        width: 280px;
        max-width: 85vw;
        border-radius: 0;
        border-right: none;
        z-index: 95;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .notifications-panel.open {
        transform: translateX(0);
    }
}

/* User Menu & Dropdown */
.user-menu { position: relative; display: flex; align-items: center; }
.user-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 2px 7px 2px 3px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.12s ease;
}
.user-trigger:hover, .user-menu.open .user-trigger {
    background: var(--icon-bg);
    color: var(--text-primary);
}
.chevron { width: 13px; height: 13px; color: var(--muted); }
.user-dropdown {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    right: 0;
    width: 200px;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.user-dropdown-meta {
    padding: 6px 9px 5px;
}
.user-dropdown-name {
    font-weight: 650;
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.3;
}
.user-dropdown-role { margin-top: 3px; }
.user-dropdown a, .user-dropdown button {
    width: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 9px;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    font-weight: 550;
    transition: background 0.12s ease;
}
.user-dropdown a:hover, .user-dropdown button:hover {
    color: var(--text-primary);
    background: var(--icon-bg);
    text-decoration: none;
}
.dropdown-logout-btn { color: var(--status-danger) !important; }
.dropdown-logout-btn:hover { background: var(--status-danger-bg) !important; color: var(--status-danger) !important; }
.user-dropdown svg { width: 15px; height: 15px; }
.user-dropdown form { margin: 0; }
.dropdown-divider { height: 1px; margin: 4px 0; background: var(--line-soft); }
.avatar {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--icon-color);
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ==========================================================================
   Main Content & High-Density Layout
   ========================================================================== */
.content {
    grid-area: content-center;
    min-width: 0;
    width: 100%;
    max-width: min(1480px, calc(100vw - 460px));
    margin-left: auto;
    margin-right: auto;
    padding: 24px 20px 48px;
}
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.page-header-row > div:first-child,
.page-header-title-block {
    min-width: 0;
    flex: 1 1 auto;
}
.page-header-row > div:first-child .subtitle,
.page-header-title-block .subtitle,
.page-header-title-block .page-subtitle {
    margin: 3px 0 0;
}
.page-header-actions,
.header-right-actions,
.panel-header-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}
.page-header-actions .btn,
.header-right-actions .btn,
.panel-header-actions .btn {
    height: 35px !important;
    min-height: 35px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    font-size: 13px !important;
    font-weight: 550 !important;
    padding: 0 14px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.page-header-actions .btn svg,
.header-right-actions .btn svg,
.panel-header-actions .btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    flex-shrink: 0;
}
.page-title {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.subtitle {
    margin: 3px 0 14px;
    color: var(--text-secondary);
    font-size: 12px;
}

.grid { display: grid; gap: 14px; }
.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr); align-items: start; }
.list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.list-primary { min-width: 0; }
.filter-panel { position: sticky; top: 74px; }
.filter-form { display: grid; gap: 10px; }
.filter-form .btn { width: 100%; }

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 18px;
    align-items: start;
}
.detail-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.detail-sidebar {
    position: sticky;
    top: 74px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   Unified, Flat Stat Cards (Removed Rainbow Tints, Scaled Down KPI Font)
   ========================================================================== */
.stats-strip-six {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 1200px) {
    .stats-strip-six { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .stats-strip-six { grid-template-columns: repeat(2, 1fr); }
}

.stats-strip-five {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 1100px) {
    .stats-strip-five { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .stats-strip-five { grid-template-columns: repeat(2, 1fr); }
}

.stats-strip-four {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 992px) {
    .stats-strip-four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .stats-strip-four { grid-template-columns: 1fr; }
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

/* Consistent, Minimal Flat Stat Card Style across ALL pages */
.pastel-stat-card,
.stat-chip,
.metric-card,
.dashboard-nav-card {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 11px 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    box-shadow: var(--shadow-sm) !important;
    transition: border-color 0.15s ease !important;
    min-width: 0 !important;
    text-decoration: none !important;
    color: inherit !important;
    transform: none !important;
}
.pastel-stat-card:hover,
.stat-chip:hover,
.dashboard-nav-card:hover {
    border-color: #CBD0C5 !important;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: var(--shadow-md) !important;
}

.pastel-stat-icon,
.metric-icon,
.dashboard-nav-card .metric-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: var(--radius-sm) !important;
    background: var(--icon-bg) !important;
    color: var(--icon-color) !important;
    border: 1px solid var(--icon-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.pastel-stat-icon svg,
.metric-icon svg {
    width: 17px !important;
    height: 17px !important;
    stroke-width: 1.8 !important;
}

.pastel-stat-info,
.stat-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.pastel-stat-label,
.stat-chip-label,
.card-label,
.dashboard-card-title {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    white-space: nowrap !important;
}

/* Scaled-down, technical, readable KPI value font (Not oversized, not giant bold) */
.pastel-stat-value,
.stat-chip-val,
.card-value,
.dashboard-card-value {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
}

/* Neutralize legacy rainbow classes completely */
.card-pastel-blue,
.card-pastel-purple,
.card-pastel-amber,
.card-pastel-emerald,
.card-pastel-sky,
.card-pastel-rose {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}
.card-pastel-blue .pastel-stat-icon,
.card-pastel-purple .pastel-stat-icon,
.card-pastel-amber .pastel-stat-icon,
.card-pastel-emerald .pastel-stat-icon,
.card-pastel-sky .pastel-stat-icon,
.card-pastel-rose .pastel-stat-icon {
    background: var(--icon-bg) !important;
    color: var(--icon-color) !important;
    border-color: var(--icon-border) !important;
}

/* ==========================================================================
   Panels, Cards, and Section Headers
   ========================================================================== */
.card, .panel, .table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1;
}
.panel { margin-bottom: 18px; }
.card { min-height: 64px; padding: 12px 14px; }

.panel-header, .panel-header-rich {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px;
    background: #FAFAF8;
    border-bottom: 1px solid var(--border);
    border-top-left-radius: calc(var(--radius-md) - 1px);
    border-top-right-radius: calc(var(--radius-md) - 1px);
    flex-wrap: wrap;
}
.panel-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}
.panel-header-icon-box {
    width: 32px !important;
    height: 32px !important;
    border-radius: var(--radius-sm) !important;
    background: var(--icon-bg) !important;
    color: var(--icon-color) !important;
    border: 1px solid var(--icon-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.panel-header-icon-box svg { width: 16px; height: 16px; }

.panel-header-text h2, .panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 650;
}
.panel-header-text p, .panel-hint {
    margin: 1px 0 0;
    color: var(--text-secondary);
    font-size: 11.5px;
}
.panel-body { padding: 14px 16px; }
.panel-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
}
.panel-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.header-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.header-search-wrap svg,
.header-search-wrap .header-search-icon {
    position: absolute;
    left: 11px;
    width: 15px;
    height: 15px;
    color: var(--muted);
    pointer-events: none;
    z-index: 2;
}
.header-search-wrap input,
.header-search-wrap input[type="search"],
.header-search-wrap input:not([type="checkbox"]):not([type="radio"]) {
    height: 35px !important;
    min-height: 35px !important;
    width: 250px !important;
    min-width: 200px;
    padding: 0 12px 0 35px !important;
    font-size: 13px !important;
    font-family: inherit;
    background: #FFFFFF;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(29, 33, 24, 0.04);
    line-height: normal;
    transition: width 0.2s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.header-search-wrap input::placeholder {
    color: var(--muted);
    font-size: 12.5px;
}
.header-search-wrap input:focus,
.header-search-wrap input[type="search"]:focus {
    width: 290px !important;
    border-color: #B5B9AF !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(28, 29, 26, 0.08), 0 1px 2px rgba(29, 33, 24, 0.04);
}

/* ==========================================================================
   Tables - Compact, Crisp, Professional
   ========================================================================== */
.table-wrap {
    position: relative;
    width: 100%;
}
@media (min-width: 861px) {
    .table-wrap { overflow: visible; }
}
@media (max-width: 860px) {
    .table-wrap { overflow-x: auto; }
}
.table-wrap:has(.dropdown.open),
.table-wrap.table-active-dropdown {
    overflow: visible !important;
    position: relative;
    z-index: 510 !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th, td {
    padding: 9px 13px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    font-size: 12.5px;
}
th {
    color: var(--text-secondary);
    background: #FAFAF8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody tr {
    transition: background 0.12s ease;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAFAF8; }
.renewal-name { color: var(--text); font-weight: 600; }

table th:first-child, table td:first-child { white-space: nowrap; }
table td:first-child > div,
.table-entity-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.client-avatar-circle,
.server-avatar-box,
.server-icon-badge,
.app-icon-badge {
    width: 26px !important;
    height: 26px !important;
    border-radius: var(--radius-sm) !important;
    background: var(--icon-bg) !important;
    color: var(--icon-color) !important;
    border: 1px solid var(--icon-border) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}
.terminal-badge {
    background: #1D2118 !important;
    color: #A8B88C !important;
    border: 1px solid #2D3325 !important;
    font-family: var(--font-mono) !important;
}

/* ==========================================================================
   Clickable App Link Chips & Direct Items
   ========================================================================== */
.app-direct-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    background: var(--icon-bg);
    color: var(--text-secondary);
    border: 1px solid var(--icon-border);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.12s ease;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-direct-link-chip:hover {
    background: #E8EAE4;
    color: var(--text-primary);
    border-color: #CBD0C5;
    text-decoration: none;
}
.app-direct-link-chip svg {
    flex-shrink: 0;
    stroke-width: 2;
}

/* ==========================================================================
   Forms & Inputs - Subtle Neutral Focus
   ========================================================================== */
label {
    display: block;
    margin: 0 0 4px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
}
input, select, textarea, button { font: inherit; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    color: var(--text);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="checkbox"], input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
    vertical-align: middle;
}
textarea { min-height: 80px; resize: vertical; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    outline: none;
    border-color: #CBD0C5;
    box-shadow: 0 0 0 2px rgba(28, 29, 26, 0.08);
}
input::placeholder, textarea::placeholder {
    color: var(--muted);
}

/* Client intervention portal: deliberately small and free of internal operational fields. */
.client-portal-content { max-width: 1120px; }
.client-request-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
    gap: 10px;
    margin: 14px 0;
    align-items: center;
}
.client-request-title { color: var(--text-primary); font-weight: 700; text-decoration: none; }
.client-request-reference { margin-top: 3px; font: 11px var(--font-mono); }
.client-request-badges { display: flex; gap: 8px; align-items: center; }
.client-request-back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-size: 12px; }
.client-request-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; }
.client-request-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; }
.client-request-meta div { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-hover); }
.client-request-meta dt { color: var(--text-secondary); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.client-request-meta dd { margin: 4px 0 0; color: var(--text-primary); font-weight: 650; }
.client-request-description { margin-top: 20px; }
.client-request-description h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--text-secondary); }
.client-request-description p { margin: 0; white-space: pre-wrap; line-height: 1.65; }
.client-file-list { display: grid; gap: 7px; margin-bottom: 16px; }
.client-file-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); text-decoration: none; }
.client-file-upload { display: grid; gap: 9px; padding-top: 14px; border-top: 1px solid var(--border); }
.client-file-upload .btn { justify-self: start; }
@media (max-width: 820px) {
    .client-request-filters { grid-template-columns: 1fr; }
    .client-request-detail-grid { grid-template-columns: 1fr; }
    .client-request-meta { grid-template-columns: 1fr; }
    .client-request-table th:nth-child(4), .client-request-table td:nth-child(4),
    .client-request-table th:nth-child(5), .client-request-table td:nth-child(5) { display: none; }
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.check-row input { width: 16px; height: 16px; min-height: 0; cursor: pointer; }
.check-row label { margin: 0; font-weight: 500; cursor: pointer; color: var(--text); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   Searchable Select Component (Type-to-Filter Combobox)
   ========================================================================== */
.searchable-select {
    position: relative;
    width: 100%;
    display: block;
}

.searchable-select-native {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: -1px !important;
    padding: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    overflow: hidden !important;
}

.searchable-select-trigger {
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    color: var(--text);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.searchable-select-trigger:hover:not(:disabled) {
    border-color: #CBD0C5;
}

.searchable-select-trigger:focus,
.searchable-select.is-open .searchable-select-trigger {
    outline: none;
    border-color: #CBD0C5;
    box-shadow: 0 0 0 2px rgba(28, 29, 26, 0.08);
}

.searchable-select.is-invalid .searchable-select-trigger,
.searchable-select-trigger.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px var(--danger-border) !important;
}

.searchable-select.is-disabled .searchable-select-trigger,
.searchable-select-trigger:disabled {
    background: var(--line-soft);
    color: var(--muted);
    cursor: not-allowed;
    border-color: var(--border);
    opacity: 0.7;
}

.searchable-select-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 6px;
    line-height: 1.4;
}

.searchable-select-label.is-placeholder {
    color: var(--muted);
}

.searchable-select-chevron {
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.18s ease;
}

.searchable-select.is-open .searchable-select-chevron {
    transform: rotate(180deg);
}

.searchable-select-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.searchable-select-dropdown[hidden] {
    display: none !important;
}

.searchable-select-dropdown.open-upward {
    top: auto;
    bottom: calc(100% + 4px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.1), 0 -2px 6px rgba(0, 0, 0, 0.04);
}

.searchable-select-search-wrap {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-subtle);
    background: #FAFAF8;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.searchable-select-search-icon {
    flex-shrink: 0;
    color: var(--muted);
}

.searchable-select-search-input {
    width: 100%;
    min-height: 28px !important;
    height: 28px !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
    background: #FFFFFF !important;
    color: var(--text) !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

.searchable-select-search-input:focus {
    border-color: #CBD0C5 !important;
    box-shadow: 0 0 0 2px rgba(28, 29, 26, 0.08) !important;
}

.searchable-select-clear {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.searchable-select-clear:hover {
    color: var(--text);
    background: var(--border-subtle);
}

.searchable-select-options {
    max-height: 210px;
    overflow-y: auto;
    padding: 4px 0;
    margin: 0;
    list-style: none;
}

.searchable-select-option {
    padding: 6px 10px;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.1s ease, color 0.1s ease;
    user-select: none;
    min-height: 30px;
    box-sizing: border-box;
}

.searchable-select-option:hover,
.searchable-select-option.is-highlighted {
    background: #F4F5F1;
    color: var(--text-primary);
}

.searchable-select-option.is-selected {
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
}

.searchable-select-option.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.searchable-select-option-check {
    flex-shrink: 0;
    color: var(--primary);
    margin-left: 8px;
}

.searchable-select-empty {
    padding: 14px 10px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.searchable-select-match {
    font-weight: 700;
    color: var(--primary-hover);
    background: rgba(242, 132, 47, 0.12);
    border-radius: 2px;
    padding: 0 1px;
}

/* Specific sizing compatibility for audit filter bar */
.searchable-select.is-audit-filter .searchable-select-trigger {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
}

/* ==========================================================================
   Buttons - Orange Primary, Neutral Secondary
   ========================================================================== */
.btn {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    cursor: pointer;
    background: #FFFFFF;
    color: var(--text);
    font-weight: 550;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.12s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.btn:hover {
    background: var(--bg);
    border-color: #D1D3C8;
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.btn-primary {
    color: #FFFFFF !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-primary:hover {
    color: #FFFFFF !important;
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-secondary,
.btn-filter {
    color: var(--text) !important;
    background: #FFFFFF !important;
    border-color: var(--border) !important;
}
.btn-secondary:hover,
.btn-filter:hover {
    background: var(--bg) !important;
    border-color: #D1D3C8 !important;
    color: var(--text) !important;
}

.btn-white-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 32px;
    min-height: 32px;
    padding: 0 13px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 550;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border) !important;
    background: #FFFFFF !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.14s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-white-more:hover {
    background: var(--bg) !important;
    border-color: #D1D3C8 !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.btn-white-more svg {
    color: var(--icon-color);
    transition: transform 0.15s ease, color 0.15s ease;
}
.dropdown.open .btn-white-more {
    background: var(--bg) !important;
    border-color: #D1D3C8 !important;
}
.dropdown.open .btn-white-more svg {
    transform: rotate(180deg);
}

/* Neutralize all decorative colorful buttons to standard secondary or primary */
.btn-teal, .btn-indigo, .btn-purple,
.btn-soft-primary, .btn-soft-emerald, .btn-soft-purple, .btn-soft-sky {
    background: #FFFFFF !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}
.btn-teal:hover, .btn-indigo:hover, .btn-purple:hover,
.btn-soft-primary:hover, .btn-soft-emerald:hover, .btn-soft-purple:hover, .btn-soft-sky:hover {
    background: var(--bg) !important;
    border-color: #D1D3C8 !important;
    color: var(--text-primary) !important;
}

.btn-danger {
    color: #FFFFFF !important;
    background: var(--status-danger) !important;
    border-color: var(--status-danger) !important;
}
.btn-danger:hover {
    background: #842324 !important;
    border-color: #842324 !important;
}

.btn-small { min-height: 26px; padding: 3px 8px; font-size: 11px; }
.btn-block { width: 100%; }
.btn-text { background: transparent; border-color: transparent; box-shadow: none; }
.btn-text:hover { background: var(--icon-bg); border-color: transparent; }

.btn-reveal-trigger {
    color: var(--text-primary) !important;
    background: #FFFFFF !important;
    border-color: var(--border) !important;
    font-weight: 550;
}
.btn-reveal-trigger:hover {
    background: var(--bg) !important;
    color: var(--text-primary) !important;
    border-color: #D1D3C8 !important;
}

/* Compact notification settings */
.notification-settings {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
    align-items: start;
}

.notification-settings.is-admin {
    grid-template-columns: 280px minmax(0, 1fr);
}

.notification-settings.is-member {
    max-width: 820px;
    grid-template-columns: minmax(0, 1fr);
}

.notification-settings.is-admin .notif-connect-notice {
    grid-column: 1 / -1;
}

.notification-settings.is-admin .notif-system-section {
    grid-column: 1;
    grid-row: 1;
}

.notification-settings.is-admin .notif-connect-notice + .notif-system-section {
    grid-row: 2;
}

.notification-settings.is-admin .notif-channels-section {
    grid-column: 2;
    grid-row: 1;
}

.notification-settings.is-admin .notif-personal-grid {
    grid-template-columns: minmax(0, 1fr);
}

.notification-settings.is-admin .notif-connect-notice ~ .notif-channels-section {
    grid-row: 2;
}

.notification-settings.is-admin .notif-scope-section {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    z-index: 20;
    overflow: visible;
}

.notification-settings.is-admin .notif-connect-notice ~ .notif-scope-section {
    grid-row: 3;
}

.notification-settings.is-admin .notif-preferences-section {
    grid-column: 2;
    grid-row: 2 / span 2;
}

.notification-settings.is-admin .notif-connect-notice ~ .notif-preferences-section {
    grid-row: 3 / span 2;
}

.notif-section {
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.notif-section-head {
    min-height: 52px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.notif-section h2,
.notif-scope-row h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

.notif-section-head p,
.notif-scope-row p {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 11.5px;
}

.notif-admin-label {
    padding: 2px 7px;
    color: var(--primary);
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.notif-system-grid {
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.notif-mini-card {
    min-width: 0;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.notif-mini-copy,
.notif-channel-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.notif-mini-copy strong,
.notif-channel-copy strong {
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 650;
}

.notif-mini-copy span,
.notif-channel-copy span {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-personal-grid {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.notif-channel-card {
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.notif-channel-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.notif-channel-top form {
    margin-left: auto;
}

.notif-channel-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--icon-color);
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    border-radius: 7px;
}

.notif-channel-icon svg {
    width: 14px;
    height: 14px;
}

.notif-card-footer {
    min-height: 28px;
    margin-top: 9px;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    font-size: 10.5px;
}

.notif-inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-text-action {
    padding: 0;
    color: var(--primary);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.notif-text-action:hover { text-decoration: underline; }
.notif-text-action.is-danger { color: var(--status-danger); }
.notif-text-action:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

.notif-switch-button {
    position: relative;
    width: 34px;
    height: 19px;
    padding: 0;
    display: block;
    flex: 0 0 auto;
    background: #D8DBD3;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease;
}

.notif-switch-button span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 13px;
    height: 13px;
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
    transition: transform .15s ease;
}

.notif-switch-button.is-on { background: var(--primary); }
.notif-switch-button.is-on span { transform: translateX(15px); }
.notif-switch-button:disabled { opacity: .45; cursor: not-allowed; }
.notif-switch-button:focus-visible,
.notif-toggle input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.notif-connect-notice {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--text-primary);
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    border-radius: var(--radius-sm);
}

.notif-connect-notice div { display: grid; gap: 2px; }
.notif-connect-notice strong { font-size: 12.5px; }
.notif-connect-notice span { color: var(--text-secondary); font-size: 11px; }

.notif-scope-row {
    padding: 11px 14px;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
}

.notif-scope-controls {
    position: relative;
    z-index: 21;
    display: flex;
    align-items: center;
    gap: 7px;
}

.notif-scope-controls select {
    width: 100%;
    min-width: 0;
    min-height: 29px;
    height: 29px;
    padding: 3px 28px 3px 9px;
    font-size: 11.5px;
}

.notif-matrix {
    table-layout: fixed;
}

.notif-matrix th,
.notif-matrix td {
    height: 36px;
    padding: 6px 12px;
    font-size: 11.5px;
}

.notif-matrix th:first-child,
.notif-matrix td:first-child {
    width: auto;
    padding-left: 14px;
    text-align: left;
}

.notif-matrix th:not(:first-child),
.notif-matrix td:not(:first-child) {
    width: 76px;
    text-align: center;
}

.notif-matrix tbody tr:not(.notif-category-row) td:first-child {
    color: var(--text-primary);
    font-weight: 550;
}

.notif-category-row td {
    height: 27px;
    padding-top: 5px;
    padding-bottom: 5px;
    color: var(--text-secondary) !important;
    background: #F6F7F4;
    font-size: 10px !important;
    font-weight: 750 !important;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.notif-toggle {
    position: relative;
    width: 30px;
    height: 17px;
    display: inline-block;
    margin: 0;
    cursor: pointer;
    vertical-align: middle;
}

.notif-toggle input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    opacity: 0;
}

.notif-toggle span {
    position: absolute;
    inset: 0;
    background: #D8DBD3;
    border-radius: 999px;
    transition: background .15s ease;
}

.notif-toggle span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 11px;
    height: 11px;
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: transform .15s ease;
}

.notif-toggle input:checked + span { background: var(--primary); }
.notif-toggle input:checked + span::after { transform: translateX(13px); }

.notif-save-row {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    font-size: 10.5px;
}

@media (max-width: 900px) {
    .notification-settings.is-admin,
    .notification-settings.is-member { max-width: 760px; grid-template-columns: minmax(0, 1fr); }
    .notification-settings.is-admin .notif-connect-notice,
    .notification-settings.is-admin .notif-system-section,
    .notification-settings.is-admin .notif-channels-section,
    .notification-settings.is-admin .notif-scope-section,
    .notification-settings.is-admin .notif-preferences-section {
        grid-column: 1;
        grid-row: auto;
    }
    .notification-settings.is-admin .notif-system-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .notif-scope-row { align-items: center; flex-direction: row; }
    .notif-scope-controls select { min-width: 165px; }
}

@media (max-width: 620px) {
    .notification-settings.is-admin .notif-system-grid,
    .notif-personal-grid { grid-template-columns: 1fr; }
    .notif-scope-row { align-items: flex-start; flex-direction: column; }
    .notif-scope-controls { width: 100%; }
    .notif-scope-controls select { flex: 1; min-width: 0; }
    .notif-matrix th:not(:first-child),
    .notif-matrix td:not(:first-child) { width: 68px; padding-left: 5px; padding-right: 5px; }
}

/* Three-Dots & Table Action Trigger */
.btn-action-trigger,
.btn-action-icon {
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}
.btn-action-trigger:hover,
.btn-action-icon:hover,
.dropdown.open .btn-action-trigger {
    background: var(--icon-bg);
    border-color: #CBD0C5;
    color: var(--text-primary);
}

/* ==========================================================================
   Dropdowns & Drawers
   ========================================================================== */
/* Elevate panel, section, card, or table-card when any dropdown inside is open */
section:has(.dropdown.open),
section.panel-active-dropdown,
.panel:has(.dropdown.open),
.panel.panel-active-dropdown,
.card:has(.dropdown.open),
.card.card-active-dropdown,
.table-card:has(.dropdown.open),
.table-card.table-card-active-dropdown {
    position: relative;
    z-index: 1000 !important;
}

tr:has(.dropdown.open), tr.row-active-dropdown,
td:has(.dropdown.open), td.cell-active-dropdown {
    position: relative;
    z-index: 1050 !important;
}
.dropdown {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}
.dropdown.open {
    position: relative;
    z-index: 1060 !important;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    z-index: 99999 !important;
    min-width: 215px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
}
.dropdown.open .dropdown-menu {
    display: flex;
    animation: dropdownPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dropdownPop {
    from { opacity: 0; transform: scale(0.97) translateY(-3px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.dropdown-menu.dropdown-menu-up {
    top: auto;
    bottom: calc(100% + 5px);
}
.dropdown-menu form {
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    box-sizing: border-box;
}
.dropdown-item:hover {
    background: var(--icon-bg);
    color: var(--text-primary);
    text-decoration: none;
}
.dropdown-item svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.8;
    color: var(--icon-color);
    flex-shrink: 0;
}
.dropdown-item:hover svg {
    color: var(--text-primary);
}
.dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background: var(--line-soft);
    border: none;
}
.dropdown-item-danger {
    color: var(--status-danger) !important;
}
.dropdown-item-danger svg {
    color: var(--status-danger) !important;
}
.dropdown-item-danger:hover {
    background: var(--status-danger-bg) !important;
    color: var(--status-danger) !important;
}
.dropdown-item-danger:hover svg {
    color: var(--status-danger) !important;
}

/* Double-click Interactive Table Rows */
tbody tr[data-row-href],
tbody tr[data-row-target] {
    cursor: pointer;
}
tbody tr[data-row-href]:hover td,
tbody tr[data-row-target]:hover td {
    background-color: #FAFBF9;
}

.col-actions {
    text-align: right;
    width: 65px;
    white-space: nowrap;
    position: relative;
    padding-right: 12px !important;
}

/* ==========================================================================
   Badges & Semantic Status Pills (Restrained Status)
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 550;
    white-space: nowrap;
    line-height: 1.35;
}
.badge-neutral {
    background: var(--status-neutral-bg);
    border-color: var(--status-neutral-border);
    color: var(--status-neutral);
}
.badge-ok,
.badge-success {
    background: var(--status-active-bg);
    border-color: var(--status-active-border);
    color: var(--status-active);
}
.badge-warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
    color: var(--status-warning);
}
.badge-danger {
    background: var(--status-danger-bg);
    border-color: var(--status-danger-border);
    color: var(--status-danger);
}
.badge-info,
.badge-blue {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1D4ED8;
}
.badge-purple {
    background: #FAF5FF;
    border-color: #E9D5FF;
    color: #7E22CE;
}
.badge-teal {
    background: #F0FDFA;
    border-color: #99F6E4;
    color: #0F766E;
}

/* Intervention Type Badges */
.badge-type-maintenance {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1D4ED8;
}
.badge-type-incident {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #DC2626;
}
.badge-type-upgrade {
    background: #F5F3FF;
    border-color: #DDD6FE;
    color: #7C3AED;
}
.badge-type-provisioning {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #059669;
}
.badge-type-security {
    background: #FFF1F2;
    border-color: #FECDD3;
    color: #E11D48;
}
.badge-type-support {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #D97706;
}

.badge-type {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-mono);
}

.status-pill-active,
.status-pill-running {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--status-active-bg);
    color: var(--status-active);
    border: 1px solid var(--status-active-border);
    font-size: 11px;
    font-weight: 550;
    white-space: nowrap;
}
.status-dot-green {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-active);
    display: inline-block;
}

.status-pill-warning {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid var(--status-warning-border);
    font-size: 11px;
    font-weight: 550;
}
.status-pill-danger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid var(--status-danger-border);
    font-size: 11px;
    font-weight: 550;
}
.status-pill-renew {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--status-neutral-bg);
    color: var(--status-neutral);
    border: 1px solid var(--status-neutral-border);
    font-size: 11px;
    font-weight: 550;
}

.count-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.12s ease;
}
.count-pill:hover {
    background: var(--icon-bg);
    border-color: #CBD0C5;
    color: var(--text-primary);
    text-decoration: none;
}

.muted { color: var(--muted); }
.masked { font-family: var(--font-mono); letter-spacing: 0.15em; color: var(--muted); }
code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text);
    background: var(--bg);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* Flashes & Alerts */
.flash {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    margin-bottom: 16px;
    border: 1px solid;
    border-radius: var(--radius-md);
    font-size: 12px;
}
.flash-icon { font-weight: 700; font-size: 13px; flex-shrink: 0; }
.flash-success { color: var(--status-active); background: var(--status-active-bg); border-color: var(--status-active-border); }
.flash-error { color: var(--status-danger); background: var(--status-danger-bg); border-color: var(--status-danger-border); }
.flash-warning { color: var(--status-warning); background: var(--status-warning-bg); border-color: var(--status-warning-border); }

/* ==========================================================================
   Server Specifications Sidebar List
   ========================================================================== */
.spec-list {
    display: flex;
    flex-direction: column;
}
.spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12.5px;
    gap: 10px;
}
.spec-row:last-child { border-bottom: none; }
.spec-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}
.spec-value {
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    text-align: right;
}
.spec-notes-box {
    margin-top: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==========================================================================
   Empty States (Calm, Neutral Icon)
   ========================================================================== */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px 20px;
    margin: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}
.empty-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 8px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--icon-color);
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
}
.empty-icon svg { width: 19px; height: 19px; stroke-width: 1.8; }
.empty-title {
    color: var(--text);
    font-size: 13.5px;
    font-weight: 650;
    margin-bottom: 3px;
}
.empty-subtitle {
    max-width: 360px;
    color: var(--text-secondary);
    font-size: 12px;
}
.empty.compact-empty {
    padding: 20px 12px;
    margin: 8px;
    font-size: 11.5px;
}

/* ==========================================================================
   Drawers & Modals
   ========================================================================== */
.drawer-layer,
.drawer {
    position: fixed;
    z-index: 10000 !important;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
}
.drawer-layer.open,
.drawer.open {
    visibility: visible;
    pointer-events: auto;
}
.drawer-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(29, 33, 24, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: default;
}
.drawer-layer.open .drawer-backdrop,
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(480px, 94vw);
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-layer.open .drawer-panel,
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: #FAFAF8;
    border-bottom: 1px solid var(--border);
}
.drawer-header h2 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--text); }
.drawer-body { padding: 18px; flex: 1; min-height: 0; overflow-y: auto; }
.drawer-body .form-grid { grid-template-columns: 1fr; }
.drawer-body .form-grid .full { grid-column: auto; }
.drawer-body form .field,
form.drawer-body .field,
.modal-card form .field,
form.modal-card .field,
.panel-body form .field,
form.panel-body .field {
    margin-bottom: 20px;
}
.drawer-body form .field:last-of-type,
form.drawer-body .field:last-of-type,
.modal-card form .field:last-of-type,
form.modal-card .field:last-of-type,
.panel-body form .field:last-of-type,
form.panel-body .field:last-of-type {
    margin-bottom: 24px;
}
.drawer-body form .actions,
form.drawer-body .actions,
.modal-card form .actions,
form.modal-card .actions,
.panel-body form .actions,
form.panel-body .actions {
    margin-top: 24px;
}
.drawer-body form button[type="submit"]:not(.actions button),
form.drawer-body button[type="submit"]:not(.actions button),
.modal-card form button[type="submit"]:not(.actions button),
form.modal-card button[type="submit"]:not(.actions button),
.panel-body form button[type="submit"]:not(.actions button),
form.panel-body button[type="submit"]:not(.actions button) {
    margin-top: 24px;
}
.drawer-body .form-grid > div:has(button[type="submit"]),
form.drawer-body .form-grid > div:has(button[type="submit"]),
.modal-card .form-grid > div:has(button[type="submit"]),
form.modal-card .form-grid > div:has(button[type="submit"]),
.panel-body .form-grid > div:has(button[type="submit"]),
form.panel-body .form-grid > div:has(button[type="submit"]),
form.panel-body .form-grid + div {
    margin-top: 24px;
}

/* Renewal drawers: compact treatment using the OpsVault action color. */
.renewal-panel {
    width: min(440px, 94vw);
    border-top: 3px solid var(--primary);
}

.renewal-panel-header {
    min-height: 52px;
    padding: 10px 16px;
    background: #FFFFFF;
}

.renewal-panel-header h2 {
    display: flex;
    align-items: center;
    gap: 9px;
}

.renewal-panel-header h2::before {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    content: "";
}

.renewal-panel-body {
    padding: 16px;
}

.renewal-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-md);
    background: var(--primary-soft);
}

.renew-target-name {
    display: block;
    max-width: 270px;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.renew-target-date {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 11.5px;
}

.renew-target-date strong {
    color: var(--primary-hover);
    font-weight: 700;
}

.renewal-info-box .badge-type {
    flex: 0 0 auto;
    background: #FFFFFF;
    border-color: var(--primary-border);
    color: var(--primary-hover);
}

.renewal-panel .field {
    margin-bottom: 15px !important;
}

.renewal-panel .field:last-of-type {
    margin-bottom: 15px !important;
}

.period-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 7px;
}

.renewal-panel .period-selector .btn {
    width: 100%;
    min-height: 34px;
    padding-inline: 8px;
    box-shadow: none;
}

.renewal-panel .period-selector .btn.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #FFFFFF !important;
}

.renewal-panel .period-selector .btn.btn-primary:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.renewal-auto-row {
    margin: 4px 0 18px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: #FAFAF8;
}

.renewal-auto-row input {
    accent-color: var(--primary);
}

.renewal-panel .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 0 !important;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.renewal-panel .actions .btn {
    min-height: 38px;
}

.renewal-history-icon {
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary-hover);
}

.renewal-history-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.renewal-history-stat {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
}

.renewal-history-stat span {
    display: block;
    margin-bottom: 3px;
    color: var(--text-secondary);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.renewal-history-stat strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.renewal-history-filters {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1fr) minmax(140px, 0.8fr) auto auto;
    align-items: end;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: #FAFAF8;
}

.renewal-filter-field {
    display: grid;
    gap: 5px;
    min-width: 0;
    margin: 0;
}

.renewal-filter-field > span {
    color: var(--text-secondary);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.renewal-filter-field select {
    width: 100%;
    min-height: 34px;
    padding-block: 6px;
    background-color: #FFFFFF;
}

.renewal-filter-reset {
    min-height: 34px;
}

.renewal-filter-count {
    align-self: center;
    color: var(--text-secondary);
    font-size: 11.5px;
    white-space: nowrap;
}

.renewal-filter-count strong {
    color: var(--primary-hover);
}

@media (max-width: 900px) {
    .renewal-history-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .renewal-filter-count {
        justify-self: end;
    }
}

@media (max-width: 520px) {
    .renewal-panel .actions {
        grid-template-columns: 1fr;
    }

    .renewal-panel .actions .btn {
        width: 100%;
    }

    .renewal-history-summary {
        grid-template-columns: 1fr;
    }

    .renewal-history-filters {
        grid-template-columns: 1fr;
    }

    .renewal-filter-reset,
    .renewal-filter-count {
        width: 100%;
        justify-self: stretch;
        text-align: center;
    }
}
.icon-btn {
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text-secondary);
    cursor: pointer;
}
.icon-btn:hover {
    background: var(--icon-bg);
    color: var(--text-primary);
}
body.drawer-open { overflow: hidden; }
body.spotlight-open { overflow: hidden; }

body.spotlight-open .topbar,
body:has(.spotlight-overlay.open) .topbar {
    z-index: 2147483647 !important;
}

/* ==========================================================================
   Spotlight Search Modal (Ctrl+K)
   ========================================================================== */
.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647 !important;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    padding-left: 16px;
    padding-right: 16px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}
.spotlight-overlay.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 2147483647 !important;
}
.spotlight-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 12, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
    z-index: 1;
}
.spotlight-dialog {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transform: scale(0.98) translateY(-4px);
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}
.spotlight-overlay.open .spotlight-dialog {
    transform: scale(1) translateY(0);
}
.spotlight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #FAFAF8;
}
.spotlight-search-icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
    flex-shrink: 0;
}
.spotlight-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    outline: none;
    padding: 0;
    font-family: inherit;
}
.spotlight-input::placeholder { color: var(--muted); }
.spotlight-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.spotlight-esc-btn {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}
.spotlight-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spotlightSpin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spotlightSpin { to { transform: rotate(360deg); } }

.spotlight-body {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 0;
}
.spotlight-category-title {
    font-size: 10.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 7px 16px 3px;
}
.spotlight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s ease;
}
.spotlight-item:hover,
.spotlight-item.active {
    background: var(--icon-bg);
    text-decoration: none;
}
.spotlight-item.active .spotlight-item-title {
    color: var(--text-primary);
}
.spotlight-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.spotlight-item-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--icon-bg);
    color: var(--icon-color);
    border: 1px solid var(--icon-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.spotlight-item-icon svg { width: 15px; height: 15px; }

.spotlight-icon-client,
.spotlight-icon-server,
.spotlight-icon-domain,
.spotlight-icon-app,
.spotlight-icon-lock,
.spotlight-icon-user,
.spotlight-icon-dashboard,
.spotlight-icon-gear,
.spotlight-icon-shield {
    background: var(--icon-bg) !important;
    color: var(--icon-color) !important;
    border: 1px solid var(--icon-border) !important;
}

.spotlight-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spotlight-item-sub {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spotlight-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.spotlight-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.spotlight-arrow {
    width: 13px;
    height: 13px;
    color: var(--muted);
    opacity: 0;
    transition: all 0.12s ease;
}
.spotlight-item:hover .spotlight-arrow,
.spotlight-item.active .spotlight-arrow {
    opacity: 1;
    color: var(--text-primary);
}

.spotlight-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-secondary);
}
.spotlight-empty-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}
.spotlight-empty-sub { font-size: 12px; color: var(--muted); }

.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    background: #FAFAF8;
    font-size: 11px;
    color: var(--text-secondary);
}
.spotlight-hints { display: flex; align-items: center; gap: 10px; }
.hint-item { display: inline-flex; align-items: center; gap: 3px; }
.hint-item kbd {
    display: inline-block;
    padding: 1px 4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 3px;
}
.spotlight-full-search-link {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}
.spotlight-full-search-link:hover { text-decoration: underline; color: var(--primary); }

/* ==========================================================================
   Login & Setup (Flat Off-White Background, Clean Cards)
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 30px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.login-card.setup-card { max-width: 440px; }
.login-header { text-align: center; margin-bottom: 20px; }
.login-badge-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.login-badge-wrap .brand-mark {
    width: 38px;
    height: 38px;
}
.login-badge-wrap .brand-mark svg { width: 20px; height: 20px; }
.login-card h1 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text);
}
.login-card .field { margin: 14px 0; }
.totp-instruction {
    text-align: center;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 12px;
}
.input-code {
    font-size: 22px !important;
    font-family: var(--font-mono) !important;
    font-weight: 700 !important;
    letter-spacing: 0.25em !important;
    text-align: center !important;
    padding: 8px !important;
    min-height: 44px !important;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.password-input-wrap input {
    width: 100% !important;
    padding-right: 36px !important;
}
.password-toggle-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease;
    z-index: 2;
}
.password-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--icon-bg);
}
.password-toggle-btn:focus-visible {
    outline: 2px solid var(--border);
    outline-offset: 1px;
}
.password-toggle-btn svg { width: 16px; height: 16px; pointer-events: none; }
.password-toggle-btn .eye-off-icon { display: none; }
.password-toggle-btn.is-showing { color: var(--text-primary); }
.password-toggle-btn.is-showing .eye-on-icon { display: none; }
.password-toggle-btn.is-showing .eye-off-icon { display: block; }

.login-footer { margin-top: 16px; text-align: center; }
.login-restart { color: var(--muted); font-size: 12px; font-weight: 500; }
.login-restart:hover { color: var(--text); }

.enrollment-intro { text-align: center; margin-bottom: 14px; }
.enrollment-intro h3 { margin: 0 0 3px; font-size: 15px; font-weight: 650; }
.enrollment-qr-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    margin-bottom: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.enrollment-qr-img {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Modern Auth & Onboarding Layout (Reference Inspired)
   ========================================================================== */
.auth-container {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-brand-header {
    text-align: center;
    margin-bottom: 26px;
}
.auth-brand-header .brand-mark {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(242, 132, 47, 0.28);
}
.auth-brand-header .brand-mark svg {
    width: 24px;
    height: 24px;
    stroke: #FFFFFF;
}
.auth-brand-title {
    font-size: 22px;
    font-weight: 750;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}
.auth-brand-subtitle {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 0;
}
.auth-brand-link {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.auth-brand-link:hover {
    opacity: 0.85;
}
.auth-brand-logo {
    height: 48px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}
@media (max-width: 480px) {
    .auth-brand-logo {
        height: 40px;
        max-width: 180px;
    }
}
.auth-card-logo {
    height: 44px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto 16px;
}
@media (max-width: 480px) {
    .auth-card-logo {
        height: 38px;
        max-width: 170px;
        margin-bottom: 12px;
    }
}

/* Split Login Container */
.auth-split-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 44px;
    width: 100%;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 30px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.auth-card-centered {
    width: 100%;
    max-width: 440px;
    padding: 30px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.auth-card-header {
    margin-bottom: 20px;
}
.auth-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}
.auth-card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}
.auth-card .field,
.auth-card-centered .field {
    margin-bottom: 20px;
}
.auth-card .field:last-of-type,
.auth-card-centered .field:last-of-type {
    margin-bottom: 26px;
}

/* Perks Panel on Right side */
.auth-perks {
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-width: 310px;
}
.auth-perk-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.auth-perk-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.auth-perk-icon svg { width: 18px; height: 18px; }
.auth-perk-title {
    font-size: 14px;
    font-weight: 650;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.auth-perk-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Input with Icon Prefix */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.input-icon-wrap svg.input-prefix-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
}
.input-icon-wrap input {
    width: 100% !important;
    padding-left: 36px !important;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-icon-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(242, 132, 47, 0.15);
    outline: none;
}

/* Segmented 6-Digit Code Input */
.code-digits-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 22px 0 20px;
}
.code-digit-box,
input.code-digit-box,
input:not([type="checkbox"]):not([type="radio"]).code-digit-box {
    width: 52px !important;
    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    font-size: 32px !important;
    font-weight: 800 !important;
    font-family: var(--font-mono), Consolas, monospace !important;
    line-height: 58px !important;
    text-align: center !important;
    color: var(--text-primary) !important;
    background: #FFFFFF !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    caret-color: var(--primary);
}
.code-digit-box:focus,
input.code-digit-box:focus,
input:not([type="checkbox"]):not([type="radio"]).code-digit-box:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(242, 132, 47, 0.22) !important;
}
@media (max-width: 480px) {
    .code-digits-container {
        gap: 6px;
    }
    .code-digit-box,
    input.code-digit-box,
    input:not([type="checkbox"]):not([type="radio"]).code-digit-box {
        width: 42px !important;
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
        font-size: 26px !important;
        line-height: 48px !important;
    }
}

/* Status Circle Avatars */
.status-circle-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.status-circle-avatar.success {
    background: var(--emerald-soft);
    border: 1px solid var(--emerald-border);
    color: var(--emerald);
}
.status-circle-avatar.warning {
    background: var(--amber-soft);
    border: 1px solid var(--amber-border);
    color: var(--amber);
}
.status-circle-avatar.danger {
    background: var(--red-soft);
    border: 1px solid var(--red-border);
    color: var(--red);
}
.status-circle-avatar svg {
    width: 26px;
    height: 26px;
}

/* Auth Footer Links */
.auth-footer {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 860px;
    font-size: 12px;
    color: var(--muted);
    padding: 0 8px;
}
.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 14px;
}
.auth-footer a:hover {
    color: var(--text-primary);
}

.input-icon-wrap .password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}
.input-icon-wrap:has(.password-toggle-btn) input {
    padding-right: 38px !important;
}

/* =============================================================================
   Table Filter Pills & Chips
   ============================================================================= */
.table-filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 550;
    color: var(--text-secondary);
    background: #FFFFFF;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.filter-chip:hover {
    color: var(--text-primary);
    border-color: var(--muted);
    background: var(--surface);
}
.filter-chip.active {
    color: #FFFFFF;
    background: #1C1D1A;
    border-color: #1C1D1A;
}
.filter-chip .chip-count {
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}
.filter-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
}

/* Audit Log Filtering Controls */
.audit-filter-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.audit-filter-grid {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.audit-filter-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}
.audit-filter-col label {
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 0;
}
.audit-filter-control {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    font-size: 12.5px !important;
    background: #FFFFFF !important;
    color: var(--text-primary) !important;
    width: 100%;
    box-sizing: border-box;
}
.audit-filter-control:focus {
    border-color: var(--primary) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(242, 132, 47, 0.15) !important;
}
.audit-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .auth-split-wrapper {
        flex-direction: column;
        gap: 24px;
    }
    .auth-perks {
        max-width: 100%;
        width: 100%;
        order: 2;
    }
    .auth-card {
        max-width: 100%;
    }
    .code-digit-box {
        width: 38px;
        height: 46px;
        font-size: 18px;
    }
}

/* ==========================================================================
   Server Header Banner & Breadcrumbs
   ========================================================================== */
.server-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.server-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.server-avatar-box {
    width: 48px !important;
    height: 48px !important;
    border-radius: var(--radius-md) !important;
    font-size: 22px !important;
    font-weight: 700 !important;
}
.server-header-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.server-header-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.server-header-title {
    font-size: 22px;
    font-weight: 750;
    color: var(--text);
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}
.server-header-subtitle {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}
.server-header-subtitle a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}
.server-header-subtitle a:hover { color: var(--primary); }
.server-header-subtitle .meta-dot { color: var(--muted); font-size: 11px; }

.server-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--muted);
}
.breadcrumb-nav a {
    color: var(--text-secondary);
    font-weight: 500;
}
.breadcrumb-nav a:hover {
    color: var(--primary);
    text-decoration: none;
}
.breadcrumb-sep { color: var(--muted); }
.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

.onboarding {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    background: #FFFFFF;
    border: 1px solid var(--border);
}

.table-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-subtle);
    background: #FAFAF8;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: nowrap !important;
}
.table-pagination {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.page-btn {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text-secondary);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    flex-shrink: 0 !important;
    user-select: none;
}
.page-btn.active {
    background: #1C1D1A;
    color: #FFFFFF;
    border-color: #1C1D1A;
}
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Responsive */
@media (max-width: 980px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid, .two-col, .list-layout, .detail-layout { grid-template-columns: 1fr; }
    .filter-panel, .detail-sidebar { position: static; }

    .mobile-nav-toggle { display: inline-flex; }
    .topbar-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #FFFFFF;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        align-items: stretch;
        padding: 8px 16px;
        display: none;
    }
    .topbar-nav.open { display: flex; }
    .nav-item { min-height: 38px; padding: 7px 12px; }
    .search-label, .vault-pill-badge { display: none; }
}

@media (max-width: 680px) {
    .content { padding: 16px 12px 30px; }
    .cards, .form-grid { grid-template-columns: 1fr; }
    .user-name { display: none; }
    .login-card { padding: 22px 16px; }
    .page-header-actions,
    .header-right-actions,
    .panel-header-actions {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    .page-header-actions .header-search-wrap,
    .header-right-actions .header-search-wrap,
    .panel-header-actions .header-search-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }
    .page-header-actions .header-search-wrap input,
    .header-right-actions .header-search-wrap input,
    .panel-header-actions .header-search-wrap input {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* =============================================================================
   Enterprise Page Navigation Tabs
   ============================================================================= */
.page-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
    padding: 0 4px;
    overflow-x: auto;
}
.detail-main > .page-tabs-bar {
    margin-top: 0;
    margin-bottom: 0;
}
.page-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 550;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    user-select: none;
    margin-bottom: -1px;
    white-space: nowrap;
}
.page-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}
.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 650;
}
.page-tab-btn .tab-count-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.page-tab-btn.active .tab-count-badge {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-border);
}
.tab-content-panel {
    display: none !important;
}
.tab-content-panel.active {
    display: block !important;
}

/* =============================================================================
   Connected Permissions Two-Column Grid (Client -> Servers)
   ============================================================================= */
.permissions-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.permissions-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .permissions-grid {
        grid-template-columns: 1fr;
    }
}
.perm-col-panel {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.perm-col-header {
    padding: 13px 16px;
    background: #FAFAF8;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.perm-col-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.perm-search-box {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: #FFFFFF;
    position: relative;
}
.perm-search-box svg {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--muted);
    pointer-events: none;
}
.perm-search-box input {
    width: 100%;
    padding: 7px 11px 7px 32px;
    font-size: 12.5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.perm-search-box input:focus {
    background: #FFFFFF;
    border-color: var(--primary);
    outline: none;
}

/* Client Rows on Left Column */
.perm-client-list {
    max-height: 520px;
    overflow-y: auto;
    padding: 6px;
}
.perm-client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
    margin-bottom: 3px;
}
.perm-client-row:hover {
    background: var(--bg);
}
.perm-client-row.selected {
    background: rgba(242, 132, 47, 0.05);
    border-color: rgba(242, 132, 47, 0.22);
}
.perm-client-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.perm-client-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.perm-server-count-badge {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid var(--border);
    white-space: nowrap;
    margin-left: 8px;
}
.perm-client-row.selected .perm-server-count-badge {
    background: #FFFFFF;
    color: var(--primary);
    border-color: var(--primary-border);
}

/* Server Group on Right Column */
.perm-servers-wrapper {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 250px;
}
.perm-client-server-group {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.15s ease;
}
.perm-group-header {
    padding: 10px 14px;
    background: #FAFAF8;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.perm-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.perm-group-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}
.perm-server-list {
    padding: 4px 8px;
}
.perm-server-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.1s ease;
    gap: 10px;
}
.perm-server-row:hover {
    background: var(--bg);
}
.perm-server-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.perm-server-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.perm-server-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

/* Empty state on Right Column */
.perm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
}
.perm-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--muted);
}
.perm-empty-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.perm-empty-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.5;
}

/* Bottom Assignment Summary Bar */
.assignment-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 14px;
}
.assignment-count-summary {
    font-size: 13px;
    font-weight: 550;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.assignment-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =============================================================================
   Client Overview Summary Cards
   ============================================================================= */
.client-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (max-width: 860px) {
    .client-overview-grid {
        grid-template-columns: 1fr;
    }
}
.overview-summary-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.overview-summary-card .panel-header-rich {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.overview-summary-body {
    padding: 12px 16px;
    flex: 1;
}
.overview-summary-footer {
    padding: 10px 16px;
    background: #FAFAF8;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}
.overview-item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.overview-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.1s ease;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.overview-item-row:hover {
    background: var(--bg);
}

/* =============================================================================
   Responsive Layout for Sidebar Navigation
   ============================================================================= */
@media (max-width: 1200px) {
    .topbar-inner {
        margin: 0 auto;
        max-width: 100%;
        padding: 0 20px;
    }
    .content {
        margin: 0 auto;
        max-width: 100%;
        padding: 20px 20px 44px;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: 270px;
        max-width: 85vw;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--border);
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg), 0 10px 30px rgba(0, 0, 0, 0.15);
    }
    .sidebar-close-btn {
        display: inline-flex;
    }
    .mobile-sidebar-toggle {
        display: inline-flex;
    }
}

@media (max-width: 960px) {
    .topbar-inner {
        padding: 0 16px;
        grid-template-columns: auto 1fr;
    }
    .content {
        padding: 18px 16px 40px;
    }
    .topbar-center {
        min-width: 0;
        max-width: none;
        justify-content: flex-end;
    }
    .topbar-search-btn .search-label,
    .topbar-search-btn kbd {
        display: none;
    }
    .topbar-search-btn {
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
    }
    .topbar-right {
        display: none;
    }
}

body.sidebar-open {
    overflow: hidden;
}

/* =============================================================================
   Dropzone & File Attachment Components
   ============================================================================= */
.dropzone-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
}

.dropzone-area:hover,
.dropzone-area.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.dropzone-area.has-file {
    border-style: solid;
    border-color: var(--primary-border);
    background: #FFFDFC;
    padding: 14px 18px;
}

.dropzone-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.dropzone-area.has-file .dropzone-input {
    display: none;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.dropzone-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.dropzone-area:hover .dropzone-icon,
.dropzone-area.dragover .dropzone-icon {
    color: var(--primary);
    border-color: var(--primary-border);
    transform: translateY(-2px);
}

.dropzone-title {
    font-size: 13.5px;
    color: var(--text-primary);
}

.dropzone-title strong {
    color: var(--primary);
    font-weight: 600;
}

.dropzone-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropzone-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 540px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    z-index: 2;
    pointer-events: auto;
}

.dropzone-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.dropzone-preview-icon {
    flex-shrink: 0;
    color: var(--primary);
}

.dropzone-preview-details {
    display: flex;
    flex-direction: column;
    text-align: left;
    overflow: hidden;
}

.dropzone-preview-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.dropzone-preview-size {
    font-size: 11.5px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.dropzone-remove-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    min-height: 26px;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
}

.dropzone-remove-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Sidebar Specific Dropzone Tuning */
.detail-sidebar .dropzone-area {
    padding: 16px 12px;
    min-height: 94px;
}
.detail-sidebar .dropzone-icon {
    width: 36px;
    height: 36px;
}
.detail-sidebar .dropzone-icon svg {
    width: 18px;
    height: 18px;
}
.detail-sidebar .dropzone-title {
    font-size: 12.5px;
}
.detail-sidebar .dropzone-subtitle {
    font-size: 11px;
}
.detail-sidebar .dropzone-file-preview {
    padding: 6px 10px;
}
.detail-sidebar .dropzone-preview-name {
    max-width: 180px;
    font-size: 12px;
}

/* ==========================================================================
   Support Tickets & Contracts Design System
   ========================================================================== */

/* Spacing and Layout Harmonization: Identical 16px horizontal and vertical gaps */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

@media (max-width: 1024px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

.detail-main,
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-main .panel,
.detail-sidebar .panel {
    margin-bottom: 0 !important;
}

.stats-strip-six {
    margin-bottom: 16px;
}

/* Radio Pill Group Components */
.radio-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.radio-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.radio-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.radio-pill-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.radio-pill:hover .radio-pill-content {
    border-color: #CBD5E1;
    background: var(--panel);
    color: var(--text-primary);
}

.radio-pill-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94A3B8;
    display: inline-block;
    transition: all 0.15s ease;
}

/* Priority Pills: Low, Medium, High, Critical */
.radio-pill.critical input:checked ~ .radio-pill-content {
    background: #FEF2F2;
    border-color: #EF4444;
    color: #991B1B;
    font-weight: 650;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.radio-pill.critical input:checked ~ .radio-pill-content .radio-pill-indicator {
    background: #DC2626;
    box-shadow: 0 0 0 2px #FECACA;
}

.radio-pill.high input:checked ~ .radio-pill-content {
    background: #FFF7ED;
    border-color: #F97316;
    color: #9A3412;
    font-weight: 650;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}
.radio-pill.high input:checked ~ .radio-pill-content .radio-pill-indicator {
    background: #EA580C;
    box-shadow: 0 0 0 2px #FED7AA;
}

.radio-pill.medium input:checked ~ .radio-pill-content {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #1E40AF;
    font-weight: 650;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.radio-pill.medium input:checked ~ .radio-pill-content .radio-pill-indicator {
    background: #2563EB;
    box-shadow: 0 0 0 2px #BFDBFE;
}

.radio-pill.low input:checked ~ .radio-pill-content {
    background: #F1F5F9;
    border-color: #64748B;
    color: #334155;
    font-weight: 650;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.15);
}
.radio-pill.low input:checked ~ .radio-pill-content .radio-pill-indicator {
    background: #64748B;
}

/* Category Pills */
.radio-pill.category-pill input:checked ~ .radio-pill-content {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary);
    font-weight: 650;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.12);
}
.radio-pill.category-pill input:checked ~ .radio-pill-content .radio-pill-indicator {
    background: var(--primary);
}

/* Drag and Drop File Upload Component */
.file-dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: var(--bg);
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.file-dropzone:hover, .file-dropzone.drag-over {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.file-dropzone-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-dropzone-icon {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.file-dropzone:hover .file-dropzone-icon {
    color: var(--primary);
}

.file-dropzone-primary {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.file-dropzone-primary .browse-link {
    color: var(--primary);
    text-decoration: underline;
}

.file-dropzone-hint {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: block;
}

.file-dropzone-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.file-preview-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Chat & Conversation Messenger System */
.chat-stream {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0 16px 0;
}

.chat-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.chat-row.chat-row-other {
    justify-content: flex-start;
}

.chat-row.chat-row-self {
    justify-content: flex-end;
}

/* Date separator outside messages */
.chat-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 12px 0;
    position: relative;
    width: 100%;
}

.chat-date-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
    z-index: 1;
}

.chat-date-pill {
    position: relative;
    z-index: 2;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-bubble {
    max-width: 72%;
    min-width: 120px;
    padding: 9px 12px 6px 12px;
    position: relative;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

/* Other user's message (Left) */
.chat-row-other .chat-bubble {
    background: #F1F5F9;
    color: var(--text-primary);
    border: 1px solid #E2E8F0;
    border-radius: 14px 14px 14px 3px;
}

/* Active logged-in user's message (Right) */
.chat-row-self .chat-bubble {
    background: #EEF2FF;
    color: #1E1B4B;
    border: 1px solid #C7D2FE;
    border-radius: 14px 14px 3px 14px;
}

/* Internal Tech Notes */
.chat-bubble.bubble-internal {
    background: #FFFDF5 !important;
    border-color: #FCD34D !important;
    color: #78350F !important;
}

/* Message Action Buttons (Edit / Delete) - Top Right Corner of Bubble, Shown on Hover */
.chat-msg-actions-topright,
.chat-msg-actions-inline,
.chat-msg-actions {
    position: absolute;
    top: 5px;
    right: 7px;
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.12s ease;
    transform: translateY(-2px);
    z-index: 3;
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    line-height: 1 !important;
}

.chat-row-self .chat-msg-actions-topright {
    background: rgba(255, 255, 255, 0.96);
    border-color: #C7D2FE;
}

.bubble-internal .chat-msg-actions-topright {
    background: rgba(255, 253, 245, 0.96);
    border-color: #FCD34D;
}

.chat-bubble:hover .chat-msg-actions-topright,
.chat-bubble:focus-within .chat-msg-actions-topright,
.chat-bubble:hover .chat-msg-actions-inline,
.chat-bubble:focus-within .chat-msg-actions-inline,
.chat-bubble:hover .chat-msg-actions,
.chat-bubble:focus-within .chat-msg-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-msg-act-btn {
    background: transparent;
    border: none;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    vertical-align: middle;
    transition: background 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

.chat-msg-act-btn:hover {
    transform: scale(1.12);
}

/* Distinctly Colored Action Icons */
.chat-msg-act-edit {
    color: #2563EB;
}

.chat-msg-act-edit:hover {
    background: #DBEAFE;
    color: #1D4ED8;
}

.chat-msg-act-del {
    color: #DC2626;
}

.chat-msg-act-del:hover {
    background: #FEE2E2;
    color: #B91C1C;
}

.chat-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    font-size: 11px;
    min-height: 18px;
    white-space: nowrap;
    padding-right: 48px;
}

.chat-row-self .chat-bubble-header {
    justify-content: flex-start;
}

.chat-row-other .chat-bubble-header {
    justify-content: flex-start;
}

.chat-bubble-header-meta {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    margin-left: 0;
    margin-right: auto;
}

.chat-row-other .chat-bubble-header {
    color: var(--text-secondary);
}

.chat-row-self .chat-bubble-header {
    color: #4F46E5;
}

.chat-bubble.bubble-internal .chat-bubble-header {
    color: #B45309;
}

.chat-author-name {
    font-weight: 650;
}

.chat-bubble-text {
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Time in Bottom Right Corner */
.chat-bubble-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    margin-left: auto;
    font-size: 10px;
    line-height: 1;
}

.chat-row-other .chat-bubble-footer {
    color: #64748B;
}

.chat-row-self .chat-bubble-footer {
    color: #6366F1;
}

.bubble-internal .chat-bubble-footer {
    color: #B45309;
}

.chat-msg-time {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.chat-msg-edited {
    font-size: 9.5px;
    font-style: italic;
    opacity: 0.75;
}

/* Inline Edit Controls */
.chat-inline-edit {
    margin-top: 4px;
    width: 100%;
}

.chat-inline-edit-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.45;
    font-family: inherit;
    resize: vertical;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary);
    box-sizing: border-box;
    min-height: 52px;
}

.chat-inline-edit-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(242, 132, 47, 0.15);
}

.chat-inline-edit-btns {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

.btn-chat-mini {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-chat-cancel {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-chat-cancel:hover {
    background: var(--bg);
}

.btn-chat-save {
    background: var(--primary);
    color: #ffffff;
}

.btn-chat-save:hover {
    filter: brightness(0.95);
}

@media (max-width: 768px) {
    .chat-msg-actions-inline,
    .chat-msg-actions {
        opacity: 0.9;
        visibility: visible;
    }
}

.chat-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #FFFFFF;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.chat-avatar-mini.staff { background: var(--primary); }
.chat-avatar-mini.client { background: #2563EB; }
.chat-avatar-mini.internal-tech { background: #D97706; }

/* Initial Issue Origin Card (First one at top) */
.chat-origin-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.chat-origin-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.chat-origin-body {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.ticket-message-avatar.internal-tech {
    background: #D97706;
}

.ticket-message-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticket-message-author-name {
    font-size: 13.5px;
    font-weight: 650;
    color: var(--text-primary);
}

.ticket-message-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.ticket-internal-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
    font-size: 11px;
    font-weight: 650;
    padding: 3px 8px;
    border-radius: 4px;
}

.ticket-internal-pill svg {
    width: 12px;
    height: 12px;
}

.ticket-message-body {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.ticket-attachments-list {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ticket-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.ticket-attachment-chip:hover {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary);
}

/* Sidebar Attached Files Scrollable Container */
.sidebar-attachments-scroll {
    max-height: 195px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-attachments-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-attachments-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-attachments-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-attachments-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.sidebar-attachments-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
}

/* Unified Chat Composer Form Group */
.chat-composer-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    transition: all 0.15s ease;
}

.chat-composer-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
    background: var(--panel);
}

.chat-composer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.mini-switch-group {
    display: inline-flex;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px;
    gap: 2px;
}

.mini-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 550;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.mini-switch-btn:hover {
    color: var(--text-primary);
}

.mini-switch-btn.active.internal {
    background: #FEF3C7;
    color: #92400E;
    font-weight: 650;
}

.mini-switch-btn.active.public {
    background: #EFF6FF;
    color: #1D4ED8;
    font-weight: 650;
}

.chat-composer-textarea {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 2px 0 6px 0 !important;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-primary);
    resize: vertical;
    min-height: 48px;
    box-shadow: none !important;
}

.chat-composer-textarea::placeholder {
    color: var(--muted);
}

.chat-composer-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 8px 0;
}

.chat-composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.chat-composer-tools-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-attach {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-attach:hover {
    color: var(--text-primary);
    border-color: #94A3B8;
    background: var(--bg-hover);
}

.btn-send-mini {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Contract Banners */
.contract-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.contract-banner-active {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

.contract-banner-inactive {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.contract-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contract-banner-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contract-banner-active .contract-banner-icon {
    background: #DCFCE7;
    color: #15803D;
}

.contract-banner-inactive .contract-banner-icon {
    background: #FEE2E2;
    color: #DC2626;
}

.contract-banner-title {
    font-size: 13.5px;
    font-weight: 650;
    margin: 0;
}

.contract-banner-desc {
    font-size: 12px;
    margin: 2px 0 0 0;
    opacity: 0.9;
}

/* ==========================================================================
   Chat Bubble Attachments & Media Gallery
   ========================================================================== */
.chat-bubble-attachments {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bubble-internal .chat-bubble-attachments {
    border-top-color: rgba(180, 83, 9, 0.15);
}

.chat-bubble-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-img-thumb {
    position: relative;
    width: 105px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.chat-img-thumb:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.chat-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.chat-img-thumb:hover img {
    transform: scale(1.05);
}

.chat-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 60%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 3px 5px;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 550;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.chat-img-thumb:hover .chat-img-overlay {
    opacity: 1;
}

.chat-img-zoom-icon {
    display: inline-flex;
    align-items: center;
}

.chat-bubble-files {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-file-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
    max-width: 100%;
}

.chat-file-pill:hover {
    background: var(--bg-hover);
    border-color: var(--primary-border);
}

.chat-file-pill-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.chat-file-pill-name {
    font-weight: 550;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-file-pill-size {
    font-size: 10px;
    color: var(--muted);
    flex-shrink: 0;
}

.chat-file-pill-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.chat-file-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--primary);
    background: var(--panel);
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.chat-file-action-btn:hover {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

/* ==========================================================================
   Attachment Carousel & Lightbox Modal (Unboxed & Application Theme)
   ========================================================================== */
.attachment-carousel-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(28, 29, 26, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.attachment-carousel-modal.open {
    opacity: 1;
    pointer-events: auto;
}

/* Floating Top Bar (OpsVault Style) */
.carousel-top-bar {
    width: 100%;
    max-width: 980px;
    min-height: 48px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(29, 33, 24, 0.10);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    z-index: 20;
    transform: translateY(-8px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.attachment-carousel-modal.open .carousel-top-bar {
    transform: translateY(0);
}

.carousel-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.carousel-file-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.carousel-title-group {
    min-width: 0;
}

.carousel-filename {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.carousel-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 1px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.carousel-counter-badge {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 650;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.carousel-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.carousel-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.carousel-close-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.carousel-close-btn:hover {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border-color: var(--status-danger-border);
}

/* Center Unboxed Media Stage */
.carousel-stage {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px 70px;
    cursor: default;
}

.carousel-content-wrapper {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.carousel-image {
    max-width: 86vw;
    max-height: calc(84vh - 120px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.6);
    user-select: none;
    transition: transform 0.2s ease;
}

/* Unboxed Document / File Card in OpsVault style */
.carousel-file-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 40px;
    text-align: center;
    max-width: 440px;
    box-shadow: 0 16px 36px rgba(29, 33, 24, 0.14);
}

.carousel-file-card-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px auto;
    border-radius: 10px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-file-card-title {
    font-size: 14px;
    font-weight: 650;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    word-break: break-all;
}

.carousel-file-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

/* Floating Navigation Buttons (Application Style) */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(29, 33, 24, 0.10);
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 15;
}

.carousel-nav-btn:hover {
    background: #FFFFFF;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 18px rgba(242, 132, 47, 0.22);
}

.carousel-nav-btn.prev {
    left: 18px;
}

.carousel-nav-btn.next {
    right: 18px;
}

.carousel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
    box-shadow: none;
    border-color: var(--border);
    color: var(--muted);
}

/* Floating Bottom Dock / Strip (OpsVault Style) */
.carousel-bottom-dock {
    width: auto;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(29, 33, 24, 0.12);
    padding: 5px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 20;
    transform: translateY(8px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.attachment-carousel-modal.open .carousel-bottom-dock {
    transform: translateY(0);
}

.carousel-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 2px 4px;
}

.carousel-thumb-item {
    width: 52px;
    height: 38px;
    border-radius: 6px;
    border: 2px solid transparent;
    overflow: hidden;
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
    opacity: 0.65;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-thumb-item:hover {
    opacity: 0.95;
    border-color: var(--border);
}

.carousel-thumb-item.active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.carousel-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-thumb-doc-icon {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* ==========================================================================
   Redesigned Assignee & Time Tracking Card (Detail Sidebar)
   ========================================================================== */
.assignee-picker-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assignee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.assignee-current {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.assignee-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assignee-avatar.unassigned {
    background: var(--border);
    color: var(--muted);
}

.assignee-name-wrap {
    min-width: 0;
}

.assignee-name {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.assignee-sub {
    font-size: 10.5px;
    color: var(--muted);
    display: block;
}

.assignee-select-wrap {
    position: relative;
    flex-shrink: 0;
}

.assignee-select-compact {
    font-size: 11.5px;
    padding: 3px 22px 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 550;
}

.time-log-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.time-log-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-log-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.time-log-val {
    font-size: 13.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.time-log-sub {
    font-size: 10.5px;
    color: var(--muted);
}

.btn-time-log-toggle {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-time-log-toggle:hover {
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.inline-time-input-box {
    margin-top: 6px;
    padding: 8px;
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: 6px;
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ==========================================================================
   Composer Message Edit Mode & Active Highlight
   ========================================================================== */
.chat-composer-edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #EFF6FF;
    border-bottom: 1px solid #BFDBFE;
    padding: 6px 12px;
    font-size: 11.5px;
    color: #1E40AF;
    font-weight: 550;
    border-radius: 6px 6px 0 0;
}

.chat-composer-edit-banner .edit-banner-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-composer-edit-banner .btn-cancel-edit {
    background: transparent;
    border: 1px solid #93C5FD;
    color: #1E40AF;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.chat-composer-edit-banner .btn-cancel-edit:hover {
    background: #DBEAFE;
}

.chat-bubble.editing-active {
    box-shadow: 0 0 0 2px #3B82F6, 0 2px 8px rgba(59, 130, 246, 0.15) !important;
}

/* ==========================================================================
   Attachment Removal Controls & Actions
   ========================================================================== */
.chat-file-action-btn.chat-file-action-del {
    color: #DC2626;
    border-color: #FECACA;
}

.chat-file-action-btn.chat-file-action-del:hover {
    background: #DC2626;
    color: #FFFFFF;
    border-color: #DC2626;
}

.chat-img-del-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 19px;
    height: 19px;
    background: rgba(220, 38, 38, 0.88);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.1s ease;
    z-index: 5;
    padding: 0;
}

.chat-img-thumb:hover .chat-img-del-btn {
    opacity: 1;
}

.chat-img-del-btn:hover {
    transform: scale(1.15);
    background: #DC2626;
}

.carousel-action-btn.carousel-action-del {
    background: #DC2626 !important;
    border-color: #B91C1C !important;
    color: #FFFFFF !important;
}

.carousel-action-btn.carousel-action-del:hover {
    background: #B91C1C !important;
}

/* ==========================================================================
   Centered Confirmation Modal
   ========================================================================== */
.drawer-layer.confirm-modal-layer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-box {
    position: relative;
    width: min(440px, 92vw);
    background: var(--panel, #FFFFFF);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 10001;
    margin: auto;
    overflow: hidden;
    animation: modalScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid var(--border-subtle, #EDEDE6);
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    color: var(--text-primary);
}

.confirm-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.confirm-modal-icon.danger {
    background: #FEE2E2;
    color: #DC2626;
}

.confirm-modal-body {
    padding: 16px 20px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.confirm-modal-body p {
    margin: 0;
}

.confirm-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px 16px 20px;
    background: #F9FAFB;
    border-top: 1px solid var(--border-subtle, #EDEDE6);
}


