/* =============================================================================
   AADMIRE PEOPLE — Zoho-inspired enterprise theme
   Light chrome, red brand accent, flat/crisp cards, tinted status badges.
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* --- Brand --- */
    --primary: #E42527;
    --primary-dark: #C81E20;
    --primary-tint: #FDECEC;
    --primary-tint-strong: #FBD8D8;
    /* Button fill uses a softer, warmer red than the raw brand-mark red above.
       #E42527 is Zoho's logo/accent red — fine at small sizes (the logo dot,
       an active nav border, a link) but too saturated as a large solid fill;
       that's what read as "harsh." Zoho's own product buttons use a lighter,
       warmer coral-red for button surfaces, reserving the fully-saturated
       brand red for small marks. --button-primary follows that same split. */
    --button-primary: #E2574C;
    --button-primary-hover: #D64637;

    /* --- Status accents --- */
    --success: #1CA875;
    --success-dark: #16875D;
    --success-tint: #E7F7F1;
    --warning: #E8A013;
    --warning-dark: #B87C0A;
    --warning-tint: #FEF5E3;
    --info: #3E7BC4;
    --info-dark: #2E5F9E;
    --info-tint: #EAF2FB;
    --danger: #D33A3A;
    --danger-dark: #B02C2C;
    --danger-tint: #FCEAEA;
    --purple: #7E57C2;
    --purple-tint: #F1ECFA;

    /* --- Neutrals --- */
    --ink: #1E2129;
    --ink-soft: #565D6D;
    --ink-faint: #8A93A3;
    --surface: #FFFFFF;
    --canvas: #F5F6F8;
    --border: #E3E6EB;
    --border-strong: #D3D7DE;
    --sidebar-hover: #F7F2F2;

    /* --- Elevation --- */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);

    /* --- Shape --- */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;

    --font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Legacy variable names kept for backward compatibility with any inline styles */
    --primary-color: var(--primary);
    --text-dark: var(--ink);
    --text-light: var(--ink-soft);
    --border-color: var(--border);
    --card-bg: var(--surface);
    --body-bg: var(--canvas);
    --shadow-float: var(--shadow-sm);
    --accent-success: var(--success);
}

/* =============================================================================
   1. Reset & Base
   ============================================================================= */
* { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--canvas);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--ink); margin: 0 0 0.5rem 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem 0; color: var(--ink-soft); }
a { color: var(--primary); }
code {
    background: var(--canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 0.85em;
}

/* =============================================================================
   2. Top Bar
   ============================================================================= */
.topbar {
    background-color: var(--surface);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}
.logo-container { display: flex; align-items: center; }
.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}
.logo::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--primary);
}
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.user-greeting {
    font-size: 0.85rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-greeting i.fa-user-circle { display: none; } /* replaced by avatar below */
.user-avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar-photo {
    width: 100%; height: 100%;
    object-fit: cover;
}
.button-logout {
    background: var(--surface);
    color: var(--ink-soft);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.button-logout:hover { background: var(--danger-tint); color: var(--danger-dark); border-color: var(--danger-tint); }

.main-container { display: flex; flex: 1; min-height: 0; }

/* =============================================================================
   3. Sidebar — light, Zoho Next-Gen style
   ============================================================================= */
.hamburger-btn {
    display: none; /* shown only at tablet/mobile widths, see responsive section */
    background: none; border: none; cursor: pointer;
    font-size: 1.15rem; color: var(--ink); padding: 6px 8px; margin-right: 4px;
    border-radius: var(--radius-sm);
}
.hamburger-btn:hover { background: var(--canvas); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 199;
    background: rgba(30, 33, 41, 0.45);
}
.sidebar-overlay.sidebar-overlay-visible { display: block; }

.sidebar {
    width: 232px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    padding: 0.75rem 0;
    flex-shrink: 0;
    overflow-y: auto;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background-color 0.12s, color 0.12s;
}
.sidebar a i { width: 16px; text-align: center; color: var(--ink-faint); font-size: 0.9em; transition: color 0.12s; }
.sidebar a:hover { background-color: var(--sidebar-hover); color: var(--primary); }
.sidebar a:hover i { color: var(--primary); }
.sidebar a.active-link {
    background-color: var(--primary-tint);
    color: var(--primary-dark);
    border-left-color: var(--primary);
    font-weight: 600;
}
.sidebar a.active-link i { color: var(--primary); }

.dropdown-content { display: none; background-color: #FCFBFB; }
.dropdown.active .dropdown-content { display: block; }
.dropdown-content a { padding: 9px 20px 9px 48px; font-size: 0.8rem; }
.dropdown-icon { margin-left: auto; font-size: 0.7em; color: var(--ink-faint); transition: transform 0.2s; }
.dropdown.active .dropdown-icon { transform: rotate(180deg); }
.dropdown.active > .dropbtn { color: var(--ink); font-weight: 600; }

.content-area {
    flex: 1;
    padding: 1.75rem 2rem;
    overflow-y: auto;
    min-width: 0;
}

/* =============================================================================
   4. Footer
   ============================================================================= */
.site-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--ink-faint);
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.site-footer p { margin: 2px 0; color: var(--ink-faint); }
.site-footer a { color: var(--primary); text-decoration: none; }

/* =============================================================================
   5. Login / Landing page
   ============================================================================= */
.page-login-body { background-color: var(--canvas); }
.page-login-body .main-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--canvas);
    padding: 1rem;
    min-height: 80vh;
    box-sizing: border-box;
}
.page-login-body .sidebar { display: none; }
.page-login-body .content-area {
    flex: 0;
    width: 100%;
    max-width: 900px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.landing-hero { text-align: center; padding: 0.5rem; margin-bottom: 0; }
.hero-icon { font-size: 2rem; color: var(--primary); margin-bottom: 0.5rem; }
.landing-hero h1 { font-size: 1.6rem; margin: 0.25rem 0; font-weight: 700; }
.landing-hero p { color: var(--ink-soft); margin-bottom: 0.5rem; font-size: 0.9rem; }

.login-section { display: flex; justify-content: center; margin-top: 0.5rem; width: 100%; }
.login-section .card {
    width: 100%;
    max-width: 360px;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 0;
}
.login-section h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--ink); text-align: center; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    text-align: center;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 800px;
}
.feature-card { padding: 1rem; }
.feature-card i { font-size: 1.3rem; color: var(--primary); margin-bottom: 6px; display: block; }
.feature-card h3 { font-size: 0.9rem; margin-bottom: 3px; font-weight: 600; }
.feature-card p { font-size: 0.8rem; color: var(--ink-faint); line-height: 1.4; margin: 0; }

/* =============================================================================
   6. Dashboard
   ============================================================================= */
.dashboard-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-xs);
    border-left: 4px solid var(--primary);
}
.welcome-section { display: flex; align-items: center; gap: 1.25rem; }
.welcome-icon {
    font-size: 1.6rem;
    color: var(--primary);
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-tint);
    border-radius: 50%;
    overflow: hidden;
}
.welcome-icon-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.welcome-text h1 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.user-role { margin: 0.2rem 0 0 0; color: var(--ink-soft); font-size: 0.85rem; }
.quick-stats { display: flex; gap: 0.75rem; }
.stat-item {
    background: var(--canvas);
    border: 1px solid var(--border);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    display: flex; align-items: center; gap: 10px;
}
.stat-value { font-weight: 700; display: block; font-size: 1rem; color: var(--ink); }
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-faint); display: block; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

