/* ==========================================================================
   Admin panel
   Compact page header, a horizontal tab bar instead of a sidebar, a wider
   page for tables, the admin profile and the admin settings page. Every rule
   is scoped to .dashboard-section.is-admin so the company and job seeker
   dashboards keep their own look. This file is loaded last, so it only needs
   !important where an earlier sheet used it.
   ========================================================================== */

.section.dashboard-section.is-admin {
    padding-top: 28px !important;
}

/* modern-refresh.css caps .wrap at 1240px with !important. Admin pages are
   mostly tables, so they get the width of the screen up to 1600px. */
.dashboard-section.is-admin > .wrap {
    max-width: 1600px !important;
}

@media (min-width: 768px) {
    .dashboard-section.is-admin > .wrap {
        padding-left: 28px;
        padding-right: 28px;
    }
}

/* No sidebar column: the content uses the full row. */
.dashboard-section.is-admin .dash-layout,
.dashboard-section.is-admin .dash-layout.is-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
}

/* ---- Page header ------------------------------------------------------- */

.is-admin .admin-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin: 0 0 18px;
}

.is-admin .admin-head-text {
    min-width: 0;
}

.is-admin .admin-head-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #2d51a8;
}

.is-admin .admin-head-title {
    margin: 4px 0 6px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 900;
    color: #0d1330;
}

.is-admin .admin-head-sub {
    margin: 0;
    max-width: 640px;
    font-size: 15px;
    line-height: 1.55;
    color: #5b6b85;
}

.is-admin .admin-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

[dir="rtl"] .is-admin .admin-head-eyebrow {
    letter-spacing: 0;
}

/* ---- Tab bar ----------------------------------------------------------- */

.is-admin .admin-tabs {
    margin: 0 0 18px;
    border: 1px solid #dbe5f3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

/* Tabs wrap onto a second line rather than hiding off the edge, so every
   section stays visible on desktop. Phones scroll instead (see below). */
.is-admin .admin-tabs-track {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.is-admin .admin-tabs-track::-webkit-scrollbar {
    display: none;
}

.is-admin .admin-tabs-group {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}

/* A thin divider marks where Workspace, Hiring, Platform and Account meet. */
.is-admin .admin-tabs-group + .admin-tabs-group {
    margin-inline-start: 4px;
    padding-inline-start: 8px;
    border-inline-start: 1px solid #e3eaf5;
}

.is-admin .admin-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.is-admin .admin-tab:hover {
    background: #f1f5fd;
    color: #24448c;
}

.is-admin .admin-tab:focus-visible {
    outline: 2px solid #2d51a8;
    outline-offset: 1px;
}

.is-admin .admin-tab .side-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: #64748b;
}

.is-admin .admin-tab.is-active {
    background: #e6eefb;
    color: #1e3a8a;
}

.is-admin .admin-tab.is-active .side-icon,
.is-admin .admin-tab:hover .side-icon {
    color: #24448c;
}

.is-admin .admin-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e0e8f7;
    color: #24448c;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.is-admin .admin-tab-badge.is-alert {
    background: #fde2e2;
    color: #b42318;
}

.is-admin .admin-tab.is-active .admin-tab-badge {
    background: #fff;
}

/* "Post a Job" and "Job Posts" shared one briefcase icon; post is now a plus. */
.is-admin .side-icon-post-job:before {
    width: 17px;
    height: 17px;
    bottom: auto;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.is-admin .side-icon-post-job:after {
    width: 9px;
    height: 9px;
    top: auto;
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(currentColor, currentColor) center / 9px 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 2px 9px no-repeat;
}

/* Laptop screens: the icons go, so all eleven tabs still fit on one line. */
@media (max-width: 1440px) {
    .is-admin .admin-tab {
        padding: 8px 10px;
        font-size: 13px;
    }

    .is-admin .admin-tab .side-icon {
        display: none;
    }

    .is-admin .admin-tabs-group + .admin-tabs-group {
        margin-inline-start: 2px;
        padding-inline-start: 6px;
    }
}

/* Phones: one row that scrolls sideways, with the current tab brought into
   view by dashboard-charts.js, instead of several stacked rows of tabs. */
@media (max-width: 767px) {
    .is-admin .admin-tabs-track {
        flex-wrap: nowrap;
    }
}

/* ---- Profile ----------------------------------------------------------- */

.is-admin .admin-profile {
    display: grid;
    gap: 18px;
}

.is-admin .admin-profile-hero {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px 22px;
    padding: 22px 24px;
    border: 1px solid #dbe5f3;
    border-radius: 18px;
    background: linear-gradient(135deg, #f6f9ff, #edf3fc);
}

.is-admin .profile-photo.admin-profile-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 34px;
    font-weight: 900;
    box-shadow: 0 0 0 4px #fff, 0 8px 22px rgba(36, 68, 140, .16);
}

.is-admin .admin-profile-id {
    flex: 1 1 260px;
    min-width: 0;
}

.is-admin .admin-profile-id h3 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.2;
}

