
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f9;
    color: #18202b;
}
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 245px;
    background: #111827;
    color: white;
    padding: 22px 18px;
    position: fixed;
    top: 0; bottom: 0; left: 0;
}
.brand {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
}
.brand span { color: #38bdf8; }
.user-box {
    background: rgba(255,255,255,0.08);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 22px;
}
.user-box small { color: #cbd5e1; }
.sidebar nav a {
    display: block;
    color: #e5e7eb;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
}
.sidebar nav a:hover { background: rgba(56,189,248,0.18); color: #fff; }
.main-content {
    margin-left: 245px;
    padding: 28px;
    width: calc(100% - 245px);
}
.main-content.full {
    margin-left: 0;
    width: 100%;
}
.page-header {
    background: white;
    padding: 22px;
    border-radius: 14px;
    margin-bottom: 22px;
    border: 1px solid #e5e7eb;
}
.page-header h1 { margin: 0 0 5px; }
.page-header p { margin: 0; color: #64748b; }
.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.card {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 18px;
    border-radius: 14px;
    min-width: 160px;
    box-shadow: 0 5px 18px rgba(15,23,42,0.04);
}
.card.big { max-width: 520px; }
.card h3 { font-size: 28px; margin: 0; color: #0f172a; }
.card p { margin: 5px 0 0; color: #64748b; }
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    margin-bottom: 28px;
}
th, td {
    padding: 11px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
}
th { background: #f8fafc; color: #334155; }
tr:hover td { background: #f9fbff; }
a { color: #0369a1; }
.btn, button {
    display: inline-block;
    background: #0369a1;
    color: white !important;
    text-decoration: none;
    border: none;
    padding: 10px 14px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
}
.btn:hover, button:hover { background: #075985; }
.form-card {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 22px;
    border-radius: 14px;
    max-width: 800px;
    margin-bottom: 28px;
}
label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 6px;
}
input, select, textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
}
textarea { min-height: 85px; }
button { margin-top: 16px; }
.alerts { margin-bottom: 15px; }
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }
.badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.suspended, .badge.revoked { background: #fee2e2; color: #991b1b; }
.badge.archived { background: #e5e7eb; color: #374151; }
.login-card {
    width: 420px;
    margin: 90px auto;
    background: white;
    border-radius: 18px;
    padding: 32px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 60px rgba(15,23,42,0.08);
}
.login-card h1 { margin-top: 0; }
.muted { color: #64748b; }
.hint {
    margin-top: 18px;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
}
.check-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 6px 16px;
    margin: 10px 0;
}
.check-row input { width: auto; }
@media (max-width: 900px) {
    .sidebar { position: static; width: 100%; }
    .app-shell { display: block; }
    .main-content { margin-left: 0; width: 100%; }
}

/* Google Drive-style DATA Library */
.library-customer-form { min-width: 360px; }
.library-customer-form label { margin-top: 0; }
.library-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: white;
    border: 1px solid #e5e7eb;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}
.breadcrumb { font-weight: 600; color: #475569; }
.breadcrumb a { text-decoration: none; color: #0369a1; }
.breadcrumb span { margin: 0 8px; color: #94a3b8; }
.toolbar-actions { display: flex; gap: 10px; }
.library-workspace {
    min-height: 560px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    align-content: start;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.04);
}
.library-item {
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 16px 12px;
    background: #f8fafc;
    cursor: default;
    user-select: none;
    min-height: 132px;
    transition: 0.15s ease;
}
.library-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}
.file-icon { font-size: 42px; margin-bottom: 10px; }
.file-name {
    font-weight: 700;
    word-break: break-word;
    line-height: 1.25;
}
.file-meta {
    margin-top: 7px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.25;
}
.up-item { background: #fff7ed; }
.empty-library {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}
.empty-library h2 { color: #0f172a; margin-bottom: 8px; }
.context-menu {
    position: absolute;
    display: none;
    min-width: 190px;
    background: white;
    border: 1px solid #cbd5e1;
    box-shadow: 0 18px 45px rgba(15,23,42,0.16);
    border-radius: 12px;
    z-index: 1000;
    padding: 6px;
}
.context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    color: #0f172a !important;
    padding: 10px 12px;
    margin: 0;
    border-radius: 8px;
    font-weight: 600;
}
.context-menu button:hover { background: #f1f5f9; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
    background: white;
    border-radius: 16px;
    padding: 22px;
    border: 1px solid #e5e7eb;
    width: min(620px, 96vw);
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 24px 70px rgba(15,23,42,0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.modal-header h2 { margin: 0; }
.modal-close {
    background: #f1f5f9;
    color: #0f172a !important;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 22px;
}
@media (max-width: 900px) {
    .library-toolbar, .row-between { flex-direction: column; align-items: stretch; }
    .library-customer-form { min-width: 0; width: 100%; }
    .toolbar-actions { flex-direction: column; }
}

/* Customer user list filters */
.compact-filter { max-width: none; }
.filter-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1.4fr auto;
    gap: 12px;
    align-items: end;
}
.filter-grid label { margin-top: 0; }
.filter-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}
.btn.secondary {
    background: #e2e8f0;
    color: #0f172a !important;
}
.btn.secondary:hover { background: #cbd5e1; }
.table-summary {
    margin: 10px 0 12px;
    color: #475569;
}
.empty-cell {
    text-align: center;
    color: #64748b;
    padding: 24px;
}
@media (max-width: 900px) {
    .filter-grid { grid-template-columns: 1fr; }
    .filter-actions { flex-direction: column; align-items: stretch; }
}

/* Customer portal Google-Drive-style layout */
.portal-shell {
    min-height: 100vh;
    background: #f4f6f9;
}
.portal-header {
    height: 72px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.portal-brand {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.portal-brand span { color: #38bdf8; }
.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.portal-user {
    font-weight: 600;
    color: #334155;
}
.portal-content {
    padding: 24px;
}
.drive-page-header {
    margin-bottom: 16px;
}
.drive-page-header h1 {
    margin: 0 0 4px;
    font-size: 34px;
}
.drive-page-header p {
    margin: 0;
    color: #64748b;
}
.portal-workspace {
    min-height: 420px;
}
.viewer-shell {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
}
.viewer-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}
.viewer-topbar h1 {
    margin: 0 0 4px;
    font-size: 24px;
}
.viewer-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.pdf-toolbar button { margin-top: 0; }
.pdf-canvas-wrap {
    background: #eef2f7;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 20px;
    overflow: auto;
    text-align: center;
}
#pdfCanvas {
    max-width: 100%;
    box-shadow: 0 12px 30px rgba(15,23,42,0.15);
    background: white;
}
.image-viewer-wrap {
    background: #eef2f7;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.viewer-image {
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 0 12px 30px rgba(15,23,42,0.15);
    background: white;
}
@media print {
    .portal-header, .viewer-topbar, .pdf-toolbar, .alerts { display: none !important; }
    body, .portal-shell, .portal-content { background: white; padding: 0; }
    .viewer-shell, .pdf-canvas-wrap, .image-viewer-wrap { border: none; box-shadow: none; padding: 0; }
}


/* V12 secure server-side PDF image preview */
.pdf-image-wrap {
    background: #eef2f7;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 24px;
    overflow: auto;
    text-align: center;
    min-height: 520px;
}
.pdf-page-image {
    display: inline-block;
    width: 100%;
    max-width: 1100px;
    height: auto;
    background: white;
    box-shadow: 0 12px 30px rgba(15,23,42,0.15);
}
@media print {
    .pdf-page-image { width: 100% !important; max-width: none; box-shadow: none; }
}


/* V13 fallback embedded PDF preview */
.pdf-fallback-wrap {
    background: #eef2f7;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 16px;
}
.pdf-fallback-frame {
    display: block;
    width: 100%;
    height: 78vh;
    min-height: 620px;
    border: 0;
    background: white;
    border-radius: 10px;
}


/* V14 clean customer PDF viewer */
.hidden { display: none !important; }
.clean-viewer {
    padding: 20px;
}
.secure-pdf-frame-wrap {
    background: #eef2f7;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 10px;
    overflow: hidden;
}
.secure-pdf-frame {
    display: block;
    width: 100%;
    height: calc(100vh - 210px);
    min-height: 640px;
    border: 0;
    background: white;
    border-radius: 8px;
}
@media print {
    .portal-header,
    .viewer-topbar {
        display: none !important;
    }
    .secure-pdf-frame-wrap {
        border: 0;
        padding: 0;
        background: white;
    }
}


/* V16 customer document watermark */
.watermark-status {
    margin: 6px 0 0;
    color: #0369a1;
    font-size: 13px;
    font-weight: 600;
}
.watermark-container {
    position: relative;
}
.watermark-overlay {
    position: absolute;
    inset: 10px;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(3, minmax(320px, 1fr));
    grid-auto-rows: 140px;
    opacity: 0.18;
}
.watermark-overlay span {
    color: #334155;
    font-size: 15px;
    font-weight: 700;
    transform: rotate(-28deg);
    align-self: center;
    justify-self: center;
    white-space: nowrap;
    user-select: none;
}
.secure-pdf-frame,
.viewer-image {
    position: relative;
    z-index: 1;
}
@media print {
    .watermark-overlay {
        opacity: 0.22;
    }
}


/* V18 global watermark settings */
.watermark-preview-box {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.watermark-preview-img {
    max-width: 320px;
    max-height: 180px;
    display: block;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
}
.watermark-image-overlay {
    position: absolute;
    inset: 10px;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.22;
}
.watermark-image-overlay img {
    max-width: 38%;
    max-height: 38%;
    object-fit: contain;
}
.watermark-image-overlay span {
    position: absolute;
    left: 24px;
    bottom: 18px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.85;
    white-space: nowrap;
}

/* V19 polished customer document viewer */
.document-view-shell {
    max-width: 1680px;
    margin: 0 auto;
}
.document-hero-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe7f3;
    border-radius: 20px;
    padding: 24px 26px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}
.document-hero-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, #0ea5e9, #2563eb);
}
.document-hero-main {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 4px;
}
.document-view-kicker {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 7px 12px;
}
.document-view-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    color: #0f172a;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.document-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    line-height: 1.2;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.meta-pill.accent {
    background: #ecfeff;
    border-color: #a5f3fc;
    color: #0f766e;
    font-weight: 600;
}
.meta-pill.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
    font-weight: 600;
}
.meta-pill.muted {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}
.document-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    min-width: 170px;
    position: relative;
    z-index: 1;
}
.viewer-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
}
.viewer-surface {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55);
}
.secure-pdf-frame-wrap {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4f9 100%);
    border-color: #d8e3ee;
    border-radius: 16px;
    padding: 12px;
}
.secure-pdf-frame {
    height: calc(100vh - 255px);
    min-height: 620px;
    border-radius: 12px;
}
.image-viewer-wrap {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4f9 100%);
    border-color: #d8e3ee;
    border-radius: 16px;
    padding: 18px;
}
.viewer-image {
    border-radius: 12px;
}
.watermark-status {
    display: none;
}
@media (max-width: 920px) {
    .document-hero-card {
        flex-direction: column;
        align-items: stretch;
    }
    .document-hero-actions {
        justify-content: flex-start;
        min-width: 0;
    }
    .document-view-title {
        font-size: 21px;
    }
    .viewer-panel {
        padding: 12px;
    }
    .secure-pdf-frame {
        height: calc(100vh - 295px);
        min-height: 520px;
    }
}


/* V20 watermark correction */
.watermark-image-overlay.image-only span {
    display: none !important;
}
.watermark-overlay {
    opacity: 0.14;
}
.watermark-overlay span {
    font-size: 18px;
    color: #1f2937;
}


/* V21 internal user management */
.privilege-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.privilege-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin: 0;
    cursor: pointer;
}
.privilege-card:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}
.privilege-card input {
    width: auto;
    margin-top: 4px;
}
.privilege-card strong {
    display: block;
    color: #0f172a;
}
.privilege-card small {
    display: block;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.3;
}
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}
.form-actions .btn {
    margin-top: 16px;
}


/* V24 attractive login redesign */
.main-content.full {
    min-height: 100vh;
    background: linear-gradient(135deg, #eaf2ff 0%, #f8fbff 45%, #eef5ff 100%);
}
.main-content.full .alerts {
    max-width: 1280px;
    margin: 22px auto 0;
    padding: 0 8px;
}
.login-page {
    max-width: 1280px;
    margin: 28px auto 48px;
    padding: 0 8px;
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 28px;
    align-items: stretch;
}
.login-hero-panel {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(145deg, #0f172a 0%, #0b3b74 50%, #1d4ed8 100%);
    color: white;
    min-height: 680px;
    box-shadow: 0 28px 70px rgba(15,23,42,0.18);
}
.login-hero-panel::before,
.login-hero-panel::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    filter: blur(2px);
}
.login-hero-panel::before {
    width: 340px; height: 340px; right: -80px; top: -70px;
}
.login-hero-panel::after {
    width: 260px; height: 260px; left: -70px; bottom: -60px;
}
.login-hero-content {
    position: relative;
    z-index: 1;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}
.login-badge {
    display: inline-flex;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    font-size: 13px;
    letter-spacing: 0.4px;
    margin-bottom: 18px;
}
.login-hero-content h1 {
    margin: 0;
    font-size: 52px;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.login-hero-text {
    margin-top: 18px;
    max-width: 660px;
    color: rgba(255,255,255,0.86);
    font-size: 19px;
    line-height: 1.7;
}
.login-feature-grid {
    display: grid;
    gap: 16px;
    margin-top: 34px;
}
.login-feature-card {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 14px;
    align-items: center;
    padding: 18px 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(5px);
}
.login-feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 24px;
    background: rgba(255,255,255,0.16);
}
.login-feature-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}
.login-feature-card small {
    display: block;
    color: rgba(255,255,255,0.82);
    line-height: 1.5;
}
.login-card-premium {
    width: auto;
    margin: 0;
    padding: 36px 34px;
    border-radius: 28px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px rgba(15,23,42,0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 680px;
}
.login-card-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}
.login-logo-mark {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 12px 30px rgba(37,99,235,0.25);
}
.login-card-header h2 {
    margin: 0 0 4px;
    font-size: 34px;
    line-height: 1.1;
}
.login-card-header p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}
.login-form-premium label {
    margin-top: 18px;
    margin-bottom: 7px;
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.login-form-premium input {
    padding: 14px 15px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 1px rgba(15,23,42,0.02);
    transition: 0.18s ease;
}
.login-form-premium input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96,165,250,0.16);
}
.btn-login-full {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
    box-shadow: 0 16px 30px rgba(37,99,235,0.18);
}
.login-footer-note {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}
@media (max-width: 1080px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-hero-panel,
    .login-card-premium {
        min-height: auto;
    }
    .login-hero-content { padding: 34px 28px; }
    .login-card-premium { padding: 30px 24px; }
    .login-hero-content h1 { font-size: 40px; }
}
@media (max-width: 640px) {
    .main-content.full .alerts { margin-top: 16px; }
    .login-page { margin-top: 16px; }
    .login-hero-content h1 { font-size: 32px; }
    .login-hero-text { font-size: 16px; }
    .login-card-header { align-items: flex-start; }
    .login-card-header h2 { font-size: 28px; }
}


