/* ============================================================
   COMPANY PORTAL — Unified Style Sheet
   Pages: index, admin, employee, attendance,
          attendance-admin, attendance-login
   Theme: Medeuon Teal/Navy — June 2026
   ============================================================ */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    /* Brand palette — teal/navy to match Medeuon logo */
    --primary-color:    #0d9488;   /* teal-600 */
    --primary-dark:     #0f766e;   /* teal-700 */
    --primary-darker:   #115e59;   /* teal-800 */
    --primary-light:    #ccfbf1;   /* teal-100 */
    --primary-xlight:   #f0fdfa;   /* teal-50  */
    --accent:           #14b8a6;   /* teal-500 */
    --accent2:          #06b6d4;   /* cyan-500 (secondary accent) */

    --bg-page:          #f0fafa;
    --bg-secondary:     #f7fffe;
    --card-bg:          #ffffff;
    --card-shadow:      0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(13,148,136,.06);
    --card-shadow-hover:0 8px 28px rgba(13,148,136,.18);

    --border-color:     #e2f0ef;
    --border-focus:     #0d9488;

    --text-primary:     #0f2027;
    --text-secondary:   #1e3a3a;
    --text-tertiary:    #6b9090;
    --text-muted:       #5a8080;

    --success:          #16a34a;
    --success-bg:       #dcfce7;
    --success-border:   #bbf7d0;
    --warning:          #d97706;
    --warning-bg:       #fef9c3;
    --warning-border:   #fde68a;
    --danger:           #dc2626;
    --danger-bg:        #fee2e2;
    --danger-border:    #fecaca;
    --info:             #0284c7;
    --info-bg:          #e0f2fe;
    --info-border:      #bae6fd;

    --radius-sm:        7px;
    --radius:           12px;
    --radius-lg:        16px;

    --nav-bg:           #0f2027;
    --nav-text:         #a7d8d4;
    --nav-hover:        rgba(13,148,136,.18);

    --att-primary:      #0d9488;
    --att-accent:       #14b8a6;
    --att-bg:           #f0fafa;

    /* Animation timing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --bg-page:          #061414;
    --bg-secondary:     #0c1f1f;
    --card-bg:          #0c1f1f;
    --card-shadow:      0 2px 16px rgba(0,0,0,.4);
    --card-shadow-hover:0 8px 32px rgba(13,148,136,.22);
    --border-color:     #143d3a;
    --border-focus:     #14b8a6;
    --text-primary:     #e8fffe;
    --text-secondary:   #a7d8d4;
    --text-tertiary:    #5a9090;
    --text-muted:       #7ab5b0;
    --nav-bg:           #040f0f;
    --att-bg:           #061414;
    --primary-xlight:   #0a2020;
    --primary-light:    #0a3030;
    --bg-secondary:     #0c1f1f;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--text-primary); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; }
.text-xs       { font-size: .78rem; }
.text-sm       { font-size: .85rem; }
.text-muted    { color: var(--text-muted); }
.text-tertiary { color: var(--text-tertiary); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.mt-1  { margin-top: .25rem; }
.mb-2  { margin-bottom: 1rem; }
.gap-1 { gap: .5rem; }

/* ── Layout ─────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(13,148,136,.35) 0%, transparent 70%),
        linear-gradient(160deg, #040f0f 0%, #0d2a28 45%, #0f3d3a 100%);
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(13,148,136,.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(6,182,212,.08) 0%, transparent 40%);
    pointer-events: none;
}
/* Animated grid pattern */
.login-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(13,148,136,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,148,136,.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
}
.card:hover { box-shadow: var(--card-shadow-hover); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background: var(--nav-bg);
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(13,148,136,.15), 0 4px 24px rgba(0,0,0,.4);
    border-bottom: 1px solid rgba(13,148,136,.12);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    flex-shrink: 0;
}
.navbar-logo {
    height: 38px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    padding: 4px 6px;
    transition: opacity .15s;
}
.navbar-logo:hover { opacity: .85; }
.navbar-title {
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
}
.navbar-right {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.navbar-divider {
    width: 1px;
    height: 22px;
    background: rgba(13,148,136,.25);
    margin: 0 .35rem;
    flex-shrink: 0;
}
.navbar-user {
    font-size: .78rem;
    color: var(--nav-text);
    font-weight: 600;
    background: rgba(13,148,136,.12);
    border: 1px solid rgba(13,148,136,.22);
    border-radius: 20px;
    padding: .3rem .85rem;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Buttons ────────────────────────────────────────────────── */
button, .btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.15rem;
    font-size: .85rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s, transform .15s var(--ease-out), box-shadow .15s;
    background: var(--primary-color);
    color: #fff;
    line-height: 1;
    font-family: inherit;
}
button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,148,136,.3);
}
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm { padding: .35rem .8rem; font-size: .78rem; }
.btn-lg { padding: .8rem 1.6rem; font-size: .95rem; }

