/* Inopro HQ design system. One small file, self-hosted fonts, no build step.
   Brand: blue #1564FE, charcoal #252626, Montserrat for headings, Inter for the interface. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600 800; font-display: swap;
    src: url("../fonts/montserrat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #f1f4f9;
    --hover: #f6f8fc;
    --border: #e3e8ef;
    --border-strong: #ccd5e1;
    --text: #1a1d24;
    --muted: #596273;
    --faint: #8b94a5;
    --brand: #1564fe;
    --brand-hover: #0f52d6;
    --brand-soft: #eaf1ff;
    --brand-ink: #ffffff;
    --sky: #2d9cea;
    --ok: #12795a;
    --ok-soft: #e4f5ee;
    --warn: #9a5700;
    --warn-soft: #fdf1da;
    --bad: #c42b2b;
    --bad-soft: #fdeaea;
    --radius: 8px;
    --radius-lg: 12px;
    --ring: 0 0 0 3px rgba(21, 100, 254, .22);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --sidebar-w: 236px;
    --topbar-h: 56px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
    --font-head: "Montserrat", "Inter", system-ui, sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #141a23;
    --surface-2: #1b222d;
    --hover: #18202b;
    --border: #252e3b;
    --border-strong: #33404f;
    --text: #e7ebf2;
    --muted: #9ba5b6;
    --faint: #6e7a8c;
    --brand: #4d8dff;
    --brand-hover: #6fa1ff;
    --brand-soft: #14284f;
    --brand-ink: #0b1220;
    --ok: #4cc392;
    --ok-soft: #0f2a21;
    --warn: #f0b04a;
    --warn-soft: #2e2410;
    --bad: #ff7a7a;
    --bad-soft: #351718;
    --ring: 0 0 0 3px rgba(77, 141, 255, .3);
    --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; margin: 0; color: var(--text); }
h1 { font-size: 22px; font-weight: 600; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar { background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--border); }
.sidebar-brand img { height: 26px; width: auto; display: block; }
.dark-logo { display: none !important; }
:root[data-theme="dark"] .light-logo { display: none !important; }
:root[data-theme="dark"] .dark-logo { display: block !important; }

.nav { padding: 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius); color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a kbd { margin-left: auto; opacity: 0; transition: opacity .12s; }
.nav a:hover kbd { opacity: 1; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.search { position: relative; flex: 0 1 380px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input[type=search] { height: 36px; padding: 0 44px 0 36px; background: var(--surface-2); border-color: transparent; }
.search input[type=search]:hover { border-color: var(--border); }
.search input[type=search]:focus { background: var(--surface); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.spacer { flex: 1; }
.btn.menu-btn { display: none; }

.content { padding: 28px 32px 56px; width: 100%; max-width: 1360px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .titles { flex: 1 1 280px; min-width: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ------------------------------------------------------------ components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2:first-child { margin-top: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn:focus-visible, .nav a:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--ring); }

label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 5px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
textarea { height: auto; padding: 9px 11px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.err { color: var(--bad); font-size: 12.5px; margin-top: 5px; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 4px; }
.form-actions { display: flex; gap: 8px; padding-top: 8px; }

.flash { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); font-weight: 500; margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0 16px; height: 46px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { height: 38px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td a.row-title { color: var(--text); font-weight: 600; }
td a.row-title:hover { color: var(--brand); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--brand-soft); color: var(--brand); }

kbd { font: 500 11px/1 var(--font); background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; color: var(--muted); }

.empty { text-align: center; padding: 44px 20px; }
.empty .icon { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { font-size: 15px; margin-bottom: 4px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 14px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 240px; }
.toolbar select { width: auto; min-width: 140px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; display: block; color: inherit; }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat .l { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .v { font: 600 26px/1.2 var(--font-head); font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .n { color: var(--faint); font-size: 12px; margin-top: 2px; }

.card .grid2 > div > .muted.small { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: .01em; margin-bottom: 2px; }
.card .grid2 > div > div:not(.muted) { margin-bottom: 14px; }
.timer-pill { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 4px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.timer-pill time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 58px; }
.timer-proj { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.day-head td { background: var(--surface-2); font-weight: 600; height: 36px; color: var(--muted); border-bottom: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.perm-group { margin-bottom: 14px; }
.perm { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 6px; }
.perm input { width: auto; }
pre.json { margin: 0; font: 12px ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-width: 420px; color: var(--muted); }

/* dropdown menus (details/summary: no JS needed) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); padding: 6px; z-index: 30; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-panel .who strong { display: block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; }

/* ------------------------------------------------------------ sign in */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-brand { background: #1564fe; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.auth-brand img { height: 34px; width: auto; }
.auth-brand h2 { color: #fff; font-size: 30px; line-height: 1.25; font-weight: 600; max-width: 440px; margin: 0 0 14px; }
.auth-brand p { color: rgba(255, 255, 255, .85); font-size: 15px; max-width: 420px; }
.auth-brand small { color: rgba(255, 255, 255, .7); }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }

/* legal and privacy footer, public pages */
.legal-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 18px 32px 28px; font-size: 12.5px; color: var(--faint); }
.legal-foot a { color: var(--muted); }
.legal-foot a:hover { color: var(--brand); }
.legal-copy { margin-left: auto; }
.auth-form .legal-foot { padding: 28px 0 0; width: 100%; max-width: 360px; }
.auth-form .legal-copy { margin-left: 0; flex-basis: 100%; }
body.public { display: flex; flex-direction: column; min-height: 100vh; }
.public-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.public-top img { height: 28px; width: auto; }
.public-main { flex: 1; padding: 36px 24px; }
.doc { max-width: 760px; margin: 0 auto; }
.doc h1 { font-size: 28px; margin-bottom: 4px; }
.doc h2 { font-size: 17px; margin: 28px 0 8px; }
.doc p, .doc li { font-size: 15px; line-height: 1.7; }
.doc ul { padding-left: 20px; margin: 0 0 10px; }
@media (max-width: 880px) { .legal-foot { padding: 16px 16px 24px; } .legal-copy { margin-left: 0; flex-basis: 100%; } }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h1 { font-size: 24px; margin-bottom: 6px; }
.auth-form .mobile-logo { display: none; height: 28px; margin-bottom: 28px; }

@media (max-width: 880px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .16s ease; }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 15, 25, .45); }
    .btn.menu-btn { display: inline-flex; }
    .topbar { padding: 0 14px; }
    .content { padding: 20px 16px 48px; }
    .grid2 { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-form .mobile-logo { display: block; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 8px; }
}
@media (max-width: 560px) { .search kbd { display: none; } .search { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
