/* ================================================================
   NeutralHire Admin — Layout Variables
   ================================================================ */
:root {
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --sidebar-bg: #1a2035;
    --sidebar-brand-bg: #141c2e;
    --sidebar-text: #8892a4;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(79, 110, 247, 0.12);
    --sidebar-active-text: #6b8aff;
    --sidebar-active-border: #4f6ef7;
    --sidebar-section-color: #3d4f6b;
    --topbar-bg: #ffffff;
    --body-bg: #f4f6fa;
    --accent: #4f6ef7;
    --accent-hover: #3a5ae8;
}

/* ================================================================
   Reset / Base
   ================================================================ */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
}

/* ================================================================
   Sidebar
   ================================================================ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: transform .25s ease;
    overflow: hidden;
}

/* Brand / Logo */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.25rem;
    height: var(--topbar-height);
    background: var(--sidebar-brand-bg);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 110, 247, .35);
}

.sidebar-brand-text {
    color: #ffffff;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.2;
    letter-spacing: .01em;
}

.sidebar-brand-text span {
    display: block;
    font-size: .65rem;
    font-weight: 500;
    color: var(--sidebar-text);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: 1px;
}

/* Scrollable nav area */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .08) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .1);
    border-radius: 2px;
}

/* Section labels */
.sidebar-section {
    padding: 1rem 1.25rem .35rem;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sidebar-section-color);
}

/* Nav items */
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .855rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s ease;
    margin: 1px .5rem;
    border-radius: 7px;
    cursor: pointer;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: calc(100% - 1rem);
    text-align: left;
}

.sidebar-nav-item:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255, 255, 255, .06);
    text-decoration: none;
}

.sidebar-nav-item.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    font-weight: 600;
}

.sidebar-nav-item .nav-icon {
    font-size: 1rem;
    width: 1.125rem;
    text-align: center;
    flex-shrink: 0;
    opacity: .85;
}

.sidebar-nav-item.active .nav-icon {
    opacity: 1;
}

/* Sidebar footer — user info */
.sidebar-footer {
    padding: .875rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .05);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    color: #ffffff;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: var(--sidebar-text);
    font-size: .68rem;
    margin-top: 1px;
}

.sidebar-signout-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    padding: .3rem;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    transition: color .15s;
    flex-shrink: 0;
    font-size: 1rem;
}

.sidebar-signout-btn:hover {
    color: #fc8181;
}

/* ================================================================
   Topbar
   ================================================================ */
.admin-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid #eaecf0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1040;
    gap: .75rem;
}

.topbar-toggle {
    background: none;
    border: none;
    padding: .4rem;
    cursor: pointer;
    color: #6c757d;
    border-radius: 7px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}

.topbar-toggle:hover {
    background: #f8f9fa;
    color: #343a40;
}

.topbar-breadcrumb {
    flex: 1;
}

.topbar-breadcrumb .breadcrumb {
    margin: 0;
    font-size: .82rem;
}

.topbar-breadcrumb .breadcrumb-item a {
    color: var(--accent);
    text-decoration: none;
}

.topbar-breadcrumb .breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    cursor: pointer;
    position: relative;
    transition: background .15s, color .15s;
    text-decoration: none;
    font-size: 1rem;
}

.topbar-icon-btn:hover {
    background: #f8f9fa;
    color: #343a40;
}

.topbar-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: #e53e3e;
    border-radius: 50%;
    border: 2px solid #fff;
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: #e9ecef;
    margin: 0 .1rem;
}

/* User dropdown trigger */
.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .5rem .3rem .4rem;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: background .15s;
    color: #343a40;
}

.topbar-user-btn:hover {
    background: #f8f9fa;
}

.topbar-user-btn::after {
    display: none; /* hide Bootstrap caret — we use our own icon */
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-user-details {
    text-align: left;
    line-height: 1;
}

.topbar-user-name {
    font-size: .84rem;
    font-weight: 600;
    color: #1a2035;
    white-space: nowrap;
}

.topbar-user-role {
    font-size: .7rem;
    color: #868e96;
    margin-top: 2px;
}

/* Dropdown menu */
.topbar-dropdown {
    border: 1px solid #eaecf0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1) !important;
    border-radius: 10px !important;
    padding: .5rem !important;
    min-width: 200px;
}

.topbar-dropdown .dropdown-item {
    border-radius: 6px;
    font-size: .855rem;
    padding: .45rem .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.topbar-dropdown .dropdown-item:hover {
    background: #f8f9fa;
}

.topbar-dropdown .dropdown-item.text-danger:hover {
    background: #fff5f5;
    color: #e53e3e !important;
}

.topbar-dropdown .dropdown-divider {
    margin: .35rem 0;
}

.topbar-dropdown .dropdown-header {
    font-size: .75rem;
    color: #868e96;
    padding: .25rem .75rem;
    font-weight: 600;
}

/* ================================================================
   Main Content Area
   ================================================================ */
.admin-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    background: var(--body-bg);
    padding: 1.75rem 2rem;
}

/* Page header block */
.page-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a2035;
    margin: 0;
    letter-spacing: -.01em;
}

.page-header p {
    color: #868e96;
    font-size: .875rem;
    margin: .2rem 0 0;
}

/* Alerts */
.admin-alerts .alert {
    border-radius: 9px;
    font-size: .875rem;
}

/* Card polish */
.admin-main .card {
    border: 1px solid #eaecf0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.admin-main .card-header {
    border-bottom: 1px solid #eaecf0;
    background: #fff;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

/* Stat cards */
.stat-card {
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card-icon.blue   { background: #eff3ff; color: #4f6ef7; }
.stat-card-icon.green  { background: #f0fdf4; color: #22c55e; }
.stat-card-icon.orange { background: #fff7ed; color: #f97316; }
.stat-card-icon.purple { background: #faf5ff; color: #a855f7; }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a2035;
    line-height: 1;
}

.stat-card-label {
    font-size: .8rem;
    color: #868e96;
    margin-top: .2rem;
}

/* ================================================================
   Sidebar Mobile Overlay
   ================================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1049;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }

/* ================================================================
   Auth Layout
   ================================================================ */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand-icon {
    width: 58px;
    height: 58px;
    background: var(--accent);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: .875rem;
    box-shadow: 0 8px 32px rgba(79, 110, 247, .4);
}

.auth-brand h1 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -.01em;
}

.auth-brand p {
    color: rgba(255, 255, 255, .45);
    font-size: .82rem;
    margin: .3rem 0 0;
}

.auth-panel {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 2rem 2.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.auth-panel h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2035;
    margin: 0 0 .25rem;
}

.auth-panel .auth-subtitle {
    color: #868e96;
    font-size: .85rem;
    margin: 0 0 1.5rem;
}

.auth-panel .form-control {
    border-radius: 8px;
    border-color: #e2e8f0;
    padding: .6rem .875rem;
    font-size: .875rem;
    transition: border-color .15s, box-shadow .15s;
}

.auth-panel .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
}

.auth-panel .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    border-radius: 8px;
    padding: .65rem 1rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: background .15s, transform .1s;
}

.auth-panel .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

.auth-panel .btn-primary:active {
    transform: translateY(0);
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .admin-sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, .2);
    }

    .admin-topbar {
        left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .admin-main {
        margin-left: 0;
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .topbar-user-details {
        display: none;
    }
}
