:root {
    /* Bright Glass Effect Variables */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(135, 142, 192, 0.2);
    --glass-blur: 10px;

    /* Colors */
    --text-primary: #1e293b;
    /* Dark Slate for contrast */
    --text-secondary: #475569;
    /* Medium Slate */
    --color-checkin: rgba(16, 185, 129, 0.8);
    /* Emerald */
    --color-checkout: rgba(244, 63, 94, 0.8);
    /* Rose */
    --color-checkin-solid: #10b981;
    --color-checkout-solid: #f43f5e;

    /* Soft Blobs for Light Theme */
    --blob-1: #c4b5fd;
    /* Soft purple */
    --blob-2: #93c5fd;
    /* Soft blue */
    --blob-3: #fcd34d;
    /* Soft yellow */
    --app-bg: #f8fafc;

    /* Modal & Inputs */
    --modal-bg: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(255, 255, 255, 0.5);
    --switch-bg: #ccc;
    --switch-checked-bg: #10b981;
}

[data-theme="dark"] {
    /* Dark Glass Effect Variables */
    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

    /* Colors cho Dark Mode: phai sang va ro net */
    --text-primary: #f8fafc;
    /* Rat trang */
    --text-secondary: #cbd5e1;
    /* Bac sang */

    /* Nen ung dung toi */
    --app-bg: #0f172a;

    /* Doi mau blob nen cho toi nhung van co mau sac nhe nhang (Dark theme cyber/neon) */
    --blob-1: #3b0764;
    /* Very Deep purple */
    --blob-2: #1e3a8a;
    /* Deep blue */
    --blob-3: #064e3b;
    /* Deep emerald */

    /* Modal & Inputs cho Dark Mode */
    --modal-bg: rgba(30, 41, 59, 0.95);
    /* Slate 800 */
    --input-bg: rgba(15, 23, 42, 0.6);
    --switch-bg: #475569;
    --switch-checked-bg: #6366f1;
    /* Indigo bat len cho toi */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--app-bg);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    color: var(--text-primary);
}

/* Keep centered auth screens, allow data-heavy pages to scroll naturally */
body.login-body {
    justify-content: center;
    align-items: center;
}

body.is-employees-page,
body.is-timesheet-page,
body.is-salary-page,
body.is-approvals-page,
body.is-dashboard-page {
    justify-content: flex-start;
    align-items: flex-start;
}

/* --- CHONG FOUC FLASH --- */
html.preload * {
    transition: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- BACKGROUND BLOBS FOR LIQUID GLASS EFFECT --- */
.background-blobs {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    filter: blur(48px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: drift 32s infinite alternate ease-in-out;
    opacity: 0.42;
}

.blob-1 {
    width: 480px;
    height: 480px;
    background: var(--blob-1);
    top: -10%;
    left: -10%;
    animation-duration: 36s;
}

.blob-2 {
    width: 420px;
    height: 420px;
    background: var(--blob-2);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
    animation-duration: 34s;
}

.blob-3 {
    width: 320px;
    height: 320px;
    background: var(--blob-3);
    top: 40%;
    left: 45%;
    animation-duration: 40s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(96px, 96px) scale(1.14) rotate(22deg);
    }
}

/* Adaptive effects level set by theme.js: full | lite | off */
html[data-effects="lite"] {
    --glass-blur: 8px;
}

html[data-effects="lite"] .background-blobs {
    filter: blur(32px);
    opacity: 0.62;
}

html[data-effects="lite"] .blob {
    opacity: 0.32;
    animation-duration: 48s !important;
}

html[data-effects="off"] {
    --glass-blur: 4px;
}

html[data-effects="off"] .background-blobs {
    display: none;
}

html[data-effects="off"] #particleCanvas {
    display: none !important;
}

/* --- APP LAYOUT (MOBILE FIRST) --- */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    margin: 0 auto;
}

/* Global Sidebar Layout Elements */
.main-layout-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    width: 100%;
}