/* =========================
   V25 - Full UI Redesign Stage 1
   Premium Dark Blue Corporate
   ========================= */
:root {
    --ndh-bg: #eef3f9;
    --ndh-card: #ffffff;
    --ndh-line: #dbe5f1;
    --ndh-text: #0f172a;
    --ndh-muted: #64748b;
    --ndh-primary: #123a72;
    --ndh-primary-2: #1d5fc2;
    --ndh-navy: #081a33;
    --ndh-surface: #f8fbff;
    --ndh-shadow: 0 20px 55px rgba(8, 26, 51, 0.08);
    --ndh-shadow-soft: 0 10px 30px rgba(8, 26, 51, 0.05);
}
body {
    background: radial-gradient(circle at top left, #f6f9ff 0%, #eef3f9 40%, #ebf1f7 100%);
    color: var(--ndh-text);
}
.premium-admin-shell { display: flex; min-height: 100vh; }
.premium-sidebar {
    width: 276px;
    background: linear-gradient(180deg, #071427 0%, #0b2242 56%, #0d2950 100%);
    color: #fff;
    padding: 24px 18px 20px;
    position: fixed;
    inset: 0 auto 0 0;
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 18px 0 48px rgba(7,20,39,0.18);
    display: flex;
    flex-direction: column;
}
.sidebar-top { margin-bottom: 18px; }
.brand-premium {
    font-size: 28px;
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}
.brand-premium span { color: #64c0ff; display:block; }
.brand-subtitle {
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(226,232,240,0.76);
    padding-right: 8px;
}
.user-box-premium {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 22px;
}
.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    box-shadow: 0 10px 24px rgba(56,189,248,0.25);
}
.user-box-premium small { display:block; margin-top:4px; color: rgba(226,232,240,0.7); }
.sidebar-nav { overflow:auto; padding-right: 4px; }
.nav-section-title {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    color: rgba(148,163,184,0.88);
    margin: 10px 8px 9px;
    font-weight: 700;
}
.nav-space { margin-top: 18px; }
.sidebar nav a,
.sidebar-nav a {
    display: block;
    color: #dbe7f7;
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-weight: 600;
    transition: 0.18s ease;
}
.sidebar-nav a:hover {
    background: rgba(100,192,255,0.14);
    color: #fff;
    transform: translateX(2px);
}
.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.24), rgba(56,189,248,0.18));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(100,192,255,0.16);
}
.sidebar-footer { margin-top: auto; padding-top: 12px; }
.sidebar-logout {
    display: block;
    text-align: center;
    background: rgba(255,255,255,0.08);
    color: #fff !important;
    text-decoration:none;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.10);
}
.sidebar-logout:hover { background: rgba(255,255,255,0.14); }
.main-area {
    margin-left: 276px;
    width: calc(100% - 276px);
    min-height: 100vh;
}
.main-area.no-sidebar { margin-left: 0; width: 100%; }
.premium-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px 10px;
}
.topbar-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.topbar-subtitle {
    margin-top: 4px;
    color: var(--ndh-muted);
    font-size: 13px;
}
.topbar-actions { display:flex; gap:10px; flex-wrap: wrap; }
.topbar-chip {
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--ndh-line);
    color: #0f172a;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: var(--ndh-shadow-soft);
    font-size: 13px;
}
.chip-user { background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%); }
.main-content {
    margin-left: 0;
    width: 100%;
    padding: 10px 28px 34px;
}
.page-header,
.form-card,
.card,
.library-toolbar,
.table-wrap table,
.table-wrap,
table,
.panel {
    box-shadow: var(--ndh-shadow-soft);
}
.page-header {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--ndh-line);
    border-radius: 22px;
    padding: 24px 26px;
}
.page-header h1 { font-size: 34px; letter-spacing: -0.02em; }
.page-header p { color: var(--ndh-muted); font-size: 15px; }
.card,
.form-card,
.library-toolbar,
.library-workspace,
table,
.panel {
    border-radius: 20px;
    border: 1px solid var(--ndh-line);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.card { padding: 22px; }
.btn, button {
    background: linear-gradient(135deg, var(--ndh-primary) 0%, var(--ndh-primary-2) 100%);
    border-radius: 12px;
    padding: 11px 16px;
    box-shadow: 0 10px 24px rgba(29,95,194,0.16);
}
.btn:hover, button:hover { background: linear-gradient(135deg, #0f3363 0%, #1a54a9 100%); }
.btn.secondary {
    background: #edf4ff;
    color: #103362 !important;
    box-shadow:none;
    border:1px solid #cfe0fb;
}
.btn-ghost-light {
    background: rgba(255,255,255,0.12) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.20);
    box-shadow: none;
}
label {
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 7px;
}
input, select, textarea {
    border-radius: 12px;
    padding: 11px 13px;
    border: 1px solid #cbd7e6;
    transition: 0.16s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96,165,250,0.14);
}
.alerts { margin-bottom: 18px; }
.alert {
    padding: 15px 17px;
    border-radius: 16px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    box-shadow: var(--ndh-shadow-soft);
}
.alert-success { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.table-wrap { overflow-x: auto; }
table { overflow: hidden; }
th, td { padding: 13px 14px; }
th {
    background: #f5f9ff;
    color: #24406a;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
tr:hover td { background: #f9fbff; }
.text-link { font-weight: 700; text-decoration: none; }
.section-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.16);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.dashboard-hero {
    background: linear-gradient(135deg, #081a33 0%, #103362 55%, #1d5fc2 100%);
    color: white;
    border-radius: 28px;
    padding: 28px 28px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    box-shadow: 0 28px 60px rgba(8,26,51,0.18);
    border: 1px solid rgba(255,255,255,0.08);
}
.dashboard-hero h1 { margin: 0; font-size: 42px; letter-spacing: -0.03em; }
.dashboard-hero p { margin: 10px 0 0; color: rgba(255,255,255,0.82); max-width: 780px; line-height: 1.65; }
.dashboard-hero-actions { display:flex; gap: 10px; flex-wrap: wrap; }
.metric-grid {
    display:grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--ndh-line);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--ndh-shadow-soft);
}
.metric-primary {
    background: linear-gradient(135deg, #0f3363 0%, #1b57b0 100%);
    color: white;
    border-color: rgba(255,255,255,0.14);
}
.metric-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: #5b6d84; }
.metric-primary .metric-label, .metric-primary .metric-foot { color: rgba(255,255,255,0.8); }
.metric-value { font-size: 38px; font-weight: 800; margin: 14px 0 8px; line-height: 1; }
.metric-foot { color: var(--ndh-muted); font-size: 13px; line-height: 1.5; }
.spotlight-grid {
    display:grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.spotlight-card {
    border-radius: 22px;
    padding: 22px;
    border: 1px solid var(--ndh-line);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: var(--ndh-shadow-soft);
}
.spotlight-card.warn { background: linear-gradient(135deg, #fffdf5 0%, #fff7e8 100%); border-color: #f6dd9b; }
.spotlight-card.info { background: linear-gradient(135deg, #f7fbff 0%, #eef6ff 100%); border-color: #c9defb; }
.spotlight-title { font-size: 15px; font-weight: 700; color: #334155; }
.spotlight-value { font-size: 34px; font-weight: 800; margin: 10px 0 6px; }
.spotlight-foot { color: var(--ndh-muted); font-size: 13px; }
.dashboard-grid {
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.panel {
    padding: 22px;
    min-width: 0;
}
.panel-span-2 { grid-column: span 2; }
.panel-header {
    display:flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.panel-header h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.panel-header p { margin: 5px 0 0; color: var(--ndh-muted); font-size: 14px; }
.quick-action-grid {
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.quick-action-card {
    display:block;
    text-decoration:none;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dce8f7;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(8,26,51,0.04);
}
.quick-action-card:hover { transform: translateY(-2px); border-color: #bdd4f8; background: #fbfdff; }
.quick-action-card strong { display:block; margin-bottom: 6px; color:#0f172a; }
.quick-action-card span { display:block; color: var(--ndh-muted); font-size: 13px; line-height: 1.5; }
.list-stack { display:grid; gap: 12px; }
.list-row {
    display:flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f9fbff;
    border: 1px solid #e2ebf6;
    border-radius: 16px;
}
.list-row strong { display:block; margin-bottom: 4px; }
.list-row small { display:block; color: var(--ndh-muted); line-height: 1.45; }
.empty-mini {
    padding: 20px;
    text-align:center;
    border: 1px dashed #cbd7e6;
    border-radius: 16px;
    color: var(--ndh-muted);
    background: #fbfdff;
}
.filter-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.filter-actions { display:flex; gap:10px; align-items:end; padding-bottom: 1px; }
.compact-filter { max-width: none; }
.table-summary { margin: 2px 0 14px; color: var(--ndh-muted); }
@media (max-width: 1400px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .premium-sidebar { position: static; width: 100%; border-right: none; }
    .premium-admin-shell { display:block; }
    .main-area { margin-left: 0; width: 100%; }
    .premium-topbar { padding: 18px 18px 8px; }
    .main-content { padding: 8px 18px 24px; }
    .dashboard-hero { display:block; }
    .dashboard-hero-actions { margin-top: 16px; }
}
@media (max-width: 860px) {
    .metric-grid, .spotlight-grid, .dashboard-grid, .quick-action-grid, .filter-grid { grid-template-columns: 1fr; }
    .panel-span-2 { grid-column: span 1; }
    .row-between { display:block; }
    .topbar-actions { margin-top: 10px; }
}


/* =========================
   V26 - Full UI Redesign Stage 2
   Admin Management Pages
   ========================= */
.premium-page-header {
    position: relative;
    overflow: hidden;
}
.premium-page-header::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -95px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(29,95,194,0.13), rgba(29,95,194,0));
}
.page-kicker {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #123a72;
    border: 1px solid #cfe0fb;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 10px;
}
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.management-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.management-summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #dbe5f1;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(8,26,51,0.05);
}
.management-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.management-summary-card strong {
    display: block;
    margin-top: 8px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
}
.management-summary-card .status-word {
    font-size: 21px;
    text-transform: capitalize;
}
.management-panel {
    margin-top: 0;
}
.premium-filter {
    max-width: none;
    padding: 22px;
}
.premium-table .code-pill,
.code-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf4ff;
    color: #123a72;
    border: 1px solid #d4e4fb;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}
.table-subtext {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}
.action-links {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
}
.action-links a {
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    padding: 7px 9px;
    border-radius: 10px;
    background: #f1f7ff;
    border: 1px solid #d9e8fb;
    color: #123a72;
}
.action-links a:hover {
    background: #e4f0ff;
}
.premium-form-card {
    max-width: none;
}
.wide-form {
    max-width: 1120px;
}
.form-section {
    padding: 22px 0;
    border-bottom: 1px solid #e4edf8;
}
.form-section:first-child {
    padding-top: 0;
}
.form-section:last-of-type {
    border-bottom: none;
}
.form-section-title {
    margin-bottom: 16px;
}
.form-section-title h2 {
    margin: 0 0 5px;
    font-size: 22px;
    color: #0f172a;
}
.form-section-title p {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
}
.form-grid {
    display: grid;
    gap: 16px;
}
.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.span-2 {
    grid-column: span 2;
}
.sticky-actions {
    padding-top: 18px;
    border-top: 1px solid #e4edf8;
    margin-top: 4px;
}
.detail-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 18px;
    margin-bottom: 18px;
}
.detail-list {
    display: grid;
    gap: 12px;
}
.detail-list div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2ebf6;
    border-radius: 14px;
    background: #f9fbff;
}
.detail-list span {
    color: #64748b;
    font-weight: 700;
}
.detail-list strong {
    color: #0f172a;
    word-break: break-word;
}
.compact-table th,
.compact-table td {
    padding: 11px 12px;
}
.premium-privilege-grid {
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
}
.premium-privilege-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-color: #dbe5f1;
    box-shadow: 0 8px 18px rgba(8,26,51,0.04);
    transition: 0.16s ease;
}
.premium-privilege-card:hover {
    transform: translateY(-1px);
    border-color: #9ec5fe;
}
.premium-privilege-card input:checked + span strong {
    color: #1d5fc2;
}
.empty-cell {
    color: #64748b;
    text-align: center;
    padding: 28px !important;
    background: #fbfdff;
}
@media (max-width: 1100px) {
    .management-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 720px) {
    .management-summary-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: span 1;
    }
    .detail-list div {
        grid-template-columns: 1fr;
    }
}


/* V26.1 Hotfix - make header action buttons fully clickable */
.premium-page-header::after {
    pointer-events: none !important;
    z-index: 0;
}
.premium-page-header > * {
    position: relative;
    z-index: 2;
}
.page-header.row-between,
.premium-page-header.row-between {
    position: relative;
}
.page-header.row-between > a.btn,
.premium-page-header.row-between > a.btn,
.header-actions,
.header-actions .btn {
    position: relative;
    z-index: 5;
    pointer-events: auto;
}
.page-header .btn,
.premium-page-header .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    cursor: pointer;
}


/* =========================
   V27 - Full UI Redesign Stage 3
   Library, Folders, Documents, Upload
   ========================= */
.library-page-header .library-customer-form {
    min-width: 360px;
    max-width: 520px;
}
.premium-customer-switcher {
    position: relative;
    z-index: 4;
    background: rgba(255,255,255,0.72);
    border: 1px solid #dbe5f1;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 28px rgba(8,26,51,0.05);
}
.premium-customer-switcher label {
    margin-top: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
}
.library-command-bar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #dbe5f1;
    border-radius: 22px;
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(8,26,51,0.05);
    margin-bottom: 16px;
}
.command-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}
.premium-breadcrumb {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    color: #64748b;
    font-weight: 700;
}
.premium-breadcrumb a {
    color: #123a72;
    text-decoration: none;
    padding: 6px 9px;
    border-radius: 999px;
    background: #edf4ff;
    border: 1px solid #d4e4fb;
}
.premium-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.library-stats-strip {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}
.library-stats-strip div {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid #dbe5f1;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(8,26,51,0.04);
}
.library-stats-strip span {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
    margin-bottom: 6px;
}
.library-stats-strip strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
    overflow-wrap: anywhere;
}
.premium-library-workspace {
    min-height: 560px;
    padding: 26px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    align-content: start;
    gap: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(29,95,194,0.08), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #dbe5f1;
    box-shadow: 0 18px 48px rgba(8,26,51,0.06);
}
.premium-library-item {
    position: relative;
    min-height: 190px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid #e0e9f5;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: 0 10px 28px rgba(8,26,51,0.05);
    transition: 0.16s ease;
}
.premium-library-item:hover {
    transform: translateY(-3px);
    border-color: #b8d4fb;
    box-shadow: 0 20px 38px rgba(8,26,51,0.08);
}
.premium-library-item .file-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #edf4ff;
    border: 1px solid #d4e4fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
}
.folder-icon-premium {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
}
.doc-icon-premium {
    background: #fdf2f8 !important;
    border-color: #fbcfe8 !important;
}
.premium-library-item .file-name {
    font-weight: 800;
    font-size: 17px;
    line-height: 1.3;
    color: #0f172a;
    overflow-wrap: anywhere;
}
.premium-library-item .file-meta {
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.45;
    margin-top: 8px;
}
.item-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.item-action {
    display: inline-flex;
    margin-top: 12px;
    padding: 7px 10px;
    border-radius: 10px;
    background: #eef6ff;
    color: #123a72;
    border: 1px solid #d6e7fb;
    text-decoration: none;
    font-weight: 800;
    font-size: 12px;
}
.item-action-row .item-action {
    margin-top: 0;
}
.premium-empty-state {
    grid-column: 1 / -1;
    align-self: center;
    justify-self: center;
    text-align: center;
    max-width: 520px;
    padding: 44px;
    border: 1px dashed #c9d8eb;
    border-radius: 24px;
    background: rgba(255,255,255,0.76);
}
.empty-icon {
    font-size: 46px;
    margin-bottom: 12px;
}
.premium-empty-state h2 {
    margin: 0 0 8px;
}
.premium-empty-state p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}
.premium-context-menu {
    border-radius: 16px;
    border: 1px solid #dbe5f1;
    box-shadow: 0 20px 50px rgba(8,26,51,0.16);
    overflow: hidden;
}
.premium-context-menu button {
    background: white;
    color: #0f172a;
    box-shadow: none;
    border-radius: 0;
    width: 100%;
    text-align: left;
}
.premium-context-menu button:hover {
    background: #edf4ff;
}
.premium-modal-card {
    border-radius: 24px;
    border: 1px solid #dbe5f1;
    box-shadow: 0 30px 80px rgba(8,26,51,0.22);
}
.premium-modal-card .modal-header {
    align-items: flex-start;
}
.premium-modal-card .modal-header h2 {
    margin-bottom: 4px;
}
.premium-modal-card .modal-header p {
    margin: 0;
    color: #64748b;
}
.split-management-grid {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(300px, 0.65fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}
.folder-help-panel {
    background: linear-gradient(135deg, #081a33 0%, #103362 100%);
    color: white;
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 22px 52px rgba(8,26,51,0.15);
    border: 1px solid rgba(255,255,255,0.10);
}
.folder-help-panel .help-icon {
    font-size: 42px;
    margin-bottom: 14px;
}
.folder-help-panel h2 {
    margin: 0 0 10px;
    font-size: 26px;
}
.folder-help-panel p {
    color: rgba(255,255,255,0.82);
    line-height: 1.65;
}
.help-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}
.help-list div {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 14px;
}
.help-list strong {
    display: block;
    margin-bottom: 4px;
}
.help-list span {
    display: block;
    color: rgba(255,255,255,0.78);
    line-height: 1.45;
    font-size: 13px;
}
.upload-form {
    max-width: 1080px;
}
.upload-drop-section {
    border-bottom: none;
}
.upload-drop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 190px;
    border: 2px dashed #b8d4fb;
    background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
    border-radius: 22px;
    cursor: pointer;
    text-align: center;
    margin: 0;
}
.upload-drop-card:hover {
    border-color: #1d5fc2;
    background: linear-gradient(180deg, #f6faff 0%, #eaf3ff 100%);
}
.upload-drop-card input[type="file"] {
    max-width: 360px;
    margin-top: 10px;
    background: white;
}
.upload-icon {
    font-size: 44px;
}
.upload-drop-card strong {
    font-size: 20px;
    color: #0f172a;
}
.upload-drop-card small {
    color: #64748b;
}
@media (max-width: 1180px) {
    .library-stats-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .split-management-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .library-command-bar {
        align-items: stretch;
        flex-direction: column;
    }
    .library-stats-strip,
    .premium-library-workspace {
        grid-template-columns: 1fr;
    }
    .library-page-header .library-customer-form {
        min-width: 0;
        width: 100%;
    }
}


/* V27.1 Security Hotfix - customer viewer interaction protection */
.secure-media-viewer,
.secure-pdf-viewer,
.secure-pdf-frame-wrap {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
.protected-viewer-image {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.viewer-interaction-shield {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: transparent;
    pointer-events: auto;
    cursor: default;
}
.watermark-overlay,
.watermark-image-overlay {
    z-index: 30;
}
.secure-media-viewer .viewer-image {
    position: relative;
    z-index: 1;
}
@media print {
    .secure-media-viewer,
    .secure-pdf-viewer,
    .secure-pdf-frame-wrap {
        display: none !important;
    }
}


/* V27.2 Access Grants Hotfix - visible folder expansion buttons */
.permission-tree-table .tree-expander {
    min-width: 30px !important;
    min-height: 30px !important;
    opacity: 1 !important;
    color: #123a72 !important;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border: 1px solid #b9d7fb !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 5px 14px rgba(29, 95, 194, 0.12) !important;
}
.permission-tree-table .tree-expander.expanded {
    color: #ffffff !important;
    background: linear-gradient(135deg, #123a72 0%, #1d5fc2 100%) !important;
    border-color: #123a72 !important;
}
.permission-tree-table .tree-expander.no-children {
    visibility: hidden !important;
}
.permission-tree-table .tree-expander-symbol {
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}


/* V27.3 Renewal Center */
.renewal-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.renewal-summary-card {
    border-radius: 20px;
    border: 1px solid #dbe5f1;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(8,26,51,0.05);
}
.renewal-summary-card span {
    display:block;
    color:#64748b;
    text-transform: uppercase;
    letter-spacing:.06em;
    font-size:12px;
    font-weight:800;
}
.renewal-summary-card strong {
    display:block;
    margin-top:8px;
    font-size:32px;
    color:#0f172a;
}
.renewal-summary-card.primary { background: linear-gradient(135deg, #0f3363 0%, #1b57b0 100%); }
.renewal-summary-card.primary span, .renewal-summary-card.primary strong { color:#fff; }
.renewal-summary-card.danger { border-color:#fecaca; background:#fff7f7; }
.renewal-summary-card.warning { border-color:#fde68a; background:#fffcf0; }
.renewal-summary-card.info { border-color:#bfdbfe; background:#f6fbff; }
.renewal-filter-panel, .bulk-renew-panel { margin-bottom: 18px; }
.renewal-filter-grid {
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr auto;
}
.bulk-renew-grid {
    display:grid;
    grid-template-columns: 1.4fr 220px 220px auto;
    gap:16px;
    align-items:end;
}
.bulk-renew-grid h2 { margin:0 0 6px; }
.bulk-renew-grid p { margin:0; color:#64748b; line-height:1.55; }
.bulk-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.renewal-card-grid {
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap:18px;
}
.renewal-card {
    position:relative;
    background:linear-gradient(180deg,#fff 0%,#f9fbff 100%);
    border:1px solid #dbe5f1;
    border-radius:24px;
    padding:20px;
    box-shadow:0 12px 34px rgba(8,26,51,0.06);
    overflow:hidden;
}
.renewal-card::before {
    content:"";
    position:absolute;
    left:0; top:0; bottom:0;
    width:6px;
    background:#1d5fc2;
}
.renewal-card.document::before { background:#db2777; }
.renewal-card.expired::before { background:#dc2626; }
.renewal-card.due-soon::before { background:#f59e0b; }
.renewal-select {
    position:absolute;
    top:16px;
    right:16px;
    display:flex;
    gap:7px;
    align-items:center;
    margin:0;
    padding:7px 10px;
    border:1px solid #dbe5f1;
    border-radius:999px;
    background:#fff;
    font-size:12px;
    font-weight:800;
    color:#123a72;
}
.renewal-select input { width:auto; margin:0; }
.renewal-card-head {
    display:grid;
    grid-template-columns:58px 1fr;
    gap:14px;
    padding-right:90px;
    align-items:start;
}
.renewal-icon {
    width:58px;
    height:58px;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#edf4ff;
    border:1px solid #d4e4fb;
    font-size:30px;
}
.type-pill {
    display:inline-flex;
    padding:5px 9px;
    border-radius:999px;
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.06em;
    background:#e0f2fe;
    color:#075985;
}
.type-pill.document { background:#fce7f3; color:#9d174d; }
.renewal-card h3 {
    margin:8px 0 4px;
    font-size:19px;
    overflow-wrap:anywhere;
}
.renewal-card p { margin:0; color:#64748b; font-weight:700; }
.renewal-meta-grid {
    display:grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:12px;
    margin-top:18px;
}
.renewal-meta-grid div {
    background:#f8fbff;
    border:1px solid #e2ebf6;
    border-radius:14px;
    padding:12px;
}
.renewal-meta-grid span {
    display:block;
    color:#64748b;
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.05em;
    margin-bottom:6px;
}
.renewal-meta-grid strong { display:block; color:#0f172a; overflow-wrap:anywhere; }
.renewal-meta-grid small { display:block; margin-top:6px; font-weight:800; }
.expiry-danger { color:#dc2626; }
.expiry-warning { color:#b45309; }
.expiry-info { color:#1d5fc2; }
.renewal-card-actions { margin-top:16px; display:flex; justify-content:flex-end; }
.renewal-card-actions a {
    display:inline-flex;
    padding:9px 12px;
    border-radius:12px;
    background:#edf4ff;
    color:#123a72;
    border:1px solid #d4e4fb;
    font-weight:900;
    text-decoration:none;
}
.renewal-card-actions a:hover { background:#e4f0ff; }
.renewal-empty { grid-column: 1 / -1; }
@media(max-width:1200px){
    .renewal-filter-grid, .bulk-renew-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .renewal-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media(max-width:760px){
    .renewal-filter-grid, .bulk-renew-grid, .renewal-summary-grid, .renewal-card-grid, .renewal-meta-grid { grid-template-columns: 1fr; }
    .bulk-actions { justify-content:flex-start; }
    .renewal-card-head { padding-right:0; grid-template-columns:1fr; }
    .renewal-select { position:static; width:max-content; margin-left:auto; margin-bottom:10px; }
}


/* V27.4 Renewal Center customer-user-wise filtering */
.user-renewal-filter-grid {
    grid-template-columns: 1.1fr 1.35fr 0.85fr 0.9fr 1fr auto;
}
.renewal-mode-banner {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    line-height: 1.55;
}
.renewal-mode-banner.user-mode {
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    color: #0f766e;
}
.renewal-mode-banner.content-mode {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}
.renewal-permission-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 2px;
}
.renewal-permission-row span {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}
.renewal-permission-row span.yes {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}
.renewal-permission-row span.no {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}
@media (max-width: 1400px) {
    .user-renewal-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 840px) {
    .user-renewal-filter-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================
   V28 - Full UI Redesign Stage 4
   Access Grants, Watermark, Audit, Reports, Errors
   ========================= */
.access-page-header .header-actions { z-index: 5; }
.access-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.permission-control-card { max-width: none; }
.premium-permission-toolbar { display:flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.premium-permission-toolbar .field { flex: 1; min-width: 340px; }
.permission-info-strip { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 16px; }
.permission-info-strip div { border: 1px solid #dbe5f1; border-radius: 16px; padding: 14px; background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%); }
.permission-info-strip strong { display:block; color:#0f172a; margin-bottom: 4px; }
.permission-info-strip span { display:block; color:#64748b; font-size: 13px; line-height: 1.45; }
.premium-permission-tree-wrap { overflow-x: auto; max-width: 100%; border: 1px solid #dbe5f1; border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(8,26,51,0.05); }
.permission-tree-table { width:100%; min-width: 1260px; font-size: 14px; border-collapse: collapse; }
.permission-tree-table th, .permission-tree-table td { vertical-align: middle; white-space: nowrap; border-bottom: 1px solid #e5edf6; padding: 12px 10px; }
.permission-tree-table th { background:#f5f9ff; color:#1f2f46; font-weight:800; }
.permission-tree-table tr.document-row td { background:#fcfdff; }
.item-name-cell { min-width: 390px; white-space: normal !important; }
.item-tree-name { display:inline-flex; align-items:center; gap:7px; }
.item-tree-muted { color:#64748b; font-size:12px; display:block; margin-top:4px; }
.tree-expander { width:32px; height:32px; border:1px solid #b9d7fb; background:linear-gradient(135deg,#eff6ff 0%,#dbeafe 100%); color:#123a72; cursor:pointer; font-weight:900; padding:0; margin-right:8px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; line-height:1; box-shadow:0 5px 14px rgba(29,95,194,.12); vertical-align:middle; }
.tree-expander:hover { background:linear-gradient(135deg,#dbeafe 0%,#bfdbfe 100%); border-color:#7fb4f5; transform:translateY(-1px); }
.tree-expander.expanded { background:linear-gradient(135deg,#123a72 0%,#1d5fc2 100%); border-color:#123a72; color:#fff; }
.tree-expander.no-children { visibility:hidden; }
.tree-expander-symbol { display:block; font-size:18px; line-height:1; transform:translateY(-1px); }
.permission-small-input { width: 86px; padding: 8px; }
.permission-date-input { width: 145px; padding: 8px; }
.permission-check { transform: scale(1.1); }
.hidden-row { display:none; }
.item-badge { display:inline-block; padding:5px 10px; border-radius:999px; font-size:12px; font-weight:800; }
.folder-badge { background:#e0f2fe; color:#075985; }
.document-badge { background:#fef3c7; color:#92400e; }
.premium-quick-note { margin-top: 12px; padding: 14px 16px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:16px; color:#344761; line-height:1.55; }
.existing-grants-panel { margin-top: 20px; }
.permission-chip-row { display:flex; gap:6px; flex-wrap:wrap; }
.permission-chip-row span { display:inline-flex; padding:5px 8px; border-radius:999px; font-size:12px; font-weight:800; border:1px solid #e2e8f0; color:#64748b; background:#f8fafc; }
.permission-chip-row span.yes { background:#ecfdf5; color:#047857; border-color:#bbf7d0; }
.permission-chip-row span.no { opacity:.65; }
.watermark-grid { display:grid; grid-template-columns: minmax(440px, .85fr) minmax(360px, .75fr); gap: 18px; align-items:start; }
.watermark-status-card { position:relative; z-index:3; border-radius:18px; padding:14px 18px; border:1px solid #dbe5f1; background:#fff; box-shadow:0 10px 30px rgba(8,26,51,.05); min-width:180px; }
.watermark-status-card span { display:block; color:#64748b; font-size:12px; text-transform:uppercase; letter-spacing:.06em; font-weight:800; }
.watermark-status-card strong { display:block; margin-top:5px; font-size:24px; }
.watermark-status-card.enabled strong { color:#047857; }
.watermark-status-card.disabled strong { color:#991b1b; }
.watermark-form-card { max-width:none; }
.toggle-line { display:flex; gap:12px; align-items:flex-start; padding:14px; border:1px solid #dbe5f1; border-radius:16px; background:#f8fbff; margin-bottom:18px; }
.toggle-line input { width:auto; margin-top:6px; }
.toggle-line small { display:block; color:#64748b; margin-top:3px; }
.watermark-config-box { margin-top:18px; }
.watermark-preview-panel { min-height: 430px; }
.watermark-preview-document { position:relative; overflow:hidden; min-height:310px; border-radius:18px; border:1px solid #dbe5f1; background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%); display:flex; align-items:center; justify-content:center; }
.watermark-preview-document::before { content:""; position:absolute; inset:20px; border:1px solid #edf2f7; border-radius:14px; }
.watermark-preview-text { transform: rotate(-22deg); font-size:34px; font-weight:900; color:rgba(15,23,42,.16); letter-spacing:.08em; text-transform:uppercase; }
.watermark-preview-image-main { max-width:50%; max-height:50%; opacity:.25; }
.preview-lines { position:absolute; inset:36px; display:grid; gap:16px; align-content:center; pointer-events:none; }
.preview-lines span { height:12px; border-radius:999px; background:#edf2f7; opacity:.8; }
.current-watermark-file { margin-top:12px; padding:12px; border-radius:14px; background:#f8fafc; border:1px solid #e2e8f0; color:#475569; }
.watermark-rules-list { display:grid; gap:10px; margin-top:14px; }
.watermark-rules-list div { padding:12px; border-radius:14px; background:#f8fbff; border:1px solid #e2e8f0; color:#475569; line-height:1.5; }
.audit-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.audit-filter-grid { grid-template-columns: 1fr 1fr .8fr .8fr 1.2fr auto; }
.audit-table { min-width: 1200px; }
.audit-action-pill { display:inline-flex; padding:6px 10px; border-radius:999px; background:#edf4ff; border:1px solid #d4e4fb; color:#123a72; font-weight:800; font-size:12px; }
.audit-details-cell { max-width: 420px; white-space: normal; color:#475569; }
.report-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:18px; }
.report-card-large { padding:28px; }
.report-icon { width:58px; height:58px; display:flex; align-items:center; justify-content:center; border-radius:18px; background:#edf4ff; border:1px solid #d4e4fb; font-size:30px; margin-bottom:16px; }
.report-card-large h2 { margin:0 0 8px; font-size:24px; }
.report-card-large p { color:#64748b; line-height:1.65; margin-bottom:18px; }
.muted-report-card { background:linear-gradient(135deg,#ffffff 0%,#f7fbff 100%); }
.report-stat-list { display:grid; gap:10px; }
.report-stat-list div { display:flex; justify-content:space-between; gap:12px; padding:13px 14px; border-radius:14px; background:#f8fbff; border:1px solid #e2e8f0; }
.report-stat-list span { color:#64748b; font-weight:700; }
.report-stat-list strong { color:#0f172a; }
.error-shell { min-height: calc(100vh - 160px); display:flex; align-items:center; justify-content:center; padding: 40px 16px; }
.error-card { max-width:620px; text-align:center; padding:42px; border-radius:28px; background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%); border:1px solid #dbe5f1; box-shadow:0 26px 70px rgba(8,26,51,.10); }
.error-code { display:inline-flex; align-items:center; justify-content:center; min-width:88px; height:88px; padding:0 18px; border-radius:24px; background:linear-gradient(135deg,#081a33 0%,#1d5fc2 100%); color:#fff; font-size:36px; font-weight:900; margin-bottom:20px; }
.error-card h1 { margin:0 0 10px; font-size:34px; }
.error-card p { color:#64748b; font-size:17px; line-height:1.65; margin:0 0 22px; }
.error-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
@media (max-width: 1280px){ .audit-filter-grid, .user-renewal-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .watermark-grid { grid-template-columns: 1fr; } }
@media (max-width: 920px){ .permission-info-strip, .access-summary-grid, .audit-summary-grid, .report-metric-grid, .report-grid { grid-template-columns:1fr; } .audit-filter-grid { grid-template-columns:1fr; } }


/* =========================
   V29 - Full Customer Portal Redesign
   Premium external customer workspace
   ========================= */
.premium-customer-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(29,95,194,0.11), transparent 34%),
        linear-gradient(135deg, #edf4fb 0%, #f7fbff 48%, #eef4fb 100%);
}
.premium-customer-header {
    position: sticky;
    top: 0;
    z-index: 80;
    height: 78px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #dbe5f1;
    box-shadow: 0 10px 30px rgba(8,26,51,0.05);
}
.premium-portal-brand {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #071427;
    text-decoration: none;
}
.premium-portal-brand span { color: #1d5fc2; }
.premium-portal-actions { display:flex; align-items:center; gap:14px; }
.portal-user-chip {
    display:flex;
    align-items:center;
    gap:12px;
    padding: 8px 12px;
    background: #f8fbff;
    border: 1px solid #dbe5f1;
    border-radius: 999px;
}
.portal-user-chip > span {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:white;
    font-weight:900;
    background: linear-gradient(135deg, #123a72 0%, #1d5fc2 100%);
}
.portal-user-chip strong { display:block; line-height:1.1; color:#0f172a; }
.portal-user-chip small { display:block; margin-top:3px; color:#64748b; font-size:12px; max-width:260px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.portal-logout-btn { border-radius: 999px; padding: 12px 18px; }
.premium-customer-content {
    max-width: 1720px;
    margin: 0 auto;
    padding: 28px 30px 42px;
}
.portal-drive-shell, .portal-document-view-shell { max-width: 100%; }
.portal-hero-card {
    position: relative;
    overflow: hidden;
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:22px;
    padding: 30px;
    border-radius: 28px;
    background: linear-gradient(135deg, #071427 0%, #103362 55%, #1d5fc2 100%);
    color:white;
    box-shadow: 0 28px 70px rgba(8,26,51,0.18);
    border: 1px solid rgba(255,255,255,0.10);
    margin-bottom: 18px;
}
.portal-hero-card::after {
    content:"";
    position:absolute;
    width:280px;
    height:280px;
    right:-70px;
    top:-100px;
    border-radius:999px;
    background:rgba(255,255,255,0.10);
}
.portal-hero-content { position:relative; z-index:1; }
.portal-kicker {
    display:inline-flex;
    padding: 8px 13px;
    border-radius:999px;
    background:rgba(255,255,255,0.13);
    border:1px solid rgba(255,255,255,0.18);
    color:rgba(255,255,255,0.88);
    font-size:12px;
    letter-spacing:.10em;
    text-transform:uppercase;
    font-weight:800;
    margin-bottom:12px;
}
.portal-hero-card h1, .portal-document-hero h1 { margin:0; font-size:42px; line-height:1.08; letter-spacing:-0.03em; overflow-wrap:anywhere; }
.portal-hero-card p, .portal-document-hero p { margin:12px 0 0; color:rgba(255,255,255,0.82); line-height:1.6; }
.portal-hero-metrics { position:relative; z-index:1; display:flex; gap:12px; }
.portal-metric {
    min-width:120px;
    padding:16px;
    border-radius:18px;
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.16);
}
.portal-metric span { display:block; color:rgba(255,255,255,0.78); font-size:12px; text-transform:uppercase; letter-spacing:.06em; font-weight:800; }
.portal-metric strong { display:block; font-size:34px; margin-top:8px; }
.portal-command-card, .portal-list-panel, .portal-viewer-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid #dbe5f1;
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(8,26,51,0.06);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.portal-command-card { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.portal-breadcrumb { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.portal-breadcrumb a {
    text-decoration:none;
    color:#123a72;
    background:#edf4ff;
    border:1px solid #d4e4fb;
    padding:8px 12px;
    border-radius:999px;
    font-weight:800;
}
.portal-breadcrumb span { color:#94a3b8; font-weight:800; }
.portal-security-note { text-align:right; color:#64748b; line-height:1.4; }
.portal-security-note span { display:block; color:#0f766e; font-weight:900; text-transform:uppercase; letter-spacing:.05em; font-size:12px; }
.portal-security-note strong { color:#334155; font-size:13px; }
.premium-customer-workspace {
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap:18px;
    min-height: 520px;
    padding: 24px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(29,95,194,0.08), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.96) 0%, #f8fbff 100%);
    border: 1px solid #dbe5f1;
    box-shadow: 0 18px 48px rgba(8,26,51,0.06);
    margin-bottom: 20px;
}
.portal-drive-card {
    display:block;
    position:relative;
    text-decoration:none;
    color:#0f172a;
    min-height:210px;
    padding:22px;
    border-radius:24px;
    border:1px solid #e0e9f5;
    background:linear-gradient(180deg,#ffffff 0%,#f9fbff 100%);
    box-shadow:0 10px 28px rgba(8,26,51,0.05);
    transition:.16s ease;
}
.portal-drive-card:hover { transform:translateY(-4px); border-color:#b8d4fb; box-shadow:0 22px 44px rgba(8,26,51,0.10); }
.portal-file-icon {
    width:62px;
    height:62px;
    border-radius:20px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:31px;
    background:#edf4ff;
    border:1px solid #d4e4fb;
    margin-bottom:16px;
}
.portal-file-icon.folder { background:#fff7ed; border-color:#fed7aa; }
.portal-file-icon.document { background:#fdf2f8; border-color:#fbcfe8; }
.portal-card-title { font-weight:900; font-size:18px; line-height:1.28; overflow-wrap:anywhere; }
.portal-card-meta { margin-top:8px; color:#64748b; font-size:12.5px; line-height:1.48; }
.portal-open-chip {
    display:inline-flex;
    margin-top:14px;
    padding:7px 11px;
    border-radius:999px;
    background:#eef6ff;
    border:1px solid #d6e7fb;
    color:#123a72;
    font-size:12px;
    font-weight:900;
}
.portal-permission-strip { display:flex; gap:7px; flex-wrap:wrap; margin-top:14px; }
.portal-permission-strip span, .portal-table-badge, .portal-doc-badges span {
    display:inline-flex;
    padding:6px 9px;
    border-radius:999px;
    font-size:12px;
    font-weight:900;
    border:1px solid #e2e8f0;
    background:#f8fafc;
    color:#64748b;
}
.portal-permission-strip span.yes, .portal-table-badge.yes, .portal-doc-badges span.yes { background:#ecfdf5; border-color:#bbf7d0; color:#047857; }
.portal-permission-strip span.no, .portal-table-badge.no, .portal-doc-badges span.no { background:#f8fafc; border-color:#e2e8f0; color:#64748b; }
.portal-empty-state {
    grid-column:1/-1;
    justify-self:center;
    align-self:center;
    max-width:560px;
    text-align:center;
    padding:46px;
    border:1px dashed #c9d8eb;
    border-radius:26px;
    background:rgba(255,255,255,0.78);
}
.portal-empty-state.standalone { grid-column:auto; margin:30px auto; }
.portal-empty-icon { font-size:50px; margin-bottom:12px; }
.portal-empty-state h2 { margin:0 0 8px; }
.portal-empty-state p { margin:0; color:#64748b; line-height:1.65; }
.portal-section-header { display:flex; justify-content:space-between; gap:14px; align-items:center; margin-bottom:14px; }
.portal-section-header h2 { margin:0 0 4px; font-size:22px; }
.portal-section-header p { margin:0; color:#64748b; }
.portal-document-table th { background:#f5f9ff; color:#24406a; }
.portal-document-table td strong { display:block; }
.portal-document-table td small { display:block; margin-top:4px; color:#64748b; }
.portal-action-link {
    display:inline-flex;
    text-decoration:none;
    padding:8px 12px;
    border-radius:999px;
    background:#edf4ff;
    color:#123a72;
    border:1px solid #d4e4fb;
    font-weight:900;
}
.portal-document-hero {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;
    padding:26px;
    border-radius:28px;
    background:linear-gradient(135deg,#071427 0%,#103362 55%,#1d5fc2 100%);
    color:white;
    box-shadow:0 28px 70px rgba(8,26,51,0.18);
    margin-bottom:18px;
}
.portal-document-hero p { overflow-wrap:anywhere; }
.portal-doc-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.portal-document-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; min-width:220px; }
.portal-viewer-panel { padding:18px; }
.portal-secure-frame, .portal-image-frame {
    border-radius:22px;
    border:1px solid #d6e1ef;
    background:linear-gradient(180deg,#f8fbff 0%,#eef4f9 100%);
    padding:14px;
}
.portal-pdf-frame { height:calc(100vh - 270px); min-height:650px; border-radius:16px; }
.portal-image-frame .viewer-image { border-radius:16px; }
@media (max-width: 940px) {
    .premium-customer-header { height:auto; padding:16px; flex-direction:column; align-items:flex-start; }
    .premium-customer-content { padding:20px 16px 32px; }
    .portal-hero-card, .portal-document-hero, .portal-command-card { flex-direction:column; align-items:stretch; }
    .portal-hero-card h1, .portal-document-hero h1 { font-size:32px; }
    .portal-hero-metrics, .portal-document-actions { justify-content:flex-start; }
    .portal-security-note { text-align:left; }
    .premium-customer-workspace { grid-template-columns:1fr; padding:16px; }
    .portal-pdf-frame { min-height:520px; height:calc(100vh - 330px); }
}
@media (max-width: 560px) {
    .portal-user-chip small { max-width:160px; }
    .portal-hero-metrics { width:100%; }
    .portal-metric { flex:1; }
    .portal-document-actions .btn, .portal-document-actions button { width:100%; text-align:center; }
}


/* V29.1 Document viewer security hotfix */
.secure-document-viewer-root,
.secure-pdf-frame-wrap,
.secure-media-viewer {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.protected-doc-frame,
.protected-viewer-image {
    user-select: none;
    -webkit-user-drag: none;
}

.secure-pdf-frame-wrap .protected-doc-frame,
.secure-media-viewer .protected-viewer-image {
    pointer-events: none !important;
}

.viewer-doc-shield,
.viewer-interaction-shield {
    position: absolute;
    inset: 0;
    z-index: 35;
    background: transparent;
    pointer-events: auto;
    cursor: default;
}

/* keep watermarks above content but below the interaction shield */
.watermark-overlay,
.watermark-image-overlay {
    z-index: 20;
}

.viewer-surface {
    overflow: auto;
}

@media print {
    .secure-document-viewer-root {
        display: none !important;
    }
}


/* V29.2 PDF viewer fix:
   - Replaces browser PDF iframe behavior with page-image viewer
   - Right-click blocked by page-level shields
   - Scroll remains available on the normal page/container */
.secure-document-viewer-root {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.secure-viewer-panel {
    overflow: visible;
}

.portal-pdf-image-viewer {
    position: relative;
    max-height: calc(100vh - 230px);
    min-height: 640px;
    overflow-y: auto;
    overflow-x: auto;
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
    border: 1px solid #dbe7f3;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65);
}

.portal-pdf-page {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 24px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(8,26,51,0.12);
    overflow: hidden;
}

.protected-pdf-page-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.page-interaction-shield {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: transparent;
    pointer-events: auto;
    cursor: default;
}

.pdf-page-number {
    position: absolute;
    right: 14px;
    bottom: 12px;
    z-index: 45;
    background: rgba(8,26,51,0.78);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
}

.portal-pdf-page .watermark-overlay,
.portal-pdf-page .watermark-image-overlay {
    z-index: 25;
    pointer-events: none;
}

.portal-pdf-page .watermark-overlay {
    opacity: 0.13;
}

.secure-pdf-frame-wrap .protected-doc-frame,
.protected-doc-frame {
    pointer-events: auto !important;
}

.viewer-doc-shield {
    display: none !important;
}

@media print {
    .secure-document-viewer-root {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .portal-pdf-image-viewer {
        max-height: calc(100vh - 260px);
        min-height: 520px;
        padding: 14px;
    }
}


/* V31 recycle bin and controlled delete */
.danger-menu-action {
    color: #ffb4b4 !important;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.inline-delete-form {
    display: inline;
    margin-left: 10px;
}

.link-danger-button {
    border: 0;
    background: transparent;
    color: #cf2e2e;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.link-danger-button:hover {
    text-decoration: underline;
}

.danger-button {
    background: linear-gradient(135deg, #b42318, #d92d20) !important;
    color: #ffffff !important;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(217,45,32,0.24);
}

.mini-action-button {
    border: 1px solid #cfe0f2;
    background: #f6fbff;
    color: #0c2c4d;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    cursor: pointer;
}

.recycle-summary-grid {
    margin-bottom: 20px;
}

.security-note-panel {
    border: 1px solid #dbe7f3;
    background: linear-gradient(135deg, #f8fbff, #eef6ff);
    border-radius: 18px;
    padding: 18px 20px;
    margin-top: 20px;
    color: #19324d;
}

.security-note-panel strong {
    display: block;
    margin-bottom: 6px;
    color: #0a2540;
}


/* V34 global security baseline */
.security-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.security-kpi-grid.compact {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
}
.security-kpi-card {
    border: 1px solid #dbe7f3;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(135deg, #ffffff, #f5f9ff);
    box-shadow: 0 14px 32px rgba(8,26,51,0.08);
}
.security-kpi-card span {
    display: block;
    color: #61738a;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.security-kpi-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    color: #0a2540;
}
.security-kpi-card.warning {
    border-color: #ffd58a;
    background: linear-gradient(135deg, #fffaf0, #ffffff);
}
.security-kpi-card.danger {
    border-color: #ffb4aa;
    background: linear-gradient(135deg, #fff5f3, #ffffff);
}
.security-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.security-readiness-list {
    display: grid;
    gap: 12px;
}
.security-readiness-list > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #edf2f7;
    padding: 10px 0;
}
.security-readiness-list span {
    color: #61738a;
    font-weight: 700;
}
.security-readiness-list strong.ok {
    color: #0f7b44;
}
.security-readiness-list strong.warn {
    color: #b54708;
}
.status-pill.failure,
.status-pill.failed,
.status-pill.blocked {
    background: #fee4e2;
    color: #b42318;
}
.status-pill.success {
    background: #dcfae6;
    color: #067647;
}
.sop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.sop-card {
    border: 1px solid #dbe7f3;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 14px 32px rgba(8,26,51,0.08);
}
.sop-card h2 {
    margin-top: 0;
    color: #0a2540;
}
.sop-card p,
.sop-card li {
    color: #52667c;
    line-height: 1.6;
}
.sop-card code {
    display: block;
    background: #0a2540;
    color: #e6f2ff;
    padding: 12px;
    border-radius: 12px;
    font-size: 12px;
    overflow-x: auto;
}
.security-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.security-checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fbff;
    border: 1px solid #dbe7f3;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    color: #19324d;
}
@media (max-width: 1100px) {
    .security-kpi-grid,
    .security-kpi-grid.compact,
    .security-two-column,
    .sop-grid,
    .security-checklist {
        grid-template-columns: 1fr;
    }
}


/* V36 customer user delete */
.inline-delete-form {
    display: inline-block;
    margin-left: 10px;
}
.link-danger-button {
    border: 0;
    background: transparent;
    color: #c1121f;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}
.link-danger-button:hover {
    text-decoration: underline;
}
.status-pill.danger {
    background: #fee4e2;
    color: #b42318;
}


/* V36.1 visible customer user delete button */
.customer-user-delete-form {
    display: block !important;
    margin-top: 10px !important;
    margin-left: 0 !important;
}

.btn-delete-user {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 86px !important;
    min-height: 38px !important;
    padding: 9px 15px !important;
    border-radius: 12px !important;
    border: 1px solid #f6b2ad !important;
    background: #fee4e2 !important;
    color: #b42318 !important;
    font-weight: 900 !important;
    font-size: 15px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 18px rgba(180, 35, 24, 0.10) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.btn-delete-user:hover {
    background: #fecdca !important;
    color: #912018 !important;
}


/* V36.2 customer users page fix */
.customer-user-actions {
    min-width: 190px;
}
.customer-user-actions > a {
    display: inline-flex;
    margin: 4px 6px 4px 0;
}
.customer-user-delete-form {
    display: block !important;
    margin: 8px 0 0 0 !important;
}
.btn-delete-user {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 86px !important;
    min-height: 38px !important;
    padding: 9px 15px !important;
    border-radius: 12px !important;
    border: 1px solid #f6b2ad !important;
    background: #fee4e2 !important;
    color: #b42318 !important;
    font-weight: 900 !important;
    font-size: 15px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 18px rgba(180, 35, 24, 0.10) !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.btn-delete-user:hover {
    background: #fecdca !important;
    color: #912018 !important;
}


/* V36.4 customer delete */
.customer-delete-form {
    display: inline-block !important;
    margin: 4px 0 4px 8px !important;
}
.btn-delete-customer {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 78px !important;
    min-height: 38px !important;
    padding: 9px 14px !important;
    border-radius: 12px !important;
    border: 1px solid #f6b2ad !important;
    background: #fee4e2 !important;
    color: #b42318 !important;
    font-weight: 900 !important;
    font-size: 15px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 18px rgba(180, 35, 24, 0.10) !important;
}
.btn-delete-customer:hover {
    background: #fecdca !important;
    color: #912018 !important;
}
.status-pill.danger {
    background: #fee4e2;
    color: #b42318;
}


/* V37 backup restore dashboard */
.backup-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.backup-kpi-card {
    border: 1px solid #dbe7f3;
    border-radius: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, #f6faff);
    box-shadow: 0 14px 32px rgba(8,26,51,0.08);
}
.backup-kpi-card span {
    display: block;
    color: #61738a;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.backup-kpi-card strong {
    display: block;
    margin-top: 8px;
    color: #0a2540;
    font-size: 28px;
}
.backup-kpi-card small {
    display: block;
    margin-top: 8px;
    color: #52667c;
    line-height: 1.4;
    word-break: break-all;
}
.backup-kpi-card.ok {
    border-color: #a6f4c5;
    background: linear-gradient(135deg, #f0fff7, #ffffff);
}
.backup-kpi-card.warning {
    border-color: #ffd58a;
    background: linear-gradient(135deg, #fffaf0, #ffffff);
}
.backup-kpi-card.danger {
    border-color: #ffb4aa;
    background: linear-gradient(135deg, #fff5f3, #ffffff);
}
.backup-scope-grid {
    display: grid;
    gap: 12px;
}
.backup-scope-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #edf2f7;
    padding: 10px 0;
}
.backup-scope-grid span {
    color: #61738a;
    font-weight: 800;
}
.backup-scope-grid strong {
    color: #0a2540;
    word-break: break-all;
    text-align: right;
}
.restore-steps {
    display: grid;
    gap: 14px;
}
.restore-steps > div {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 14px;
    align-items: start;
    background: #f8fbff;
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    padding: 14px;
}
.restore-steps strong {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    background: #174ea6;
    color: #ffffff;
    font-size: 18px;
}
.restore-steps p {
    margin: 0;
    color: #40566f;
    line-height: 1.6;
}
.restore-steps code {
    background: #eaf2ff;
    color: #0a2540;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 800;
}
.danger-note {
    border-color: #ffb4aa !important;
    background: linear-gradient(135deg, #fff5f3, #ffffff) !important;
}
@media (max-width: 1000px) {
    .backup-kpi-grid {
        grid-template-columns: 1fr;
    }
}


/* V38 Google Drive backup */
.google-drive-status-grid strong.ok {
    color: #067647;
}
.google-drive-status-grid strong.warning {
    color: #b54708;
}
.google-drive-status-grid strong.danger {
    color: #b42318;
}
.google-drive-status-grid code,
.management-panel code {
    background: #eaf2ff;
    color: #0a2540;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 800;
}


/* V38.1 rclone backup */
.google-drive-status-grid strong.ok { color: #067647; }
.google-drive-status-grid strong.warning { color: #b54708; }
.google-drive-status-grid strong.danger { color: #b42318; }
.google-drive-status-grid code,
.management-panel code {
    background: #eaf2ff;
    color: #0a2540;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 800;
}


/* V38.2 automated local backup scheduler */
.local-backup-status-grid strong.ok,
.backup-kpi-card strong.ok {
    color: #067647;
}
.local-backup-status-grid strong.warning,
.backup-kpi-card strong.warning {
    color: #b54708;
}
.local-backup-status-grid strong.danger,
.backup-kpi-card strong.danger {
    color: #b42318;
}
.local-backup-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 18px;
}
.local-backup-form .form-check-row,
.local-backup-form .backup-scope-options,
.local-backup-form .wide-actions {
    grid-column: 1 / -1;
}
.backup-scope-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    background: #f8fbff;
}
.backup-scope-options label,
.form-check-row label {
    font-weight: 800;
    color: #0a2540;
}
.header-actions form {
    display: inline-block;
}
@media (max-width: 900px) {
    .local-backup-form,
    .backup-scope-options {
        grid-template-columns: 1fr;
    }
}


/* V39 security monitor activity reports */
.v39-report-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}
.v39-report-card-grid.compact {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}
.v39-report-card {
    display: block;
    text-decoration: none;
    border: 1px solid #dbe7f3;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(135deg, #ffffff, #f7fbff);
    color: #0a2540;
    box-shadow: 0 12px 28px rgba(8,26,51,0.07);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.v39-report-card:hover {
    transform: translateY(-2px);
    border-color: #9dc2f7;
    box-shadow: 0 18px 34px rgba(8,26,51,0.11);
}
.v39-report-card span {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #eaf2ff;
    margin-bottom: 12px;
    font-size: 22px;
}
.v39-report-card strong {
    display: block;
    font-size: 17px;
    font-weight: 900;
    margin-bottom: 6px;
}
.v39-report-card small {
    display: block;
    color: #5d7188;
    line-height: 1.45;
}
.v39-report-table-wrap {
    max-height: 720px;
    overflow: auto;
}
.v39-report-table {
    min-width: 1100px;
}
.v39-report-table td {
    vertical-align: top;
    max-width: 340px;
    word-break: break-word;
}
.v39-report-filter .filter-grid {
    align-items: end;
}
.metric-card.danger-soft {
    border-color: #ffb4aa;
    background: linear-gradient(135deg, #fff5f3, #ffffff);
}
.metric-card.warning-soft {
    border-color: #ffd58a;
    background: linear-gradient(135deg, #fffaf0, #ffffff);
}
@media (max-width: 1200px) {
    .v39-report-card-grid,
    .v39-report-card-grid.compact {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}
@media (max-width: 720px) {
    .v39-report-card-grid,
    .v39-report-card-grid.compact {
        grid-template-columns: 1fr;
    }
}
