/*
|--------------------------------------------------------------------------
| Supermarket Staff Attendance System
|--------------------------------------------------------------------------
| Premium white, black and graphite interface
| Shared by Admin, Staff and Authentication screens
|--------------------------------------------------------------------------
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --app-accent: #6c63ff;
    --app-accent-2: #23c1c9;
    --app-accent-soft: rgba(108, 99, 255, 0.10);
    --app-accent-ring: rgba(108, 99, 255, 0.16);
    --app-bg: #f5f5f7;
    --app-surface: #ffffff;
    --app-surface-soft: #f8f8fa;
    --app-surface-muted: #eeeeF1;

    --app-text: #171719;
    --app-text-secondary: #68686d;
    --app-text-muted: #929298;

    --app-border: rgba(20, 20, 22, 0.09);
    --app-border-strong: rgba(20, 20, 22, 0.16);

    --app-primary: #18181a;
    --app-primary-hover: #303034;
    --app-primary-text: #ffffff;

    --app-success: #1f7a4c;
    --app-success-bg: #eaf7f0;

    --app-warning: #9a6813;
    --app-warning-bg: #fff6df;

    --app-danger: #b3261e;
    --app-danger-bg: #fdeeee;

    --app-info: #50545c;
    --app-info-bg: #eeeef1;

    --app-radius-sm: 10px;
    --app-radius: 16px;
    --app-radius-lg: 22px;
    --app-radius-xl: 30px;

    --app-shadow-sm:
        0 1px 2px rgba(20, 20, 22, 0.04),
        0 6px 16px rgba(20, 20, 22, 0.05);

    --app-shadow:
        0 20px 48px rgba(20, 20, 22, 0.09),
        0 4px 14px rgba(20, 20, 22, 0.05);

    --app-shadow-hover:
        0 26px 56px rgba(20, 20, 22, 0.12),
        0 6px 18px rgba(20, 20, 22, 0.06);

    --app-sidebar-width: 264px;
    --app-topbar-height: 74px;

    --admin-font-page-title: 29px;
    --admin-font-section-title: 17px;
    --admin-font-body: 14px;
    --admin-font-table: 13px;
    --admin-font-button: 13px;
    --admin-font-label: 13px;
    --admin-font-small: 12px;
    --admin-font-micro: 11px;
    --admin-font-stat: 29px;
    --admin-font-topbar-title: 16px;
}

html[data-theme="dark"] {
    --app-bg: #09090a;
    --app-surface: #18181a;
    --app-surface-soft: #202023;
    --app-surface-muted: #29292d;

    --app-text: #f5f5f7;
    --app-text-secondary: #b0b0b5;
    --app-text-muted: #85858b;

    --app-border: rgba(255, 255, 255, 0.09);
    --app-border-strong: rgba(255, 255, 255, 0.17);

    --app-primary: #f2f2f4;
    --app-primary-hover: #d9d9dd;
    --app-primary-text: #171719;

    --app-success: #7bdca8;
    --app-success-bg: rgba(39, 134, 81, 0.18);

    --app-warning: #ffd27a;
    --app-warning-bg: rgba(171, 111, 18, 0.18);

    --app-danger: #ff9b95;
    --app-danger-bg: rgba(190, 54, 45, 0.18);

    --app-info: #cacacf;
    --app-info-bg: rgba(255, 255, 255, 0.07);

    --app-shadow-sm:
        0 1px 2px rgba(0, 0, 0, 0.30),
        0 6px 16px rgba(0, 0, 0, 0.22);

    --app-shadow:
        0 18px 46px rgba(0, 0, 0, 0.38),
        0 4px 14px rgba(0, 0, 0, 0.25);

    --app-shadow-hover:
        0 24px 56px rgba(0, 0, 0, 0.44),
        0 6px 18px rgba(0, 0, 0, 0.28);

    --app-accent: #8b83ff;
    --app-accent-2: #35d6d0;
    --app-accent-soft: rgba(139, 131, 255, 0.14);
    --app-accent-ring: rgba(139, 131, 255, 0.22);
}

/* =========================================================
   General
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    min-width: 0;
}

body {
    width: 100%;
    min-height: 100vh;
    min-width: 0;
    margin: 0;
    color: var(--app-text);
    background: var(--app-bg);
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: var(--admin-font-body);
    -webkit-font-smoothing: antialiased;
    transition:
        color 0.25s ease,
        background-color 0.25s ease;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================================
   Staff mobile navigation
   ========================================================= */