/* Floating summary cards (flattened — crisp bordered cards, not glassy pills) */
.universal-floating-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-top: 44px;
    margin-top: 20px;
    min-height: 230px;
    justify-content: space-between;
}
.metric-display-compact {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.metric-value-compact { font-size: 3.2rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 5px; }
.metric-label-modern { font-size: 0.68rem; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; letter-spacing: 0.06em; margin-top: 0; }

.float-icon {
    position: absolute;
    width: 56px; height: 56px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    font-size: 1.4rem;
}
.icon-top { top: -28px; left: 50%; transform: translateX(-50%); }
.icon-top i { color: var(--primary); }
.icon-top.purple i { color: var(--warning); }
.icon-top.blue i { color: var(--info); }

.icon-left { left: -16px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 1.05rem; }
.icon-left i { color: var(--success); }

.card-title { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 3px; text-align: center; }
.card-subtitle { font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 12px; text-align: center; }

.live-clock { text-align: center; margin: 8px 0 18px 0; }
.clock-time { font-size: 2.4rem; font-weight: 700; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.clock-ampm { font-size: 0.85rem; color: var(--ink-faint); font-weight: 600; display: block; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.timer-frozen .clock-time { color: var(--ink-faint); opacity: 0.8; }

.btn-row { display: flex; gap: 12px; width: 100%; margin-top: auto; }
.btn-pill {
    flex: 1; padding: 11px 0; border: none; border-radius: var(--radius-md);
    font-size: 0.9rem; font-weight: 600; color: white; cursor: pointer; transition: 0.15s;
}
.btn-checkin-green { background-color: var(--success); }
.btn-checkin-green:hover { background-color: var(--success-dark); }
.btn-checkout-red { background-color: var(--danger); }
.btn-checkout-red:hover { background-color: var(--danger-dark); }
.btn-pill:disabled { background-color: var(--border); color: var(--ink-faint); cursor: not-allowed; }

.shortcut-grid-compact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 10px; }
.shortcut-item-compact {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 12px; background: var(--canvas); border-radius: var(--radius-md);
    text-decoration: none; color: var(--ink); border: 1px solid var(--border); transition: 0.15s;
}
.shortcut-item-compact:hover { background: var(--primary-tint); border-color: var(--primary); }
.shortcut-item-compact i { font-size: 1.25rem; margin-bottom: 5px; color: var(--primary); }
.shortcut-item-compact span { font-size: 0.72rem; font-weight: 600; }

/* Metric / chart cards used on HR admin & report dashboards */
.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
}
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
    margin-bottom: 1.5rem;
}
.chart-card canvas { max-height: 260px; }
.metric-card .value, .metric-card .metric-value { font-size: 2rem; font-weight: 800; color: var(--primary); }

/* =============================================================================
   7. Page header, cards, sections
   ============================================================================= */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { display: flex; align-items: center; gap: 10px; }
.page-header p { color: var(--ink-faint); font-size: 0.88rem; margin-top: 0.25rem; }

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.profile-header h1 { display: flex; align-items: center; gap: 10px; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.card, .action-card, .data-card, .form-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.card-header { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.card-body { padding: 1.25rem; }
.action-card, .data-card, .form-section { padding: 1.25rem 1.5rem; }
.action-card h2, .data-card h2, .form-section .section-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.section-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.85rem; display: flex; align-items: center; gap: 8px; }
.section-title.text-muted { color: var(--ink-faint); font-weight: 500; }

.shadow-hover { transition: box-shadow 0.15s, transform 0.15s; }
.shadow-hover:hover { box-shadow: var(--shadow-md); }
.hidden-section { display: none; }

/* =============================================================================
   8. Forms
   ============================================================================= */
.form-group { display: flex; flex-direction: column; margin-bottom: 1rem; }
label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--ink-soft); }
input, select, textarea {
    padding: 9px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    width: 100%;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
}
input[type="file"] { padding: 7px; border-style: dashed; }
input:disabled, select:disabled, textarea:disabled { background: var(--canvas); color: var(--ink-faint); }

.grid-container, .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
}
.form-actions { display: flex; gap: 10px; margin-top: 1rem; align-items: center; }
.full-width { grid-column: 1 / -1; }
.helper-text, .small-text { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }
.note-input { font-size: 0.85rem !important; padding: 7px 9px !important; }

/* =============================================================================
   9. Buttons (unify all legacy button-* classes into one system)
   ============================================================================= */