.main-grid-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Tablet & Desktop Layout */
@media (min-width: 1024px) {
    .app-container {
        max-width: 100%;
        display: flex;
        padding: 0;
        gap: 0;
        height: 100vh;
        overflow: hidden;
    }

    /* Fixed Sidebar */
    .admin-section {
        width: 280px;
        min-width: 280px;
        height: 100vh;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--glass-border);
        display: flex !important; /* Managed by JS, but if block, make it flex */
        flex-direction: column;
        padding: 32px 24px;
        overflow-y: auto;
        z-index: 10;
        animation: none !important;
        transform: none !important;
    }

    .admin-section:hover {
        transform: none !important;
    }

    .admin-header {
        margin-bottom: 30px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1;
    }

    .admin-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    /* Scrollable Main Area */
    .main-layout-area {
        flex: 1;
        height: 100vh;
        overflow-y: auto;
        padding: 24px 32px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .profile-section {
        margin-bottom: 0;
    }

    .main-grid-container {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 24px;
        align-items: start;
    }

    .history-section {
        position: sticky;
        top: 0;
    }
}

@media (min-width: 800px) and (max-width: 1023px) {
    .app-container {
        max-width: 1400px;
        grid-template-columns: minmax(0, 1fr) 320px;
        grid-template-rows: auto 1fr;
        gap: 16px;
        padding: 18px;
    }

    .admin-section {
        grid-column: 1 / -1;
    }
}

/* --- GLASS PANEL UTILITY --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 32px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px 0 rgba(31, 38, 135, 0.22);
}

/* --- PROFILE SECTION --- */
.profile-section {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 28px;
    justify-content: space-between;
}

.profile-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
}

.profile-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    font-size: 0.92rem;
    font-weight: 600;
}

.profile-subtitle {
    margin: 0;
    color: var(--text-secondary);
    max-width: 640px;
    font-size: 0.98rem;
}

.profile-insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
    flex: 1;
    max-width: 460px;
}

.profile-chip {
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42));
    border: 1px solid rgba(255, 255, 255, 0.65);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-chip span,
.hero-note-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-chip strong {
    font-size: 0.98rem;
    line-height: 1.35;
}

.profile-chip-accent {
    background: linear-gradient(135deg, rgba(224, 231, 255, 0.92), rgba(219, 234, 254, 0.8));
    border-color: rgba(129, 140, 248, 0.22);
}

.profile-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.page-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
}

.page-hero-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.page-heading-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.page-heading-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.58));
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.18);
    color: var(--text-primary);
    font-size: 1.3rem;
    flex: 0 0 auto;
}

.page-heading-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.page-heading-stack h1,
.page-heading-stack h2 {
    margin: 0;
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    font-weight: 800;
    color: var(--text-primary);
}

.page-heading-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.45;
    max-width: 760px;
}

.page-hero-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.page-hero-note {
    min-width: 220px;
    max-width: 320px;
    padding: 16px 18px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5)),
        radial-gradient(circle at top right, rgba(147, 197, 253, 0.18), transparent 58%);
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.page-hero-note strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.35;
    margin-bottom: 6px;
}

.page-hero-note p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.5;
}

.section-card {
    padding: 20px;
    border-radius: 24px;
}

.section-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-card-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.45;
}

.profile-subtitle,
.history-description,
.page-heading-subtitle,
.section-card-subtitle,
.timesheet-salary-subtitle,
.header-title p,
.kpi-header p {
    display: none !important;
}

.page-heading-stack {
    gap: 0;
}

.section-card-header {
    margin-bottom: 10px;
}

.table-shell {
    padding: 0;
    overflow: hidden;
}

[data-theme="dark"] .page-eyebrow,
[data-theme="dark"] .page-hero-note,
[data-theme="dark"] .page-heading-icon {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.6));
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

[data-theme="dark"] .page-hero-note {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.7));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

[data-theme="dark"] .avatar {
    background: linear-gradient(135deg, rgba(30, 41, 59, 1), rgba(30, 41, 59, 0.7));
}