.staff-mobile-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 110;
    display: none;
    min-height: 62px;
    padding: 7px;
    align-items: center;
    justify-content: space-around;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 20px;
    box-shadow: var(--app-shadow);
}

.staff-mobile-link {
    display: flex;
    min-width: 54px;
    padding: 6px;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    color: var(--app-text-muted);
    font-size: 8px;
    font-weight: 650;
    text-decoration: none;
}

.staff-mobile-link.active {
    color: var(--app-text);
}

@media (max-width: 650px) {
    .staff-mobile-nav {
        display: flex;
    }

    .staff-has-mobile-nav {
        padding-bottom: 82px;
    }

    .staff-has-mobile-nav.scanner-shell {
        padding-bottom: 82px;
    }
}

/* =========================================================
   Application layout
   ========================================================= */

.app-shell {
    width: 100%;
    min-height: 100vh;
    min-width: 0;
}

.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    width: var(--app-sidebar-width);
    max-width: calc(100vw - 42px);
    padding: 20px 14px;
    overflow-y: auto;
    color: var(--app-text);
    background: var(--app-surface);
    border-right: 1px solid var(--app-border);
    transition:
        transform 0.25s ease,
        background-color 0.25s ease;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 7px 10px 20px;
    text-decoration: none;
}

.app-brand-mark {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--app-primary-text);
    background: var(--app-primary);
    border-radius: 14px;
}

.app-brand-title {
    margin: 0;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -0.25px;
    line-height: 1.2;
}

.app-sidebar-close {
    display: none !important;
}

.app-nav-label {
    padding: 16px 12px 7px;
    color: var(--app-text-muted);
    font-size: var(--admin-font-micro);
    font-weight: 750;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--app-text-secondary);
    border-radius: 13px;
    text-decoration: none;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.app-nav-link:hover {
    color: var(--app-text);
    background: var(--app-surface-soft);
    transform: translateX(2px);
}

.app-nav-link.active {
    color: var(--app-primary-text);
    background: var(--app-primary);
    box-shadow: 0 10px 22px -12px rgba(20, 20, 22, 0.4);
}

.app-nav-icon {
    display: grid;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    place-items: center;
}

.app-nav-text {
    flex: 1;
    font-size: var(--admin-font-body);
    font-weight: 650;
}

.app-nav-count {
    min-width: 22px;
    padding: 3px 6px;
    color: var(--app-text);
    background: var(--app-surface-muted);
    border-radius: 999px;
    font-size: var(--admin-font-micro);
    font-weight: 700;
    text-align: center;
}

.app-nav-link.active .app-nav-count {
    color: var(--app-primary);
    background: var(--app-primary-text);
}

.app-main {
    width: calc(100% - var(--app-sidebar-width));
    min-height: 100vh;
    min-width: 0;
    margin-left: var(--app-sidebar-width);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
    min-width: 0;
    min-height: var(--app-topbar-height);
    padding: 14px 26px;
    background: rgba(245, 245, 247, 0.84);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(18px);
}

html[data-theme="dark"] .app-topbar {
    background: rgba(9, 9, 10, 0.82);
}

