/* ============================================
   CAFE ABSENSI — Refined warm aesthetic
   ============================================ */

:root {
    --cream: #f5efe6;
    --cream-dark: #ebe3d5;
    --coffee: #3d2817;
    --coffee-light: #5a3d2a;
    --olive: #6f8a5f;
    --olive-dark: #4d6541;
    --terracotta: #c97862;
    --warm-gray: #8a7d6e;
    --ink: #1c140d;
    --error: #b94a3e;
    --shadow-sm: 0 1px 2px rgba(60, 40, 23, 0.08);
    --shadow-md: 0 4px 16px rgba(60, 40, 23, 0.12);
    --shadow-lg: 0 12px 40px rgba(60, 40, 23, 0.18);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--cream);
    color: var(--ink);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.bg-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: radial-gradient(ellipse at top left, rgba(201, 120, 98, 0.08), transparent 50%),
                      radial-gradient(ellipse at bottom right, rgba(111, 138, 95, 0.08), transparent 50%);
}

/* ============ ABSENSI PAGE ============ */
.absensi-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    position: relative;
    z-index: 2;
}

.absensi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--cream-dark);
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    font-size: 32px;
    line-height: 1;
}

.brand-name {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--coffee);
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 11px;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.clock {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--coffee);
    font-variant-numeric: tabular-nums;
}

/* ============ STATUS BAR ============ */
.status-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    font-size: 12px;
    color: var(--coffee-light);
    box-shadow: var(--shadow-sm);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--warm-gray);
}

.dot-loading { background: var(--warm-gray); animation: pulse 1.5s infinite; }
.dot-ok { background: var(--olive); }
.dot-warning { background: #d4a035; }
.dot-error { background: var(--error); }

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============ CAMERA SECTION ============ */
.camera-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.camera-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--coffee);
    margin-bottom: 16px;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
    pointer-events: none;
}

.camera-overlay-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65%;
    aspect-ratio: 1;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
}

.camera-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 20, 13, 0.75);
    color: white;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 12px;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    transition: all 0.3s;
}

.camera-hint.hint-ok {
    background: rgba(77, 101, 65, 0.9);
}

.info-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--cream);
    border-radius: 10px;
    font-size: 13px;
}

.info-label {
    color: var(--warm-gray);
}

.info-value {
    font-weight: 600;
    color: var(--coffee);
}

