/**
 * CaseMS — Main Application Stylesheet
 * Phase 0: Minimal styles for skeleton verification.
 * Bootstrap and full styling will be added in Phase 4.
 */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Icons (inline SVG)
   ============================================================ */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================================
   Top Navigation
   ============================================================ */
.topnav {
    background: #1a2332;
    color: #fff;
    height: 56px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topnav-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    max-width: 100%;
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    white-space: nowrap;
    margin-right: 24px;
    flex-shrink: 0;
}

.topnav-brand:hover { opacity: 0.9; }

.topnav-logo {
    height: 32px;
    width: auto;
}

/* Hamburger (hidden on desktop) */
.topnav-hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

/* Collapsible section */
.topnav-collapse {
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
}

/* Main nav links */
.topnav-links {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2px;
}

.topnav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 100%;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, background-color 0.15s;
}

.topnav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.topnav-link.active,
.topnav-dropdown.active > .topnav-dropdown-toggle {
    color: #fff;
    box-shadow: inset 0 -2px 0 #2563eb;
}

/* Dropdown container */
.topnav-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.topnav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-chevron {
    margin-left: 2px;
    transition: transform 0.2s;
}

.topnav-dropdown.open .icon-chevron {
    transform: rotate(180deg);
}

/* Dropdown menu */
.topnav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 6px 0;
    z-index: 1010;
}

.topnav-dropdown.open > .topnav-dropdown-menu {
    display: block;
}

.topnav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.1s;
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.topnav-dropdown-item:hover {
    background: #f3f4f6;
    color: #1a2332;
}

.topnav-dropdown-item.active {
    color: #2563eb;
    font-weight: 600;
}

.topnav-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Right section */
.topnav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    height: 100%;
}

/* Notification bell */
.topnav-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.15s;
}

.topnav-icon-btn:hover { color: #fff; }

.topnav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.topnav-badge:empty,
.topnav-badge[data-count="0"] {
    display: none;
}

/* User dropdown */
.topnav-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    font-family: inherit;
    transition: background-color 0.15s;
}

.topnav-user-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.topnav-avatar {
    width: 32px;
    height: 32px;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.topnav-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.topnav-username {
    font-size: 13px;
    font-weight: 600;
}

.topnav-role {
    font-size: 11px;
    opacity: 0.6;
}

.topnav-user-menu {
    right: 0;
    left: auto;
}

.topnav-logout-form {
    display: contents;
}

.topnav-logout-btn {
    color: #dc2626;
}

.topnav-logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ============================================================
   Page Body (sidebar + content)
   ============================================================ */
.page-body {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 56px - 40px);
}

/* ============================================================
   Sidebar (case context only)
   ============================================================ */
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 700;
    color: #1a2332;
}

.sidebar-nav {
    padding: 8px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.1s, color 0.1s;
}

.sidebar-link:hover {
    background: #f3f4f6;
    color: #1a2332;
}

.sidebar-link.active {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 600;
    border-right: 3px solid #2563eb;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
}

/* ============================================================
   Footer
   ============================================================ */
.main-footer {
    background: #1a2332;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 12px 20px;
    font-size: 12px;
}

/* ============================================================
   Mobile Responsive
   ============================================================ */
@media (max-width: 768px) {
    .topnav-hamburger {
        display: block;
    }

    .topnav-collapse {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #1a2332;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 8px 0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        z-index: 1001;
    }

    .topnav-collapse.show {
        display: flex;
    }

    .topnav-links {
        flex-direction: column;
        height: auto;
    }

    .topnav-link {
        height: auto;
        padding: 12px 16px;
    }

    .topnav-dropdown {
        height: auto;
        flex-direction: column;
    }

    .topnav-dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 0;
        padding: 0;
    }

    .topnav-dropdown.open > .topnav-dropdown-menu {
        display: block;
    }

    .topnav-dropdown-item {
        color: rgba(255, 255, 255, 0.75);
        padding: 10px 16px 10px 32px;
    }

    .topnav-dropdown-item:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .topnav-dropdown-item.active {
        color: #60a5fa;
    }

    .topnav-right {
        padding: 8px 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-left: 0;
        height: auto;
    }

    .topnav-user-menu {
        position: static;
        background: rgba(255, 255, 255, 0.05);
        box-shadow: none;
        border-radius: 0;
    }

    .topnav-user-menu .topnav-dropdown-item {
        color: rgba(255, 255, 255, 0.75);
        padding-left: 16px;
    }

    .topnav-user-menu .topnav-dropdown-divider {
        background: rgba(255, 255, 255, 0.1);
    }

    .topnav-user-menu .topnav-logout-btn {
        color: #fca5a5;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        padding: 16px;
    }
}

