/* ============================================================
   PTI Attendance — Shared Styles
   ============================================================ */

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

/* BODY */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f0f2f7;
    color: #1a1d23;
    min-height: 100vh;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7ef;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #1a1d23;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo-text { display: inline; }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: space-between;
    margin-left: 24px;
}
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.nav-link:hover { background: #f3f4f6; color: #1a1d23; }
.nav-link.active { background: #eef2ff; color: #4f46e5; }
.nav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: #374151; border-radius: 2px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 60%, #7c3aed 100%);
    padding: 28px 32px 32px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.hero::after {
    content: '';
    position: absolute;
    right: 80px;
    bottom: -80px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}
.hero-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}
.hero-text { flex: 1; }
.hero-greeting {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
}
.hero-name { color: #fff; font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}
.badge i { font-size: 11px; opacity: 0.8; }

/* ============================================================
   STATUS BAR
   ============================================================ */
.status-bar {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7ef;
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    flex-wrap: wrap;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
    flex-shrink: 0;
}
.status-label { color: #6b7280; }
.status-value { font-weight: 600; color: #10b981; }

/* ============================================================
   CONTENT / LAYOUT
   ============================================================ */
.content { max-width: 1200px; margin: 0 auto; padding: 28px 32px; }
.page-header { max-width: 900px; margin: 28px auto 0; padding: 0 32px; }
.page-title { font-size: 22px; font-weight: 700; color: #1a1d23; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.page-sub { color: #6b7280; font-size: 13.5px; line-height: 1.5; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7ef;
    padding: 24px;
    margin-bottom: 24px;
}
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1d23;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.card-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: #4f46e5;
    border-radius: 2px;
    display: inline-block;
}
.card-title.editing::before { background: #f59e0b; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12.5px; font-weight: 500; color: #6b7280; margin-bottom: 5px; }
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7ef;
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    color: #1a1d23;
    background: #f9fafb;
    outline: none;
    transition: all .15s;
}
.form-input:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}
.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7ef;
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    color: #1a1d23;
    background: #f9fafb;
    outline: none;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
.form-actions { margin-top: 6px; display: flex; gap: 10px; align-items: center; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 9px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.btn-warning:hover { background: #fef3c7; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #e5e7ef; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-filter { background: #4f46e5; color: #fff; padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.btn-reset { background: #f3f4f6; color: #374151; border: 1px solid #e5e7ef; padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-confirm { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; padding: 4px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; }
.btn-confirm:hover { background: #d1fae5; }
.btn-del-ot { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; padding: 4px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; }
.btn-del-ot:hover { background: #fee2e2; }
.btn-del-perm { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; padding: 4px 8px; border-radius: 5px; font-size: 11px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; }
.btn-edit-sm { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; padding: 4px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn-delete-sm { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; padding: 4px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; }
.link-cancel { font-size: 13px; color: #9ca3af; text-decoration: none; cursor: pointer; }
.link-cancel:hover { color: #374151; }
.btn-cancel { font-size: 13px; color: #9ca3af; text-decoration: none; }
.btn-cancel:hover { color: #374151; }
.btn-print { background: #1a1d23; color: #fff; padding: 9px 20px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; font-family: inherit; display: flex; align-items: center; gap: 8px; }
.btn-print:hover { background: #374151; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-card { background: #fff; border-radius: 12px; border: 1px solid #e5e7ef; padding: 20px 24px; margin-bottom: 24px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: 10px; align-items: flex-end; }
.filter-btns { display: flex; gap: 8px; }
.print-btn { display: flex; justify-content: flex-end; margin-bottom: 16px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    padding: 10px 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid #f0f2f7;
    background: #fafafa;
    white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid #f0f2f7; color: #374151; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafe; }
tr.row-missing td { background: #fee2e2 !important; }
tr.row-missing:hover td { background: #fecaca !important; }
tr.permission-row td { background: #eff6ff; color: #1d4ed8; }
tr.permission-row:hover td { background: #dbeafe; }
tr.editing-row td { background: #fffbeb; }
tr.totals-row td { background: #f8f9fe !important; font-weight: 600; font-size: 12.5px; color: #4f46e5; border-top: 2px solid #e5e7ef; }

/* ============================================================
   BADGES
   ============================================================ */
.cell-missing { color: #ef4444; font-size: 12px; font-weight: 600; }
.badge-ot { display: inline-block; background: #fef3c7; color: #d97706; padding: 2px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600; }
.badge-missed { display: inline-block; background: #fee2e2; color: #dc2626; padding: 2px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600; }
.range-badge { background: #eef2ff; color: #4f46e5; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.checkin-badge { background: #ecfdf5; color: #059669; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.checkout-badge { background: #fef2f2; color: #dc2626; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.day-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: #eef2ff; color: #4f46e5; margin: 2px; }
.time-pill { display: inline-block; background: #f3f4f6; color: #374151; padding: 2px 8px; border-radius: 4px; font-size: 12px; margin: 2px 2px 2px 0; }
.text-muted { color: #d1d5db; font-size: 12px; }

/* ============================================================
   EMPLOYEE / DATE SECTIONS
   ============================================================ */
.date-section { margin-bottom: 28px; }
.date-header {
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px 10px 0 0;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-header i { opacity: 0.8; font-size: 12px; }
.employee-table-wrap {
    border: 1px solid #e5e7ef;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    overflow-x: auto;
    background: #fff;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.default-note { font-size: 12.5px; color: #9ca3af; background: #fafafa; border: 1px solid #f0f2f7; border-radius: 8px; padding: 10px 14px; margin-top: 8px; }

/* ============================================================
   EMPTY / PROMPT STATES
   ============================================================ */
.empty-state { text-align: center; padding: 48px; color: #9ca3af; font-size: 14px; }
.prompt-state { text-align: center; padding: 48px; color: #9ca3af; font-size: 14px; background: #fff; border-radius: 12px; border: 1px solid #e5e7ef; }
.prompt-state i { font-size: 32px; margin-bottom: 12px; display: block; color: #d1d5db; }

/* ============================================================
   OT FORM / ROW ACTIONS
   ============================================================ */
.ot-form { display: inline; }
.row-actions { display: flex; gap: 8px; }

/* ============================================================
   WORK DAYS CHECKBOXES
   ============================================================ */
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 20px; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.day-chip span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    border-radius: 8px;
    border: 1px solid #e5e7ef;
    font-size: 12.5px;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    transition: 0.15s;
    text-align: center;
}
.day-chip input:checked + span { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border-color: transparent; }

/* ============================================================
   PUNCH WINDOWS
   ============================================================ */
.window-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.window-box { background: #f9fafb; border: 1px solid #e5e7ef; border-radius: 10px; padding: 16px; }
.window-box-title { font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.window-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkin-box { border-color: #a7f3d0; background: #f0fdf4; }
.checkin-box .window-box-title { color: #059669; }
.checkout-box { border-color: #fca5a5; background: #fef2f2; }
.checkout-box .window-box-title { color: #dc2626; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media(max-width: 768px) {
    .navbar { padding: 0 16px; height: 56px; }
    .nav-logo-text { display: none; }
    .nav-hamburger { display: flex; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #e5e7ef;
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-left: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        z-index: 99;
    }
    .nav-menu.open { display: flex; }
    .nav-links { flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; }
    .nav-link { width: 100%; padding: 10px 14px; }
    .nav-user { width: 100%; flex-wrap: wrap; gap: 8px; }
    .hero { padding: 20px 16px 24px; }
    .hero-name { font-size: 18px; }
    .content { padding: 16px; }
    .page-header { padding: 0 16px; margin-top: 20px; }
    .cards-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 16px; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .window-grid { grid-template-columns: 1fr; }
    .window-row { grid-template-columns: 1fr 1fr; }
    .day-grid { grid-template-columns: repeat(4, 1fr); }
    table, thead, tbody, tr { display: block; }
    th { display: none; }
    tr { margin-bottom: 14px; border: 1px solid #f0f2f7; border-radius: 10px; padding: 10px; }
    td { display: block; border-bottom: none; padding: 4px 6px; }
}
@media(max-width: 480px) {
    .filter-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .window-row { grid-template-columns: 1fr; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .navbar, .filter-card, .status-bar, .print-btn { display: none !important; }
    body { background: #fff; font-size: 11px; }
    .content { margin: 0; padding: 0; max-width: 100%; }
    .date-section { margin-bottom: 16px; page-break-inside: avoid; }
    .date-header { background: #1a1d23 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 0 !important; }
    .employee-table-wrap { border: 1px solid #ccc; border-radius: 0 !important; overflow: visible !important; }
    table { width: 100% !important; display: table !important; }
    thead { display: table-header-group !important; }
    tbody { display: table-row-group !important; }
    tr { display: table-row !important; border: none !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; }
    th { display: table-cell !important; font-size: 10px; padding: 6px 8px; background: #f3f4f6 !important; }
    td { display: table-cell !important; font-size: 10px; padding: 6px 8px; border-bottom: 1px solid #eee !important; }
}
/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f1f8;
    background-image: radial-gradient(ellipse at 60% 0%, #e0e7ff 0%, transparent 60%),
                      radial-gradient(ellipse at 10% 100%, #ede9fe 0%, transparent 50%);
}
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(99,102,241,0.08), 0 1px 4px rgba(0,0,0,0.06);
}
.logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 32px; }
.logo-wrap img { width: 110px; height: 110px; object-fit: contain; }
.brand { text-align: center; }
.brand-name { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, #6366f1, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2; }
.brand-sub { font-size: 12px; color: #9ca3af; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; }
.login-title { font-size: 22px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: #6b7280; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.field input { width: 100%; padding: 11px 14px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-family: inherit; color: #111827; background: #fafafa; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.field input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); background: #fff; }
.login-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; margin-top: 8px; transition: opacity 0.2s, transform 0.1s; }
.login-btn:hover { opacity: 0.92; }
.login-btn:active { transform: scale(0.99); }
.login-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; font-size: 13px; border-radius: 8px; padding: 10px 14px; margin-top: 16px; }
/* ============================================================
   NAV DROPDOWN
   ============================================================ */
.nav-dropdown { position: relative; }
.nav-dropdown-btn { background: none; cursor: pointer; display: flex; align-items: center; gap: 6px; border: none; font-family: inherit; }
.nav-dropdown-btn i { transition: transform 0.2s; }
.nav-dropdown-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; background: #fff; border: 1px solid #e5e7ef; border-radius: 10px; padding: 6px; min-width: 180px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); z-index: 200; }
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: #6b7280; text-decoration: none; transition: all .15s; }
.nav-dropdown-item:hover { background: #f3f4f6; color: #1a1d23; }
.nav-dropdown-item.active { background: #eef2ff; color: #4f46e5; }
.nav-dropdown-item i { font-size: 13px; width: 16px; }
@media(max-width: 768px) {
    .nav-dropdown-menu { position: static; border: none; box-shadow: none; padding: 0 0 0 16px; background: transparent; }
    .nav-dropdown-menu.open { display: block; }
    .nav-dropdown-item { padding: 8px 14px; }
}