.btn-ghost {
    background: transparent;
    color: var(--nav-text);
    border: 1px solid rgba(13,148,136,.2);
    border-radius: var(--radius-sm);
    transition: background .15s, border-color .15s, color .15s;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--nav-hover);
    border-color: rgba(13,148,136,.4);
    color: #fff;
    transform: none;
    box-shadow: none;
}
.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}
.btn-outline:hover:not(:disabled) {
    background: var(--primary-light);
    transform: none;
    box-shadow: none;
}
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,.3); }
.btn-email   { background: #0369a1; color: #fff; }
.btn-email:hover:not(:disabled)   { background: #075985; }

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    font-size: .78rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--primary-color);
    color: #fff;
    transition: background .15s, box-shadow .15s;
    font-family: inherit;
}
.btn-upload:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(13,148,136,.3); }

/* ── Form elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .38rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="month"],
select,
textarea {
    width: 100%;
    padding: .58rem .8rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(13,148,136,.13);
    background: var(--card-bg);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

/* ── Messages & Alerts ──────────────────────────────────────── */
.error-msg {
    color: var(--danger);
    font-size: .82rem;
    margin-top: .4rem;
    display: block;
}
.success-msg {
    color: var(--success);
    font-size: .82rem;
    margin-top: .4rem;
    display: block;
}
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    border-left: 3px solid;
    margin-bottom: 1rem;
}
.alert-success { background: var(--success-bg); color: #14532d; border-color: var(--success); }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: var(--warning); }
.alert-danger  { background: var(--danger-bg);  color: #7f1d1d; border-color: var(--danger);  }
.alert-info    { background: var(--info-bg);    color: #0c4a6e; border-color: var(--info);    }

/* ── Login Card ─────────────────────────────────────────────── */
.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(13,148,136,.12);
    padding: 2.75rem 2.25rem 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: cardIn .5s var(--ease-out);
    color: #111827;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0d9488, #06b6d4);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.login-logo {
    display: block;
    height: 56px;
    margin: 0 auto 1.75rem;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(13,148,136,.2));
}
.login-card h2 {
    text-align: center;
    margin-bottom: .3rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f2027;
}
.login-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: .88rem;
    margin-bottom: 1.85rem;
}
.login-footer   { display: flex; justify-content: flex-end; align-items: center; margin-top: 1rem; }