.is-admin .admin-profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.is-admin .admin-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: #e0e8f7;
    color: #24448c;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.is-admin .admin-pill.is-active {
    background: #dcfce7;
    color: #166534;
}

.is-admin .admin-pill.is-active:before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.is-admin .admin-pill.is-blocked {
    background: #fde2e2;
    color: #b42318;
}

.is-admin .admin-profile-since {
    font-size: 13px;
    color: #6b7a93;
}

.is-admin .admin-profile-contact {
    margin: 10px 0 0;
    font-size: 14px;
    color: #5b6b85;
    overflow-wrap: anywhere;
}

.is-admin .admin-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.is-admin .admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.is-admin .admin-stat {
    display: grid;
    align-content: start;
    gap: 3px;
    padding: 16px 18px;
    border: 1px solid #dbe5f3;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.is-admin .admin-stat:hover,
.is-admin .admin-stat:focus-visible {
    border-color: #9db5e6;
    box-shadow: 0 8px 20px rgba(36, 68, 140, .09);
    transform: translateY(-1px);
}

.is-admin .admin-stat-value {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
    color: #0d1330;
}

.is-admin .admin-stat.is-alert .admin-stat-value {
    color: #c2410c;
}

.is-admin .admin-stat-label {
    font-size: 14px;
    font-weight: 800;
    color: #24448c;
}

.is-admin .admin-stat-hint {
    font-size: 12px;
    color: #6b7a93;
}

.is-admin .admin-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.is-admin .admin-card {
    padding: 18px 20px;
    border: 1px solid #dbe5f3;
    border-radius: 16px;
    background: #fff;
}

.is-admin .admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.is-admin .admin-card-head h4 {
    margin: 0;
    font-size: 16px;
}

.is-admin .admin-card-head a {
    font-size: 13px;
    font-weight: 800;
}

.is-admin .admin-details {
    display: grid;
    margin: 0;
}

.is-admin .admin-details > div {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid #eef2f8;
}

.is-admin .admin-details > div:first-child {
    border-top: 0;
}

.is-admin .admin-details dt {
    font-size: 13px;
    font-weight: 700;
    color: #6b7a93;
}

.is-admin .admin-details dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0d1330;
    overflow-wrap: anywhere;
}

.is-admin .admin-details dd.is-empty {
    font-weight: 600;
    color: #98a2b3;
}

.is-admin .admin-activity {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.is-admin .admin-activity li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 11px 0;
    border-top: 1px solid #eef2f8;
}

.is-admin .admin-activity li:first-child {
    border-top: 0;
}

.is-admin .admin-activity strong {
    font-size: 14px;
}

.is-admin .admin-activity time {
    font-size: 12px;
    color: #8a97ad;
    white-space: nowrap;
}

.is-admin .admin-activity span {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #5b6b85;
    overflow-wrap: anywhere;
}

.is-admin .admin-empty {
    margin: 4px 0 0;
    padding: 18px;
    border: 1px dashed #cfdbee;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    color: #6b7a93;
    text-align: center;
}

/* ---- Settings ---------------------------------------------------------- */

.is-admin .settings-section-head {
    grid-column: 1 / -1;
    column-span: all;
    margin: 0;
}

.is-admin .settings-section-head:not(:first-child) {
    margin-top: 14px;
}

.is-admin .settings-section-head h3 {
    margin: 0;
    font-size: 18px;
}

.is-admin .settings-section-head p {
    margin: 4px 0 0;
    font-size: 14px;
    color: #5b6b85;
}

.is-admin .settings-photo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 8px;
    font-weight: 600;
}

.is-admin .profile-photo.settings-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 22px;
    font-weight: 900;
}

.is-admin .settings-card input[type="file"]::file-selector-button {
    margin-inline-end: 12px;
    padding: 7px 14px;
    border: 1px solid #c9d7f0;
    border-radius: 8px;
    background: #f1f5fd;
    color: #24448c;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.is-admin .settings-choices {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.is-admin .settings-choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #dbe5f3;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.is-admin .settings-choice:hover {
    border-color: #9db5e6;
}

.is-admin .settings-choice:has(input:checked) {
    border-color: #2d51a8;
    background: #f1f5fd;
    box-shadow: inset 0 0 0 1px #2d51a8;
}

.is-admin .settings-choice input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #2d51a8;
}