/* ============ ACTION BUTTONS ============ */
.action-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-action {
    padding: 20px 16px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    box-shadow: var(--shadow-md);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-action:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-action:not(:disabled):active {
    transform: translateY(0);
}

.btn-masuk {
    background: var(--olive);
    color: white;
}

.btn-keluar {
    background: var(--coffee);
    color: var(--cream);
}

.btn-icon {
    font-size: 24px;
    font-weight: 700;
}

.btn-label {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.btn-sub {
    font-size: 11px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ============ FOOTER ============ */
.absensi-footer {
    text-align: center;
    padding-top: 8px;
}

.link-admin {
    color: var(--warm-gray);
    font-size: 12px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

.link-admin:hover {
    color: var(--coffee);
}

/* ============ MODAL ============ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(28, 20, 13, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal.modal-open {
    display: flex;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 36px 28px 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

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

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.modal-success .modal-icon { background: var(--olive); }
.modal-error .modal-icon { background: var(--error); }

.modal-content h2 {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--coffee);
}

.modal-content p {
    color: var(--coffee-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-details {
    background: var(--cream);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--cream-dark);
}

.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--warm-gray); }
.detail-row strong { color: var(--coffee); font-weight: 600; }

.btn-modal {
    background: var(--coffee);
    color: var(--cream);
    border: none;
    padding: 14px 32px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal:hover {
    background: var(--coffee-light);
}

/* ============ LOADING ============ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(245, 239, 230, 0.95);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    gap: 16px;
}

.loading-overlay.loading-active {
    display: flex;
}

.loader {
    width: 44px;
    height: 44px;
    border: 3px solid var(--cream-dark);
    border-top-color: var(--coffee);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--coffee);
    font-size: 14px;
    font-weight: 500;
}

/* ============ ADMIN PAGES ============ */
.page-admin {
    background: var(--cream);
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--coffee);
    color: var(--cream);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 20px;
    padding: 0 8px 24px;
    border-bottom: 1px solid rgba(245, 239, 230, 0.15);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li a {
    display: block;
    padding: 12px 14px;
    color: var(--cream);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 4px;
    transition: all 0.2s;
    opacity: 0.75;
}

.nav-menu li a:hover {
    background: rgba(245, 239, 230, 0.08);
    opacity: 1;
}

.nav-menu li a.active {
    background: var(--olive);
    opacity: 1;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(245, 239, 230, 0.15);
    font-size: 12px;
    opacity: 0.7;
}

.sidebar-footer a {
    color: var(--cream);
    text-decoration: none;
}

.main-content {
    padding: 32px 40px;
    overflow-x: auto;
}

.page-title {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 32px;
    color: var(--coffee);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--warm-gray);
    margin-bottom: 28px;
    font-size: 14px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--olive);
}

.stat-card.stat-warning { border-left-color: #d4a035; }
.stat-card.stat-error { border-left-color: var(--error); }
.stat-card.stat-info { border-left-color: var(--terracotta); }

.stat-label {
    font-size: 12px;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.stat-value {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 32px;
    color: var(--coffee);
    line-height: 1;
}

.stat-sub {
    font-size: 12px;
    color: var(--warm-gray);
    margin-top: 4px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 12px 14px;
    background: var(--cream);
    color: var(--coffee);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--cream-dark);
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--cream-dark);
}

tr:hover td {
    background: var(--cream);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-hadir { background: rgba(111, 138, 95, 0.15); color: var(--olive-dark); }
.badge-terlambat { background: rgba(212, 160, 53, 0.15); color: #8a6020; }
.badge-pulang_cepat { background: rgba(201, 120, 98, 0.15); color: #8a4a3a; }
.badge-lembur { background: rgba(61, 40, 23, 0.15); color: var(--coffee); }
.badge-aktif { background: rgba(111, 138, 95, 0.15); color: var(--olive-dark); }
.badge-nonaktif { background: rgba(138, 125, 110, 0.2); color: var(--warm-gray); }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--coffee);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--cream-dark);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    color: var(--ink);
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--olive);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--coffee);
    color: var(--cream);
}

.btn-primary:hover {
    background: var(--coffee-light);
}

.btn-success {
    background: var(--olive);
    color: white;
}

