/* ========================================================
   HRMS Theme — Balanced Slate, Periwinkle, Forest & Gold
   ======================================================== */

:root {
    /* Brand Accent Colors */
    --color-1: #98ade2; /* Soft Periwinkle (Cool Contrast) */
    --color-2: #134200; /* Deep Forest Accent */
    --color-3: #0d6337; /* Emerald Green (Success & Clock-In) */
    --color-4: #0d7d61; /* Vibrant Teal (Brand Highlights) */
    --color-5: #fdbe3f; /* Warm Amber Gold (Attention & Badges) */

    /* Neutral, Balanced Surfaces (No green tint on canvas) */
    --bg-dark: #0b0f19;           /* Deep obsidian-slate canvas */
    --card-bg: #131b2e;           /* Sophisticated dark slate card */
    --card-inner: #0d1322;        /* Inset container / input background */
    --border-color: #212c45;      /* Subtle slate boundary */
    --border-hover: #33446b;

    /* High-Legibility Typography */
    --text-primary: #f8fafc;      /* Crisp off-white */
    --text-secondary: #94a3b8;    /* Muted cool slate */
    --text-accent: #98ade2;       /* Periwinkle highlight */

    /* Action & Status Semantics */
    --btn-primary-bg: #4f46e5;    /* Indigo action */
    --btn-primary-hover: #4338ca;
    --success: #0d6337;
    --success-hover: #117843;
    --warning: #fdbe3f;
    --warning-hover: #e5a729;
    --danger: #be123c;
    --danger-hover: #9f1239;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ================= Header ================= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Rectangular logo stands out clearly on slate neutral */
.logo-img {
    height: 2.75rem;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    border-radius: 0.5rem;
    background: #ffffff;          /* Clean white card for the company logo */
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.role-badge {
    color: var(--color-1);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    background: rgba(152, 173, 226, 0.12);
    border-radius: 0.35rem;
    border: 1px solid rgba(152, 173, 226, 0.3);
    display: inline-block;
}

/* ================= Auth / Login View ================= */
.auth-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 40px -10px rgba(0, 0, 0, 0.6);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    max-height: 3.5rem;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    margin: 0 auto 1.25rem auto;
    display: block;
    background: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 0.825rem;
    color: var(--text-secondary);
}

/* ================= Alerts / Banners ================= */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    word-break: break-word;
}

.alert-danger {
    background: rgba(190, 18, 60, 0.15);
    border: 1px solid rgba(225, 29, 72, 0.4);
    color: #fda4af;
}

.alert-success {
    background: rgba(13, 125, 97, 0.15);
    border: 1px solid rgba(13, 125, 97, 0.45);
    color: #a7f3d0;
}

/* ================= Tabs Navigation ================= */
.tab-bar {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.65rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--color-1);
    border-bottom: 2px solid var(--color-1);
    margin-bottom: -2px;
    background: rgba(152, 173, 226, 0.12);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= Grid Layouts ================= */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-split {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

.grid-split-chart {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.card-title i {
    color: var(--color-1);
}

.card-title-compact {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.card-title-compact i {
    color: var(--color-1);
}

.card-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-subtitle {
    font-size: 0.775rem;
    color: var(--text-secondary);
}

.inner-box {
    background: var(--card-inner);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
}

.inner-box-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.status-val {
    font-weight: 700;
    margin-top: 0.25rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* ================= Forms & Inputs ================= */
.form-group {
    margin-bottom: 0.9rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--card-inner);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.825rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--color-1);
    box-shadow: 0 0 0 2px rgba(152, 173, 226, 0.25);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* ================= Buttons ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 0.775rem;
    font-weight: 700;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

/* Primary = Indigo / Periwinkle Accent */
.btn-primary {
    background: #4f46e5;
    color: #ffffff;
}
.btn-primary:hover {
    background: #4338ca;
}

/* Success = Emerald --color-3 */
.btn-success {
    background: var(--color-3);
    color: #ffffff;
}
.btn-success:hover {
    background: var(--success-hover);
}

/* Warning/Attention = Amber --color-5 with dark contrast text */
.btn-warning {
    background: var(--color-5);
    color: #1e1b12; /* Dark graphite for readable AAA contrast */
}
.btn-warning:hover {
    background: var(--warning-hover);
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.7rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-group-sm {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

/* ================= Search Bar ================= */
.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.search-input {
    width: 100%;
    padding: 0.6rem 0.85rem 0.6rem 2.25rem;
    background: var(--card-inner);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--color-1);
    box-shadow: 0 0 0 2px rgba(152, 173, 226, 0.2);
}

/* ================= Scrollable Lists ================= */
.scroll-list {
    max-height: 270px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-right: 0.25rem;
}

.list-tall {
    max-height: 480px;
}

.list-item {
    background: var(--card-inner);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.8rem;
    transition: border-color 0.15s;
}

.list-item:hover {
    border-color: var(--border-hover);
}

.list-item-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.list-item-title {
    font-weight: 700;
    font-size: 0.825rem;
    color: var(--text-primary);
}

.list-item-desc {
    font-size: 0.775rem;
    color: var(--text-secondary);
    margin: 0.35rem 0 0.55rem 0;
    line-height: 1.4;
}

.list-item-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.list-item-time {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-primary);
}

.list-item-weekend {
    border-color: rgba(253, 190, 63, 0.35);
}

.list-empty {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 2rem 0;
}

/* ================= Badges ================= */
.badge-weekend {
    background: rgba(253, 190, 63, 0.15);
    color: var(--color-5);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    border: 1px solid rgba(253, 190, 63, 0.35);
}

.badge-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    background: rgba(152, 173, 226, 0.15);
    color: var(--color-1);
    border-radius: 0.25rem;
    border: 1px solid rgba(152, 173, 226, 0.3);
}

/* ================= Data Tables ================= */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.data-table th {
    padding: 0.75rem 0.85rem;
    color: var(--text-secondary);
    background: rgba(13, 19, 34, 0.8);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.04em;
}

.data-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.text-active {
    color: #4ade80;
    font-weight: 700;
}

.text-accent {
    color: var(--color-1);
}

.ip-tag {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    color: var(--color-1);
}

/* ================= Chart Container ================= */
.chart-container {
    height: 220px;
    position: relative;
    margin-top: 1rem;
}

.chart-tall {
    height: 320px;
}

/* Utilities */
.hidden { display: none !important; }
.section-spacing { margin-bottom: 1.5rem; }
.overview-spacing { margin-bottom: 1rem; }
.form-action-top { margin-top: 0.6rem; }

@media (max-width: 900px) {
    .grid-split, .grid-split-chart {
        grid-template-columns: 1fr;
    }
}

/* Sticky flex wrapper for footer */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-wrapper > main {
    flex: 1;
}

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 2.5rem;
    background: var(--card-inner);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.footer-sub {
    font-size: 0.72rem;
    color: #64748b;
}

/* Flexbox Alignment for Data & Sheets Hub Cards */
.sheet-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sheet-desc {
    margin-bottom: 1rem;
    min-height: 2.25rem; /* Guarantees matching text box height across all 3 cards */
}

.sheet-actions {
    margin-bottom: 1.25rem;
}

.sheet-btn-group {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sheet-import-form {
    margin-top: auto; /* Pushes the file input and import button to the exact bottom of every card */
}

.sheet-file-input {
    margin-bottom: 0.5rem;
}
