:root {
    --navy: #152542;
    --blue: #3267e9;
    --teal: #159a87;
    --bg: #f4f7fb;
    --line: #e4e9f1;
    --muted: #68768e;
    --ink: #1c2940;
    --red: #c83e50;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }

button, .btn {
    cursor: pointer;
    border: 0;
    border-radius: 9px;
    padding: 10px 13px;
    background: var(--blue);
    color: white;
    font-weight: 650;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn.light, button.light, a.light, span.light {
    background: #fff;
    color: #34445e;
    border: 1px solid var(--line);
}

.btn.danger { background: #ffeaed; color: #b42c42; }
.btn-sm { padding: 5px 8px; font-size: 12px; }
.is-disabled { opacity: .45; pointer-events: none; }

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
    background: var(--navy);
    color: #fff;
    padding: 20px 13px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 9px 22px; border-bottom: 1px solid #ffffff24; }
.logo {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #1ab9a8, #3267e9);
    display: grid; place-items: center; font-weight: 900;
    overflow: hidden; font-size: 11px; line-height: 1; text-align: center; padding: 2px;
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-row .muted { display: block; margin-top: 6px; }
.brand b { font-size: 14px; }
.brand small { display: block; color: #aab9d1; font-size: 11px; margin-top: 3px; }
.navlabel { font-size: 10px; color: #8ea1bf; letter-spacing: 1.3px; margin: 22px 10px 7px; }
a.nav {
    display: flex;
    width: 100%;
    gap: 10px;
    text-align: left;
    background: transparent;
    color: #c9d4e5;
    padding: 11px 12px;
    margin: 2px 0;
    font-weight: 550;
    border-radius: 9px;
    text-decoration: none;
}
a.nav:hover, a.nav.active { background: #ffffff18; color: white; }
.ico { width: 20px; text-align: center; }
.sidefoot { font-size: 10px; line-height: 1.5; color: #94a7c5; margin: 24px 10px; }
.main { min-width: 0; }
.top {
    height: 70px; background: white; border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; padding: 0 28px;
}
.crumb { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.top h2 { font-size: 18px; margin: 3px 0; }
.user { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.user b { color: #263650; }
.usermenu { position: relative; }
.usermenu summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: #e7edff;
    border: 1px solid #c9d6fb;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary .caret {
    width: 7px;
    height: 7px;
    margin-left: 2px;
    border-right: 2px solid #2857c1;
    border-bottom: 2px solid #2857c1;
    transform: rotate(45deg) translateY(-2px);
    flex: none;
}
.usermenu[open] summary { background: #d7e2ff; border-color: #3267e9; }
.usermenu[open] summary .caret { transform: rotate(225deg) translateY(-1px); }
.usermenu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 6;
    min-width: 190px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 24px #15254214;
}
.usermenu-panel a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.usermenu-panel a:hover { background: #f4f7fb; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: #e7edff; color: #2857c1;
    display: grid; place-items: center; font-weight: 800;
}
.content { padding: 25px 28px; max-width: 1600px; margin: auto; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.head h1 { margin: 0 0 5px; font-size: 25px; letter-spacing: -.5px; }
.head p, .muted { margin: 0; color: var(--muted); font-size: 12px; }
.actions, .toolbar, .hr-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: inline-flex; margin: 0; }
.hr-nav { margin-bottom: 14px; }
.hr-nav a.active-tab { background: #edf2ff; color: #24416c; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.cards.wide { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric, .panel {
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px;
    box-shadow: 0 2px 8px #13254504;
}
.mtop { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.mi { width: 34px; height: 34px; background: #edf2ff; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }
.metric strong { display: block; font-size: 24px; margin: 10px 0 4px; letter-spacing: -.6px; }
.metric small { font-size: 11px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-bottom: 15px; }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.panel h3, .dialoghead h3 { font-size: 15px; margin: 0; }
.panelhead .muted { margin-top: 4px; }
.barrow { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 9px; font-size: 12px; margin: 16px 0; }
.bar { height: 8px; background: #edf1f7; border-radius: 20px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #3267e9, #159a87); border-radius: 20px; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 20px; background: #e8f7f2; color: #147a66; font-size: 10px; }
.tag.warn { background: #fff2d8; color: #936100; }
.tag.red { background: #ffeaed; color: #b42c42; }
.notice, .alert { padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.5; margin-bottom: 17px; }
.notice { background: #fff5dc; color: #77520d; }
.alert.ok { background: #e8f7f2; color: #147a66; }
.alert.err { background: #ffeaed; color: #b42c42; }
.toolbar { margin-bottom: 13px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
    border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 10px 11px; color: var(--ink);
}
.toolbar input, .toolbar select { min-width: 150px; }
.toolbar input { flex: 1; }
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 12px; }
th {
    text-align: left; background: #f7f9fc; color: #65728a; font-size: 10px; letter-spacing: .5px;
    text-transform: uppercase; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid #edf0f5; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.dialog-page { max-width: 760px; }
.dialoghead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field label { display: block; font-weight: 650; font-size: 12px; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; border-color: #dbe2ed; border-radius: 8px; }
.field textarea { min-height: 75px; }
.field.full { grid-column: 1 / -1; }
.field .error { color: #b42c42; font-size: 11px; display: block; margin-top: 4px; }
.dialogfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.mobile { display: none; }
.login-body { background: #fff; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 36px;
    padding: 40px 56px;
    color: #fff;
    background:
        radial-gradient(circle at 12% 18%, #1ab9a855, transparent 32%),
        radial-gradient(circle at 88% 80%, #3267e966, transparent 36%),
        var(--navy);
    overflow: hidden;
}
.login-hero::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -90px;
    width: 280px;
    height: 280px;
    border: 1px solid #ffffff22;
    border-radius: 50%;
}
.login-brand, .login-copy { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-logo {
    width: 52px; height: 52px; border-radius: 16px;
    background: linear-gradient(135deg, #1ab9a8, #3267e9);
    display: grid; place-items: center;
    font-weight: 900; font-size: 13px; letter-spacing: -.2px;
    overflow: hidden; box-shadow: 0 10px 24px #00000033;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-brand b { display: block; font-size: 16px; }
.login-brand small { display: block; margin-top: 3px; color: #c5d2e6; font-size: 12px; }
.login-copy h2 {
    max-width: 460px;
    margin: 0 0 22px;
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: -.6px;
}
.login-copy ul { margin: 0; padding: 0; list-style: none; }
.login-copy li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    color: #d5e0f0;
    font-size: 14px;
}
.login-copy li::before {
    content: "";
    width: 8px; height: 8px; border-radius: 50%;
    background: #1ab9a8;
    box-shadow: 0 0 0 4px #1ab9a822;
}
.login-panel {
    display: grid;
    place-items: center;
    padding: 32px 24px;
    background: #f7f9fc;
}
.login-card { width: min(400px, 100%); }
.login-card h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.5px; }
.login-card > p { margin: 0 0 26px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-card .field { margin-bottom: 16px; }
.login-card .field label { font-size: 13px; margin-bottom: 7px; }
.login-card input[type="email"],
.login-card input[type="password"] {
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #fff;
    outline: none;
}
.login-card input:focus {
    border-color: #3267e9;
    box-shadow: 0 0 0 4px #3267e91a;
}
.login-card button {
    width: 100%;
    height: 46px;
    justify-content: center;
    border-radius: 10px;
    font-size: 15px;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 2px 0 20px; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }

@media (max-width: 1050px) {
    .cards, .cards.wide { grid-template-columns: repeat(2, 1fr); }
    .two { grid-template-columns: 1fr; }
    .content { padding: 20px 16px; }
    .top { padding: 0 16px; }
}

@media (max-width: 700px) {
    .app { display: block; }
    .side { position: fixed; z-index: 8; left: -265px; width: 250px; transition: left .2s; }
    .side.open { left: 0; }
    .mobile { display: inline-flex; background: #edf2ff; color: #24416c; }
    .content { padding: 17px 11px; }
    .head { display: block; }
    .head .actions, .head > div:last-child { margin-top: 13px; }
    .metric { padding: 12px; }
    .metric strong { font-size: 20px; }
    .fields { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .user .who { display: none; }
}

.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0 16px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.account-table input, .account-table select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
}
@media (max-width: 700px) {
    .checks { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .login { grid-template-columns: 1fr; }
    .login-hero { justify-content: flex-start; gap: 22px; padding: 28px 22px 24px; }
    .login-copy h2 { font-size: 26px; }
    .login-hero::after { display: none; }
    .login-panel { padding: 28px 18px 40px; }
}

.daypick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 16px; }
.daypick form { margin: 0; }
.daypick .btn { height: 40px; min-width: 40px; justify-content: center; padding: 0 14px; }
.daypick-date {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font-weight: 650;
    cursor: pointer;
}
.daypick-date input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.clock-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.clock-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.clock-card .logo { color: #fff; margin-bottom: 14px; }
.clock-card h1 { margin: 6px 0 8px; font-size: 28px; letter-spacing: -.4px; }
.clock-card p { line-height: 1.5; }
.clock-card button { width: 100%; justify-content: center; height: 48px; font-size: 16px; }
.clock-card [hidden] { display: none !important; }
.cam {
    position: relative;
    margin: 16px 0 12px;
    border-radius: 14px;
    overflow: hidden;
    background: #101826;
    aspect-ratio: 3 / 4;
}
.cam video, .cam canvas { width: 100%; height: 100%; object-fit: cover; display: block; background: #101826; }
.cam video { transform: scaleX(-1); }
.cam-mark {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 28px 14px 12px;
    background: linear-gradient(transparent, rgba(10, 18, 32, .88));
    color: #fff;
    pointer-events: none;
}
.cam-mark strong { display: block; font-size: 16px; }
.cam-mark span { display: block; font-size: 13px; line-height: 1.35; }
.clock-actions { display: grid; gap: 8px; }
.clock-actions.ready { grid-template-columns: 1fr 1.4fr; }
.clock-card button.light { background: #fff; color: #34445e; border: 1px solid var(--line); }
.clock-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.clock-times div { background: var(--bg); border-radius: 12px; padding: 12px; }
.clock-times span { display: block; color: var(--muted); font-size: 12px; }
.clock-times strong { font-size: 22px; }
.clock-status { font-weight: 700; }
.linkbox { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.linkbox input { flex: 1 1 180px; width: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; height: 40px; }
td .btn-sm { margin-top: 8px; }
.absen-dialog {
    border: 0;
    border-radius: 16px;
    padding: 0;
    width: min(560px, calc(100vw - 32px));
    box-shadow: 0 24px 70px #13254533;
    color: var(--ink);
}
.absen-dialog::backdrop { background: #15254280; }
.absen-dialog .pad { padding: 22px; }
.absen-dialog .dialoghead { margin-bottom: 8px; }
.absen-dialog .dialoghead p { margin-top: 4px; }
.absen-kicker {
    margin: 18px 0 8px;
    font-size: 11px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.absen-dialog input[type="time"],
.absen-dialog select,
.absen-dialog input[type="text"] {
    height: 40px;
    border: 1px solid #dbe2ed;
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
}
.absen-dialog .dialogfoot { margin-top: 12px; }
.absen-dialog [hidden] { display: none !important; }