/* Dashboard */
.dashboard h1 {
    margin-bottom: 8px;
    color: #1a2332;
}

.dashboard > p {
    color: #666;
    margin-bottom: 24px;
}

.dashboard-info {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-info h2 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #1a2332;
}

.dashboard-info ul {
    list-style: none;
    padding: 0;
}

.dashboard-info li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.dashboard-info li:last-child {
    border-bottom: none;
}

/* Error Pages */
.error-page {
    max-width: 600px;
    margin: 80px auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.error-page h1 {
    color: #c0392b;
    margin-bottom: 12px;
}

.error-page p {
    color: #666;
    margin-bottom: 20px;
}

.error-page a {
    color: #2980b9;
    text-decoration: none;
}

.error-page a:hover {
    text-decoration: underline;
}

/* ============================================================
   Auth Pages — Login, TOTP Setup, TOTP Verify
   ============================================================ */

/* Auth body replaces the default flex-column layout */
.auth-body {
    background: linear-gradient(135deg, #1a2332 0%, #2c3e50 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Centered container */
.auth-container {
    width: 100%;
    max-width: 420px;
}

/* Logo block above card */
.auth-logo-block {
    text-align: center;
    margin-bottom: 24px;
    color: #fff;
}

.auth-logo-img {
    max-height: 80px;
    width: auto;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.auth-logo-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
}

.auth-logo-subtitle {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 4px;
    letter-spacing: 1px;
}

/* Card */
.auth-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    padding: 32px;
}

/* Title & description inside card */
.auth-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 4px;
}

.auth-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Alert messages */
.auth-alert {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Form elements */
.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-form input::placeholder {
    color: #9ca3af;
}

/* TOTP code input — large centered digits */
.totp-input {
    text-align: center;
    font-size: 28px !important;
    font-weight: 600;
    letter-spacing: 8px;
    padding: 14px 12px !important;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary:active {
    background: #1e40af;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Alternative action links below the card */
.auth-alt-action {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

.auth-alt-action a {
    color: #2563eb;
    text-decoration: none;
}

.auth-alt-action a:hover {
    text-decoration: underline;
}

/* Footer below auth card */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* ---- TOTP Setup Page ---- */

/* QR code container */
.totp-qr-container {
    text-align: center;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 12px;
}

.totp-qr-container svg {
    max-width: 220px;
    height: auto;
}

/* Manual entry toggle */
.totp-manual-toggle {
    margin-bottom: 8px;
    font-size: 13px;
}

.totp-manual-toggle summary {
    color: #2563eb;
    cursor: pointer;
    padding: 6px 0;
}

.totp-manual-toggle summary:hover {
    text-decoration: underline;
}

.totp-manual-entry {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
    font-size: 13px;
}

.totp-manual-entry p {
    margin-bottom: 6px;
    color: #374151;
}

.totp-secret {
    display: block;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    letter-spacing: 2px;
    word-break: break-all;
    background: #f3f4f6;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    margin-top: 4px;
}

/* Recovery codes grid */
.recovery-codes-section {
    margin-bottom: 24px;
}

.recovery-codes-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.recovery-codes-section p {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

.recovery-codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 12px;
}

.recovery-code {
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    padding: 4px;
    letter-spacing: 1px;
}

.recovery-codes-warning {
    font-size: 11px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 10px;
    line-height: 1.5;
}

/* Inline separator */
.auth-separator {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #9ca3af;
    font-size: 12px;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-separator::before {
    margin-right: 12px;
}

.auth-separator::after {
    margin-left: 12px;
}

/* Setup steps list */
.setup-steps {
    margin-bottom: 20px;
    padding-left: 0;
    counter-reset: step;
    list-style: none;
}

.setup-steps li {
    position: relative;
    padding: 6px 0 6px 32px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    counter-increment: step;
}

.setup-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 6px;
    width: 22px;
    height: 22px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Admin Pages — Shared Components
   ============================================================ */

/* Page toolbar (title + actions row) */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-toolbar h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a2332;
    margin: 0;
}

.page-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb-separator { color: #9ca3af; }

/* ---- Alerts (flash messages — toast style) ---- */
.alert-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 420px;
    width: calc(100% - 40px);
}

.alert {
    padding: 14px 44px 14px 48px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: alertSlideIn 0.35s ease-out;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert::before {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.alert-dismiss {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
    padding: 4px;
    color: inherit;
}

.alert-dismiss:hover {
    opacity: 1;
}

.alert.alert-hiding {
    opacity: 0;
    transform: translateX(30px);
}

/* Progress bar for auto-dismiss */
.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 8px 8px;
    animation: alertProgress 5s linear forwards;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #22c55e;
    border-left: 4px solid #22c55e;
}

.alert-success::before { content: "\2713"; color: #22c55e; }
.alert-success .alert-progress { background: #22c55e; }

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #ef4444;
    border-left: 4px solid #ef4444;
}

.alert-error::before { content: "\2716"; color: #ef4444; }
.alert-error .alert-progress { background: #ef4444; }

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #f59e0b;
    border-left: 4px solid #f59e0b;
}

.alert-warning::before { content: "\26A0"; color: #f59e0b; }
.alert-warning .alert-progress { background: #f59e0b; }

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

.alert-info::before { content: "\2139"; color: #3b82f6; }
.alert-info .alert-progress { background: #3b82f6; }

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes alertProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ---- Modals ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    overflow-y: auto;
}

.modal-backdrop.modal-open {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    transform: translateY(-20px) scale(0.97);
    transition: transform 0.25s ease;
}

.modal-backdrop.modal-open .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-dialog-lg { max-width: 780px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 15px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #6b7280;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover { color: #111827; }

.modal-body {
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Success modal (flash) */
.modal-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.modal-success-icon.icon-success { background: #dcfce7; color: #16a34a; }
.modal-success-icon.icon-error   { background: #fee2e2; color: #dc2626; }
.modal-success-icon.icon-warning { background: #fef3c7; color: #d97706; }
.modal-success-icon.icon-info    { background: #dbeafe; color: #2563eb; }

.modal-flash-message {
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 20px;
}

.modal-flash-actions {
    text-align: center;
    padding-bottom: 4px;
}

/* ---- Cards ---- */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
    font-weight: 600;
    color: #1a2332;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

.card-body:empty { display: none; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-muted   { background: #f3f4f6; color: #6b7280; }

/* ---- Progress Bars ---- */
.progress-bar-container {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ---- Data Tables ---- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table td.actions {
    white-space: nowrap;
}

.data-table .text-muted {
    color: #9ca3af;
}

.data-table .text-mono {
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* ---- Additional Button Styles ---- */
.btn-secondary {
    background: #6b7280;
    color: #fff;
}

.btn-secondary:hover { background: #4b5563; }

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover { background: #b91c1c; }

.btn-outline {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn + .btn { margin-left: 6px; }

/* ---- Forms ---- */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.form-grid-2col .form-group-full {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-input.is-invalid,
.form-select.is-invalid {
    border-color: #dc2626;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.workflow-preview {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-size: 12px;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.workflow-preview-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    color: #64748b;
}

.workflow-preview-header svg {
    color: #3b82f6;
}

.workflow-preview-label {
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workflow-preview-step {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 6px;
}

.workflow-preview-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workflow-preview-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 11px;
    color: #475569;
}

.workflow-preview-tag svg {
    color: #94a3b8;
}

.form-error {
    display: block;
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.filter-bar .form-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.filter-bar .form-input,
.filter-bar .form-select {
    padding: 6px 10px;
    font-size: 13px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    background: #fff;
    transition: background-color 0.1s;
}

.pagination-link:hover:not(.disabled):not(.active) {
    background: #f3f4f6;
}

.pagination-link.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: 600;
}

.pagination-link.disabled {
    color: #9ca3af;
    cursor: default;
}

.pagination-ellipsis {
    padding: 0 6px;
    color: #9ca3af;
}

.pagination-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

/* ---- Permission Matrix ---- */
.perm-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.perm-matrix th,
.perm-matrix td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.perm-matrix th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.perm-matrix .module-header {
    background: #eef2ff;
    font-weight: 700;
    color: #3730a3;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perm-matrix .module-header td {
    padding: 10px 12px;
    border-bottom: 2px solid #c7d2fe;
}

.perm-matrix .perm-checkbox {
    width: 40px;
    text-align: center;
}

.perm-matrix .perm-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2563eb;
}

.perm-matrix .perm-name {
    font-weight: 500;
}

.perm-matrix .perm-desc {
    color: #6b7280;
    font-size: 12px;
}

.perm-matrix .perm-sensitive {
    color: #dc2626;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

/* ---- Stats Grid (Dashboard) ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.2;
}

.stat-card-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.stat-card-icon {
    float: right;
    color: #9ca3af;
    opacity: 0.5;
}

/* ---- Config Groups ---- */
.config-group {
    margin-bottom: 8px;
}

.config-group-header {
    padding: 12px 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.config-group-header:hover {
    background: #f3f4f6;
}

.config-group-body {
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 250px 80px;
    gap: 16px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.config-row:last-child { border-bottom: none; }

.config-row-label {
    font-size: 13px;
    color: #374151;
}

.config-row-key {
    font-size: 11px;
    color: #9ca3af;
    font-family: "SF Mono", "Consolas", monospace;
}

/* ---- Utility ---- */
.text-muted { color: #6b7280; }
.text-danger { color: #dc2626; }
.text-success { color: #166534; }
.text-small { font-size: 12px; }
.text-mono { font-family: "SF Mono", "Consolas", "Monaco", monospace; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* ============================================================
   Case Management
   ============================================================ */

/* Case overview two-column grid */
.case-overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

/* Case info table (key-value pairs) */
.case-info-table {
    width: 100%;
    border-collapse: collapse;
}

.case-info-table th {
    text-align: left;
    padding: 6px 12px 6px 0;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    width: 130px;
    border-bottom: 1px solid #f3f4f6;
}

.case-info-table td {
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
}

/* Sub-file grid (3 columns for A-J) */
.subfile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.subfile-card {
    display: block;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.subfile-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.subfile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.subfile-card-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 14px;
}

.subfile-card-name {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
    margin-bottom: 4px;
}

.subfile-card-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.subfile-card-phase {
    font-size: 10px;
    color: #9ca3af;
    font-style: italic;
}

.subfile-card-phase::before {
    content: "Phases: ";
    font-weight: 600;
}

/* Sub-file detail page */
.subfile-code-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 16px;
    margin-right: 8px;
    vertical-align: middle;
}

.subfile-info-banner {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.subfile-info-desc {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 4px;
}

.subfile-info-phase {
    font-size: 11px;
    color: #6366f1;
    font-weight: 600;
}

.subfile-nav-strip {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.subfile-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.subfile-nav-item:hover {
    background: #e0e7ff;
    color: #3730a3;
}

.subfile-nav-item.active {
    background: #3730a3;
    color: #fff;
    border-color: #3730a3;
}

/* Sub-file strip on case overview */
.subfile-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.subfile-strip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}

.subfile-strip-item:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.subfile-strip-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.subfile-strip-name {
    font-size: 11px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 960px) {
    .subfile-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .subfile-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    font-size: 12px;
    color: #6b7280;
}

/* Quick links */
.quick-links {
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Workflow Execution
   ============================================================ */

/* Workflow step cards (active steps panel) */
.workflow-step-card {
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
}

.workflow-step-card:last-child {
    margin-bottom: 0;
}

.workflow-step-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.workflow-step-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* Workflow step requirements */
.workflow-step-requirements {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.req-header {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.req-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.req-status-ok {
    color: #16a34a;
}

.req-status-blocked {
    color: #dc2626;
}

.req-missing-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.req-missing-list li {
    font-size: 12px;
    color: #6b7280;
    padding: 2px 0;
}

.req-missing-list li::before {
    content: "\2717 ";
    color: #dc2626;
    font-weight: 700;
}

.req-missing-list li a {
    color: #2563eb;
    text-decoration: none;
}

.req-missing-list li a:hover {
    text-decoration: underline;
}

/* Gateway decision radio cards */
.radio-card {
    display: block;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.radio-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.radio-card input[type="radio"] {
    margin-right: 10px;
    accent-color: #2563eb;
}

.radio-card input[type="radio"]:checked ~ span,
.radio-card:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}

/* Button variants for workflow actions */
.btn-success {
    background: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
}

.btn-warning {
    background: #d97706;
    color: #fff;
}

.btn-warning:hover {
    background: #b45309;
}

/* ---- Mobile Admin Responsive ---- */
@media (max-width: 768px) {
    .form-grid-2col {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group {
        min-width: auto;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .config-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .case-overview-grid {
        grid-template-columns: 1fr;
    }

    .subfile-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.modal-close:hover { color: #111827; }
.modal-body {
    padding: 20px;
}
.modal-body .form-group {
    margin-bottom: 14px;
}
.modal-body .form-group:last-child {
    margin-bottom: 0;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
}

/* Danger outline button */
.btn-danger-outline {
    color: #dc2626;
    border-color: #fca5a5;
}
.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* Form hint text */
.form-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* File drop zone */
.file-drop-zone {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.file-drop-zone:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.file-drop-zone.dragover {
    border-color: #2563eb;
    background: #dbeafe;
}
.file-drop-zone.has-file {
    border-style: solid;
    border-color: #93c5fd;
    background: #f0f7ff;
    padding: 14px 16px;
}
.file-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-drop-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    pointer-events: none;
}
.file-drop-placeholder svg {
    color: #9ca3af;
}
.file-drop-placeholder span {
    font-size: 13px;
    font-weight: 500;
}
.file-drop-placeholder small {
    font-size: 11px;
    color: #9ca3af;
}
.file-drop-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    text-align: left;
}
.file-drop-selected svg {
    flex-shrink: 0;
    color: #2563eb;
}
.file-drop-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-drop-size {
    font-size: 12px;
    color: #6b7280;
    flex-shrink: 0;
}
.file-drop-remove {
    pointer-events: auto;
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    z-index: 1;
}
.file-drop-remove:hover {
    color: #dc2626;
}

/* ============================================================
   Document Templating — Wizard, Template Cards, Preview, Verify
   ============================================================ */

/* Template selection grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.template-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.template-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
.template-card-icon {
    color: #2563eb;
    flex-shrink: 0;
}
.template-card-body { flex: 1; }
.template-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px;
}
.template-card-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin: 0 0 10px;
}
.template-card-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.template-card-action { margin-top: auto; }

/* Wizard progress bar */
.wizard-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 16px 0;
    overflow-x: auto;
}
.wizard-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 80px;
}
.wizard-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.wizard-step-indicator.active .wizard-step-number {
    background: #2563eb;
    color: #fff;
}
.wizard-step-indicator.completed .wizard-step-number {
    background: #059669;
    color: #fff;
}
.wizard-step-label {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
}
.wizard-step-indicator.active .wizard-step-label { color: #2563eb; font-weight: 600; }
.wizard-step-indicator.completed .wizard-step-label { color: #059669; }
.wizard-step-connector {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    min-width: 20px;
    margin: 0 4px;
    margin-bottom: 18px;
}

/* Wizard step content */
.wizard-container { max-width: 800px; }
.wizard-step-content { display: none; }
.wizard-step-content.active { display: block; }

/* Wizard navigation */
.wizard-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Info text in wizard (for cautions, declarations) */
.doc-info-text-preview {
    background: #f0f9ff;
    border-left: 3px solid #2563eb;
    padding: 12px 16px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
    border-radius: 0 4px 4px 0;
    margin-bottom: 12px;
}

/* Repeating table in wizard */
.repeating-table-wrap { margin-top: 4px; }
.repeating-table input.form-input,
.repeating-table textarea.form-textarea {
    font-size: 13px;
    padding: 6px 8px;
}
.repeating-remove {
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
}

/* Preview page */
.preview-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.preview-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #92400e;
    font-size: 13px;
}
.preview-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.preview-frame-container {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}
.preview-frame {
    width: 100%;
    min-height: 1200px;
    border: none;
    background: #fff;
}

/* Print view */
.print-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.print-toolbar-info h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}
.print-toolbar-meta { display: flex; gap: 8px; align-items: center; }
.print-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.print-document-container {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}
.print-frame {
    width: 100%;
    min-height: 1200px;
    border: none;
    background: #fff;
}

/* Verify page (minimal layout) */
.minimal-body {
    background: #f3f4f6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.minimal-container {
    max-width: 560px;
    width: 100%;
}
.verify-container {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}
.verify-logo { margin-bottom: 16px; }
.verify-title { font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 4px; }
.verify-subtitle { font-size: 13px; color: #6b7280; margin: 0 0 24px; }

.verify-result {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.verify-valid { background: #ecfdf5; border: 1px solid #a7f3d0; }
.verify-invalid { background: #fef2f2; border: 1px solid #fecaca; }
.verify-icon { font-size: 36px; margin-bottom: 8px; }
.verify-valid .verify-icon { color: #059669; }
.verify-invalid .verify-icon { color: #dc2626; }
.verify-result h2 { font-size: 18px; margin: 0 0 6px; }
.verify-valid h2 { color: #065f46; }
.verify-invalid h2 { color: #991b1b; }
.verify-result p { font-size: 13px; margin: 0; }
.verify-valid p { color: #047857; }
.verify-invalid p { color: #b91c1c; }
.verify-note { margin-top: 8px !important; font-style: italic; }

.verify-details { text-align: left; margin-bottom: 24px; }
.verify-table { width: 100%; border-collapse: collapse; }
.verify-table th,
.verify-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}
.verify-table th { font-weight: 600; color: #374151; width: 40%; }
.verify-table td { color: #111827; }

.verify-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.verify-status-signed { background: #d1fae5; color: #065f46; }
.verify-status-draft { background: #fef3c7; color: #92400e; }
.verify-status-pending { background: #e0e7ff; color: #3730a3; }

.verify-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    font-size: 12px;
    color: #9ca3af;
}
.verify-disclaimer { margin-top: 8px; font-style: italic; }

/* Detail table (used in upload-signed) */
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th,
.detail-table td { padding: 8px 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.detail-table th { font-weight: 600; color: #374151; width: 35%; text-align: left; }
.detail-table td { color: #111827; }

/* Form checkbox label */
.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}
.form-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

/* Intel accordion records */
.intel-record-header:hover {
    background: #f3f4f6;
}
.intel-record:last-child {
    border-bottom: none;
}

/* ============================================================
   Tasks — Summary Bar, Filter Tabs, SLA Indicators
   ============================================================ */
.task-summary-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.task-summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}
.task-summary-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.task-summary-count {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}
.task-summary-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.task-summary-overdue .task-summary-count { color: #dc2626; }
.task-summary-due-soon .task-summary-count { color: #f59e0b; }
.task-summary-on-track .task-summary-count { color: #10b981; }
.task-summary-unclaimed .task-summary-count { color: #6b7280; }

.filter-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 16px;
}

/* ============================================================
   Searchable Checkbox Multi-Select Widget
   ============================================================ */
.ms-widget {
    position: relative;
}

.ms-trigger {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-trigger:focus,
.ms-trigger[aria-expanded="true"] {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ms-trigger .ms-trigger-placeholder {
    color: #9ca3af;
}

.ms-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.ms-dropdown.is-open {
    display: block;
}

.ms-dropdown-header {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ms-search {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
}

.ms-search:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.ms-dropdown-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ms-action-btn {
    padding: 4px 9px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s;
}

.ms-action-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ms-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.ms-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 12px;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}

.ms-item:hover {
    background: #f0f4ff;
}

.ms-item.is-selected {
    background: #eff6ff;
}

.ms-item input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
}

.ms-item-label {
    font-size: 13px;
    color: #1f2937;
    line-height: 1.4;
}

.ms-empty {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

.ms-footer {
    padding: 6px 12px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 12px;
    color: #6b7280;
}

.ms-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    min-height: 0;
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.ms-tag-remove {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

.ms-tag-remove:hover {
    color: #1e40af;
}
.filter-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.filter-tab:hover { color: #1f2937; }
.filter-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* SLA indicator — left-border cell in table */
.sla-indicator-overdue { background: #dc2626 !important; }
.sla-indicator-due-soon { background: #f59e0b !important; }
.sla-indicator-on-track { background: #10b981 !important; }
.sla-indicator-none { background: #e5e7eb !important; }

/* Empty tasks state */
.empty-tasks {
    text-align: center;
    padding: 48px 16px;
    color: #6b7280;
}
.empty-tasks .empty-icon { margin-bottom: 12px; opacity: 0.4; }
.empty-tasks h3 { color: #374151; margin-bottom: 4px; }
.empty-tasks p { font-size: 13px; }

/* ============================================================
   CSS Tooltips (data-tooltip attribute)
   ============================================================ */
[data-tooltip] {
    position: relative;
    cursor: default;
}
[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 100;
}
/* Tooltip bubble */
[data-tooltip]::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1f2937;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 220px;
}
/* Arrow */
[data-tooltip]::before {
    content: '';
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 4px solid transparent;
    border-top-color: #1f2937;
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* Bottom variant */
[data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: calc(100% + 6px);
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: calc(100% + 2px);
    border-top-color: transparent;
    border-bottom-color: #1f2937;
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip-pos="bottom"]:hover::before,
[data-tooltip-pos="bottom"]:hover::after {
    transform: translateX(-50%) translateY(0);
}
/* Left-aligned variant (for items near right edge) */
[data-tooltip-align="left"]::after { left: 0; transform: translateX(0) translateY(4px); }
[data-tooltip-align="left"]::before { left: 12px; transform: translateX(0) translateY(4px); }
[data-tooltip-align="left"]:hover::after,
[data-tooltip-align="left"]:hover::before { transform: translateX(0) translateY(0); }

/* ============================================================
   Dashboard — Asymmetric Grid Layout & Widgets
   ============================================================ */

/* Header */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.dash-header h1 { margin: 0; font-size: 24px; color: #1f2937; }
.dash-subtitle { color: #6b7280; font-size: 13px; margin-top: 2px; }
.dash-header-stats { display: flex; gap: 20px; }
.dash-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.dash-kpi-value { font-size: 22px; font-weight: 700; color: #1f2937; line-height: 1.2; }
.dash-kpi-danger { color: #dc2626; }
.dash-kpi-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }

/* Asymmetric Grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}
.dash-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    min-width: 0;
}
.dash-card-full    { grid-column: span 12; }
.dash-card-wide    { grid-column: span 8; }
.dash-card-narrow  { grid-column: span 4; }
.dash-card-medium  { grid-column: span 6; }
.dash-card-small   { grid-column: span 3; }

@media (max-width: 1200px) {
    .dash-card-wide   { grid-column: span 7; }
    .dash-card-narrow { grid-column: span 5; }
    .dash-card-small  { grid-column: span 6; }
}
@media (max-width: 900px) {
    .dash-card-wide, .dash-card-narrow, .dash-card-medium, .dash-card-small {
        grid-column: span 12;
    }
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.dash-card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-empty {
    text-align: center;
    padding: 24px 12px;
    color: #9ca3af;
    font-size: 13px;
}

/* ── Donut Chart ── */
.dash-chart-row { display: flex; gap: 20px; align-items: center; }
.dash-donut-wrap { flex: 0 0 200px; }
.dash-donut { width: 100%; height: auto; }
.dash-donut-center-num { font-size: 28px; font-weight: 700; fill: #1f2937; }
.dash-donut-center-label { font-size: 12px; fill: #6b7280; }

.dash-legend { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.dash-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dash-legend-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    display: inline-block;
}
.dash-legend-label { flex: 1; color: #374151; }
.dash-legend-value { font-weight: 600; color: #1f2937; min-width: 20px; text-align: right; }

/* ── SLA Gauge ── */
.dash-gauge-wrap { text-align: center; margin-bottom: 12px; }
.dash-gauge-svg { width: 140px; height: auto; }
.dash-gauge-num { font-size: 22px; font-weight: 700; fill: #1f2937; }
.dash-gauge-label { font-size: 9px; fill: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }

.dash-sla-pills { display: flex; flex-direction: column; gap: 6px; }
.dash-sla-pill {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-radius: 8px; font-size: 12px;
}
.dash-sla-pill-num { font-weight: 700; font-size: 18px; margin-right: 8px; }
.dash-sla-danger { background: #fef2f2; color: #dc2626; }
.dash-sla-warn   { background: #fffbeb; color: #d97706; }
.dash-sla-ok     { background: #ecfdf5; color: #059669; }

/* ── Bar Chart (Monthly Trends) ── */
.dash-bar-chart-body {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding: 0 4px;
}
.dash-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; }
.dash-bar-col { display: flex; gap: 3px; align-items: flex-end; height: 140px; width: 100%; }
.dash-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 2px;
    transition: height 0.3s;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.dash-bar-opened { background: #3b82f6; }
.dash-bar-closed { background: #10b981; }
.dash-bar-val {
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    padding-top: 2px;
}
.dash-bar-label { font-size: 10px; color: #6b7280; margin-top: 4px; }
.dash-bar-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}
.dash-bar-legend span { display: flex; align-items: center; gap: 4px; }

/* ── Horizontal Bars (Team Workload) ── */
.dash-hbar-list { display: flex; flex-direction: column; gap: 8px; }
.dash-hbar-row { display: flex; align-items: center; gap: 8px; }
.dash-hbar-label { width: 120px; font-size: 12px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-hbar-track { flex: 1; height: 16px; background: #f3f4f6; border-radius: 8px; display: flex; overflow: hidden; }
.dash-hbar-fill { height: 100%; transition: width 0.3s; }
.dash-hbar-active { background: #3b82f6; }
.dash-hbar-closed { background: #10b981; }
.dash-hbar-value { font-size: 12px; font-weight: 600; color: #1f2937; min-width: 24px; text-align: right; }

/* ── Mini Donut (Typology) ── */
.dash-mini-donut-wrap { text-align: center; margin-bottom: 8px; }
.dash-mini-donut { width: 100px; height: 100px; }
.dash-mini-legend { display: flex; flex-direction: column; gap: 4px; }

/* ── Risk Bars ── */
.dash-risk-bars { display: flex; flex-direction: column; gap: 10px; }
.dash-risk-row { display: flex; align-items: center; gap: 8px; }
.dash-risk-label { width: 60px; font-size: 12px; color: #374151; }
.dash-risk-track { flex: 1; height: 12px; background: #f3f4f6; border-radius: 6px; overflow: hidden; }
.dash-risk-fill { height: 100%; border-radius: 6px; transition: width 0.3s; }
.dash-risk-value { font-size: 12px; font-weight: 600; color: #1f2937; min-width: 20px; text-align: right; }

/* ── Financial Summary ── */
.dash-finance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.dash-finance-item {
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid;
}
.dash-finance-proceeds { background: #f0f9ff; border-color: #3b82f6; }
.dash-finance-frozen   { background: #ecfdf5; border-color: #10b981; }
.dash-finance-seized   { background: #fffbeb; border-color: #f59e0b; }
.dash-finance-returned { background: #fef2f2; border-color: #dc2626; }
.dash-finance-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.3px; }
.dash-finance-value { font-size: 18px; font-weight: 700; color: #1f2937; margin-top: 2px; }
.dash-finance-pct { font-size: 11px; color: #059669; margin-top: 2px; }

.dash-recovery { margin-top: 4px; }
.dash-recovery-header { display: flex; justify-content: space-between; font-size: 12px; color: #374151; margin-bottom: 4px; }
.dash-recovery-track { height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.dash-recovery-fill { height: 100%; background: linear-gradient(90deg, #10b981, #3b82f6); border-radius: 4px; transition: width 0.5s; }

/* ── Priority ── */
.dash-pri-list { display: flex; flex-direction: column; gap: 14px; }
.dash-pri-item {}
.dash-pri-header { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; margin-bottom: 4px; }
.dash-pri-header strong { margin-left: auto; font-size: 18px; }
.dash-pri-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-pri-bar { height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; }
.dash-pri-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ── Activity Feed ── */
.dash-activity-feed { display: flex; flex-direction: column; gap: 0; }
.dash-activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-icon { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: #f9fafb; display: flex; align-items: center; justify-content: center; }
.dash-activity-content { flex: 1; min-width: 0; }
.dash-activity-text { font-size: 12px; color: #374151; line-height: 1.4; }
.dash-activity-meta { font-size: 11px; color: #9ca3af; display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.dash-activity-meta a { color: #3b82f6; text-decoration: none; }

/* ── Admin Row ── */
.dash-admin-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.dash-admin-stat {
    text-align: center;
    padding: 8px 16px;
    background: #f9fafb;
    border-radius: 8px;
}
.dash-admin-stat.dash-admin-warn { background: #fef2f2; }
.dash-admin-num { display: block; font-size: 20px; font-weight: 700; color: #1f2937; }
.dash-admin-warn .dash-admin-num { color: #dc2626; }
.dash-admin-label { font-size: 11px; color: #6b7280; }
.dash-admin-links { margin-left: auto; display: flex; gap: 6px; }

/* ── Dashboard Drilldown ────────────────────────────── */
.dash-drilldown { cursor: pointer; }
.dash-drilldown:hover { opacity: 0.8; }
.dash-legend-item.dash-drilldown:hover { background: #f3f4f6; border-radius: 4px; }
.dash-sla-pill.dash-drilldown:hover { filter: brightness(0.95); }
.dash-hbar-row.dash-drilldown:hover { background: #f9fafb; border-radius: 4px; }
.dash-risk-row.dash-drilldown:hover { background: #f9fafb; border-radius: 4px; }
.dash-finance-item.dash-drilldown:hover { filter: brightness(0.95); transform: translateY(-1px); }
.dash-pri-item.dash-drilldown:hover { background: #f9fafb; border-radius: 4px; }
.dash-kpi.dash-drilldown:hover { background: rgba(37, 99, 235, 0.06); border-radius: 8px; }

/* Drilldown modal table */
.drilldown-case-link { color: #2563eb; font-weight: 600; text-decoration: none; }
.drilldown-case-link:hover { text-decoration: underline; }
.drilldown-case-noaccess { color: #9ca3af; font-weight: 500; }

/* SVG circle drilldown hover */
circle.dash-drilldown:hover { opacity: 0.75; transition: opacity 0.15s; }

/* Compact table variant */
.data-table-compact td, .data-table-compact th { padding: 6px 10px; font-size: 13px; }