.user-info h2 {
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 4px;
    /* Soften shadow for light mode */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.user-info p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* --- MAIN ACTION SECTION --- */
.main-action-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    padding: 28px 28px 24px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    margin-bottom: 16px;
}

.dashboard-hero-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dashboard-hero-side {
    display: grid;
    gap: 14px;
}

.hero-note-card {
    min-height: 0;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.5)),
        radial-gradient(circle at top right, rgba(147, 197, 253, 0.2), transparent 55%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.hero-note-card strong {
    display: block;
    margin: 8px 0 6px;
    font-size: 1.08rem;
    line-height: 1.35;
}

.hero-note-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.95rem;
}

.hero-note-card-primary {
    background:
        linear-gradient(160deg, rgba(236, 253, 245, 0.96), rgba(219, 234, 254, 0.72)),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.16), transparent 58%);
    border-color: rgba(16, 185, 129, 0.18);
}

.date-display {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 14px 0 14px;
    font-weight: 500;
}

.time-display {
    font-size: 5.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    /* Dark subtle shadow for light mode text */
    text-shadow: 0 4px 15px rgba(135, 142, 192, 0.15);
    margin-bottom: 18px;
    letter-spacing: -2px;
    line-height: 1;
    color: #0f172a;
    width: 100%;
    text-align: left;
}

@media (max-width: 500px) {
    .time-display {
        font-size: 4rem;
    }
}

.status {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    width: fit-content;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 4px;
    align-items: stretch;
}

#checkInBtn,
#checkOutBtn {
    grid-column: span 6;
    max-width: none;
    width: 100%;
}

#overtimeRequestBtn,
#missingRequestBtn,
#viewRequestHistoryBtn,
#mySalaryBtn {
    min-height: 44px;
    font-size: 0.92rem !important;
}

.action-utility-btn {
    grid-column: span 6;
    min-height: 66px !important;
    padding: 14px 16px !important;
    border-radius: 18px !important;
    justify-content: flex-start !important;
    text-align: left;
    font-weight: 700;
    white-space: normal !important;
    line-height: 1.35;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.glass-btn {
    border: none;
    outline: none;
    padding: 16px 32px;
    border-radius: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex: 1;
    max-width: 220px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-check-in {
    background: var(--color-checkin);
    box-shadow: 0 4px 20px rgba(46, 213, 115, 0.2);
}

.btn-check-in:hover {
    background: rgba(46, 213, 115, 0.6);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 213, 115, 0.4);
}

.btn-check-out {
    background: var(--color-checkout);
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.2);
}