.app-topbar-inner {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.app-topbar-title-group {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.app-topbar-title-text {
    min-width: 0;
}

.app-page-heading {
    margin: 0;
    overflow: hidden;
    font-size: var(--admin-font-topbar-title);
    font-weight: 750;
    letter-spacing: -0.45px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-page-subtitle {
    margin-top: 3px;
    overflow: hidden;
    color: var(--app-text-muted);
    font-size: var(--admin-font-small);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-actions {
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.admin-profile-button {
    display: flex;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 6px 10px 6px 7px;
    align-items: center;
    gap: 10px;
    color: var(--app-text);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    text-decoration: none;
    box-shadow: var(--app-shadow-sm);
    transition:
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.admin-profile-button:hover {
    box-shadow: var(--app-shadow);
    border-color: var(--app-border-strong);
    transform: translateY(-1px);
}

.admin-profile-avatar {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    color: var(--app-primary-text);
    background: var(--app-primary);
    border-radius: 10px;
    font-size: var(--admin-font-micro);
    font-weight: 750;
}

.admin-profile-name {
    display: block;
    max-width: 130px;
    overflow: hidden;
    color: var(--app-text);
    font-size: var(--admin-font-label);
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    color: var(--app-text);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 13px;
    box-shadow: var(--app-shadow-sm);
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.app-icon-button:hover {
    box-shadow: var(--app-shadow);
    border-color: var(--app-border-strong);
    transform: translateY(-1px);
}

.app-content {
    width: 100%;
    min-width: 0;
    padding: 26px;
}

/* =========================================================
   Cards and dashboard metrics
   ========================================================= */

.app-card {
    min-width: 0;
    color: var(--app-text);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-sm);
    transition:
        box-shadow 0.22s ease,
        transform 0.22s ease,
        border-color 0.22s ease;
}

.app-card:hover {
    box-shadow: var(--app-shadow);
    border-color: var(--app-border-strong);
}

.app-card-body {
    padding: 20px;
}

.app-card-header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--app-border);
}

.app-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 730;
}

.app-card-subtitle {
    margin: 4px 0 0;
    color: var(--app-text-muted);
    font-size: 11px;
}

.app-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.app-stat-card {
    min-width: 0;
    min-height: 146px;
    padding: 20px;
    color: var(--app-text);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-sm);
    transition:
        box-shadow 0.22s ease,
        transform 0.22s ease,
        border-color 0.22s ease;
}

.app-stat-card:hover {
    box-shadow: var(--app-shadow-hover);
    border-color: var(--app-border-strong);
    transform: translateY(-2px);
}

.app-stat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.app-stat-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--app-text);
    background: var(--app-surface-soft);
    border-radius: 13px;
}

.app-stat-label {
    color: var(--app-text-secondary);
    font-size: var(--admin-font-small);
    font-weight: 650;
}

.app-stat-value {
    margin-top: 18px;
    font-size: var(--admin-font-stat);
    font-weight: 760;
    letter-spacing: -1.2px;
}

.app-stat-note {
    margin-top: 5px;
    color: var(--app-text-muted);
    font-size: var(--admin-font-small);
}

/* =========================================================
   Buttons
   ========================================================= */

.app-btn {
    display: inline-flex;
    min-height: 42px;
    padding: 9px 15px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 680;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.app-btn:hover {
    transform: translateY(-1px);
}

.app-btn:active {
    transform: translateY(0);
}

.app-btn-primary {
    color: var(--app-primary-text);
    background: var(--app-primary);
    box-shadow: 0 10px 22px -12px rgba(20, 20, 22, 0.45);
}

.app-btn-primary:hover {
    color: var(--app-primary-text);
    background: var(--app-primary-hover);
    box-shadow: 0 14px 28px -12px rgba(20, 20, 22, 0.5);
}

.app-btn-secondary {
    color: var(--app-text);
    background: var(--app-surface);
    border-color: var(--app-border);
}

.app-btn-secondary:hover {
    color: var(--app-text);
    background: var(--app-surface-soft);
    border-color: var(--app-border-strong);
}

.app-btn-danger {
    color: var(--app-danger);
    background: var(--app-danger-bg);
}

/* =========================================================
   Forms
   ========================================================= */

.app-form-label {
    display: block;
    margin-bottom: 7px;
    color: var(--app-text);
    font-size: 11px;
    font-weight: 680;
}

.app-form-control,
.app-form-select {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    color: var(--app-text);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    outline: none;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.app-form-control:focus,
.app-form-select:focus {
    background: var(--app-surface);
    border-color: var(--app-accent);
    box-shadow: 0 0 0 4px var(--app-accent-ring);
}

.app-form-control::placeholder {
    color: var(--app-text-muted);
}

input[type="date"].app-form-control::-webkit-calendar-picker-indicator,
input[type="time"].app-form-control::-webkit-calendar-picker-indicator,
input[type="datetime-local"].app-form-control::-webkit-calendar-picker-indicator {
    opacity: 0.85;
    cursor: pointer;
}

html[data-theme="dark"] input[type="date"].app-form-control::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"].app-form-control::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"].app-form-control::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.15);
}

