/* =============================================================
   DocuPrime Application — Custom Stylesheet
   Covers: Admin Layout, Sidebar, Login Layout, Forms
   ============================================================= */


/* ── BASE ─────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}


/* =============================================================
   ADMIN LAYOUT
   ============================================================= */

.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */

.sidebar {
    width: 220px;
    min-width: 220px;
    background: #0d1b3e;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.25s ease, min-width 0.25s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 56px;
    min-width: 56px;
}

.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.55rem;
}

.sidebar.collapsed .sidebar-logo-text {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

/* Sidebar header */

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo-text {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: #fff;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.sidebar-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar navigation */

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.5rem;
    list-style: none;
    margin: 0;
}

.nav-section {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 0.75rem 0.3rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 255, 255, 0.65);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

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

.sidebar-nav .nav-link.active {
    background: rgba(21, 112, 239, 0.25);
    color: #fff;
}

.sidebar-nav .nav-link i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

/* Sidebar footer / user area */

.sidebar-footer {
    padding: 0.75rem 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1570ef;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
}

.btn-logout {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.55);
    border-radius: 5px;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ── Main content area ── */

.admin-main {
    flex: 1;
    overflow-y: auto;
    background: #f4f6f9;
    min-width: 0;
}

.admin-content {
    padding: 1.5rem 2rem;
}


/* =============================================================
   LOGIN LAYOUT
   ============================================================= */

.login-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Left panel ── */

.login-left {
    width: 40%;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    background: #fff;
    padding: 0;
}

.login-left-header {
    padding: 2rem 2.5rem 1rem;
}

.login-logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #0d1b3e;
    text-decoration: none;
}

.login-left-body {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem 2.5rem 2rem;
}

.login-left-body > div {
    width: 100%;
    max-width: 340px;
}

.login-left-footer {
    padding: 1.5rem 2.5rem;
    border-top: 1px solid #f0f0f0;
}

/* ── Right panel ── */

