/* ============================================================
   absensi.css — SIPDAM Absensi Page
   Theme: Light Green (sama dengan dashboard)
   ============================================================ */

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

:root {
    --abs-green:    #1a7a4a;
    --abs-green-m:  #2d9e63;
    --abs-green-l:  #e8f7ee;
    --abs-green-l2: #d0eedd;
    --abs-teal:     #0d9488;
    --abs-blue:     #2563eb;
    --abs-blue-l:   #eff6ff;
    --abs-violet:   #7c3aed;
    --abs-amber:    #d97706;
    --abs-amber-l:  #fffbeb;
    --abs-rose:     #dc2626;
    --abs-rose-l:   #fff1f2;
    --abs-sky:      #0891b2;
    --abs-sky-l:    #ecfeff;
    --abs-border:   #d1e8da;
    --abs-t1:       #0f172a;
    --abs-t2:       #334155;
    --abs-t3:       #64748b;
    --abs-t4:       #94a3b8;
    --abs-bg:       #f0f7f3;
    --abs-white:    #ffffff;
    --abs-font:     'Figtree', 'Segoe UI', sans-serif;
}

.abs-icon-wrap {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, var(--abs-green), var(--abs-green-m));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    box-shadow: 0 4px 14px rgba(26,122,74,0.25);
}
.abs-page-title {
    font-family: var(--abs-font); font-size: 20px;
    font-weight: 700; color: var(--abs-t1); line-height: 1;
}
.abs-page-sub { font-size: 12px; color: var(--abs-t3); margin-top: 3px; }

