/* Nynik Technologies employee portal — ink, paper and gold, like nyniktechnologies.com */
:root {
  --ink: #0C0A06; --surface: #15110A; --raised: #1C170E; --raised-2: #241D11; --line: #2F2818; --line-2: #4A3D22;
  --gold: #E8B54A; --gold-2: #F2C96E; --gold-deep: #B9821F; --gold-soft: rgba(232, 181, 74, .12);
  --paper: #F4EFE4; --muted: #ABA391; --faint: #7E7666;
  --ok: #4CC38A; --ok-soft: rgba(76, 195, 138, .14); --err: #F06A6A; --err-soft: rgba(240, 106, 106, .14);
  --info: #6CB4EE; --info-soft: rgba(108, 180, 238, .14); --idle: #6E6656;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 15.5px/1.5 var(--font); font-optical-sizing: auto; min-height: 100vh; }
a { color: var(--gold); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.mono-mark, .boot .mono { width: 44px; height: 44px; border-radius: 12px; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.boot .mono { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ------------------------------------------------------------------ Sign in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(80% 60% at 80% 0%, #2a1f0b 0%, transparent 60%), var(--ink); }
.signin-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); }
.signin-card .brandline { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.signin-card .brandline strong { display: block; letter-spacing: .08em; font-size: .95rem; }
.signin-card h1 { margin-bottom: 8px; }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: #1f1f1f; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 650; cursor: pointer; text-decoration: none; margin: 22px 0 14px; }
.google-btn:hover { background: #f1f1f1; }
.google-btn svg { width: 20px; height: 20px; }
.signin-note { font-size: .86rem; color: var(--muted); }
.notice { border-radius: 12px; padding: 12px 14px; margin: 14px 0 0; font-size: .92rem; }
.notice.err { background: var(--err-soft); color: #ffb3b3; border: 1px solid rgba(240,106,106,.35); }
.notice.ok { background: var(--ok-soft); color: #a8ebc9; border: 1px solid rgba(76,195,138,.35); }
.notice.gold { background: var(--gold-soft); color: var(--gold-2); border: 1px solid rgba(232,181,74,.35); }
.notice.info { background: var(--info-soft); color: #bfe0fa; border: 1px solid rgba(108,180,238,.35); }

/* ------------------------------------------------------------------ Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brandline { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.sidebar .brandline .mono-mark { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 9px; }
.sidebar .brandline strong { font-size: .86rem; letter-spacing: .08em; line-height: 1.15; }
.sidebar .brandline strong span { display: block; color: var(--muted); font-size: .76rem; letter-spacing: 0; font-weight: 500; }
.nav-label { color: var(--faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--paper); text-decoration: none; font-size: .95rem; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--raised); }
.nav a.active { background: var(--gold-soft); color: var(--gold-2); }
.nav a.active svg { color: var(--gold); }
.nav a .badge { margin-left: auto; }
.sidebar .me { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sidebar .me .who { min-width: 0; flex: 1; }
.sidebar .me .who strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me .who span { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; padding: 26px clamp(16px, 3vw, 36px) 60px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--raised-2); color: var(--gold-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; overflow: hidden; border: 1px solid var(--line-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: .75rem; }

/* ------------------------------------------------------------------ Building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.kpi .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--faint); font-size: .8rem; }
.kpi.accent { border-color: var(--line-2); background: linear-gradient(160deg, rgba(232,181,74,.13), transparent 65%), var(--surface); }
.kpi.accent .value { color: var(--gold-2); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--raised); color: var(--paper); padding: 9px 15px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--gold-deep); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.primary:hover { background: var(--gold-2); }
.btn.ok { background: var(--ok-soft); border-color: rgba(76,195,138,.45); color: #a8ebc9; }
.btn.danger { background: var(--err-soft); border-color: rgba(240,106,106,.45); color: #ffb3b3; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--paper); background: var(--raised); }
.btn.sm { padding: 6px 10px; font-size: .84rem; border-radius: 8px; }
.btn.lg { padding: 14px 22px; font-size: 1.05rem; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 17px; height: 17px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--raised-2); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.ok { background: var(--ok-soft); color: #8fe3bb; }
.pill.err { background: var(--err-soft); color: #ff9e9e; }
.pill.gold { background: var(--gold-soft); color: var(--gold-2); }
.pill.info { background: var(--info-soft); color: #a9d4f7; }
.pill.plain::before { display: none; }
.badge { background: var(--gold); color: var(--ink); border-radius: 999px; font-size: .72rem; font-weight: 800; padding: 1px 7px; min-width: 20px; text-align: center; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; color: var(--muted); }
.field input, .field select, .field textarea, .input { background: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--paper); font-size: .95rem; width: 100%; min-width: 0; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,181,74,.18); }
.field .help { color: var(--faint); font-size: .8rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--paper); font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
input[type=range] { accent-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.tabs { display: inline-flex; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: .88rem; font-weight: 600; }
.tabs button.active { background: var(--raised-2); color: var(--gold-2); }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--faint); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--raised); }
td .sub { display: block; color: var(--muted); font-size: .82rem; }
.person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person strong { display: block; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

.bar { height: 8px; border-radius: 99px; background: var(--raised-2); overflow: hidden; display: flex; min-width: 80px; }
.bar i { display: block; height: 100%; }
.bar i.work { background: var(--gold); }
.bar i.idle { background: var(--idle); }
.legend { display: inline-flex; align-items: center; gap: 14px; font-size: .82rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .work::before { background: var(--gold); }
.legend .idle::before { background: var(--idle); }

/* ------------------------------------------------------------------ Today */
.punch-card { position: relative; overflow: hidden; background: radial-gradient(70% 90% at 100% 0%, rgba(232,181,74,.16), transparent 60%), var(--surface); border-color: var(--line-2); padding: 26px; }
.punch-card .state { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 750; margin: 6px 0 6px; }
.punch-card .clock { font-size: .9rem; color: var(--muted); }
.punch-card .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.punch-card .where { margin-top: 14px; font-size: .9rem; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--faint); margin-right: 8px; vertical-align: 1px; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 4px rgba(76,195,138,.18); animation: pulse 1.6s ease-in-out infinite; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.stat-line { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; }
.stat-line div { min-width: 90px; }
.stat-line strong { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat-line span { color: var(--muted); font-size: .82rem; }

/* ------------------------------------------------------------------ Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { color: var(--faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; text-align: center; padding-bottom: 2px; }
.cal .day { min-height: 74px; border-radius: 10px; background: var(--ink); border: 1px solid var(--line); padding: 6px 7px; font-size: .78rem; display: flex; flex-direction: column; gap: 2px; cursor: default; position: relative; }
.cal .day.click { cursor: pointer; }
.cal .day.click:hover { border-color: var(--gold-deep); }
.cal .day .n { font-weight: 700; font-size: .86rem; }
.cal .day .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal .day.blank { background: transparent; border-color: transparent; }
.cal .day.present { border-color: rgba(76,195,138,.4); background: linear-gradient(180deg, rgba(76,195,138,.12), transparent); }
.cal .day.wfh { border-color: rgba(108,180,238,.4); background: linear-gradient(180deg, rgba(108,180,238,.12), transparent); }
.cal .day.leave, .cal .day.half_leave { border-color: rgba(232,181,74,.4); background: linear-gradient(180deg, rgba(232,181,74,.12), transparent); }
.cal .day.absent { border-color: rgba(240,106,106,.4); background: linear-gradient(180deg, rgba(240,106,106,.1), transparent); }
.cal .day.holiday { background: repeating-linear-gradient(135deg, #17130c 0 6px, #1c170e 6px 12px); }
.cal .day.off { opacity: .55; }
.cal .day.today { outline: 2px solid var(--gold); outline-offset: -1px; }
.cal .tag { font-size: .7rem; font-weight: 650; }
.cal .tag.present { color: #8fe3bb; } .cal .tag.wfh { color: #a9d4f7; } .cal .tag.leave, .cal .tag.half_leave { color: var(--gold-2); } .cal .tag.absent { color: #ff9e9e; } .cal .tag.holiday { color: var(--gold); }

/* ------------------------------------------------------------------ Charts */
.chart { display: flex; align-items: stretch; gap: 6px; height: 170px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chart .col .track { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.chart .col .pile { display: flex; flex-direction: column; border-radius: 6px 6px 3px 3px; overflow: hidden; min-height: 2px; background: var(--raised-2); }
.chart .col .pile i { display: block; flex-basis: 0; min-height: 0; }
.chart .col .pile i.work { background: var(--gold); }
.chart .col .pile i.idle { background: var(--idle); }
.chart .col:hover .pile { filter: brightness(1.12); }
.chart .col .lbl { text-align: center; color: var(--faint); font-size: .7rem; margin-top: 6px; white-space: nowrap; overflow: hidden; }
.chart .col.sel .lbl { color: var(--gold-2); font-weight: 700; }
.timeline { display: grid; grid-template-columns: repeat(108, 1fr); gap: 1px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--line); }
.timeline i { background: var(--ink); display: block; }
.timeline-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: .72rem; margin-top: 6px; }

/* ------------------------------------------------------------------ Drawer, dialog, toasts */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; display: flex; justify-content: flex-end; }
.overlay.center { align-items: center; justify-content: center; padding: 16px; }
.drawer { width: min(720px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; padding: 24px clamp(16px, 3vw, 28px) 40px; box-shadow: var(--shadow); }
.dialog { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; }
.dialog h2 { margin-bottom: 8px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--raised-2); border: 1px solid var(--line-2); border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .92rem; animation: slide .2s ease-out; }
.toast.ok { border-left-color: var(--ok); } .toast.err { border-left-color: var(--err); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

.code-box { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: .14em; color: var(--gold-2); background: var(--ink); border: 1px dashed var(--line-2); border-radius: 14px; padding: 14px 18px; text-align: center; font-variant-numeric: tabular-nums; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(step); width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-2); display: grid; place-items: center; font-weight: 800; }
.map { height: 340px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--raised); }
.req { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--ink); }
.req + .req { margin-top: 10px; }
.req .top { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.req .reason { margin: 8px 0 0; color: #DCD5C5; white-space: pre-wrap; }
.color-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -1px; }
.balance { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--ink); }
.balance .big { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.balance .big small { font-size: .9rem; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ Phones */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: rgba(12,10,6,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .menu-btn { background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
  .topbar .menu-btn svg { width: 20px; height: 20px; }
  .main { padding: 18px 14px 80px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .cal { gap: 3px; }
  .cal .day { min-height: 52px; padding: 4px; font-size: .68rem; }
  .cal .day .t, .cal .day .tag { display: none; }
  .cal .day .n { font-size: .8rem; }
  .cal .day.present::after, .cal .day.wfh::after, .cal .day.leave::after, .cal .day.half_leave::after, .cal .day.absent::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: currentColor; }
  .cal .day.present { color: var(--ok); } .cal .day.wfh { color: var(--info); } .cal .day.leave, .cal .day.half_leave { color: var(--gold); } .cal .day.absent { color: var(--err); }
  .cal .day .n { color: var(--paper); }
  .drawer { padding-top: max(20px, env(safe-area-inset-top)); }
  .punch-card { padding: 20px; }
  .punch-card .actions .btn.lg { width: 100%; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Apps used */
.apps { display: flex; flex-direction: column; gap: 8px; }
.app-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 70px; align-items: center; gap: 12px; font-size: .92rem; }
.app-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar { height: 8px; background: var(--raised-2); border-radius: 99px; overflow: hidden; }
.app-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: 99px; }
.app-time { text-align: right; color: var(--muted); }
@media (max-width: 560px) { .app-row { grid-template-columns: 1fr 64px; } .app-bar { grid-column: 1 / -1; order: 3; } }
.app-line { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; line-height: 1.55; }
.app-line > span:first-child { overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