.login-right {
    flex: 1;
    background: linear-gradient(160deg, #839bbd 0%, #0a1d36 55%, #0a1f3d 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Star field pseudo-element */
.login-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 60%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 15%, rgba(255, 255, 255, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 45%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 80%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 25%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 15% 75%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 90%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 55%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 35% 35%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 5% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 50% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 88%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 20% 92%, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    pointer-events: none;
}

.login-right-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 560px;
}

/* Drata brand icon circles */

.drata-icon-ring {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(34, 197, 94, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.15), 0 0 80px rgba(34, 197, 94, 0.08);
}

.drata-icon-inner {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4ade80;
    font-size: 1.8rem;
}

/* Trusted company logos */

.trusted-logos {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.trusted-logo {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Mini feature icons orbiting the shield */
.login-mini-icon {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4ade80;
    font-size: 0.85rem;
}
.login-mini-icon--1 { top: -8px;  right: -8px; }
.login-mini-icon--2 { bottom: -8px; right: -8px; }
.login-mini-icon--3 { bottom: -8px; left: -8px; }

/* Framework compliance badges */
.framework-badge {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
}

/* ── Login form controls ── */

.form-control-login {
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

.form-control-login:focus {
    border-color: #1570ef;
    box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
    outline: none;
}

.btn-signin {
    background: #1570ef;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    width: 100%;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.15s;
}

.btn-signin:hover {
    background: #1054b8;
}

.btn-signin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}


/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 768px) {
    /* Admin sidebar collapses to icon-only on mobile */
    .sidebar {
        width: 56px;
        min-width: 56px;
    }

    .sidebar .sidebar-label,
    .sidebar .nav-section,
    .sidebar .user-info {
        display: none;
    }

    .sidebar .nav-link {
        justify-content: center;
        padding: 0.55rem;
    }

    .sidebar .sidebar-logo-text {
        display: none;
    }

    .sidebar .sidebar-header {
        justify-content: center;
    }

    /* Login: hide right panel on mobile */
    .login-right {
        display: none;
    }

    .login-left {
        width: 100%;
        min-width: unset;
    }
}


/* =============================================================
   ORG SELECTOR PAGE
   ============================================================= */

.org-selector-page {
    min-height: 100vh;
    background: #f0f4ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.org-selector-header {
    text-align: center;
    margin-bottom: 2rem;
}

.org-selector-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0d1b3e;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.org-selector-subtitle {
    color: #64748b;
    font-size: 0.95rem;
}

.org-selector-grid {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.org-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.org-card:hover {
    border-color: #1570ef;
    box-shadow: 0 0 0 3px #1570ef18;
}

.org-card-icon {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #1570ef;
    flex-shrink: 0;
    overflow: hidden;
}

.org-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-card-body {
    flex: 1;
}

.org-card-name {
    font-weight: 700;
    color: #0d1b3e;
    font-size: 0.95rem;
}

.org-card-arrow {
    color: #94a3b8;
    font-size: 1rem;
}

.badge-status.active   { background: #dcfce7; color: #16a34a; border-radius: 6px; padding: 0.15rem 0.5rem; font-size: 0.72rem; }
.badge-status.pending  { background: #fef9c3; color: #ca8a04; border-radius: 6px; padding: 0.15rem 0.5rem; font-size: 0.72rem; }
.badge-status.inactive { background: #f1f5f9; color: #64748b; border-radius: 6px; padding: 0.15rem 0.5rem; font-size: 0.72rem; }

.org-empty {
    text-align: center;
    padding: 3rem 0;
}

.org-selector-footer {
    margin-top: 2rem;
}


/* =============================================================
   SIDEBAR ORG CONTEXT
   ============================================================= */

.sidebar-org-context {
    padding: 0.5rem 1.2rem 0.75rem;
    border-bottom: 1px solid #ffffff14;
    margin-bottom: 0.25rem;
}

.sidebar-org-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-org-role {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 1px;
}

.sidebar.collapsed .sidebar-org-context {
    display: none;
}



/* =============================================================
   CONTROLS PAGE LAYOUT
   ============================================================= */

.controls-page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.controls-top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
}

.controls-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0d1b3e;
    margin: 0;
}

.controls-page-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.controls-main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}


/* =============================================================
   CONTROLS FILTER PANEL (left sub-sidebar)
   ============================================================= */

.controls-filter-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    height: 100%;
    /* padding: 1rem 0; */
    padding-bottom: 1rem;
}

.cfp-section-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0d1b3e;
    padding: 1rem 1rem 0.35rem;
}

.cfp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cfp-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 0.38rem 1rem;
    font-size: 0.83rem;
    color: #475569;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    border-radius: 0;
}

.cfp-item:hover {
    background: #f0f4ff;
    color: #1570ef;
}

.cfp-item.active {
    background: #eff6ff;
    color: #1570ef;
    font-weight: 600;
}
.all-controls-count {
    background: #03589f !important;
    color: #fff !important;
    font-weight: 600 !important;
    height: 42px !important;
}
.cfp-fw-icon {
    font-size: 0.82rem;
    color: #1570ef;
    flex-shrink: 0;
}

.cfp-divider {
    margin: 0.5rem 1rem;
    border: none;
    border-top: 1px solid #e2e8f0;
}


/* =============================================================
   CONTROLS HEADER
   ============================================================= */

.controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.controls-header-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: #0d1b3e;
    margin: 0;
}

.controls-header-sub {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

.btn-create-control {
    background: #1570ef;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-create-control:hover {
    background: #1258c4;
}


/* =============================================================
   CONTROLS TOOLBAR (tabs + search)
   ============================================================= */

.controls-toolbar {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
}

.controls-tabs {
    display: flex;
    flex-shrink: 0;
}

.ctrl-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.65rem 1.1rem;
    font-size: 0.83rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.ctrl-tab:hover {
    color: #0d1b3e;
    background: #f8fafc;
}

.ctrl-tab.active {
    background: #0d1b3e;
    color: #fff;
    border-bottom-color: transparent;
    font-weight: 600;
    border-radius: 4px 4px 0 0;
}

.controls-search-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 0.75rem;
    gap: 0.5rem;
    min-width: 0;
}

.controls-search-icon {
    color: #94a3b8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.controls-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.83rem;
    color: #334155;
    background: transparent;
    padding: 0.65rem 0;
    min-width: 0;
}

.controls-search-input::placeholder {
    color: #94a3b8;
}