/* Force all form elements inside login card to be always legible */
.login-card .form-group label {
    color: #374151;
    font-weight: 600;
    font-size: .83rem;
}
.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
    background: #f0fafa;
    border: 1.5px solid #c8e8e5;
    color: #0f2027;
    border-radius: 9px;
    padding: .7rem .9rem;
    font-size: .92rem;
}
.login-card input[type="text"]:focus,
.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus {
    background: #fff;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13,148,136,.14);
}
.login-card input::placeholder { color: #9ca3af; }
.login-card #loginBtn {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    font-size: .95rem;
    border-radius: 9px;
    padding: .78rem;
    box-shadow: 0 4px 16px rgba(13,148,136,.3);
    transition: opacity .18s, transform .18s, box-shadow .18s;
}
.login-card #loginBtn:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(13,148,136,.4);
}
.login-card .error-msg { color: #dc2626; }
.login-card .btn-ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    font-size: .78rem;
}
.login-card .btn-ghost:hover { background: #f3f4f6; color: #374151; }

/* ── Stats Row ──────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.15rem 1rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    transition: box-shadow .2s, transform .2s var(--ease-out);
    animation: fadeUp .4s var(--ease-out) both;
}
.stat-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.stat-card-profit { border-top-color: var(--success); }
.stat-value { font-size: 1.65rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label {
    font-size: .73rem;
    color: var(--text-tertiary);
    margin-top: .3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: .35rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
}
.tab-btn {
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: .65rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: -2px;
    transform: none !important;
    box-shadow: none !important;
    transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--primary-color); background: transparent; }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-pane        { display: none; }
.tab-pane.active { display: block; animation: fadeUp .25s var(--ease-out); }

/* ── Inbox tab buttons (inside modal) ───────────────────────── */
.inbox-tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s, border-color .15s;
    transform: none !important;
    box-shadow: none !important;
}
.inbox-tab-btn.active,
.inbox-tab-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ── Project Grid & Cards ───────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
.project-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.15rem 1.3rem;
    cursor: pointer;
    transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out), border-color .2s;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    animation: fadeUp .35s var(--ease-out) both;
}
.project-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-3px);
    border-color: rgba(13,148,136,.3);
}
.project-card-title  { font-size: .95rem; font-weight: 700; color: var(--text-primary); }
.project-card-client { font-size: .78rem; color: var(--text-tertiary); }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: .25rem; }
.project-card-last-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .48rem .65rem;
    background: var(--primary-xlight);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
    margin-top: .1rem;
}
.last-note-label { font-size: .68rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
.last-note-text  { font-size: .78rem; color: var(--text-secondary); line-height: 1.4; }
.last-note-time  { font-size: .68rem; color: var(--text-tertiary); }

/* Due date pills */
.due-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
}
.due-pill-ok      { background: var(--success-bg); color: #14532d; }
.due-pill-urgent  { background: var(--warning-bg); color: #78350f; }
.due-pill-overdue { background: var(--danger-bg);  color: #7f1d1d; }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
    text-align: center;
    gap: .6rem;
}
.empty-icon    { font-size: 2.5rem; line-height: 1; }
.empty-icon-lg { font-size: 3rem; line-height: 1; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-not-started { background: #f3f4f6; color: #374151; }
.badge-ongoing     { background: var(--primary-light); color: var(--primary-darker); }
.badge-blocked     { background: #fee2e2; color: #991b1b; }
.badge-finished    { background: #dcfce7; color: #15803d; }

/* Chip (inline type tag) */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead th {
    background: var(--primary-color);
    color: #fff;
    padding: .72rem .88rem;
    text-align: left;
    font-weight: 700;
    font-size: .78rem;
    white-space: nowrap;
    letter-spacing: .02em;
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
tbody td             { padding: .68rem .88rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td    { background: var(--primary-xlight); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4,15,15,.55);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(13,148,136,.1);
    width: min(560px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn .25s var(--ease-out);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.95) translateY(12px); }
    to   { opacity: 1; transform: scale(1)  translateY(0);    }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: .25rem .45rem;
    line-height: 1;
    border-radius: 6px;
    transition: background .15s, color .15s;
    box-shadow: none !important;
    transform: none !important;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-scroll { overflow-y: auto; padding: 1.3rem 1.5rem 1.5rem; flex: 1; }

/* ── Project Detail Modal ───────────────────────────────────── */
.pd-hero {
    background: linear-gradient(135deg, #040f0f, #0d9488);
    color: #fff;
    padding: 1.5rem 1.75rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.pd-hero-title { font-size: 1.2rem; font-weight: 800; margin-top: .5rem; color: #fff; }
.pd-hero-desc  { font-size: .83rem; opacity: .8; margin-top: .35rem; }
.pd-hero-meta  { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.pd-meta-pill  { background: rgba(255,255,255,.15); color: #fff; font-size: .72rem; padding: 2px 9px; border-radius: 99px; border: 1px solid rgba(255,255,255,.12); }
.pd-scroll-body { overflow-y: auto; max-height: 60vh; }
.pd-section-label {
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-tertiary);
}
.pd-timeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.pd-timeline-section { padding: 1.25rem 1.75rem; }
.pd-docs-section     { padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--border-color); }

.pd-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem 1.2rem;
    padding: 1.1rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
}
.pd-body-full { grid-column: 1 / -1; }
.due-date-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.due-date-block { display: flex; flex-direction: column; gap: .25rem; flex: 1; min-width: 140px; }
.due-date-sublabel {
    font-size: .72rem; font-weight: 600; color: var(--text-tertiary);
    display: flex; align-items: center; gap: .3rem;
}
.due-ext-tag {
    background: var(--warning-bg); color: #78350f; font-size: .64rem; font-weight: 700;
    padding: 1px 6px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em;
}

.team-member-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.team-member-item {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--primary-light); color: var(--primary-darker);
    border-radius: 99px; padding: 3px 10px; font-size: .78rem; font-weight: 600;
}

.cp-team-chip {
    display: inline-flex; align-items: center;
    background: var(--bg-primary); color: var(--text-secondary);
    border: 1px solid var(--border-color); border-radius: 99px;
    padding: 4px 12px; font-size: .8rem; font-weight: 600;
    cursor: pointer; transition: all .15s; user-select: none;
}
.cp-team-chip:hover { border-color: var(--primary-color); color: var(--primary-color); }
.cp-team-chip.selected {
    background: var(--primary-color); color: #fff; border-color: var(--primary-color);
}

.pd-finance-section { padding: 1.1rem 1.75rem; border-bottom: 1px solid var(--border-color); }
.finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: .85rem; }
.fin-card {
    background: var(--bg-secondary); border-radius: var(--radius);
    padding: .75rem .9rem; border: 1px solid var(--border-color);
    border-top: 3px solid var(--border-color); display: flex; flex-direction: column; gap: .2rem;
}
.fin-card-cost    { border-top-color: var(--info); }
.fin-card-expense { border-top-color: var(--warning); }
.fin-card-profit  { border-top-color: var(--success); }
.fin-card-loss    { border-top-color: var(--danger) !important; }
.fin-card-label { font-size: .7rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
.fin-card-value { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }

.expense-list { display: flex; flex-direction: column; gap: .35rem; }
.expense-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem .75rem; background: var(--bg-secondary);
    border-radius: var(--radius-sm); border: 1px solid var(--border-color); font-size: .83rem;
}
.expense-amount { font-weight: 700; color: var(--danger); white-space: nowrap; }

.pd-replies-section { padding: 1.1rem 1.75rem; }
.reply-card {
    background: var(--bg-secondary); border-radius: var(--radius-sm);
    border: 1px solid var(--border-color); border-left: 3px solid var(--primary-color);
    padding: .6rem .85rem; font-size: .82rem;
}
.reply-unread { border-left-color: var(--danger); background: var(--danger-bg); }

/* ── Timeline ───────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: .5rem; }
.timeline-item {
    display: flex; gap: .75rem; padding: .65rem .8rem;
    background: var(--bg-secondary); border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color); font-size: .83rem;
    transition: background .15s;
}
.timeline-item:hover { background: var(--primary-xlight); }
.timeline-item-body { flex: 1; }
.timeline-meta { font-size: .72rem; color: var(--text-tertiary); margin-top: .2rem; }

.timeline-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: .5rem; padding: 2.5rem 1rem; color: var(--text-tertiary); font-size: .85rem;
}
.timeline-entry { display: flex; gap: .75rem; position: relative; }
.timeline-spine { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 20px; }
.timeline-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--primary-color); border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-color); flex-shrink: 0; margin-top: 3px;
}
.timeline-dot.dc-status   { background: var(--info); box-shadow: 0 0 0 2px var(--info); }
.timeline-dot.dc-note     { background: var(--primary-color); }
.timeline-dot.dc-task     { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-content { flex: 1; padding-bottom: 1rem; }
.timeline-content-header { display: flex; align-items: center; gap: .4rem; margin-bottom: .25rem; flex-wrap: wrap; }
.timeline-note { font-size: .83rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: .3rem; }
.meta-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--primary-color); color: #fff;
    font-size: .6rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.tl-type-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 99px; font-size: .7rem; font-weight: 700; }
.tl-type-chip.chip-status { background: var(--info-bg);    color: #0c4a6e; }
.tl-type-chip.chip-note   { background: var(--primary-light); color: var(--primary-darker); }
.tl-type-chip.chip-task   { background: var(--success-bg); color: #14532d; }

/* ── Documents list ─────────────────────────────────────────── */
.docs-list  { display: flex; flex-direction: column; gap: .4rem; }
.docs-empty { text-align: center; padding: 1.5rem; color: var(--text-tertiary); font-size: .82rem; font-style: italic; }
.doc-item {
    display: flex; align-items: center; gap: .65rem; padding: .52rem .78rem;
    background: var(--bg-secondary); border-radius: var(--radius-sm);
    border: 1px solid var(--border-color); font-size: .83rem;
    transition: background .15s, border-color .15s;
}
.doc-item:hover { background: var(--primary-light); border-color: var(--primary-color); }
.doc-icon { font-size: 1.2rem; flex-shrink: 0; }
.doc-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.doc-name { font-weight: 600; color: var(--primary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: .72rem; color: var(--text-tertiary); }

/* ── Flex helpers ───────────────────────────────────────────── */
.flex-row     { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.section-title {
    font-size: 1rem; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: .4rem;
}

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inbox badge ────────────────────────────────────────────── */
.inbox-badge {
    background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700;
    padding: 1px 5px; border-radius: 99px; min-width: 18px; text-align: center;
}

/* ============================================================
   ATTENDANCE LOGIN  (attendance-login.html)
   ============================================================ */
.att-login-wrapper {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 70% 50% at 50% -5%, rgba(13,148,136,.4) 0%, transparent 65%),
        linear-gradient(160deg, #040f0f 0%, #0c2a28 50%, #0f3d3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}
.att-login-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(13,148,136,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,148,136,.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
/* Floating blobs */
.att-login-wrapper::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13,148,136,.15), transparent 70%);
    top: -100px; right: -100px;
    pointer-events: none;
}

.att-login-card {
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(13,148,136,.12);
    padding: 2.75rem 2.5rem 3rem;
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
    animation: cardIn .5s var(--ease-out);
}
.att-login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent2));
    border-radius: 20px 20px 0 0;
}
.att-login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}
.att-login-logo img {
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(13,148,136,.25));
}
.att-login-logo .logo-fallback {
    font-size: 1.5rem; font-weight: 900;
    color: var(--primary-color); letter-spacing: 2px;
    border: 2.5px solid var(--primary-color);
    padding: 10px 20px; border-radius: 8px;
}
.att-login-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: .4rem;
}
.att-login-subtitle {
    text-align: center;
    font-size: .85rem;
    color: var(--text-tertiary);
    margin-bottom: 1.75rem;
}
.att-login-field { margin-bottom: 1.15rem; }
.att-login-field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .4rem;
}
.att-login-field input {
    width: 100%;
    padding: .75rem .9rem;
    border: 1.5px solid #c8e8e5;
    border-radius: 9px;
    font-size: .92rem;
    color: #0f2027;
    background: #f4fffe;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
    font-family: inherit;
}
.att-login-field input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13,148,136,.13);
}
.att-login-err {
    display: none;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: .65rem .9rem;
    font-size: .83rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    animation: fadeUp .2s ease;
}
.att-login-btn-wrap { display: flex; justify-content: center; margin-top: .75rem; }
.att-login-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: .8rem 3.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .18s, transform .18s var(--ease-out), box-shadow .18s;
    box-shadow: 0 4px 16px rgba(13,148,136,.3);
    width: 100%;
    font-family: inherit;
}
.att-login-btn:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(13,148,136,.4);
}
.att-login-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ============================================================
   ATTENDANCE PAGE SHELL  (attendance.html)
   ============================================================ */
