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

:root {
    --green-950: #0b2b20;
    --green-900: #103d2d;
    --green-800: #16563d;
    --green-700: #1c704a;
    --green-600: #258b58;
    --green-500: #36a96e;
    --green-400: #63c68d;
    --green-300: #9bdfb7;
    --green-200: #ccefd9;
    --green-100: #e8f8ee;
    --green-50: #f4fbf6;
    --ink: #19372b;
    --muted: #718279;
    --line: #e4eee7;
    --surface: #ffffff;
    --bg: #f4f8f5;
    --shadow: 0 14px 40px rgba(20, 72, 46, .065);
}

* { box-sizing: border-box; }
body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-900); }

.app-navbar {
    background: linear-gradient(105deg, var(--green-950) 0%, #15583b 55%, #20764b 100%);
    box-shadow: 0 6px 22px rgba(8, 43, 29, .16);
}
.navbar-brand { font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 800; letter-spacing: -.02em; }
.navbar-dark .navbar-nav .nav-link { color: rgba(255,255,255,.76); font-size: 13px; font-weight: 600; padding-left: .65rem; padding-right: .65rem; }
.navbar-dark .navbar-nav .nav-link:hover, .navbar-dark .navbar-nav .nav-link:focus { color: #fff; }
.navbar .dropdown-menu { border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); }
.navbar .dropdown-item { border-radius: 8px; padding: 9px 12px; font-size: 13px; }

.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 16px;
    color: #fff; background: linear-gradient(145deg, #54c987, #176f49);
    font: 800 16px 'Manrope', sans-serif; letter-spacing: -.06em;
    box-shadow: 0 9px 20px rgba(29, 130, 80, .18);
}
.brand-mark-sm { width: 31px; height: 31px; border-radius: 10px; font-size: 11px; box-shadow: none; }
.eyebrow { color: var(--green-600); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.page-heading { font: 800 clamp(1.55rem, 2.4vw, 2.15rem)/1.18 'Manrope', sans-serif; letter-spacing: -.055em; color: var(--green-950); }
.section-heading { font: 800 1.08rem/1.35 'Manrope', sans-serif; letter-spacing: -.035em; color: var(--green-950); }
.text-secondary { color: var(--muted) !important; }
.date-chip { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 50px; background: white; color: var(--green-800); font-weight: 700; font-size: 12px; box-shadow: 0 4px 16px rgba(19, 77, 48, .04); }
.date-chip-dot, .scanner-live-dot { display: inline-block; width: 8px; height: 8px; background: #43bd78; border-radius: 50%; box-shadow: 0 0 0 4px rgba(67,189,120,.12); }

.stat-card, .surface-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
    box-shadow: var(--shadow);
}
.stat-card { position: relative; min-height: 151px; padding: 20px; overflow: hidden; }
.stat-card:after { content: ''; position: absolute; width: 105px; height: 105px; right: -38px; bottom: -49px; border-radius: 50%; background: var(--green-50); }
.stat-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; margin-bottom: 14px; font-size: 20px; font-weight: 700; }
.stat-icon-green { background: #e5f8ec; color: #21894e; }
.stat-icon-amber { background: #fff4dc; color: #b37a17; }
.stat-icon-teal { background: #e0f7f1; color: #168c72; }
.stat-icon-coral { background: #fff0e8; color: #ca7043; }
.stat-label { color: #71847a; font-size: 12px; font-weight: 600; }
.stat-value { color: var(--green-950); font: 800 31px/1.1 'Manrope', sans-serif; letter-spacing: -.06em; margin: 4px 0; }
.stat-meta { color: #91a198; font-size: 11px; }
.surface-card { padding: 24px; }
.soft-pill { display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 30px; background: var(--green-50); color: var(--green-700); border: 1px solid #dff1e5; font-size: 11px; font-weight: 700; white-space: nowrap; }

.action-tile { display: flex; align-items: center; gap: 13px; min-height: 82px; padding: 15px; border-radius: 15px; border: 1px solid var(--line); background: #fff; color: var(--ink); transition: .18s ease; }
.action-tile:hover { border-color: #a6ddba; background: #fbfffc; transform: translateY(-2px); box-shadow: 0 10px 25px rgba(28, 112, 74, .08); color: var(--ink); }
.action-icon { flex: 0 0 42px; display: flex; justify-content: center; align-items: center; width: 42px; height: 42px; border-radius: 13px; background: #e8f8ee; color: #21894e; font-size: 22px; }
.action-icon-lime { background: #f1f8df; color: #6e9825; }
.action-icon-orange { background: #fff1e6; color: #c77a35; }
.action-icon-teal { background: #e2f7f2; color: #13886e; }
.action-icon-pink { background: #fff0f4; color: #c65a7b; }
.action-icon-blue { background: #eaf2ff; color: #4e7cb7; }
.action-tile strong { display: block; font-size: 13px; font-weight: 800; }
.action-tile small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.tile-arrow { margin-left: auto; color: #9db3a5; font-size: 24px; line-height: 1; }
.progress-soft { height: 9px; background: #edf4ef; border-radius: 20px; }
.progress-soft .progress-bar { background: linear-gradient(90deg, #40b879, #8ed8a7); border-radius: 20px; }

.btn { border-radius: 11px; font-size: 13px; font-weight: 700; padding: 9px 15px; }
.btn-lg { padding: 12px 18px; }
.btn-green { color: #fff; background: linear-gradient(110deg, #22864f, #36aa6c); border: 0; box-shadow: 0 7px 17px rgba(35, 143, 82, .17); }
.btn-green:hover, .btn-green:focus { color: #fff; background: linear-gradient(110deg, #176e40, #278e58); box-shadow: 0 9px 20px rgba(35, 143, 82, .23); }
.btn-outline-success { color: var(--green-700); border-color: #a9d6b8; }
.btn-outline-success:hover { color: white; background: var(--green-700); border-color: var(--green-700); }
.form-label { color: #385748; font-size: 12px; font-weight: 700; margin-bottom: 7px; }
.form-control, .form-select { min-height: 43px; border-color: #dce9df; border-radius: 10px; background-color: #fcfefc; color: var(--ink); font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: #76c494; box-shadow: 0 0 0 .22rem rgba(54,169,110,.12); background: white; }
textarea.form-control { min-height: auto; }
.form-text { color: #84958c; font-size: 11px; }
.alert { border-radius: 12px; font-size: 13px; }
.alert-soft-warning { color: #75571f; background: #fff8e8; }

.app-table { margin-bottom: 0; font-size: 12px; }
.app-table thead th { padding: 12px 12px; border-bottom: 1px solid #e7f0e9; color: #82948a; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; white-space: nowrap; }
.app-table tbody td { padding: 13px 12px; border-color: #eff4f0; color: #345345; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.status-present { color: #197447; background: #e6f7ec; }
.status-sakit { color: #9a6422; background: #fff5df; }
.status-izin { color: #46739d; background: #eaf3fd; }
.status-alpha { color: #a44d4d; background: #fff0ef; }
.empty-state { text-align: center; padding: 44px 15px; color: #8a9b91; }
.empty-state strong { display: block; margin: 12px 0 5px; color: var(--green-900); font-size: 13px; }
.empty-state p { font-size: 12px; }
.empty-icon { margin: auto; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 15px; background: var(--green-50); color: var(--green-600); font-size: 23px; }

.rule-row { display: flex; align-items: flex-start; gap: 13px; padding: 13px 0; border-bottom: 1px solid #edf3ee; color: #718279; font-size: 12px; line-height: 1.6; }
.rule-row:last-child { padding-bottom: 0; border-bottom: 0; }
.rule-number { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px; background: #e9f7ed; color: #298653; font: 800 10px 'Manrope', sans-serif; }

.scanner-shell { padding: 16px; border: 1px solid #dcefe2; border-radius: 16px; background: linear-gradient(145deg, #f8fdf9, #f1faf4); }
.scanner-topline { display: flex; align-items: center; gap: 10px; color: var(--green-800); font-size: 12px; font-weight: 800; margin-bottom: 13px; }
.qr-reader { width: 100%; min-height: 265px; overflow: hidden; border: 1px dashed #a8d8b7; border-radius: 13px; background: #102e22; }
.qr-reader video { border-radius: 12px; }
#reader__dashboard_section_csr button, #reader__dashboard_section_swaplink { border-radius: 8px !important; }
#reader__dashboard_section_csr select { padding: 7px; border-radius: 8px; border: 1px solid #cfe2d5; }
.scan-result { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 13px 15px; border: 1px solid #e4eee7; border-radius: 13px; background: #f9fcfa; color: #718279; }
.scan-result strong { display: block; color: #395b49; font-size: 12px; }
.result-mark { display: flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; background: #e5f5eb; color: #278b51; font-size: 18px; font-weight: 800; }
.scan-result-success { border-color: #c7e9d2; background: #f2fbf5; }
.scan-result-error { border-color: #f0d6d3; background: #fff8f7; }
.scan-result-error .result-mark { background: #ffebe8; color: #b85e50; }
.duration-pill { display: inline-flex; border-radius: 8px; background: #eaf7ee; color: #247d4b; padding: 6px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.duration-alert { background: #fff1e9; color: #bd5d36; }
.code-sample { padding: 13px; border-radius: 10px; background: #f1f8f3; border: 1px dashed #b8d9c3; color: #365e48; font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.app-footer { padding: 17px 0; margin-top: 35px; border-top: 1px solid var(--line); color: #91a097; font-size: 11px; }

.auth-page { background: radial-gradient(circle at 12% 12%, rgba(121,213,157,.25), transparent 30%), radial-gradient(circle at 90% 85%, rgba(43,145,88,.16), transparent 28%), linear-gradient(135deg, #f5fbf6, #eaf6ed); }
.auth-card { border-radius: 24px; overflow: hidden; }
.auth-card .card-body { background: rgba(255,255,255,.96); }
.auth-card .brand-mark { margin-bottom: 5px; }

@media (max-width: 767.98px) {
    .surface-card { padding: 18px; border-radius: 17px; }
    .stat-card { min-height: 138px; padding: 16px; }
    .stat-value { font-size: 27px; }
    .qr-reader { min-height: 225px; }
    .app-navbar .navbar-brand { font-size: 12px; }
    .navbar-nav { padding-top: 9px; }
}