.controls-search-settings {
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
}

.controls-search-settings:hover {
    color: #1570ef;
}


/* =============================================================
   CONTROLS BULK ACTION BAR
   ============================================================= */

.controls-bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fafafa;
    flex-shrink: 0;
}

.ctrl-select-all {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.ctrl-bulk-divider {
    width: 1px;
    height: 14px;
    background: #e2e8f0;
    margin: 0 0.35rem;
    flex-shrink: 0;
}

.ctrl-bulk-btn {
    background: none;
    border: none;
    font-size: 0.78rem;
    color: #475569;
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}

.ctrl-bulk-btn:hover:not(:disabled) {
    background: #eff6ff;
    color: #1570ef;
}

.ctrl-bulk-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* =============================================================
   CONTROLS FLAT LIST ROWS
   ============================================================= */

.controls-flat-list {
    flex: 1;
    overflow-y: auto;
}

.ctrl-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    transition: background 0.1s;
}

.ctrl-row:hover {
    background: #f8faff;
}

.ctrl-row-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-top: 0.1rem;
    flex-shrink: 0;
}

.ctrl-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.ctrl-status-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.ctrl-status-icon.status-ready {
    color: #16a34a;
}

.ctrl-status-icon.status-pending {
    color: #cbd5e1;
}

.ctrl-row-body {
    flex: 1;
    min-width: 0;
}

.ctrl-row-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

.ctrl-code {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1570ef;
    white-space: nowrap;
    flex-shrink: 0;
}

.ctrl-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #0d1b3e;
    line-height: 1.35;
}

.ctrl-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
    margin-bottom: 0.35rem;
}

.ctrl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ctrl-fw-badge {
    font-size: 0.7rem;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
    display: inline-block;
    white-space: nowrap;
}

.ctrl-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.1rem;
    flex-shrink: 0;
}

.ctrl-action-icon {
    font-size: 0.95rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.12s;
}

.ctrl-action-icon:hover {
    color: #1570ef;
}

.ctrl-action-icon.text-success {
    color: #16a34a !important;
}

.controls-pagination {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}


/* =============================================================
   SLIDE-IN DRAWER
   ============================================================= */

.control-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
}

.control-drawer.open {
    transform: translateX(0);
}

.control-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.control-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.control-drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #f8fafc;
}

.control-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
}

/* ============================================================
   FRAMEWORKS PAGES
   ============================================================ */

/* Page wrapper */
.fw-page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background: #f8fafc;
}

.fw-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0.75rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.fw-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0d1b3e;
    margin: 0;
}

/* Readiness toggle */
.fw-readiness-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.fw-toggle-btn {
    padding: 0.3rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.fw-toggle-btn.active {
    background: #1570ef;
    color: #fff;
    border-color: #1570ef;
}

.fw-toggle-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* Framework cards grid */
.fw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    padding: 1.5rem;
}

.fw-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.15s;
}

.fw-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fw-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fw-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.fw-badge-lg {
    width: 52px;
    height: 52px;
    font-size: 0.72rem;
}

.fw-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: #0d1b3e;
}

/* SVG circular gauge */
.fw-card-gauge-wrap {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}

.fw-gauge {
    width: 160px;
    height: 160px;
    display: block;
}

.fw-gauge-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 8;
}

.fw-gauge-arc {
    fill: none;
    stroke: #f59e0b;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s ease;
}

.fw-gauge-pct {
    font-size: 22px;
    font-weight: 700;
    fill: #0d1b3e;
    text-anchor: middle;
    dominant-baseline: middle;
}

.fw-gauge-label {
    font-size: 10px;
    fill: #64748b;
    text-anchor: middle;
}

.fw-gauge-sublabel {
    font-size: 9px;
    fill: #94a3b8;
    text-anchor: middle;
}

/* Card stats row */
.fw-card-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.fw-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #0d1b3e;
    text-decoration: none;
}

.fw-stat-link:hover {
    color: #1570ef;
}

.fw-stat i {
    font-size: 1rem;
    color: #64748b;
}

.fw-stat-link:hover i {
    color: #1570ef;
}

.fw-stat-num {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.2;
}

.fw-stat small,
.fw-stat div small {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
}

