:root {
  --bg: #0b0d0c;
  --panel: #131715;
  --panel-2: #181d1a;
  --line: #232a26;
  --line-2: #2e3632;
  --text: #e9eeea;
  --muted: #8b968f;
  --green: #2fa35a;
  --green-2: #46c06f;
  --green-soft: rgba(47, 163, 90, .14);
  --blue: #3b82f6;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #a855f7;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 18px; }
h3 { font-size: 14px; margin: 18px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ic { width: 18px; height: 18px; flex: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--text); font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item, .nav-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c4ccc7; font-weight: 500; }
.nav-item:hover, .nav-head:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.nav-item.active, .nav-head.active { background: var(--green-soft); color: var(--green-2); }
.nav-section { padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; flex: 1; }
.tree summary { list-style: none; cursor: pointer; padding: 6px 10px 6px 14px; border-radius: 8px; display: flex; align-items: center; gap: 8px; color: #c4ccc7; font-size: 13px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--panel-2); }
.tree-item { display: block; padding: 5px 10px 5px 34px; border-radius: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.tree-item.active { color: var(--green-2); background: var(--green-soft); }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 1; min-width: 0; font-weight: 500; }
.me:hover { text-decoration: none; }
.me small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: rgba(11, 13, 12, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.menu-btn { display: none; }

/* Clock */
.clock { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; }
.clock-dot { width: 8px; height: 8px; border-radius: 50%; background: #56605a; }
.clock-dot.on { background: var(--green-2); box-shadow: 0 0 0 4px rgba(70, 192, 111, .18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(70, 192, 111, .05); } }
.clock-label { color: var(--muted); font-size: 12px; }
.clock-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; }
.clock .btn { border-radius: 999px; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3f4943; text-decoration: none; }
.btn-primary, .btn-in { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover, .btn-in:hover { background: #33b062; border-color: #33b062; }
.btn-out { background: #3a1d1d; border-color: #5b2626; color: #ffb4b4; }
.btn-danger { color: #ff9c9c; border-color: #4b2424; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; margin-top: 8px; padding: 11px; }
.btn-big { padding: 14px 28px; font-size: 16px; border-radius: 12px; }
.icon-btn { display: inline-flex; padding: 7px; border-radius: 8px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
input[type=checkbox] { width: auto; accent-color: var(--green); }
input[type=color] { padding: 2px; height: 38px; }
input[type=file] { padding: 7px; }
textarea { min-height: 90px; resize: vertical; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 400; margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form label { margin: 0; }
.inline-form input, .inline-form select { width: auto; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.warn b { color: var(--amber); }
.stat.bad b { color: #ff7d7d; }
.stat.ok b { color: var(--green-2); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.task-title { color: var(--text); font-weight: 500; }
.task-title:hover { color: var(--green-2); }
tr.done .task-title { color: var(--muted); text-decoration: line-through; }

/* Badges */
.status, .prio, .pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-todo { background: #23292580; color: #b5bfb9; }
.st-in_progress { background: rgba(59, 130, 246, .14); color: #7fb0ff; }
.st-review { background: rgba(245, 158, 11, .14); color: #fbbf4d; }
.st-done { background: var(--green-soft); color: var(--green-2); }
.prio { padding: 1px 8px; border: 1px solid; background: none; }
.pr-urgent { color: #ff7d7d; border-color: #5b2626; }
.pr-high { color: #fdba74; border-color: #5a3a1c; }
.pr-normal { color: #93b7f5; border-color: #24375a; }
.pr-low { color: #8b968f; border-color: #2e3632; }
.pill-ok { background: var(--green-soft); color: var(--green-2); }
.pill-warn { background: rgba(245, 158, 11, .14); color: #fbbf4d; }
.pill-bad { background: rgba(239, 68, 68, .14); color: #ff8a8a; }
.pill-mute { background: #1d2320; color: var(--muted); }
.pill-blue { background: rgba(59, 130, 246, .14); color: #7fb0ff; }
.due { font-size: 12.5px; }
.due-over { color: #ff7d7d; font-weight: 600; }
.due-today { color: #fbbf4d; font-weight: 600; }

/* Avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 12px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; border: 2px solid var(--panel); }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.more { background: #2e3632; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell small { display: block; color: var(--muted); }

/* Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 300px; display: flex; flex-direction: column; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.col-body { flex: 1; display: flex; flex-direction: column; gap: 8px; border-radius: 8px; transition: background .15s; }
.col-body.over { background: var(--green-soft); }
.tcard { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; cursor: grab; }
.tcard:hover { border-color: #3f4943; }
.tcard.dragging { opacity: .5; }
.tcard a { color: var(--text); font-weight: 500; display: block; margin-bottom: 8px; }
.tcard-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.tcard-meta .row { gap: 6px; }

/* Groups */
.group { margin-bottom: 18px; }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.count { color: var(--muted); font-size: 12px; background: var(--panel-2); border-radius: 999px; padding: 1px 8px; }

/* Client cards */
.ccard { display: flex; flex-direction: column; gap: 10px; }
.ccard-top { display: flex; align-items: center; gap: 12px; }
.ccard-top .swatch { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.ccard-top a { color: var(--text); font-weight: 600; font-size: 15px; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.pitem { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.pitem:hover { border-color: var(--line-2); text-decoration: none; background: var(--panel-2); }
.progress { height: 6px; border-radius: 99px; background: #222925; overflow: hidden; margin-top: 7px; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 99px; }

/* Task detail */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.title-input { font-size: 22px; font-weight: 600; background: transparent; border-color: transparent; padding: 6px 8px; margin-left: -8px; }
.title-input:hover { border-color: var(--line-2); }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-body { flex: 1; min-width: 0; word-wrap: break-word; }
.comment-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.comment-meta b { color: var(--text); font-weight: 600; margin-right: 6px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font-size: 12.5px; max-width: 280px; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file:hover { text-decoration: none; border-color: var(--green); }
.thumb { width: 120px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2); display: block; }
.activity { font-size: 12.5px; color: var(--muted); padding: 6px 0; }
.activity b { color: #c4ccc7; font-weight: 500; }
.subtask { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.subtask:last-child { border-bottom: 0; }
.subtask a { flex: 1; color: var(--text); }
.subtask.done a { color: var(--muted); text-decoration: line-through; }
.assignee-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; }
.meta-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; color: var(--muted); }
.meta-row span:last-child { color: var(--text); }

/* Clock-in hero */
.hero-clock { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: linear-gradient(135deg, #12251a, #131715 60%); border: 1px solid #1f3a2a; border-radius: 16px; padding: 22px 24px; margin-bottom: 18px; }
.hero-clock .big-time { font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hero-clock p { margin: 2px 0 0; color: var(--muted); }

/* Misc */
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash-success { background: var(--green-soft); border-color: #24563a; color: #a6e9bd; }
.flash-error { background: rgba(239, 68, 68, .1); border-color: #5b2626; color: #ffb4b4; }
.flash-info { background: rgba(59, 130, 246, .1); border-color: #24375a; color: #b6d0ff; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.tabs a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.active { background: var(--panel-2); color: var(--text); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.quick-add { display: flex; gap: 8px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 16px; }
.quick-add input[name=title] { flex: 1 1 260px; }
.quick-add select, .quick-add input[type=date] { width: auto; flex: 0 0 auto; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 14px; padding: 22px; width: min(560px, 94vw); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin-bottom: 16px; }
.day-grid td.weekend { color: var(--muted); }
.who { display: flex; flex-direction: column; }
.who-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.who-row:last-child { border-bottom: 0; }
.who-row .grow { flex: 1; min-width: 0; }
.who-row small { color: var(--muted); display: block; }
.sessions { font-size: 12px; color: var(--muted); }

/* Auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; flex-direction: column; background: radial-gradient(ellipse at top, #10261a, var(--bg) 60%); }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px; }
.auth-card.wide { width: min(640px, 100%); }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card > p { margin: 0 0 20px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.auth-brand img { width: 96px; }

@media (max-width: 1100px) {
  .layout-2, .task-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
  .menu-btn { display: inline-flex; }
  .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .clock { order: 5; width: 100%; justify-content: space-between; }
  .clock-label { flex: 1; }
  .content { padding: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .top-actions { order: 4; }
}
