/* ==========================================================================
   Admin Shell Layout — Clean Enterprise Light Sidebar + White Topbar
   ========================================================================== */
.admin-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background: var(--ui-bg);
    font-family: var(--ui-font-sans);
    font-size: 14px;
}

/* ── Sidebar (eTechbank Deep Navy Brand Theme — Responsive v3.0) ── */
.admin-sidebar {
    position: relative;
    width: 272px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #091a33 0%, #0d2547 56%, #102e56 100%);
    color: rgba(241, 245, 249, 0.92);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    z-index: var(--ui-z-sidebar);
    transition: width .2s cubic-bezier(.22, 1, .36, 1), transform .24s cubic-bezier(.22, 1, .36, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 24px rgba(7, 21, 41, 0.14);
}

.admin-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 12% 0%, rgba(245, 166, 35, 0.12) 0%, transparent 45%),
                radial-gradient(circle at 90% 100%, rgba(56, 189, 248, 0.1) 0%, transparent 48%);
    pointer-events: none;
}

.admin-sidebar-head {
    position: relative;
    z-index: 1;
    height: var(--ui-topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-layout .admin-sidebar a.admin-sidebar-brand {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0;
    border-bottom: 0;
    text-decoration: none;
    color: #ffffff;
    overflow: hidden;
}

.admin-brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 5px;
}

.admin-brand-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.admin-brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.admin-brand-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-brand-sub {
    color: #fbbf24;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.admin-sidebar-close-btn {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color .15s ease;
}

.admin-sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.admin-sidebar-nav {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.admin-sidebar-nav::-webkit-scrollbar { width: 5px; }
.admin-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 999px; }
.admin-sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .34); }
.admin-sidebar-nav::-webkit-scrollbar-track { background: transparent; }

.admin-sidebar-foot {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11.5px;
    color: rgba(148, 163, 184, 0.88);
    white-space: nowrap;
    overflow: hidden;
}

.admin-sidebar-foot__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
    flex-shrink: 0;
}

/* Navigation sections & tree hierarchy */
.sidebar-section { margin: 2px 0; }
.sidebar-section + .sidebar-section { margin-top: 4px; }
.sidebar-items {
    margin: 3px 0 6px 20px;
    padding-left: 10px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.14);
}
.sidebar-items.collapsed { display: none; }
.admin-sidebar.searching .sidebar-items.collapsed { display: block; }

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 39px;
    padding: 8px 11px;
    border-radius: 10px;
    color: rgba(241, 245, 249, 0.9);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-group-header > .rzi:first-child {
    color: rgba(148, 163, 184, 0.92);
    transition: color .15s ease;
}

.sidebar-group-header:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-group-header:hover > .rzi:first-child {
    color: #7dd3fc;
}

.sidebar-group-header.active-group {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.12);
}

.sidebar-group-header.active-group > .rzi:first-child {
    color: #38bdf8;
}

.sidebar-group-header .sidebar-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-group-header .chevron {
    transition: transform .16s ease, color .15s ease;
    font-size: 1rem !important;
    color: rgba(148, 163, 184, 0.72);
    flex-shrink: 0;
    width: 18px !important;
}

.sidebar-group-header.expanded .chevron {
    transform: rotate(90deg);
    color: #7dd3fc;
}

.admin-layout .admin-sidebar a.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 37px;
    padding: 7px 11px;
    margin: 2px 0;
    border-radius: 9px;
    color: rgba(203, 213, 225, 0.88);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    width: 100%;
    transition: background-color .15s ease, color .15s ease;
}

.admin-layout .admin-sidebar a.sidebar-link.top-level {
    min-height: 40px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 6px;
}

.admin-layout .admin-sidebar a.sidebar-link > .rzi {
    color: rgba(148, 163, 184, 0.86);
    transition: color .15s ease;
}

.admin-layout .admin-sidebar a.sidebar-link .sidebar-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-layout .admin-sidebar a.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.admin-layout .admin-sidebar a.sidebar-link:hover > .rzi {
    color: #7dd3fc;
}

.admin-layout .admin-sidebar a.sidebar-link.active {
    background: linear-gradient(90deg, rgba(33, 95, 157, 0.62) 0%, rgba(56, 189, 248, 0.2) 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.2);
}

.admin-layout .admin-sidebar a.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: #f5a623;
}

.admin-layout .admin-sidebar a.sidebar-link.active > .rzi {
    color: #fbbf24;
}

.admin-sidebar .rzi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
    overflow: hidden;
}

/* Desktop collapsed sidebar */
body.admin-sidebar-collapsed .admin-sidebar {
    width: var(--ui-sidebar-collapsed-w);
}

body.admin-sidebar-collapsed .admin-sidebar-head {
    justify-content: center;
    padding: 0;
}

body.admin-sidebar-collapsed .admin-sidebar-brand {
    justify-content: center;
}

body.admin-sidebar-collapsed .admin-brand-info,
body.admin-sidebar-collapsed .sidebar-text,
body.admin-sidebar-collapsed .sidebar-group-header .chevron,
body.admin-sidebar-collapsed .sidebar-items,
body.admin-sidebar-collapsed .admin-sidebar-foot__text {
    display: none;
}

body.admin-sidebar-collapsed .admin-sidebar-foot {
    justify-content: center;
    padding: 12px 0;
}

body.admin-sidebar-collapsed .admin-layout .admin-sidebar a.sidebar-link,
body.admin-sidebar-collapsed .sidebar-group-header {
    justify-content: center;
    padding: 9px 0;
}

body.admin-sidebar-collapsed .admin-layout .admin-sidebar a.sidebar-link.active::before {
    display: none;
}

/* Mobile backdrop (hidden on desktop) */
.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 21, 41, .56);
    backdrop-filter: blur(3px);
    z-index: var(--ui-z-backdrop);
}