.fw-stat-divider {
    width: 1px;
    height: 28px;
    background: #e2e8f0;
    flex-shrink: 0;
}

/* ============================================================
   FRAMEWORK DETAIL PAGE
   ============================================================ */

.fw-detail-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.fw-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
}

.fw-detail-info {
    flex: 1;
    min-width: 0;
}

.fw-detail-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0d1b3e;
}

.fw-detail-desc {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    max-width: 520px;
}

.fw-detail-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.fw-detail-gauge-wrap {
    display: flex;
    align-items: center;
}

.fw-detail-gauge {
    width: 90px;
    height: 90px;
    display: block;
}

.fw-detail-gauge-pct {
    font-size: 14px;
    font-weight: 700;
    fill: #0d1b3e;
    text-anchor: middle;
    dominant-baseline: middle;
}

.fw-detail-gauge-label {
    font-size: 8px;
    fill: #64748b;
    text-anchor: middle;
}

.fw-stat-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 100px;
    background: #fff;
}

.fw-stat-card-danger { border-color: #fecaca; }
.fw-stat-card-success { border-color: #bbf7d0; }
.fw-stat-card-info { border-color: #bfdbfe; }

.fw-stat-card .stat-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d1b3e;
    display: block;
    margin-top: 0.25rem;
}

.fw-stat-card .stat-label {
    font-size: 0.68rem;
    color: #64748b;
    display: block;
    margin-top: 0.15rem;
}

/* Tabs bar */
.fw-detail-tabs-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.fw-detail-tabs {
    display: flex;
    gap: 0;
}

.fw-tab {
    padding: 0.75rem 1.1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 0.83rem;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.fw-tab.active {
    color: #1570ef;
    border-bottom-color: #1570ef;
    font-weight: 600;
}

.fw-tab:hover:not(.active) {
    color: #0d1b3e;
    background: #f8fafc;
}

.fw-search-wrap {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin-left: auto;
}

.fw-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.fw-search-input {
    width: 100%;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #0d1b3e;
    outline: none;
}

.fw-search-input:focus {
    border-color: #1570ef;
    box-shadow: 0 0 0 2px rgba(21,112,239,0.12);
}

/* Detail two-column layout */
.fw-detail-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.fw-detail-sidebar {
    width: 210px;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    background: #fff;
}

.fw-detail-main {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

/* Select all bar */
.fw-req-bar {
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Requirement list */
.fw-req-list {
    flex: 1;
}

.req-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.req-row:hover {
    background: #f8fafc;
}

.req-row-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.1rem;
    flex-shrink: 0;
}

.req-checkbox {
    cursor: pointer;
}

.req-row-body {
    flex: 1;
    min-width: 0;
}

.req-row-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #0d1b3e;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.req-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.req-ctrl-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.req-ctrl-badge.badge-ready {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.req-ctrl-badge.badge-pending {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* ============================================================
   FRAMEWORK DETAIL SIDEBAR (cfp-* classes)
   ============================================================ */

.cfp-section-title {
    padding: 0.85rem 1rem 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.cfp-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cfp-list li {
    padding: 0;
}

.cfp-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    color: #475569;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    border-radius: 0;
}

.cfp-item:hover {
    background: #f1f5f9;
    color: #0d1b3e;
}

.cfp-item.active {
    background: #eff6ff;
    color: #1570ef;
    font-weight: 600;
}

.cfp-fw-icon {
    font-size: 0.82rem;
    flex-shrink: 0;
    color: inherit;
}

.cfp-divider {
    margin: 0.5rem 1rem;
    border-color: #e2e8f0;
}

/* ============================================================
   POLICY CENTER PAGE
   ============================================================ */

.policies-top-header {
    padding: 1.5rem 1.5rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.policies-stats-row {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.policy-stat-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #fff;
    height: 100%;
}

.policy-stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.policy-stat-card .stat-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0d6efd;
}

.policies-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.875rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.policies-filter-bar .form-select {
    max-width: 180px;
    font-size: 0.875rem;
}

.policies-filter-bar .form-control {
    max-width: 220px;
    font-size: 0.875rem;
}

.policies-table-wrap {
    padding: 1rem 1.5rem 1.5rem;
    background: #f8fafc;
    min-height: 300px;
}

.policies-table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    border-top: none;
}

.policies-table td {
    font-size: 0.875rem;
    vertical-align: middle;
}

.policies-table .policy-name-cell {
    font-weight: 600;
    color: #0d1b3e;
}

.policies-table .sortable-th {
    cursor: pointer;
    user-select: none;
}

.policies-table .sortable-th:hover {
    color: #0d1b3e;
}

.policies-table .owner-cell .owner-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0d1b3e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.policy-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: border-color 0.2s, background 0.2s;
    min-height: 100px;
}

.policy-dropzone:hover {
    border-color: #0d1b3e;
    background: #f0f4ff;
}

.policy-section-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.policy-source-section,
.policy-upload-zone,
.policy-details-section,
.policy-personnel-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1rem;
}

.policy-replace-section {
    padding-bottom: 0.5rem;
}

/* ── Framework Select page ─────────────────────────────────────────────────── */

/* Selected card highlight */
.fws-selected {
    border-color: #1570ef !important;
    box-shadow: 0 0 0 2px rgba(21,112,239,0.15);
}

.fws-card {
    display: flex;
    flex-direction: column;
}

.fws-description {
    flex-grow: 1;
    min-height: 2.5rem;
}

/* ── Available Frameworks section (Frameworks Index page) ── */

.fws-available-section {
    margin: 1.5rem 1.5rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.fws-available-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.fws-available-header:hover {
    background: #f1f5f9;
}

.fws-chevron {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    color: #64748b;
}

.fws-available-header[aria-expanded="false"] .fws-chevron {
    transform: rotate(-90deg);
}

/* 5-column grid for available frameworks */
.fws-available-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    padding: 1.25rem;
}

.fws-avail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    background: #fafafa;
    transition: box-shadow 0.15s;
}