.abs-wrap  { padding: 28px 0; background: var(--abs-bg); min-height: 100vh; }
.abs-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ── Tab nav ── */
.abs-tabs {
    display: flex; gap: 4px;
    background: var(--abs-white); border: 1px solid var(--abs-border);
    border-radius: 14px; padding: 5px; margin-bottom: 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.abs-tab {
    flex: 1; padding: 10px 14px; border-radius: 10px;
    font-family: var(--abs-font); font-size: 12px; font-weight: 700;
    color: var(--abs-t3); border: none; background: transparent;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 7px;
}
.abs-tab:hover  { color: var(--abs-t2); background: var(--abs-green-l); }
.abs-tab.active {
    background: var(--abs-green-l); color: var(--abs-green);
    border: 1px solid var(--abs-green-l2);
}
.abs-tab-panel  { display: none; }
.abs-tab-panel.active { display: block; }

/* ── Layout util ── */
.abs-content-grid {
    display: grid; grid-template-columns: 240px 1fr;
    gap: 18px; align-items: start;
}
@media(max-width:960px) { .abs-content-grid { grid-template-columns: 1fr; } }

/* ── Sidebar ── */
.abs-sidebar {
    background: var(--abs-white); border: 1px solid var(--abs-border);
    border-radius: 16px; padding: 20px;
    position: sticky; top: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.abs-sidebar-title {
    font-family: var(--abs-font); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em; color: var(--abs-t3);
    margin-bottom: 16px; display: flex; align-items: center; gap: 7px;
}
.abs-sidebar-title::after { content:''; flex:1; height:1px; background:var(--abs-border); }

.abs-field + .abs-field { margin-top: 12px; }
.abs-field-label {
    font-size: 10px; color: var(--abs-t3); font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: 5px; display: block;
}
.abs-input {
    width: 100%; background: var(--abs-bg); border: 1px solid var(--abs-border);
    color: var(--abs-t1); border-radius: 8px; padding: 9px 12px;
    font-family: var(--abs-font); font-size: 12px; outline: none;
    transition: border-color .2s;
}
.abs-input:focus {
    border-color: var(--abs-green);
    box-shadow: 0 0 0 3px rgba(26,122,74,0.08);
}
.abs-input::placeholder { color: var(--abs-t4); }

.abs-divider { height: 1px; background: var(--abs-border); margin: 14px 0; }

.abs-chip-group { display: flex; flex-wrap: wrap; gap: 5px; }
.abs-chip {
    padding: 4px 10px; border-radius: 99px; font-size: 10px; font-weight: 600;
    border: 1px solid var(--abs-border); color: var(--abs-t2); background: transparent;
    cursor: pointer; transition: all .2s; font-family: var(--abs-font);
}
.abs-chip:hover,
.abs-chip.active          { border-color: var(--abs-green);  color: var(--abs-green);  background: var(--abs-green-l); }
.abs-chip.green:hover,
.abs-chip.green.active    { border-color: var(--abs-green);  color: var(--abs-green);  background: var(--abs-green-l); }
.abs-chip.amber:hover,
.abs-chip.amber.active    { border-color: var(--abs-amber);  color: var(--abs-amber);  background: var(--abs-amber-l); }
.abs-chip.sky:hover,
.abs-chip.sky.active      { border-color: var(--abs-sky);    color: var(--abs-sky);    background: var(--abs-sky-l); }
.abs-chip.rose:hover,
.abs-chip.rose.active     { border-color: var(--abs-rose);   color: var(--abs-rose);   background: var(--abs-rose-l); }

.abs-filter-btn {
    width: 100%; margin-top: 14px; padding: 10px; border-radius: 9px;
    background: linear-gradient(135deg, var(--abs-green), var(--abs-green-m));
    color: #fff; font-family: var(--abs-font); font-size: 11px; font-weight: 700;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: all .2s; box-shadow: 0 4px 14px rgba(26,122,74,0.25);
}
.abs-filter-btn:hover { opacity:.9; transform: translateY(-1px); }

.abs-reset-btn {
    width: 100%; margin-top: 7px; padding: 9px; border-radius: 9px;
    background: transparent; border: 1px solid var(--abs-border);
    color: var(--abs-t2); font-size: 11px; font-family: var(--abs-font);
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 7px;
}
.abs-reset-btn:hover { border-color: var(--abs-rose); color: var(--abs-rose); }

/* ── Panel ── */
.abs-panel {
    background: var(--abs-white); border: 1px solid var(--abs-border);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.abs-panel-head {
    padding: 16px 20px; border-bottom: 1px solid var(--abs-border);
    display: flex; align-items: center; justify-content: space-between;
    background: #f8fdf9;
}
.abs-panel-head-left  {
    font-family: var(--abs-font); font-size: 12px;
    font-weight: 700; color: var(--abs-t1);
    display: flex; align-items: center; gap: 7px;
}
.abs-panel-head-right { font-size: 11px; color: var(--abs-t3); }

/* ── Table ── */
.abs-table { width: 100%; border-collapse: collapse; }
.abs-table thead tr { background: #f8fdf9; }
.abs-table th {
    padding: 12px 18px; text-align: left;
    font-family: var(--abs-font); font-size: 9px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--abs-t3);
    border-bottom: 1px solid var(--abs-border);
}
.abs-table th:last-child { text-align: center; }
.abs-table td {
    padding: 13px 18px; border-bottom: 1px solid #f0f7f3;
    vertical-align: middle; font-family: var(--abs-font);
}
.abs-table tr:last-child td { border-bottom: none; }
.abs-table tbody tr { transition: background .15s; }
.abs-table tbody tr:hover { background: #f8fdf9; }

.abs-rownum { font-size: 11px; color: var(--abs-t3); font-weight: 600; }
.abs-av {
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--abs-green), var(--abs-green-m));
    color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.abs-av-name { font-size: 12px; font-weight: 600; color: var(--abs-t1); font-family: var(--abs-font); }
.abs-av-sub  { font-size: 10px; color: var(--abs-t3); margin-top: 1px; }
.abs-date    { font-size: 11px; color: var(--abs-t1); font-weight: 500; }
.abs-time    { font-size: 12px; color: var(--abs-t1); font-weight: 700; }
.abs-time-empty { font-size: 12px; color: var(--abs-t4); }
.abs-duration   { font-size: 11px; color: var(--abs-green); font-weight: 600; }

.abs-late-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 6px; border-radius: 99px; font-size: 9px; font-weight: 700;
    background: var(--abs-rose-l); color: var(--abs-rose); border: 1px solid #fca5a5;
}
.abs-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 99px; font-size: 10px; font-weight: 700;
    font-family: var(--abs-font); border: 1px solid; white-space: nowrap;
}
.abs-badge-green { background: var(--abs-green-l); color: var(--abs-green); border-color: var(--abs-green-l2); }
.abs-badge-amber { background: var(--abs-amber-l); color: var(--abs-amber); border-color: #fde68a; }
.abs-badge-sky   { background: var(--abs-sky-l);   color: var(--abs-sky);   border-color: #a5f3fc; }
.abs-badge-rose  { background: var(--abs-rose-l);  color: var(--abs-rose);  border-color: #fca5a5; }

.abs-actions { display: flex; align-items: center; justify-content: center; gap: 5px; }
.abs-action-btn {
    width: 30px; height: 30px; border-radius: 7px;
    border: 1px solid var(--abs-border); background: transparent;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s; font-size: 11px;
}
.abs-action-view { color: var(--abs-green); }
.abs-action-view:hover { background: var(--abs-green-l); border-color: var(--abs-green); }

.abs-empty { padding: 60px 20px; text-align: center; }
.abs-empty-icon {
    width: 60px; height: 60px; border-radius: 14px;
    background: var(--abs-green-l); border: 1px solid var(--abs-green-l2);
    margin: 0 auto 14px; display: flex; align-items: center;
    justify-content: center; font-size: 22px; color: var(--abs-green);
}
.abs-empty-title {
    font-family: var(--abs-font); font-size: 13px;
    font-weight: 700; color: var(--abs-t2); margin-bottom: 4px;
}
.abs-empty-sub { font-size: 11px; color: var(--abs-t3); }
.abs-pag {
    padding: 14px 20px; border-top: 1px solid var(--abs-border);
    background: #f8fdf9;
}

/* ── Riwayat tab ── */
.ril-controls {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 16px 20px; border-bottom: 1px solid var(--abs-border);
    background: #f8fdf9;
}
.ril-select {
    background: var(--abs-bg); border: 1px solid var(--abs-border);
    color: var(--abs-t1); border-radius: 8px; padding: 8px 12px;
    font-size: 12px; font-family: var(--abs-font);
    outline: none; cursor: pointer;
}
.ril-select:focus { border-color: var(--abs-green); }

.ril-nav-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--abs-border); background: transparent;
    color: var(--abs-t2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: all .2s;
}
.ril-nav-btn:hover { border-color: var(--abs-green); color: var(--abs-green); }

.ril-month-label {
    font-family: var(--abs-font); font-size: 13px;
    font-weight: 700; color: var(--abs-t1); min-width: 120px; text-align: center;
}
.ril-load-btn {
    padding: 8px 18px; border-radius: 8px;
    background: linear-gradient(135deg, var(--abs-green), var(--abs-green-m));
    color: #fff; font-family: var(--abs-font); font-size: 11px; font-weight: 700;
    border: none; cursor: pointer; transition: all .2s;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 4px 14px rgba(26,122,74,0.25);
}
.ril-load-btn:hover { opacity: .9; }

/* Riwayat list */
.ril-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; border-bottom: 1px solid #f0f7f3;
    transition: background .15s;
}
.ril-item:last-child { border-bottom: none; }
.ril-item:hover { background: #f8fdf9; }

.ril-date-box {
    width: 44px; flex-shrink: 0; text-align: center;
    background: var(--abs-green-l); border: 1px solid var(--abs-green-l2);
    border-radius: 9px; padding: 8px 4px;
}
.ril-date-num  { font-size: 16px; font-weight: 700; color: var(--abs-green); }
.ril-date-day  { font-size: 9px; color: var(--abs-t3); font-weight: 600; text-transform: uppercase; margin-top: 1px; }
.ril-times     { flex: 1; }
.ril-time-row  { font-size: 13px; color: var(--abs-t1); font-weight: 700; }
.ril-time-sub  { font-size: 10px; color: var(--abs-t3); margin-top: 3px; }
.ril-sub-green { color: var(--abs-green); }
.ril-sub-amber { color: var(--abs-amber); }

/* ── Rekap tab ── */
.rek-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
@media(max-width:900px) { .rek-layout { grid-template-columns: 1fr; } }

.rek-sidebar {
    background: var(--abs-white); border: 1px solid var(--abs-border);
    border-radius: 14px; padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.rek-sidebar-title {
    font-family: var(--abs-font); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em; color: var(--abs-t3);
    margin-bottom: 14px; display: flex; align-items: center; gap: 7px;
}
.rek-sidebar-title::after { content:''; flex:1; height:1px; background:var(--abs-border); }

.rek-stat-big {
    background: var(--abs-green-l); border: 1px solid var(--abs-green-l2);
    border-radius: 16px; padding: 24px; text-align: center; margin-bottom: 14px;
}
.rek-pct-label { font-size: 10px; color: var(--abs-t2); font-weight: 600; letter-spacing: .05em; margin-bottom: 8px; }
.rek-pct-val   { font-size: 52px; font-weight: 800; color: var(--abs-green); letter-spacing: -2px; line-height: 1; font-family: var(--abs-font); }
.rek-pct-sub   { font-size: 12px; color: var(--abs-t2); margin-top: 6px; }
.rek-progress  { height: 6px; background: var(--abs-green-l2); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.rek-progress-bar { height: 100%; background: linear-gradient(90deg, var(--abs-green), var(--abs-green-m)); border-radius: 99px; transition: width .5s; }

.rek-4grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; }
.rek-card {
    background: var(--abs-white); border-radius: 12px; padding: 14px 10px;
    border: 1px solid; text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rek-card-num   { font-size: 24px; font-weight: 800; font-family: var(--abs-font); }
.rek-card-label { font-size: 9px; font-weight: 600; color: var(--abs-t2); margin-top: 4px; }
.rek-card-bar   { height: 3px; border-radius: 99px; margin-top: 8px; }

.rek-avg {
    background: var(--abs-white); border: 1px solid var(--abs-border);
    border-radius: 14px; padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rek-avg-title {
    font-family: var(--abs-font); font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em; color: var(--abs-t3);
    margin-bottom: 14px; display: flex; align-items: center; gap: 7px;
}
.rek-avg-title::after { content:''; flex:1; height:1px; background:var(--abs-border); }

.rek-avg-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0; border-bottom: 1px solid #f0f7f3;
}
.rek-avg-row:last-child { border-bottom: none; }
.rek-avg-label { font-size: 12px; color: var(--abs-t2); }
.rek-avg-val   { font-size: 13px; font-weight: 700; font-family: var(--abs-font); }

/* ── Modal ── */
.abs-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 50; overflow-y: auto;
}
.abs-overlay.show { display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }

.abs-modal {
    background: var(--abs-white); border: 1px solid var(--abs-border);
    border-radius: 20px; width: 100%; max-width: 820px;
    padding: 32px; box-shadow: 0 24px 60px rgba(0,0,0,0.15);
    animation: absModalIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes absModalIn {
    from { opacity:0; transform: scale(.94) translateY(12px); }
    to   { opacity:1; transform: none; }
}
.abs-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--abs-border);
}
.abs-modal-title {
    font-family: var(--abs-font); font-size: 16px; font-weight: 700;
    color: var(--abs-t1); display: flex; align-items: center; gap: 9px;
}
.abs-modal-title i { color: var(--abs-green); }
.abs-close-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--abs-border); color: var(--abs-t3);
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: all .2s;
}
.abs-close-btn:hover { border-color: var(--abs-rose); color: var(--abs-rose); }

.abs-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media(max-width:600px) { .abs-detail-grid { grid-column: 1fr; } }

.abs-detail-card {
    background: var(--abs-bg); border: 1px solid var(--abs-border);
    border-radius: 11px; padding: 14px;
}
.abs-detail-card.full { grid-column: 1/-1; }
.abs-detail-label     { font-size: 9px; color: var(--abs-t3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.abs-detail-val       { font-size: 13px; color: var(--abs-t1); font-weight: 600; }
.abs-detail-val-mono  { font-size: 15px; color: var(--abs-t1); font-weight: 700; font-family: var(--abs-font); }
.abs-detail-sub       { font-size: 10px; color: var(--abs-t3); margin-top: 2px; }

.abs-keterangan-box {
    background: var(--abs-green-l); border: 1px solid var(--abs-green-l2);
    border-radius: 11px; padding: 14px; margin-bottom: 12px;
}
.abs-keterangan-label { font-size: 9px; color: var(--abs-green); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.abs-keterangan-text  { font-size: 12px; color: var(--abs-t1); line-height: 1.6; }

.abs-foto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:600px) { .abs-foto-grid { grid-template-columns: 1fr; } }

.abs-foto-card { background: var(--abs-bg); border: 1px solid var(--abs-border); border-radius: 11px; overflow: hidden; }
.abs-foto-card-head {
    padding: 9px 13px; border-bottom: 1px solid var(--abs-border);
    font-size: 10px; font-weight: 700; color: var(--abs-t2);
    font-family: var(--abs-font); text-transform: uppercase; letter-spacing: .06em;
    display: flex; align-items: center; gap: 6px;
}
.abs-foto-img { width: 100%; height: 200px; object-fit: cover; display: block; cursor: pointer; transition: transform .2s; }
.abs-foto-img:hover { transform: scale(1.02); }
.abs-foto-empty {
    height: 200px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px; color: var(--abs-t4);
}
.abs-foto-empty i { font-size: 24px; }
.abs-foto-empty span { font-size: 11px; }

.abs-spinner {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 50px 20px; gap: 12px;
}
.abs-spinner i { font-size: 24px; color: var(--abs-green); animation: absSpin .8s linear infinite; }
@keyframes absSpin { to { transform: rotate(360deg); } }
.abs-spinner p { font-size: 12px; color: var(--abs-t2); }

.abs-modal-footer {
    display: flex; justify-content: flex-end;
    padding-top: 20px; margin-top: 6px; border-top: 1px solid var(--abs-border);
}
.abs-btn-close-footer {
    padding: 9px 20px; border-radius: 9px; font-size: 12px; font-weight: 700;
    font-family: var(--abs-font); background: transparent;
    border: 1px solid var(--abs-border); color: var(--abs-t2); cursor: pointer;
    display: flex; align-items: center; gap: 6px; transition: all .2s;
}
.abs-btn-close-footer:hover { border-color: var(--abs-rose); color: var(--abs-rose); }

.abs-preview-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.93); backdrop-filter: blur(10px);
    z-index: 60; align-items: center; justify-content: center;
}
.abs-preview-overlay.show { display: flex; }
.abs-preview-overlay img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 12px; }
.abs-preview-x {
    position: absolute; top: 18px; right: 18px;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--abs-rose); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; cursor: pointer;
}

.ril-loading, .rek-loading {
    padding: 50px 20px; text-align: center; color: var(--abs-t2); font-size: 13px;
}
.ril-loading i, .rek-loading i {
    font-size: 22px; color: var(--abs-green); animation: absSpin .8s linear infinite;
    display: block; margin-bottom: 10px;
}