.btn-check-out:hover {
    background: rgba(255, 71, 87, 0.6);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

/* --- HISTORY SECTION --- */
.history-section {
    display: flex;
    flex-direction: column;
    max-height: 500px;
    min-height: 430px;
    padding: 24px 24px 22px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
}

.history-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-description {
    margin: 0 0 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.glass-btn-small {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.glass-btn-small:hover {
    background: rgba(244, 63, 94, 0.2);
    color: var(--color-checkout-solid);
    transform: scale(1.1);
}

@media (min-width: 769px) {
    .desktop-back-btn {
        display: none !important;
    }
}

.log-list {
    list-style: none;
    overflow-y: auto;
    padding-right: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-section.history-empty {
    min-height: 360px;
    max-height: 420px;
}

.history-section.history-empty .log-list {
    justify-content: center;
}

/* Custom Scrollbar for list */
.log-list::-webkit-scrollbar {
    width: 6px;
}

.log-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.log-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.log-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.log-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.log-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-item .log-type {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-item.in .log-type {
    color: var(--color-checkin-solid);
}

.log-item.out .log-type {
    color: var(--color-checkout-solid);
}

.log-item .log-time {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.9;
}

/* --- LOGIN PAGE --- */
.login-body {
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
    z-index: 1;
}

.change-password-container {
    max-width: 500px;
}

.login-header {
    text-align: center;
    margin-bottom: 10px;
}

.login-icon {
    font-size: 3.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    display: inline-block;
    padding: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--color-checkin-solid);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.input-group input::placeholder {
    color: #94a3b8;
}

.btn-login {
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-login:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.8), rgba(6, 182, 212, 0.8));
    transform: translateY(-2px);
}

.login-error {
    color: #ff4757;
    font-size: 0.95rem;
    text-align: center;
    min-height: 20px;
    font-weight: 500;
}

.login-hints {
    margin-top: 5px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.login-hints p {
    margin-bottom: 10px;
}

.login-hints-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.hint-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.hint-badge:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hint-badge strong {
    color: var(--text-primary);
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* --- ADMIN PANEL (For Index.html) --- */
.admin-section {
    grid-column: 1 / -1;
    margin-top: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.admin-header h3 {
    font-size: 1.3rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.role-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.role-admin {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.4), rgba(79, 70, 229, 0.4));
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}

.role-manager {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.4), rgba(59, 130, 246, 0.4));
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.admin-btn {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 12px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.admin-btn i {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .admin-actions {
        grid-template-columns: 1fr;
    }
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.admin-btn.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(37, 99, 235, 0.14)) !important;
    border-color: rgba(79, 70, 229, 0.38) !important;
    color: #3730a3 !important;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.14) !important;
}

/* --- MODAL CONFIRM --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    /* Bright White */
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* --- GLOBAL THEME TOGGLE FAB --- */
.global-theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: #1e293b;
    font-size: 1.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.global-theme-toggle:hover {
    transform: scale(1.04) rotate(6deg);
    background: #ffffff;
}

[data-theme="dark"] .global-theme-toggle {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .global-theme-toggle:hover {
    background: #1e293b;
}

@media (max-width: 768px) {
    .global-theme-toggle {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        opacity: 0.92;
    }
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 5px;
    transition: 0.2s;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Pending Badge Pulse */
@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }
}

#pendingBadge {
    animation: badgePulse 1.5s ease-in-out infinite;
}

/* Approvals Button Accent */
.btn-approvals:not(.active) {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

.btn-approvals:not(.active):hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Approvals page body scroll override */
body.is-approvals-page {
    overflow-y: auto !important;
    align-items: flex-start !important;
    padding: 30px 15px !important;
}

/* --- Ghi de CSS Modal Content cho dung chuan Dark Mode --- */
.modal-content {
    background: var(--modal-bg) !important;
    color: var(--text-primary);
}

/* --- CSS THEME SWITCH TOGGLE --- */
.theme-switch input:checked+.slider {
    background-color: var(--switch-checked-bg);
}

.theme-switch input:focus+.slider {
    box-shadow: 0 0 1px var(--switch-checked-bg);
}

.theme-switch input:checked+.slider:before {
    transform: translateX(24px);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* --- DARK MODE ELEMENT OVERRIDES --- */
[data-theme="dark"] .admin-btn,
[data-theme="dark"] .log-item,
[data-theme="dark"] .hint-badge {
    background: rgba(30, 41, 59, 0.65) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .admin-btn:hover,
[data-theme="dark"] .log-item:hover,
[data-theme="dark"] .hint-badge:hover {
    background: rgba(30, 41, 59, 0.85) !important;
}

[data-theme="dark"] .admin-btn.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.36), rgba(37, 99, 235, 0.28)) !important;
    color: #eef2ff !important;
    border-color: rgba(129, 140, 248, 0.45) !important;
}

[data-theme="dark"] .profile-chip,
[data-theme="dark"] .hero-note-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.58)) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .profile-chip-accent,
[data-theme="dark"] .hero-note-card-primary {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(30, 64, 175, 0.32)) !important;
}