textarea.app-form-control {
    min-height: 110px;
    resize: vertical;
}

/* =========================================================
   Tables
   ========================================================= */

.app-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.app-table th {
    padding: 13px 16px;
    color: var(--app-text-muted);
    background: var(--app-surface-soft);
    border-bottom: 1px solid var(--app-border);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.45px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table td {
    padding: 15px 16px;
    color: var(--app-text-secondary);
    border-bottom: 1px solid var(--app-border);
    font-size: 12px;
    vertical-align: middle;
}

.app-table tbody tr:last-child td {
    border-bottom: 0;
}

.app-table tbody tr {
    transition: background-color 0.15s ease;
}

.app-table tbody tr:hover {
    background: var(--app-surface-soft);
}

.app-table-primary {
    color: var(--app-text);
    font-weight: 680;
}

/* =========================================================
   Status
   ========================================================= */

.app-badge {
    display: inline-flex;
    min-height: 26px;
    padding: 5px 10px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 720;
    white-space: nowrap;
}

body.admin-shell .app-card-title {
    font-size: var(--admin-font-section-title);
}

body.admin-shell .app-card-subtitle {
    font-size: var(--admin-font-small);
}

body.admin-shell .app-btn {
    font-size: var(--admin-font-button);
}

body.admin-shell .app-form-label {
    font-size: var(--admin-font-label);
}

body.admin-shell .app-form-control,
body.admin-shell .app-form-select {
    font-size: var(--admin-font-body);
}

body.admin-shell .app-table th {
    font-size: var(--admin-font-small);
}

body.admin-shell .app-table td {
    font-size: var(--admin-font-table);
}

body.admin-shell .app-badge {
    font-size: var(--admin-font-micro);
}

.app-badge-success {
    color: var(--app-success);
    background: var(--app-success-bg);
}

.app-badge-warning {
    color: var(--app-warning);
    background: var(--app-warning-bg);
}

.app-badge-danger {
    color: var(--app-danger);
    background: var(--app-danger-bg);
}

.app-badge-neutral {
    color: var(--app-info);
    background: var(--app-info-bg);
}

/* =========================================================
   Admin responsive layout safeguards
   ========================================================= */

body.admin-shell .app-shell,
body.admin-shell .app-main,
body.admin-shell .app-content,
body.admin-shell .app-card,
body.admin-shell .app-card-body,
body.admin-shell .app-table-wrap {
    min-width: 0;
}

body.admin-shell .attendance-admin-content,
body.admin-shell .admin-leave-content,
body.admin-shell .shift-content,
body.admin-shell .salary-content,
body.admin-shell .office-content,
body.admin-shell .holiday-content {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
}

body.admin-shell .dashboard-grid,
body.admin-shell .dashboard-grid > *,
body.admin-shell .dashboard-section-stack,
body.admin-shell .staff-form-layout,
body.admin-shell .shift-form-grid,
body.admin-shell .office-layout,
body.admin-shell .holiday-layout,
body.admin-shell .attendance-summary-grid,
body.admin-shell .admin-leave-summary,
body.admin-shell .shift-summary,
body.admin-shell .salary-summary-grid,
body.admin-shell .office-summary,
body.admin-shell .holiday-summary,
body.admin-shell .staff-stat-grid,
body.admin-shell .staff-form-grid,
body.admin-shell .shift-field-grid,
body.admin-shell .office-coordinate-grid {
    min-width: 0;
}

body.admin-shell .dashboard-action {
    width: 100%;
    min-width: 0;
    min-height: 88px;
}

body.admin-shell .dashboard-action > span:last-child,
body.admin-shell .dashboard-action-title,
body.admin-shell .dashboard-action-description {
    min-width: 0;
}

body.admin-shell .dashboard-action-title {
    overflow-wrap: break-word;
    white-space: normal;
}

body.admin-shell .dashboard-action-description {
    overflow-wrap: break-word;
}

body.admin-shell .attendance-table-card,
body.admin-shell .admin-leave-table-card,
body.admin-shell .shift-table-card,
body.admin-shell .salary-table-card,
body.admin-shell .office-card,
body.admin-shell .holiday-card {
    max-width: 100%;
    min-width: 0;
}

body.admin-shell .attendance-table-wrap,
body.admin-shell .admin-leave-table-wrap,
body.admin-shell .shift-table-wrap,
body.admin-shell .salary-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.admin-shell .attendance-filter-grid,
body.admin-shell .admin-leave-filter-grid {
    min-width: 0;
}

body.admin-shell .attendance-filter-actions,
body.admin-shell .admin-leave-filter-actions,
body.admin-shell .staff-filter-actions,
body.admin-shell .salary-filter,
body.admin-shell .salary-toolbar,
body.admin-shell .office-form-actions,
body.admin-shell .holiday-form-actions {
    min-width: 0;
}

body.admin-shell .qr-page {
    min-height: calc(100vh - var(--app-topbar-height) - 52px);
    padding: 0;
}

body.admin-shell .qr-card {
    max-width: 500px;
    min-width: 0;
}

body.admin-shell .qr-box {
    width: min(390px, 100%);
    min-height: 0;
    aspect-ratio: 1 / 1;
}

body.admin-shell .qr-box img {
    height: auto;
}

@media (max-width: 1199.98px) {
    body.admin-shell .salary-summary-grid,
    body.admin-shell .staff-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    body.admin-shell .app-shell,
    body.admin-shell .app-main,
    body.admin-shell .app-topbar,
    body.admin-shell .app-topbar-inner,
    body.admin-shell .app-content {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    body.admin-shell .app-main {
        margin-left: 0;
    }

    body.admin-shell .dashboard-grid,
    body.admin-shell .staff-form-layout,
    body.admin-shell .shift-form-grid,
    body.admin-shell .office-layout,
    body.admin-shell .holiday-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    body.admin-shell .attendance-summary-grid,
    body.admin-shell .admin-leave-summary,
    body.admin-shell .shift-summary,
    body.admin-shell .office-summary,
    body.admin-shell .holiday-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.admin-shell .attendance-filter-grid,
    body.admin-shell .admin-leave-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.admin-shell .attendance-filter-actions,
    body.admin-shell .admin-leave-filter-actions {
        grid-column: 1 / -1;
    }

}

@media (max-width: 767.98px) {
    body.admin-shell .app-content,
    body.admin-shell .attendance-admin-content,
    body.admin-shell .admin-leave-content,
    body.admin-shell .shift-content,
    body.admin-shell .salary-content,
    body.admin-shell .office-content,
    body.admin-shell .holiday-content {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
    }

    body.admin-shell .app-content {
        padding-right: 14px;
        padding-left: 14px;
    }

    body.admin-shell .dashboard-welcome,
    body.admin-shell .staff-page-heading,
    body.admin-shell .staff-form-heading,
    body.admin-shell .attendance-admin-hero,
    body.admin-shell .salary-hero,
    body.admin-shell .office-hero,
    body.admin-shell .holiday-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    body.admin-shell .dashboard-welcome h2,
    body.admin-shell .staff-page-heading h2,
    body.admin-shell .staff-form-heading h2,
    body.admin-shell .attendance-admin-hero h1,
    body.admin-shell .admin-leave-hero h1,
    body.admin-shell .shift-hero h1,
    body.admin-shell .salary-hero h1,
    body.admin-shell .office-hero h1,
    body.admin-shell .holiday-hero h1 {
        font-size: 26px;
    }

    body.admin-shell .admin-profile-name {
        display: none;
    }

    body.admin-shell .admin-profile-button > span:last-child {
        display: none;
    }

    body.admin-shell .admin-profile-button {
        gap: 0;
        padding-right: 7px;
    }

    body.admin-shell .staff-form-grid,
    body.admin-shell .shift-field-grid,
    body.admin-shell .office-coordinate-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body.admin-shell .app-content {
        padding: 16px 14px 72px;
    }

    body.admin-shell .app-stat-grid,
    body.admin-shell .attendance-summary-grid,
    body.admin-shell .admin-leave-summary,
    body.admin-shell .shift-summary,
    body.admin-shell .salary-summary-grid,
    body.admin-shell .office-summary,
    body.admin-shell .holiday-summary,
    body.admin-shell .staff-stat-grid,
    body.admin-shell .dashboard-quick-actions,
    body.admin-shell .attendance-filter-grid,
    body.admin-shell .admin-leave-filter-grid {
        grid-template-columns: 1fr;
    }

    body.admin-shell .app-stat-card,
    body.admin-shell .dashboard-action {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    body.admin-shell .attendance-filter-actions,
    body.admin-shell .admin-leave-filter-actions,
    body.admin-shell .staff-filter-actions,
    body.admin-shell .salary-filter,
    body.admin-shell .salary-toolbar,
    body.admin-shell .office-form-actions,
    body.admin-shell .holiday-form-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    body.admin-shell .attendance-filter-button,
    body.admin-shell .attendance-reset-button,
    body.admin-shell .admin-leave-filter-button,
    body.admin-shell .admin-leave-reset,
    body.admin-shell .staff-filter-actions .app-btn,
    body.admin-shell .salary-input,
    body.admin-shell .salary-filter-button,
    body.admin-shell .salary-generate-all,
    body.admin-shell .office-primary-button,
    body.admin-shell .office-secondary-button,
    body.admin-shell .holiday-primary-button,
    body.admin-shell .holiday-secondary-button {
        width: 100%;
    }

    body.admin-shell .app-card-header,
    body.admin-shell .attendance-table-header,
    body.admin-shell .admin-leave-table-header,
    body.admin-shell .shift-table-header,
    body.admin-shell .salary-table-header,
    body.admin-shell .office-card-header,
    body.admin-shell .holiday-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    body.admin-shell .qr-card {
        padding: 22px 16px;
        border-radius: 22px;
    }

    body.admin-shell .qr-title {
        font-size: 24px;
    }
}

/* =========================================================
   Login
   ========================================================= */

.app-login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(430px, 0.9fr);
}

.app-login-brand {
    min-height: 100vh;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-login-panel {
    min-height: 100vh;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-login-card {
    width: 100%;
    max-width: 470px;
    padding: 38px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xl);
    box-shadow: var(--app-shadow);
}

.app-login-title {
    margin: 0;
    font-size: 30px;
    font-weight: 760;
    letter-spacing: -1.1px;
}

.app-login-description {
    margin: 9px 0 28px;
    color: var(--app-text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

/* =========================================================
   Mobile
   ========================================================= */

.app-sidebar-overlay {
    display: none;
}

.app-mobile-menu {
    display: none;
}

@media (max-width: 1199.98px) {
    .app-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: min(var(--app-sidebar-width), calc(100vw - 42px));
        transform: translateX(-100%);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .app-sidebar-close {
        position: absolute;
        top: 14px;
        right: 14px;
        display: inline-grid !important;
        width: 38px;
        height: 38px;
        padding: 0;
        place-items: center;
        color: var(--app-text);
        background: var(--app-surface-soft);
        border: 1px solid var(--app-border);
        border-radius: 12px;
        cursor: pointer;
    }

    .app-sidebar-brand {
        padding-right: 48px;
    }

    .app-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1030;
        display: none;
        background: rgba(0, 0, 0, 0.44);
    }

    body.sidebar-open .app-sidebar-overlay {
        display: block;
    }

    .app-main {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin-left: 0;
    }

    .app-mobile-menu {
        display: inline-grid;
    }

    .app-login-page {
        display: block;
    }

    .app-login-brand {
        min-height: auto;
        padding: 32px 24px;
    }

    .app-login-panel {
        min-height: auto;
        padding: 30px 18px 60px;
    }
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 18px 14px 82px;
    }

    .app-topbar {
        padding: 12px;
    }

    .app-page-heading {
        font-size: 15px;
    }

    .app-page-subtitle {
        display: none;
    }

    .app-stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .app-stat-card {
        min-height: 128px;
    }

    .app-card-body,
    .app-card-header {
        padding: 16px;
    }

    .app-login-brand {
        padding: 24px 18px;
    }

    .app-login-panel {
        padding: 18px 12px 45px;
    }

    .app-login-card {
        padding: 26px 20px;
        border-radius: 24px;
    }

    .app-login-title {
        font-size: 26px;
    }
}