.att-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 0 3rem;
    background: var(--att-bg);
    min-height: 100vh;
}

/* Attendance topbar */
.att-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(13,148,136,.15);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.att-topbar-left  { display: flex; align-items: center; gap: 10px; }
.att-topbar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}
.att-topbar-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.att-topbar-title i { font-size: .9rem; color: var(--accent); }

.att-nav-btn {
    background: rgba(13,148,136,.12);
    color: var(--accent);
    border: 1.5px solid rgba(13,148,136,.25);
    border-radius: 7px;
    padding: 5px 11px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: 5px;
    transform: none !important;
    box-shadow: none !important;
    font-family: inherit;
}
.att-nav-btn:hover { background: rgba(13,148,136,.22); border-color: rgba(13,148,136,.45); }

.att-logout-btn {
    background: rgba(220,38,38,.15);
    color: #fca5a5;
    border: 1.5px solid rgba(220,38,38,.25);
    border-radius: 7px;
    padding: 6px 13px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background .15s;
    transform: none !important;
    box-shadow: none !important;
    font-family: inherit;
}
.att-logout-btn:hover { background: rgba(220,38,38,.28); color: #fff; }

/* Logo strip */
.att-logo-section {
    background: var(--card-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--border-color);
}
.att-logo-section img { height: 52px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(13,148,136,.15)); }