/* ── Workspace Column (Topbar + Main Content) ── */
.admin-workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Topbar (Crisp White Enterprise Header) ── */
.admin-topbar {
    height: var(--ui-topbar-h);
    flex-shrink: 0;
    background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 0 12px;
    z-index: var(--ui-z-topbar);
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.admin-sidebar-toggle-btn {
    border: 0;
    background: transparent;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ui-radius);
    color: var(--ui-text-secondary);
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease;
}

.admin-sidebar-toggle-btn:hover {
    background: var(--ui-surface-subtle);
    color: var(--ui-text);
}

.admin-sidebar-toggle-btn .rzi {
    font-size: 1.3rem;
}

.admin-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 320px;
    max-width: 100%;
    height: 38px;
    padding: 0 10px 0 12px;
    border-radius: var(--ui-radius);
    background: var(--ui-surface-subtle);
    border: 1px solid var(--ui-border);
    color: var(--ui-text-muted);
    transition: border-color .14s ease, background-color .14s ease;
}

.admin-search:focus-within {
    background: var(--ui-surface);
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px rgba(var(--ui-primary-rgb), .12);
}

.admin-search .rzi {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.admin-search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: none !important;
    color: var(--ui-text);
    font-size: 13.5px;
}

.admin-search input::placeholder {
    color: var(--ui-placeholder);
}

.admin-search-hint {
    font-size: 11px;
    color: var(--ui-text-muted);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.admin-topbar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    color: var(--ui-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.admin-topbar-action .rzi { font-size: 1.1rem; }

.admin-topbar-action:hover {
    background: var(--ui-surface-subtle);
    border-color: var(--ui-border-strong);
    color: var(--ui-text);
}

.admin-topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--ui-radius);
    color: var(--ui-text-secondary);
    text-decoration: none;
    position: relative;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease;
}

.admin-topbar-icon-btn:hover {
    background: var(--ui-surface-subtle);
    color: var(--ui-text);
}

.admin-topbar-icon-btn .rzi {
    font-size: 1.25rem;
    color: inherit;
}

.admin-topbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--ui-danger);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
}

/* ── Topbar Dropdowns (Notification & User) ── */
.admin-dd-wrap {
    position: relative;
}

.admin-dd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.admin-dd-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: var(--ui-z-dropdown);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-popover);
    color: var(--ui-text);
}

/* User Trigger & Menu */
.admin-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    background: transparent;
    padding: 4px 8px 4px 5px;
    border-radius: var(--ui-radius);
    cursor: pointer;
    color: var(--ui-text);
    transition: background-color .14s ease, border-color .14s ease;
}

.admin-user:hover {
    background: var(--ui-surface-subtle);
    border-color: var(--ui-border);
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    border: 1px solid rgba(var(--ui-primary-rgb), .2);
    font-weight: 600;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-user-meta {
    max-width: 150px;
    overflow: hidden;
    line-height: 1.25;
}

.admin-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ui-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-email {
    font-size: 11.5px;
    color: var(--ui-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-chevron {
    font-size: 1rem;
    color: var(--ui-text-muted);
}

.admin-user-menu {
    width: 240px;
    overflow: hidden;
}

.admin-user-menu-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ui-divider);
    background: var(--ui-surface-subtle);
}

.admin-user-menu-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ui-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-menu-email {
    font-size: 12px;
    color: var(--ui-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-menu-list {
    padding: 6px;
}

.admin-user-menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: var(--ui-radius);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13.5px;
    color: var(--ui-text-secondary);
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    transition: background-color .12s ease, color .12s ease;
}

.admin-user-menu-item:hover {
    background: var(--ui-surface-subtle);
    color: var(--ui-text);
}

.admin-user-menu-item .rzi {
    font-size: 1.1rem;
    color: var(--ui-text-muted);
}

.admin-user-menu-item.is-danger {
    color: var(--ui-danger);
}

.admin-user-menu-item.is-danger .rzi {
    color: var(--ui-danger);
}

.admin-user-menu-item.is-danger:hover {
    background: var(--ui-danger-soft);
    color: var(--ui-danger-hover);
}

.admin-user-menu-sep {
    height: 1px;
    background: var(--ui-divider);
    margin: 5px 6px;
}

/* Notification Dropdown */
.admin-notif-menu {
    width: 350px;
    max-width: calc(100vw - 24px);
    overflow: hidden;
}

.admin-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ui-divider);
}

.admin-notif-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-text);
}

.admin-notif-markall {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 12px;
    color: var(--ui-primary);
    font-weight: 500;
    cursor: pointer;
}

.admin-notif-markall:hover {
    text-decoration: underline;
}

.admin-notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.admin-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 30px 16px;
    color: var(--ui-text-muted);
    font-size: 13px;
}

.admin-notif-empty .rzi {
    font-size: 1.6rem;
    color: var(--ui-placeholder);
}

.admin-notif-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--ui-divider);
    background: var(--ui-surface);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    text-align: left;
    cursor: pointer;
}

.admin-notif-item:last-child { border-bottom: 0; }
.admin-notif-item:hover { background: var(--ui-surface-subtle); }
.admin-notif-item.is-unread { background: var(--ui-primary-soft); }
.admin-notif-item.is-unread:hover { background: #DFEEF9; }

.admin-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    background: transparent;
}

.admin-notif-item.is-unread .admin-notif-dot {
    background: var(--ui-primary);
}

.admin-notif-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.admin-notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text);
    line-height: 1.35;
}

.admin-notif-item-text {
    font-size: 12.5px;
    color: var(--ui-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.admin-notif-item-time {
    font-size: 11.5px;
    color: var(--ui-text-muted);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* ── Main Content Scroll Area ── */
.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    background: var(--ui-bg);
}
