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

:root {
    --ink: #16221f;
    --muted: #6d7b76;
    --green-950: #102f29;
    --green-900: #173e35;
    --green-700: #266c58;
    --green-500: #3d9a78;
    --mint: #dff4e8;
    --cream: #f5f2e9;
    --paper: #fffefa;
    --line: #dfe5df;
    --orange: #e58b4b;
    --red: #b94a48;
    --shadow: 0 22px 60px rgba(18, 47, 41, .13);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: 'DM Sans', system-ui, sans-serif; font-size: 15px; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand { font-family: 'Manrope', system-ui, sans-serif; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--paper); text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand b { color: #a9d8c3; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px 4px 14px 4px; background: #a9d8c3; color: var(--green-950); font-size: 22px; }
.brand--small { color: var(--green-950); font-size: 17px; }
.brand--small .brand-mark { width: 36px; height: 36px; font-size: 18px; }

.terminal-page { min-height: 100vh; background: var(--green-950); }
.terminal-page::before { content: ''; position: fixed; inset: 0; background: radial-gradient(circle at 12% 18%, rgba(83, 158, 126, .26), transparent 32%), radial-gradient(circle at 88% 86%, rgba(229, 139, 75, .13), transparent 30%); pointer-events: none; }
.terminal-shell { position: relative; display: grid; grid-template-columns: minmax(220px, 340px) minmax(380px, 570px); align-items: center; justify-content: center; gap: clamp(40px, 8vw, 110px); min-height: 100vh; padding: 44px; }
.terminal-brand { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; padding: 20px 0 42px; }
.live-clock { color: var(--paper); }
.live-clock strong { display: block; font-family: 'Manrope', sans-serif; font-size: clamp(64px, 8vw, 102px); letter-spacing: -.08em; line-height: .9; }
.live-clock span { display: block; color: #a9bdb6; font-size: 16px; margin-top: 18px; text-transform: capitalize; }
.terminal-card { width: 100%; min-height: 650px; padding: clamp(30px, 5vw, 54px); border-radius: 32px; background: var(--paper); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; }
.eyebrow { margin-bottom: 10px; color: var(--green-700); font-weight: 700; font-size: 12px; letter-spacing: .11em; text-transform: uppercase; }
.terminal-card h1 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -.045em; }
.lead { margin-bottom: 24px; color: var(--muted); font-size: 17px; }
.inline-alert { padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: #fce9e7; color: #8f3534; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 10px 0 26px; }
.pin-dots span { width: 16px; height: 16px; border: 2px solid #b8c3bd; border-radius: 50%; transition: .18s ease; }
.pin-dots span.filled { border-color: var(--green-700); background: var(--green-700); transform: scale(1.08); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { min-height: 58px; border: 1px solid var(--line); border-radius: 16px; background: #fafaf6; color: var(--ink); font: 700 21px 'Manrope', sans-serif; cursor: pointer; transition: .16s ease; }
.keypad button:hover { border-color: #9bb9ac; background: var(--mint); transform: translateY(-1px); }
.keypad button:active { transform: scale(.97); }
.keypad .keypad-action { color: var(--muted); font: 600 13px 'DM Sans', sans-serif; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border: 0; border-radius: 13px; font-weight: 700; cursor: pointer; text-decoration: none; transition: .16s ease; }
.button--primary { background: var(--green-900); color: white; box-shadow: 0 8px 22px rgba(23, 62, 53, .2); }
.button--primary:hover { background: var(--green-700); transform: translateY(-1px); }
.button--primary:disabled { background: #b9c3bf; box-shadow: none; cursor: not-allowed; transform: none; }
.button--wide { width: 100%; margin-top: 14px; }
.button--ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.button--danger { background: #fce9e7; color: #963b39; }
.button--small { min-height: 36px; padding: 0 13px; border-radius: 10px; font-size: 13px; }
.rh-link { align-self: center; margin-top: 20px; color: var(--muted); font-size: 13px; }
.terminal-shell > footer { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #8fa59d; font-size: 12px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin: 0 4px 0 8px; border-radius: 50%; background: #6dd29e; box-shadow: 0 0 0 4px rgba(109, 210, 158, .12); }

.employee-welcome { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
.employee-welcome h1 { margin: 0; font-size: 30px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px 8px 22px 8px; background: var(--mint); color: var(--green-700); font: 800 25px 'Manrope', sans-serif; }
.current-state { display: grid; grid-template-columns: 1fr auto; gap: 5px 15px; align-items: center; padding: 20px; margin-bottom: 26px; border: 1px solid #cfe4da; border-radius: 18px; background: #f4fbf7; }
.current-state span { color: var(--muted); font-size: 13px; }
.current-state strong { grid-column: 1; font-size: 18px; }
.current-state small { grid-column: 2; grid-row: 1 / span 2; color: var(--green-700); }
.action-label { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.clock-actions { display: grid; gap: 12px; }
.clock-action { width: 100%; display: grid; grid-template-columns: 44px 1fr; gap: 1px 13px; text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: white; cursor: pointer; transition: .16s ease; }
.clock-action:hover { border-color: #8eb3a2; background: #f7fbf8; transform: translateY(-1px); }
.clock-action > span { grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--mint); color: var(--green-700); font-size: 22px; }
.clock-action strong { align-self: end; }
.clock-action small { color: var(--muted); }
.clock-action--break_start > span, .clock-action--clock_out > span { background: #fff0e3; color: #b8672f; }
.cancel-form { margin-top: 18px; text-align: center; }
.finished-message { display: flex; flex-direction: column; gap: 5px; padding: 24px; border-radius: 18px; background: var(--mint); color: var(--green-900); text-align: center; }
.finished-message span { color: var(--green-700); }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 clamp(20px, 5vw, 70px); border-bottom: 1px solid var(--line); background: rgba(255, 254, 250, .94); backdrop-filter: blur(18px); }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a { padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; }
.topnav a:hover, .topnav a.active { background: var(--mint); color: var(--green-900); }
.menu-toggle { display: none; }
.admin-page { min-height: 100vh; background: #f7f6f1; }
.admin-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 28px; }
.page-heading h1 { margin-bottom: 6px; font-size: 32px; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 8px 30px rgba(25, 48, 42, .05); }
.stat-card { padding: 21px; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 8px; font: 800 29px 'Manrope', sans-serif; letter-spacing: -.04em; }
.stat-card small { display: block; margin-top: 4px; color: var(--green-700); }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; margin-top: 18px; }
.panel { padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.panel-head h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.panel-head a { color: var(--green-700); font-weight: 700; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 10px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
td { padding: 14px 10px; border-bottom: 1px solid #edf0ec; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 11px; font-weight: 700; }
.person-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--mint); color: var(--green-700); font-weight: 800; }
.badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge--success { background: #e1f5e9; color: #27704f; }
.badge--warning { background: #fff0d9; color: #9c6125; }
.badge--danger { background: #fce7e6; color: #9b3e3d; }
.badge--muted { background: #ecefec; color: #69736f; }
.activity-list { display: grid; gap: 2px; }
.activity { display: grid; grid-template-columns: 9px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid #edf0ec; }
.activity:last-child { border-bottom: 0; }
.activity-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 4px var(--mint); }
.activity strong { display: block; font-size: 13px; }
.activity span, .activity time { color: var(--muted); font-size: 12px; }
.empty { padding: 35px 20px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 13px; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea, .filterbar input, .filterbar select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #ccd4cf; border-radius: 12px; background: white; color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(61, 154, 120, .12); }
.field textarea { min-height: 90px; resize: vertical; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafaf7; font-weight: 600 !important; cursor: pointer; }
.check input { width: auto; min-height: auto; accent-color: var(--green-700); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; padding-top: 6px; }
.split-layout { display: grid; grid-template-columns: 1fr 360px; gap: 18px; }
.filterbar { display: grid; grid-template-columns: 1fr 190px auto; gap: 10px; margin-bottom: 20px; }
.text-link { color: var(--green-700); font-weight: 700; text-decoration: none; }
.muted { color: var(--muted); }
.balance-positive { color: #27704f; font-weight: 700; }
.balance-negative { color: var(--red); font-weight: 700; }
.event-time { font: 700 13px 'Manrope', sans-serif; }
.event-list { display: flex; flex-wrap: wrap; gap: 6px; }
.event-chip { padding: 5px 7px; border-radius: 7px; background: #edf4f0; color: var(--green-900); font-size: 11px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(38px, 6vw, 80px); overflow: hidden; background: var(--green-950); color: white; }
.login-visual::after { content: ''; position: absolute; width: 430px; height: 430px; right: -160px; bottom: -160px; border: 90px solid rgba(169, 216, 195, .12); border-radius: 50%; }
.login-copy { position: relative; z-index: 1; max-width: 510px; }
.login-copy h1 { margin-bottom: 18px; font-size: clamp(40px, 6vw, 72px); line-height: .98; letter-spacing: -.07em; }
.login-copy p { max-width: 430px; color: #acc1b9; font-size: 17px; line-height: 1.6; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; }
.login-form { width: min(410px, 100%); }
.login-form h2 { margin-bottom: 8px; font-size: 30px; letter-spacing: -.04em; }
.login-form > p { margin-bottom: 28px; color: var(--muted); }
.login-form .field { margin-bottom: 15px; }
.login-form .button { margin-top: 7px; }
.login-back { display: inline-block; margin-top: 20px; color: var(--muted); font-size: 13px; }

.toast { position: fixed; z-index: 100; top: 82px; left: 50%; transform: translateX(-50%); width: min(480px, calc(100% - 30px)); padding: 14px 18px; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.15); font-weight: 700; text-align: center; animation: toast-in .3s ease both; }
.terminal-page .toast { top: 24px; }
.toast--success { background: #ddf4e7; color: #205f45; }
.toast--error { background: #fbe5e3; color: #903a38; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } }

@media (max-width: 900px) {
    .terminal-shell { grid-template-columns: 1fr; gap: 24px; padding: 25px 20px 70px; }
    .terminal-brand { align-self: auto; flex-direction: row; align-items: center; padding: 0; }
    .live-clock { text-align: right; }
    .live-clock strong { font-size: 40px; }
    .live-clock span { display: none; }
    .terminal-card { min-height: auto; max-width: 570px; justify-self: center; border-radius: 24px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .split-layout { grid-template-columns: 1fr; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { min-height: 310px; }
    .login-copy h1 { font-size: 46px; }
    .login-copy p { display: none; }
}

@media (max-width: 680px) {
    .terminal-card { padding: 30px 22px; }
    .terminal-card h1 { font-size: 28px; }
    .topbar { padding: 0 18px; }
    .menu-toggle { display: block; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; }
    .topnav { display: none; position: absolute; top: 60px; right: 16px; flex-direction: column; align-items: stretch; min-width: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }
    .topnav.open { display: flex; }
    .admin-main { width: min(100% - 28px, 1180px); padding-top: 28px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 23px; }
    .panel { padding: 18px; border-radius: 17px; }
    .form-grid, .filterbar { grid-template-columns: 1fr; }
    .login-form-wrap { padding: 34px 22px; }
    .login-visual { min-height: 250px; padding: 32px 24px; }
    .terminal-shell > footer { bottom: 20px; max-width: calc(100% - 30px); white-space: normal; text-align: center; }
}

@media print {
    .topbar, .page-heading .button, .filterbar, .no-print, .toast { display: none !important; }
    .admin-main { width: 100%; padding: 0; }
    .panel { box-shadow: none; border: 0; padding: 0; }
    body { background: white; font-size: 11px; }
}