.fws-avail-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
}

.fws-avail-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0d1b3e;
    line-height: 1.3;
}

.fws-learn-btn {
    font-size: 0.72rem;
    padding: 0.2rem 0.65rem;
    margin-top: auto;
}

/* Smaller badge variant for available cards */
.fw-badge-sm {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.7rem !important;
    min-width: 36px !important;
}

@media (max-width: 1200px) {
    .fws-available-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .fws-available-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Bootstrap 5 Pagination Fix (Livewire 4 — all containers) ─────────── */
/* Always hide the mobile-only prev/next section */
/* nav > div.d-sm-none {
    display: none !important;
} */
/* Always show the full desktop section */
/* nav > div.d-none {
    display: flex !important;
    flex: 1;
    align-items: center;
    justify-content: space-between;
} */
/* Constrain page-link button size in case Bootstrap CDN is slow/missing */
/* .page-link {
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 0.375rem 0.75rem;
} */

/* Quill Snow editor — Bootstrap card integration */
#policy-editor-container .ql-toolbar.ql-snow {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}
#policy-editor-container .ql-container.ql-snow {
    border: none;
    font-size: 0.9rem;
}
#policy-editor-container .ql-editor {
    min-height: 500px;
    padding: 1.5rem;
}
.policy-content-view h1,
.policy-content-view h2,
.policy-content-view h3 {
    color: #0d1b3e;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.policy-content-view p {
    margin-bottom: 0.75rem;
}
.policy-content-view ul,
.policy-content-view ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}
.policy-content-view table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.policy-content-view table th,
.policy-content-view table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}
.policy-content-view table thead th {
    background: #f8f9fa;
    font-weight: 600;
}
.policy-content-view pre,
.policy-content-view code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    background: #f8f9fa;
    border-radius: 4px;
}
.policy-content-view pre {
    padding: 1rem;
    margin-bottom: 0.75rem;
    overflow-x: auto;
}
.policy-content-view code {
    padding: 0.1em 0.3em;
}

/* Policy editor — table styles */
#policy-editor-container .ql-editor table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}
#policy-editor-container .ql-editor table td,
#policy-editor-container .ql-editor table th {
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    min-width: 80px;
    vertical-align: top;
}
#policy-editor-container .ql-editor table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Policy editor — image styles */
#policy-editor-container .ql-editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5rem 0;
}

/* Policy content view — image styles */
.policy-content-view img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5rem 0;
}