/* Check-in grid */
.checkin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 14px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}
.checkin-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 16px 6px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform .18s var(--ease-out), box-shadow .18s;
    min-height: 78px;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(13,148,136,.2);
}
.checkin-btn i { font-size: 1.35rem; }
.checkin-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(13,148,136,.35);
}
.checkin-btn:active:not(:disabled) { transform: translateY(0); }
.checkin-btn:disabled { background: linear-gradient(135deg, #9ca3af, #6b7280); opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }
.checkin-btn.done     { background: linear-gradient(135deg, var(--success), #15803d) !important; opacity: 1 !important; cursor: not-allowed; box-shadow: 0 2px 8px rgba(22,163,74,.25); }

/* Status message */
.att-status { padding: 0 14px; min-height: 44px; margin-top: 8px; }
.att-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 500;
    animation: fadeUp .3s ease;
    line-height: 1.45;
}
.att-msg.processing { background: var(--info-bg);    color: #0369a1; border: 1px solid var(--info-border);    }
.att-msg.success    { background: var(--success-bg); color: #14532d; border: 1px solid var(--success-border); }
.att-msg.warning    { background: var(--warning-bg); color: #78350f; border: 1px solid var(--warning-border); }
.att-msg.error      { background: var(--danger-bg);  color: #7f1d1d; border: 1px solid var(--danger-border);  }

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

/* Attendance section cards */
.att-section {
    background: var(--card-bg);
    margin-top: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.att-section-title {
    font-size: .9rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}
.att-section-title i { color: var(--att-accent); }

/* Check-ins table */
.checkins-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.checkins-table th {
    background: var(--primary-xlight);
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    color: var(--primary-darker);
    border-bottom: 2px solid var(--border-color);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.checkins-table td             { padding: 10px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.checkins-table tr:last-child td { border-bottom: none; }
.cr-label { font-weight: 700; color: var(--text-primary); }
.cr-time  { font-weight: 700; color: var(--text-primary); font-family: 'Courier New', monospace; }
.cr-badge { font-size: .72rem; padding: 3px 10px; border-radius: 99px; font-weight: 700; }
.cr-done  { background: var(--success-bg); color: #14532d; }
.cr-pend  { background: var(--warning-bg); color: #78350f; }

/* Holidays */
.holiday-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.holiday-controls label { font-size: .8rem; color: var(--text-secondary); font-weight: 700; }
.holiday-controls select {
    padding: 5px 8px; border: 1.5px solid var(--border-color);
    border-radius: 7px; font-size: .8rem; color: var(--text-primary);
    background: var(--bg-secondary); cursor: pointer; min-width: 90px; width: auto;
    font-family: inherit;
}
.reset-btn {
    background: var(--primary-xlight); color: var(--primary-color);
    border: 1.5px solid rgba(13,148,136,.2); border-radius: 7px;
    padding: 5px 11px; font-size: .78rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 5px;
    transform: none !important; box-shadow: none !important; font-family: inherit;
    transition: background .15s, border-color .15s;
}
.reset-btn:hover { background: var(--primary-light); border-color: rgba(13,148,136,.4); }

.hol-table    { width: 100%; border-collapse: collapse; font-size: .82rem; }
.hol-table th {
    background: var(--primary-xlight); padding: 7px 10px; text-align: left;
    font-weight: 700; color: var(--primary-darker);
    border-bottom: 2px solid var(--border-color); font-size: .75rem; text-transform: uppercase;
}
.hol-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-color); }
.hol-table tr:last-child td { border-bottom: none; }
.hol-empty    { text-align: center; padding: 20px; color: var(--text-tertiary); font-style: italic; font-size: .83rem; }

/* ── Leave Balance Tiles ──────────────────────────────────────── */
.leave-balance-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.leave-balance-tile {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 18px;
    border: 1.5px solid var(--border-color);
    box-shadow: 0 1px 6px rgba(63,81,181,.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.leave-balance-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}
.leave-balance-tile.casual::before { background: linear-gradient(90deg, #5c6bc0, #7986cb); }
.leave-balance-tile.earned::before { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.lb-type {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-tertiary);
}
.lb-remain {
    font-size: 2rem;
    font-weight: 900;
    color: #1a237e;
    line-height: 1.1;
}
.leave-balance-tile.earned .lb-remain { color: var(--primary-darker); }
.lb-of {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ── Leave Application Form ───────────────────────────────────── */
.leave-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}
.leave-form > div { display: flex; flex-direction: column; gap: 5px; }
.leave-form label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.leave-form select,
.leave-form input[type="date"] {
    padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: .875rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    outline: none;
    width: 100%;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
    cursor: pointer;
}
.leave-form select:focus,
.leave-form input[type="date"]:focus {
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63,81,181,.13);
    background: var(--card-bg);
}
.leave-form .full-row { grid-column: 1 / -1; }
.leave-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: .875rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    outline: none;
    resize: vertical;
    min-height: 74px;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
}
.leave-form textarea:focus {
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63,81,181,.13);
    background: var(--card-bg);
}
.leave-days-hint {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 9px 12px;
    background: var(--primary-xlight);
    border-radius: 9px;
    border: 1.5px solid var(--border-color);
    min-height: 40px;
    display: flex;
    align-items: center;
}
.leave-submit-btn {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #3f51b5, #5c6bc0);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    transition: opacity .18s, transform .18s, box-shadow .18s;
    box-shadow: 0 4px 14px rgba(63,81,181,.3);
    width: 100%;
    transform: none;
}
.leave-submit-btn:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(63,81,181,.4);
}
.leave-submit-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Leave History Table ──────────────────────────────────────── */
.leave-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}
.leave-table th {
    background: #e8eaf6;
    color: #3f51b5;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    font-size: .73rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 2px solid #c5cae9;
}
.leave-table th:first-child { border-radius: 0; }
.leave-table th:last-child  { border-radius: 0; }
.leave-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
}
.leave-table tr:last-child td { border-bottom: none; }
.leave-table tr:hover td { background: #f5f6ff; }
.lt-reason { font-size: .82rem; color: var(--text-secondary); max-width: 180px; }
.lt-reason small { color: var(--text-tertiary); }

/* Leave type pills */
.leave-type-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
}
.ltp-casual { background: #e8eaf6; color: #3f51b5; }
.ltp-sick   { background: #fce4ec; color: #c62828; }
.ltp-earned { background: var(--primary-light); color: var(--primary-darker); }

/* Leave status pills */
.leave-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.lp-pending   { background: #fff8e1; color: #e65100; }
.lp-approved  { background: var(--success-bg); color: #14532d; }
.lp-rejected  { background: var(--danger-bg);  color: #7f1d1d; }
.lp-cancelled { background: #f3f4f6; color: #6b7280; }

/* Cancel leave button */
.cancel-leave-btn {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
    border-radius: 7px;
    padding: 4px 10px;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: background .15s, box-shadow .15s;
    transform: none !important;
    box-shadow: none !important;
    white-space: nowrap;
}
.cancel-leave-btn:hover { background: #fecaca; box-shadow: 0 2px 8px rgba(220,38,38,.2) !important; }

/* Clock & calendar */
.att-date-str {
    text-align: center; font-size: .85rem; font-weight: 700;
    color: var(--text-secondary); margin-bottom: 14px;
}
.att-clock-cal {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; flex-wrap: wrap;
}
.analog-clock {
    width: 130px; height: 130px; border-radius: 50%;
    background: var(--card-bg); border: 3px solid var(--att-accent);
    position: relative;
    box-shadow: 0 4px 20px rgba(13,148,136,.2);
    flex-shrink: 0;
}
.hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom center; border-radius: 4px; }
.hand-h { width: 4px;   height: 32px; background: var(--text-primary);  margin-left: -2px; }
.hand-m { width: 3px;   height: 44px; background: var(--text-secondary); margin-left: -1.5px; }
.hand-s { width: 1.5px; height: 52px; background: #e74c3c; margin-left: -.75px; }
.clock-dot {
    position: absolute; top: 50%; left: 50%;
    width: 7px; height: 7px; background: var(--att-accent);
    border-radius: 50%; transform: translate(-50%,-50%); z-index: 5;
}
.clock-num { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }
.clock-num span {
    position: absolute; font-size: .6rem; font-weight: 700;
    color: var(--text-tertiary); transform: translate(-50%, -50%);
}
.cn1  span { top: 15%;  left: 73%; }
.cn2  span { top: 27%;  left: 90%; }
.cn3  span { top: 50%;  left: 96%; }
.cn4  span { top: 73%;  left: 90%; }
.cn5  span { top: 85%;  left: 73%; }
.cn6  span { top: 91%;  left: 50%; }
.cn7  span { top: 85%;  left: 27%; }
.cn8  span { top: 73%;  left: 10%; }
.cn9  span { top: 50%;  left: 4%;  }
.cn10 span { top: 27%;  left: 10%; }
.cn11 span { top: 15%;  left: 27%; }
.cn12 span { top: 9%;   left: 50%; }

/* Mini calendar */
.mini-cal { min-width: 180px; }
.mini-cal-head { text-align: center; font-size: .85rem; font-weight: 800; color: var(--primary-color); margin-bottom: 8px; }
.mini-cal-wk { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .65rem; font-weight: 700; color: var(--text-tertiary); margin-bottom: 4px; gap: 1px; }
.mini-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: .72rem; }
.mini-cal-days div { padding: 3px 2px; border-radius: 50%; cursor: default; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.mini-cal-days .today { background: var(--primary-color); color: #fff; font-weight: 800; }

/* Birthday banner */
.bday-banner {
    display: none;
    margin: 10px 14px 0;
    background: linear-gradient(135deg, #e74c3c, #ff6b6b);
    color: #fff; border-radius: 14px; padding: 14px 16px; text-align: center;
    animation: fadeUp .5s ease;
}
.bday-banner p     { font-size: .95rem; font-weight: 800; }
.bday-banner small { font-size: .76rem; opacity: .9; }

/* ============================================================
   ATTENDANCE ADMIN PAGE  (attendance-admin.html)
   ============================================================ */
.att-admin-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}
.att-admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1rem 1.4rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}
.att-admin-topbar h1 {
    font-size: 1.3rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.att-admin-topbar-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
    margin-right: .5rem;
}
.att-admin-topbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Stat tiles */
.att-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .85rem;
    margin-bottom: 1.4rem;
}
.att-stat-tile {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    text-align: center;
    border-top: 3px solid var(--primary-color);
    transition: box-shadow .2s, transform .2s var(--ease-out);
    animation: fadeUp .4s var(--ease-out) both;
}
.att-stat-tile:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.att-stat-tile.present { border-top-color: var(--success); }
.att-stat-tile.partial { border-top-color: var(--warning); }
.att-stat-tile.absent  { border-top-color: var(--danger); }
.att-stat-tile .num    { font-size: 2.1rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.att-stat-tile .lbl    {
    font-size: .73rem; color: var(--text-tertiary); margin-top: 5px;
    font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}

/* Filter bar */
.att-filter-bar {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
    background: var(--card-bg);
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.1rem;
    border: 1px solid var(--border-color);
}
.att-filter-bar label { font-size: .78rem; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.att-filter-bar select,
.att-filter-bar input[type="date"],
.att-filter-bar input[type="month"] {
    padding: 6px 9px; border: 1.5px solid var(--border-color);
    border-radius: 7px; font-size: .82rem;
    background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; width: auto;
    font-family: inherit;
}
.att-search-input {
    flex: 1; min-width: 140px; padding: 6px 12px;
    border: 1.5px solid var(--border-color); border-radius: 20px;
    font-size: .82rem; background: var(--bg-secondary); color: var(--text-primary);
    width: auto; outline: none; transition: border-color .18s, box-shadow .18s;
    font-family: inherit;
}
.att-search-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }

/* Attendance table */
.att-table-wrap {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--card-shadow); overflow: auto; border: 1px solid var(--border-color);
}
.att-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 650px; }
.att-table th {
    background: var(--primary-color);
    color: #fff; padding: 12px 13px; text-align: left;
    font-weight: 700; white-space: nowrap; font-size: .78rem;
}
.att-table th:first-child { border-radius: var(--radius) 0 0 0; }
.att-table th:last-child  { border-radius: 0 var(--radius) 0 0; }
.att-table td             { padding: 10px 13px; border-bottom: 1px solid var(--border-color); }
.att-table tr:last-child td { border-bottom: none; }
.att-table tr:hover td    { background: var(--primary-xlight); }
.att-table .emp-name      { font-weight: 700; color: var(--text-primary); }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.s-full    { background: var(--success-bg); color: #14532d; }
.s-partial { background: var(--warning-bg); color: #78350f; }
.s-absent  { background: var(--danger-bg);  color: #7f1d1d; }

.time-cell         { font-weight: 700; font-size: .82rem; font-family: 'Courier New', monospace; }
.time-cell.missing { color: var(--text-tertiary); }
.table-empty       { text-align: center; padding: 2.5rem; color: var(--text-tertiary); font-style: italic; font-size: .88rem; }

.btn-export {
    background: var(--success); color: #fff; border: none;
    border-radius: 7px; padding: 7px 14px; font-size: .8rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: .35rem;
    transition: background .15s, box-shadow .15s; transform: none !important;
    font-family: inherit;
}
.btn-export:hover { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,.3); }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.att-table tbody { animation: fadeSlideIn .3s ease; }

/* Tab navigation */
.att-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.4rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.att-tab-btn {
    flex: 1;
    padding: .75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    white-space: nowrap;
}
.att-tab-btn:hover {
    background: var(--primary-xlight);
    color: var(--primary-color);
}
.att-tab-btn.active {
    background: var(--primary-xlight);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

/* Tab panels — only .active is visible */
.att-tab-panel {
    display: none;
}
.att-tab-panel.active {
    display: block;
    animation: fadeSlideIn .25s var(--ease-out) both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .stats-row      { grid-template-columns: repeat(2, 1fr); }
    .project-grid   { grid-template-columns: 1fr; }
    .navbar         { padding: 0 1rem; height: 56px; }
    .navbar-title   { display: none; }
    .navbar-logo    { height: 32px; }
    .navbar-user    { max-width: 100px; }
    .navbar-divider { display: none; }
    .page-wrapper   { padding: 1rem .75rem 3rem; }
    .att-stat-row   { grid-template-columns: repeat(2, 1fr); }
    .tabs           { overflow-x: auto; }
    .finance-summary { grid-template-columns: 1fr; }
    .pd-body        { grid-template-columns: 1fr; }
    .modal          { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-backdrop { align-items: flex-end; padding: 0; }
}
@media (max-width: 480px) {
    .att-login-card { padding: 2rem 1.5rem; border-radius: 16px; margin: .75rem; }
    .att-page       { max-width: 100%; }
    .checkin-grid   { gap: 7px; padding: 10px; }
    .checkin-btn    { font-size: .76rem; padding: 12px 4px; min-height: 68px; }
    .login-card     { padding: 2.25rem 1.5rem; }
}

/* ── Scroll animation helper ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