[data-theme="dark"] .profile-kicker,
[data-theme="dark"] .section-kicker,
[data-theme="dark"] .user-role-badge {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

[data-theme="dark"] .time-display {
    color: var(--text-primary) !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .status {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .glass-btn-small {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .glass-btn-small:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .toast {
    background: rgba(30, 41, 59, 0.95) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .input-group input {
    background: rgba(30, 41, 59, 0.8) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .input-group input:focus {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: var(--color-checkin-solid) !important;
}

/* Doi mau trang sang cho thanh cuon cac bang trong Dark Mode */
[data-theme="dark"] .table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4) !important;
}

[data-theme="dark"] .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6) !important;
}

/* Tuy chinh thanh cuon the table-wrapper cho toan he thong (Light Mode mac dinh) */
.table-wrapper::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* --- MOBILE SAFE OVERRIDES (does not affect desktop) --- */
@media (max-width: 768px) {
    body {
        padding: 8px !important;
        overflow-x: hidden !important;
        width: 100%;
    }

    .app-container {
        gap: 8px;
        padding: 6px;
        width: 100%;
        max-width: 100%;
    }

    .glass-panel {
        padding: 12px;
        border-radius: 16px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .app-container,
    .app-container-full,
    .app-container-large,
    .salary-container,
    .timesheet-header,
    .header-actions,
    .salary-header,
    .salary-header-main,
    .salary-header-actions {
        min-width: 0;
        max-width: 100%;
    }

    .profile-section {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 88px 10px 10px;
        position: relative;
    }

    .profile-copy,
    .profile-section .user-info {
        flex-grow: 1;
        min-width: 0;
    }

    .profile-kicker {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .profile-insights {
        display: none;
    }

    .profile-actions {
        grid-column: auto;
        margin-left: 0 !important;
        display: flex !important;
        justify-content: flex-end;
        gap: 6px !important;
        margin-top: 0;
        position: absolute;
        top: 8px;
        right: 8px;
        z-index: 2;
    }

    .user-name-row {
        gap: 8px;
        padding-right: 4px;
    }

    #systemSettingsBtn,
    #logoutBtn {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.92rem !important;
        padding: 0 !important;
        border-radius: 10px !important;
    }

    .user-info h2 {
        font-size: 1.05rem;
        margin: 0;
    }

    .profile-subtitle,
    .user-info p {
        font-size: 0.82rem;
        margin: 2px 0 0 0;
    }

    .page-hero {
        flex-direction: column;
        padding: 14px 14px 12px;
        gap: 12px;
    }

    .page-hero-main {
        gap: 10px;
    }

    .page-heading-row {
        gap: 10px;
        align-items: center;
    }

    .page-heading-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 1.08rem;
    }

    .page-heading-stack h1,
    .page-heading-stack h2 {
        font-size: clamp(1.2rem, 5.2vw, 1.7rem);
        white-space: nowrap;
    }

    .page-heading-subtitle {
        font-size: 0.86rem;
        line-height: 1.35;
    }

    .page-hero-actions {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

    .page-hero-note {
        max-width: none;
        min-width: 0;
        width: 100%;
        padding: 14px;
        border-radius: 18px;
    }

    .section-card {
        padding: 14px;
        border-radius: 18px;
    }

    .section-card-header {
        margin-bottom: 12px;
    }

    .section-card-title {
        font-size: 1rem;
        line-height: 1.2;
    }

    .section-card-subtitle {
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .user-role-badge {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    .dashboard-hero-main {
        align-items: center;
        text-align: center;
    }

    .dashboard-hero-side {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .section-kicker {
        margin: 0 auto;
    }

    .time-display {
        font-size: 2.7rem;
        letter-spacing: -1px;
        text-align: center;
    }

    .status {
        margin-bottom: 14px;
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        font-size: 0.92rem;
    }

    .date-display {
        margin-bottom: 8px;
        font-size: 0.96rem;
        letter-spacing: 1.2px;
        text-align: center;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 12px;
        width: 100%;
        min-width: 0;
    }

    #checkInBtn,
    #checkOutBtn {
        grid-column: auto;
    }

    .action-utility-btn {
        grid-column: auto;
        min-height: 52px !important;
        justify-content: center !important;
        text-align: center;
    }

    .glass-btn {
        max-width: 100%;
        width: 100%;
        font-size: 0.94rem;
        padding: 11px 12px;
        line-height: 1.2;
        white-space: normal;
        text-transform: none;
        letter-spacing: 0;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .glass-btn-small {
        max-width: 100%;
        min-width: 0;
        height: auto;
        min-height: 36px;
    }

    .main-action-section {
        padding: 16px 12px;
    }

    .admin-section {
        padding: 12px !important;
    }

    .admin-actions {
        gap: 8px;
        min-width: 0;
    }

    .admin-btn {
        padding: 10px 8px;
        font-size: 0.84rem;
        min-width: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        text-transform: none;
        letter-spacing: 0;
        word-break: break-word;
    }

    .filter-tabs,
    .timesheet-tabs {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .filter-tab,
    .tab-btn {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
        white-space: normal !important;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        word-break: break-word;
    }

    .glass-btn span,
    .admin-btn span,
    .filter-tab span,
    .tab-btn span {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        word-break: break-word;
    }

    .glass-panel:hover,
    .glass-btn:hover,
    .glass-btn-small:hover,
    .admin-btn:hover {
        transform: none !important;
    }

    .table-container,
    .table-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .history-section {
        max-height: none;
        min-height: 0;
        padding: 12px !important;
    }

    .history-header {
        align-items: flex-start;
        gap: 6px;
        flex-direction: column;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .history-header h3 {
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
        line-height: 1.25;
    }

    .history-description {
        margin-bottom: 10px;
        font-size: 0.88rem;
    }

    .admin-header {
        align-items: flex-start;
        gap: 6px;
        flex-direction: column;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .admin-header h3 {
        font-size: 1rem;
        margin: 0;
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
        line-height: 1.25;
    }

    .admin-header > div:first-child {
        align-items: flex-start;
    }

    .role-badge {
        margin-top: 8px;
    }

    .modal-content {
        width: calc(100vw - 16px) !important;
        max-width: 520px !important;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
        border-radius: 16px;
    }

    .toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        padding: 10px 12px;
    }

    .login-container {
        padding: 20px;
        max-width: 100%;
    }

    .login-header h2 {
        font-size: 1.65rem;
    }

    .login-header p {
        font-size: 0.95rem;
    }

    /* Reserve safe space so floating theme button does not cover content */
    body.is-salary-page,
    body.is-approvals-page,
    body.is-timesheet-page,
    body.is-employees-page,
    body.is-dashboard-page {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 68px) !important;
    }
}

@media (max-width: 420px) {
    .time-display {
        font-size: 2.3rem;
        letter-spacing: -0.5px;
    }

    .date-display,
    .status {
        line-height: 1.3;
    }
}

/* --- UX PRO MAX OPTIMIZATIONS: ACCESSIBILITY + RESPONSIVE STABILITY --- */
html,
body {
    min-height: 100dvh;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.glass-btn,
.glass-btn-small,
.admin-btn,
.filter-tab,
.tab-btn,
.btn-approve,
.btn-reject {
    min-height: 44px;
    touch-action: manipulation;
}

.glass-btn-small {
    min-width: 44px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
.filter-tab:focus-visible,
.tab-btn:focus-visible {
    outline: 3px solid rgba(6, 182, 212, 0.8);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2);
}

.modal-overlay {
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.modal-content {
    width: min(100%, 760px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}

@media (min-width: 801px) {
    .app-container {
        align-items: start;
    }

    .main-action-section {
        min-height: 0;
    }

    .history-section {
        min-height: 430px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
    }

    .profile-section {
        gap: 8px 10px;
        padding-right: 92px;
    }

    .admin-actions {
        grid-template-columns: 1fr;
    }

    .glass-btn,
    .admin-btn,
    .filter-tab,
    .tab-btn {
        min-height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .blob,
    .background-blobs {
        animation: none !important;
    }
}