.is-admin .settings-choice-text {
    display: grid;
    gap: 2px;
}

.is-admin .settings-choice-text strong {
    font-size: 14px;
}

.is-admin .settings-choice-text span {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #5b6b85;
}

.is-admin .settings-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #6b7a93;
}

.is-admin .settings-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 14px;
    font-weight: 700;
}

.is-admin .settings-status.is-done {
    background: #ecfdf3;
    color: #166534;
}

.is-admin .settings-status.is-done:before {
    content: "";
    width: 7px;
    height: 12px;
    margin: -3px 2px 0 2px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ---- Smaller screens --------------------------------------------------- */

@media (max-width: 1024px) {
    .is-admin .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .is-admin .admin-profile-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .is-admin .admin-head-title {
        font-size: 24px;
    }

    .is-admin .admin-profile-hero {
        padding: 18px;
    }

    .is-admin .admin-details > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }
}

/* ---- Dark theme -------------------------------------------------------- */

body.theme-dark .is-admin .admin-head-eyebrow {
    color: #93b4e9;
}

body.theme-dark .is-admin .admin-head-title,
body.theme-dark .is-admin .admin-stat-value,
body.theme-dark .is-admin .admin-details dd,
body.theme-dark .is-admin .admin-profile-id h3,
body.theme-dark .is-admin .admin-card-head h4 {
    color: #e5e7eb;
}

body.theme-dark .is-admin .admin-head-sub,
body.theme-dark .is-admin .admin-profile-contact,
body.theme-dark .is-admin .admin-activity span,
body.theme-dark .is-admin .settings-section-head p,
body.theme-dark .is-admin .settings-choice-text span {
    color: #a7b4cc;
}

body.theme-dark .is-admin .admin-tabs {
    border-color: #2a3a70;
    background: #0d1330;
    box-shadow: none;
}

body.theme-dark .is-admin .admin-tabs-group + .admin-tabs-group {
    border-color: #1f2c5c;
}

body.theme-dark .is-admin .admin-tab {
    color: #cbd5e1;
}

body.theme-dark .is-admin .admin-tab .side-icon {
    color: #94a3b8;
}

body.theme-dark .is-admin .admin-tab:hover {
    background: #152249;
    color: #e5e7eb;
}

body.theme-dark .is-admin .admin-tab.is-active {
    background: #1d2d63;
    color: #fff;
}

body.theme-dark .is-admin .admin-tab.is-active .side-icon,
body.theme-dark .is-admin .admin-tab:hover .side-icon {
    color: #bcd2f2;
}

body.theme-dark .is-admin .admin-tab-badge {
    background: #1f2c5c;
    color: #bcd2f2;
}

body.theme-dark .is-admin .admin-tab-badge.is-alert {
    background: #4a1d24;
    color: #fecaca;
}

body.theme-dark .is-admin .admin-tab.is-active .admin-tab-badge {
    background: #0d1330;
}

body.theme-dark .is-admin .admin-profile-hero {
    border-color: #2a3a70;
    background: linear-gradient(135deg, #111b42, #0d1330);
}

body.theme-dark .is-admin .profile-photo.admin-profile-photo {
    box-shadow: 0 0 0 4px #0d1330, 0 8px 22px rgba(0, 0, 0, .35);
}

body.theme-dark .is-admin .admin-stat,
body.theme-dark .is-admin .admin-card,
body.theme-dark .is-admin .settings-choice {
    border-color: #2a3a70;
    background: #0d1330;
}

body.theme-dark .is-admin .admin-stat-label {
    color: #93b4e9;
}

body.theme-dark .is-admin .admin-details > div,
body.theme-dark .is-admin .admin-activity li {
    border-color: #1f2c5c;
}

body.theme-dark .is-admin .admin-details dd.is-empty {
    color: #7384a6 !important;
}

body.theme-dark .is-admin .admin-pill {
    background: #1f2c5c;
    color: #bcd2f2;
}

body.theme-dark .is-admin .settings-choice:has(input:checked) {
    border-color: #6f93dd;
    background: #152151;
    box-shadow: inset 0 0 0 1px #6f93dd;
}

body.theme-dark .is-admin .settings-card input[type="file"]::file-selector-button {
    border-color: #2a3a70;
    background: #152151;
    color: #bcd2f2;
}

body.theme-dark .is-admin .settings-status {
    background: #3a2410;
    color: #fed7aa;
}

body.theme-dark .is-admin .settings-status.is-done {
    background: #0f2e1d;
    color: #bbf7d0;
}

body.theme-dark .is-admin .admin-empty {
    border-color: #2a3a70;
    color: #a7b4cc;
}