.btn-success:hover {
    background: var(--olive-dark);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-secondary {
    background: var(--cream);
    color: var(--coffee);
    border: 1px solid var(--cream-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Login page */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--cream);
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand .brand-mark {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.login-brand h1 {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--coffee);
}

.login-brand p {
    color: var(--warm-gray);
    font-size: 13px;
    margin-top: 4px;
}

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
}

.alert-error {
    background: rgba(185, 74, 62, 0.1);
    color: var(--error);
}

.alert-success {
    background: rgba(111, 138, 95, 0.15);
    color: var(--olive-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: relative;
        height: auto;
    }
    .main-content {
        padding: 20px;
    }
    .page-title {
        font-size: 24px;
    }
}

/* ============================================
   APPEND ke akhir public/css/style.css
   ============================================ */

/* Shift picker modal */
.modal-shift-content {
    max-width: 420px !important;
    text-align: left !important;
    padding: 28px 24px !important;
}

.shift-card {
    background: white;
    border: 1px solid var(--cream-dark);
    border-left: 4px solid var(--olive);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.shift-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.shift-name {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 18px;
    color: var(--coffee);
    margin-bottom: 2px;
}

.shift-time {
    color: var(--warm-gray);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* Status badge tambahan */
.badge-lupa_checkout {
    background: rgba(138, 125, 110, 0.2);
    color: var(--warm-gray);
}

/* Gaji card styling */
.gaji-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.gaji-item {
    background: var(--cream);
    padding: 12px 16px;
    border-radius: 10px;
}

.gaji-item-label {
    font-size: 11px;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gaji-item-value {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--coffee);
    margin-top: 4px;
}

.gaji-total {
    background: var(--coffee) !important;
    color: var(--cream);
}

.gaji-total .gaji-item-value {
    color: var(--cream);
}

.gaji-total .gaji-item-label {
    color: rgba(245, 239, 230, 0.7);
}


/* ============================================
   APPEND ke akhir public/css/style.css
   (Untuk shift selector inline di halaman utama)
   ============================================ */

.shift-section {
    background: white;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}

.shift-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.shift-section-label {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 16px;
    color: var(--coffee);
}

.shift-section-hint {
    font-size: 11px;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.shift-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.shift-card-inline {
    background: var(--cream);
    border: 2px solid transparent;
    border-left: 4px solid var(--olive);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
}

.shift-card-inline:hover {
    background: var(--cream-dark);
    transform: translateY(-1px);
}

.shift-card-inline.shift-active {
    background: white;
    border: 2px solid var(--olive);
    border-left-width: 4px;
    box-shadow: 0 0 0 3px rgba(111, 138, 95, 0.2);
}

.shift-card-inline .shift-name {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 16px;
    color: var(--coffee);
    line-height: 1.1;
}

.shift-card-inline .shift-time {
    color: var(--warm-gray);
    font-size: 11px;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.shift-selected {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(111, 138, 95, 0.12);
    border-radius: 8px;
    font-size: 13px;
    color: var(--olive-dark);
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.link-reset {
    background: none;
    border: none;
    color: var(--coffee);
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    padding: 0;
}

.link-reset:hover {
    color: var(--terracotta);
}

/* ============================================
   APPEND ke akhir public/css/style.css
   (Untuk card Lembur Manual + admin reject button)
   ============================================ */

.shift-card-lembur {
    background: linear-gradient(135deg, rgba(201, 120, 98, 0.15), rgba(201, 120, 98, 0.05));
    border-left-color: var(--terracotta) !important;
    border: 2px solid transparent;
    border-left-width: 4px;
    position: relative;
    overflow: hidden;
}

.shift-card-lembur::before {
    content: '';
    position: absolute;
    top: -2px; right: -2px;
    width: 20px; height: 20px;
    background: var(--terracotta);
    border-bottom-left-radius: 8px;
    opacity: 0.15;
}

.shift-card-lembur:hover {
    background: linear-gradient(135deg, rgba(201, 120, 98, 0.25), rgba(201, 120, 98, 0.1));
}

.shift-card-lembur.shift-active {
    background: white !important;
    border: 2px solid var(--terracotta) !important;
    border-left-width: 4px !important;
    box-shadow: 0 0 0 3px rgba(201, 120, 98, 0.25) !important;
}

.shift-card-lembur .shift-name {
    color: var(--terracotta) !important;
}

/* Badge untuk jenis di tabel admin */
.badge-jenis-shift {
    background: rgba(61, 40, 23, 0.1);
    color: var(--coffee);
}

.badge-jenis-lembur_manual {
    background: rgba(201, 120, 98, 0.15);
    color: #8a4a3a;
}

/* Approval badge */
.badge-rejected {
    background: rgba(138, 125, 110, 0.2);
    color: var(--warm-gray);
    text-decoration: line-through;
}

/* Tombol kecil di admin */
.btn-icon-only {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-right: 4px;
}
.btn-approve { background: rgba(111, 138, 95, 0.15); color: var(--olive-dark); }
.btn-reject { background: rgba(185, 74, 62, 0.15); color: var(--error); }
.btn-approve:hover { background: var(--olive); color: white; }
.btn-reject:hover { background: var(--error); color: white; }