.btn, .button, .button-save, .btn-primary,
.button-approve, .button-view-edit, .button-export,
button[type="submit"], input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--button-primary);
    color: #fff;
    padding: 9px 18px;
    border: 1px solid var(--button-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
    transition: 0.15s;
    line-height: 1.3;
}
.btn:hover, .button:hover, .button-save:hover, .btn-primary:hover,
.button-approve:hover, .button-view-edit:hover, .button-export:hover,
button[type="submit"]:hover, input[type="submit"]:hover {
    background: var(--button-primary-hover);
    border-color: var(--button-primary-hover);
}
.button-save { width: auto; }

.btn-secondary, .toggle-button {
    background: var(--surface);
    color: var(--ink-soft);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover, .toggle-button:hover { background: var(--canvas); color: var(--ink); }

.button-approve, .button-approve-small { background: var(--success); border-color: var(--success); }
.button-approve:hover, .button-approve-small:hover { background: var(--success-dark); border-color: var(--success-dark); }

.button-reject, .button-reject-small, .button-delete {
    background: var(--surface);
    color: var(--danger);
    border: 1px solid var(--danger-tint);
}
.button-reject:hover, .button-reject-small:hover, .button-delete:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.button-view-edit, .button-view-edit-small {
    background: var(--surface);
    color: var(--info-dark);
    border: 1px solid var(--info-tint);
}
.button-view-edit:hover, .button-view-edit-small:hover { background: var(--info); color: #fff; border-color: var(--info); }

.button-export { background: var(--ink); border-color: var(--ink); }
.button-export:hover { background: #000; border-color: #000; }

.button-small, .button-approve-small, .button-reject-small, .button-view-edit-small {
    padding: 5px 11px;
    font-size: 0.76rem;
    border-radius: var(--radius-sm);
}

.action-btn-group, .action-btn-group-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* =============================================================================
   10. Tables
   ============================================================================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
thead th {
    text-align: left;
    padding: 10px 12px;
    background: var(--canvas);
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    vertical-align: middle;
}
tbody tr:hover { background: var(--canvas); }
tbody tr:last-child td { border-bottom: none; }

.monitor-table thead th { background: var(--primary-tint); color: var(--primary-dark); }

/* =============================================================================
   11. Badges, pills, status indicators
   ============================================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--canvas);
    color: var(--ink-soft);
    white-space: nowrap;
}
.role-badge { background: var(--primary-tint); color: var(--primary-dark); }
.badge-count { background: var(--canvas); color: var(--ink-soft); padding: 3px 9px; border-radius: 10px; font-size: 0.75rem; font-weight: 700; }

.status-badge-pending { background: var(--warning-tint); color: var(--warning-dark); }
.status-approved { background: var(--success-tint); color: var(--success-dark); }
.status-rejected { background: var(--danger-tint); color: var(--danger-dark); }
.status-late { background: var(--danger-tint); color: var(--danger-dark); }
.status-ontime { background: var(--success-tint); color: var(--success-dark); }
/* Class names starting with a digit must be escaped in CSS (leading digit is invalid unescaped) */
.\32 fa-status-enabled { background: var(--success-tint); color: var(--success-dark); padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.\32 fa-status-disabled { background: var(--canvas); color: var(--ink-faint); padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.duration-pill { background: var(--info-tint); color: var(--info-dark); padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }

/* =============================================================================
   12. Alerts & empty states
   ============================================================================= */
.alert {
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-tint); color: var(--success-dark); border-color: #C9EDDD; }
.alert-danger { background: var(--danger-tint); color: var(--danger-dark); border-color: #F6CDCD; }
.alert-info { background: var(--info-tint); color: var(--info-dark); border-color: #CFE2F5; }
.info-box-danger { background: var(--danger-tint); color: var(--danger-dark); border: 1px solid #F6CDCD; border-radius: var(--radius-md); padding: 0.85rem 1.1rem; }

.empty-state, .empty-msg {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ink-faint);
}
.empty-state i { font-size: 2rem; margin-bottom: 10px; display: block; color: var(--border-strong); }

.danger-zone { border: 1px solid var(--danger-tint); background: var(--danger-tint); border-radius: var(--radius-lg); padding: 1.25rem; margin-top: 1.5rem; }
.highlight-border { border-left: 3px solid var(--primary); padding-left: 1rem; }

/* =============================================================================
   13. Misc utilities
   ============================================================================= */
.text-muted, .text-light { color: var(--ink-faint); }
.text-dark { color: var(--ink); }
.text-italic { font-style: italic; }
.font-weight-600 { font-weight: 600; }
.report-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.remark-cell { color: var(--ink-soft); font-size: 0.82rem; }
.onboarding-footer, .onoff-section, .oversight-section, .history-section { margin-top: 1.5rem; }

/* Dashboard "highlights" widgets (holidays / birthdays / anniversaries) */
.highlight-list { list-style: none; margin: 0; padding: 0; }
.highlight-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 0; border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.highlight-list li:last-child { border-bottom: none; }
.highlight-date {
    flex-shrink: 0; min-width: 52px;
    background: var(--primary-tint); color: var(--primary-dark);
    font-weight: 700; font-size: 0.72rem; text-align: center;
    padding: 3px 6px; border-radius: var(--radius-sm);
}
.highlight-label { color: var(--ink); }

/* Generic modal popup (e.g. late-login notice) */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(30, 33, 41, 0.5);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); padding: 2rem;
    max-width: 380px; width: 100%; text-align: center;
}
.modal-icon { font-size: 2rem; color: var(--warning); margin-bottom: 0.75rem; }
.modal-box h3 { margin-bottom: 0.5rem; }
.modal-box p { color: var(--ink-soft); margin-bottom: 1.25rem; }

/* Radio-button "toggle switch" group (e.g. Auto/Manual employee code mode) */
.toggle-switch-group { display: flex; gap: 10px; margin-top: 4px; }
.toggle-switch {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    padding: 8px 14px; cursor: pointer; font-size: 0.85rem; font-weight: 500;
    transition: 0.15s;
}
.toggle-switch input[type="radio"] { width: auto; margin: 0; }
.toggle-switch:has(input:checked) {
    border-color: var(--primary); background: var(--primary-tint); color: var(--primary-dark);
}
.employee-code-badge {
    display: inline-block; background: var(--canvas); border: 1px solid var(--border);
    color: var(--ink-soft); font-weight: 600; font-family: monospace;
    padding: 8px 11px; border-radius: var(--radius-md); font-size: 0.88rem;
}

/* Profile photo widgets */
.profile-photo-preview {
    width: 72px; height: 72px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--border-strong);
}
.profile-photo-placeholder {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--primary-tint); color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.4rem; border: 2px solid var(--border-strong);
}

/* Show/hide password toggle (auto-injected by JS around every password field) */
.password-field-wrapper { position: relative; width: 100%; }
.password-field-wrapper input[type="password"],
.password-field-wrapper input[type="text"] { padding-right: 40px; width: 100%; }
.password-toggle-btn {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--ink-faint); font-size: 0.9rem; padding: 4px 6px;
    display: flex; align-items: center; justify-content: center;
}
.password-toggle-btn:hover { color: var(--ink-soft); }

/* =============================================================================
   14. Responsive — tablet (≤1024px) and mobile (≤768px, ≤480px)
   Desktop (>1024px) layout above is untouched; everything below only adds
   overrides at narrower widths.
   ============================================================================= */

/* --- Tablet & mobile: off-canvas sidebar, shown via the hamburger button --- */
@media (max-width: 1024px) {
    .hamburger-btn { display: inline-flex; align-items: center; justify-content: center; }

    .main-container { position: relative; }

    .sidebar {
        position: fixed;
        top: 56px; /* below the topbar */
        left: 0;
        bottom: 0;
        width: 78vw;
        max-width: 300px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow-md);
    }
    .sidebar.sidebar-open { transform: translateX(0); }

    .content-area { padding: 1.25rem; width: 100%; }

    /* 3-column layouts become 2 on tablet, before dropping to 1 on phones */
    .dashboard-grid,
    .features-grid,
    #org_chart_page .org-children { grid-template-columns: repeat(2, 1fr); }

    .quick-stats { flex-wrap: wrap; }
}

/* --- Phones and small tablets --- */
@media (max-width: 768px) {
    .features-grid { grid-template-columns: 1fr; }
    .main-container { flex-direction: column; }
    .content-area { padding: 1rem; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .dashboard-header .quick-stats { width: 100%; }
    .grid-container, .form-grid, .dashboard-grid { grid-template-columns: 1fr; }

    /* Topbar: keep the logo + hamburger + avatar; drop the verbose greeting text */
    .topbar { padding: 0 0.85rem; }
    .user-greeting { font-size: 0; gap: 0; } /* collapses text, avatar circle stays visible */
    .user-avatar-circle { margin: 0; }
    .button-logout span { display: none; }
    .button-logout { padding: 7px 10px; }

    /* Tables: don't let a wide table blow out the layout — scroll horizontally
       instead. Applied to the common containers tables sit in across templates. */
    .card-body, .data-card, .action-card, .form-section, .card {
        overflow-x: auto;
    }
    table { min-width: 560px; }

    /* Buttons and form actions become full-width, easier to tap */
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn, .form-actions .btn-secondary, .form-actions a.btn-secondary {
        width: 100%; text-align: center;
    }
    .header-actions { flex-wrap: wrap; }

    /* Dashboard floating cards: slightly smaller so 3 stacked cards don't
       feel oversized on a phone screen */
    .metric-value-compact { font-size: 2.4rem; }
    .clock-time { font-size: 1.9rem; }
    .shortcut-grid-compact { grid-template-columns: 1fr; }

    .login-section .card { padding: 1.5rem; }
    .features-grid { margin-top: 1rem; }

    .toggle-switch-group { flex-direction: column; }
}

/* --- Small phones --- */
@media (max-width: 480px) {
    .content-area { padding: 0.75rem; }
    .page-header h1, .profile-header h1 { font-size: 1.2rem; }
    .card-body, .action-card, .data-card, .form-section { padding: 1rem; }
    .logo { font-size: 1rem; }
    .modal-box { padding: 1.5rem; }
    .universal-floating-card { padding: 16px; padding-top: 40px; }
    .metric-value-compact { font-size: 2rem; }
}

.date-confirm-label {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-weight: 500;
    vertical-align: middle;
}

.masked-date-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0 8px;
    background: var(--surface);
    height: 38px;
}
.masked-date-part {
    border: none;
    outline: none;
    background: transparent;
    text-align: center;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--ink);
    padding: 0;
}
.masked-date-day, .masked-date-month { width: 24px; }
.masked-date-year { width: 42px; }
.masked-date-sep { color: var(--ink-faint); font-size: 0.85rem; }
.masked-date-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-tint); }

/* Employee list filter bar */
.employee-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}
.employee-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0 12px;
    height: 38px;
    flex: 1 1 260px;
    min-width: 220px;
}
.employee-filter-search i { color: var(--ink-faint); font-size: 0.85rem; }
.employee-filter-search input {
    border: none; outline: none; background: transparent;
    width: 100%; height: 100%; font-size: 0.88rem;
}
.employee-filter-select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 0.85rem;
    color: var(--ink);
    min-width: 160px;
}
.employee-filter-clear {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--ink-soft); font-size: 0.82rem; text-decoration: none;
    padding: 0 6px;
}
.employee-filter-clear:hover { color: var(--danger-dark); }

.employee-active-filters {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 0.82rem; color: var(--ink-soft);
    margin-bottom: 12px;
}

.employee-sort-link {
    color: var(--ink-soft);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}
.employee-sort-link i { font-size: 0.75rem; opacity: 0.35; }
.employee-sort-link:hover { color: var(--primary-dark); }
.employee-sort-link:hover i { opacity: 0.7; }
.employee-sort-link.active { color: var(--primary-dark); }
.employee-sort-link.active i { opacity: 1; color: var(--primary); }
