/* ---- Hobber Tracker design system ------------------------------------------------- */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --ink: #1a2233;
    --ink-soft: #5b6478;
    --line: #e3e6ec;
    --accent: #4653e8;
    --accent-ink: #ffffff;
    --accent-soft: #eef0ff;
    --sidebar-bg: #161b2c;
    --sidebar-ink: #aab2c8;
    --sidebar-active: #ffffff;
    --green: #1a9b6c;
    --green-soft: #e2f6ee;
    --amber: #b97c10;
    --amber-soft: #fdf3df;
    --red: #cc3d51;
    --red-soft: #fdeaed;
    --blue: #2f6fd6;
    --blue-soft: #e8f0fd;
    --purple: #7a4fd0;
    --purple-soft: #f1eafd;
    --gray-soft: #eceef2;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 27, 45, 0.06), 0 4px 16px rgba(20, 27, 45, 0.05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 14.5px;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -0.02em; }
h2 { font-size: 14px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); display: flex; gap: 8px; align-items: baseline; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

.muted { color: var(--ink-soft); font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.right { margin-left: auto; }
.error-text { color: var(--red); font-size: 13px; }

/* ---- Shell ------------------------------------------------------------------------ */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 218px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--sidebar-active); }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #7a4fd0);
    color: #fff; font-weight: 700; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; padding: 14px 10px 4px; color: #6b7490; }
.nav-link {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; border-radius: 7px;
    color: var(--sidebar-ink); font-size: 13.5px;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: var(--sidebar-active); text-decoration: none; }
.nav-link.active { background: rgba(255, 255, 255, 0.1); color: var(--sidebar-active); font-weight: 600; }
.nav-icon { width: 16px; text-align: center; opacity: 0.85; }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 12px 10px 0; font-size: 13px; }
.user-name { color: var(--sidebar-active); font-weight: 600; margin-bottom: 4px; }
.link-button { background: none; border: none; color: var(--sidebar-ink); cursor: pointer; padding: 0; font-size: 12.5px; }
.link-button:hover { color: var(--sidebar-active); text-decoration: underline; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 28px; background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.search { flex: 0 1 420px; }
.search input {
    width: 100%; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg); font-size: 13.5px;
}
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.topbar-hint { margin-left: auto; font-size: 12.5px; color: var(--ink-soft); }

.content { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }

/* ---- Page scaffolding ------------------------------------------------------------- */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
}
.card-warn { border-left: 3px solid var(--amber); }

.empty {
    background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 34px; text-align: center; color: var(--ink-soft);
}

/* ---- Corner cards ----------------------------------------------------------------- */

.corner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.corner-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px;
    display: flex; flex-direction: column; gap: 2px; color: var(--ink);
    border-top: 3px solid var(--accent);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.corner-card:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 22px rgba(20, 27, 45, 0.1); }
.corner-bugs { border-top-color: var(--red); }
.corner-features { border-top-color: var(--purple); }
.corner-review { border-top-color: var(--amber); }
.corner-history { border-top-color: var(--green); }
.corner-count { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.corner-label { font-weight: 650; }
.corner-sub { font-size: 12.5px; color: var(--ink-soft); }

.dash-cols { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } }

/* ---- Pills & refs ----------------------------------------------------------------- */

.pill {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; white-space: nowrap;
}
.st-open { background: var(--blue-soft); color: var(--blue); }
.st-inprogress { background: var(--accent-soft); color: var(--accent); }
.st-inreview { background: var(--amber-soft); color: var(--amber); }
.st-done { background: var(--green-soft); color: var(--green); }
.st-dropped { background: var(--gray-soft); color: var(--ink-soft); }
.ty-bug { background: var(--red-soft); color: var(--red); }
.ty-feature { background: var(--purple-soft); color: var(--purple); }
.pr-low { background: var(--gray-soft); color: var(--ink-soft); }
.pr-medium { background: var(--blue-soft); color: var(--blue); }
.pr-high { background: var(--amber-soft); color: var(--amber); }
.pr-critical { background: var(--red-soft); color: var(--red); }
.role-pill { background: var(--gray-soft); color: var(--ink-soft); }

.ref {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px; font-weight: 600; color: var(--accent);
    background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
.ref-big { font-size: 14px; padding: 3px 10px; }
.gh-badge {
    font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
    background: #24292f; color: #fff; margin-left: 6px; white-space: nowrap;
}
a.gh-badge:hover { text-decoration: none; opacity: 0.85; }

/* ---- Tables & lists --------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--ink-soft); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table.compact th, .table.compact td { padding: 7px 12px; }
.row-link { cursor: pointer; }
.row-link:hover { background: #f7f8fb; }
.row-muted { opacity: 0.55; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.item-title { color: var(--ink); font-weight: 550; }
a.item-title:hover { color: var(--accent); text-decoration: none; }

.item-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item-list li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input[type="search"], .filters select {
    padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px;
}
.filters .count { margin-left: auto; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }

/* ---- Buttons & forms -------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f2f4f8; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #3844d8; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: default; }
.mini-btn {
    border: 1px solid var(--line); background: var(--surface); border-radius: 6px;
    font-size: 11.5px; padding: 3px 8px; cursor: pointer; color: var(--ink-soft);
}
.mini-btn:hover { color: var(--ink); }
.icon-button { background: none; border: none; font-size: 15px; cursor: pointer; color: var(--ink-soft); }

input, select, textarea {
    font-family: inherit; font-size: 13.5px; color: var(--ink);
    border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; width: 100%; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
label input, label select, label textarea { font-weight: 400; color: var(--ink); }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { min-width: 140px; }
.stack-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.inline-input { padding: 4px 8px; font-size: 12.5px; max-width: 150px; }

/* ---- Detail page ------------------------------------------------------------------ */

.detail-refline { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.detail-title { font-size: 20px; }
.status-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 18px;
}
.status-note { flex: 1; min-width: 200px; }
.detail-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .detail-cols { grid-template-columns: 1fr; } }

.meta { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; }
.meta dt { color: var(--ink-soft); font-size: 12.5px; }
.meta dd { margin: 0; font-size: 13px; display: flex; gap: 6px; align-items: center; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.checklist label { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; color: var(--ink); font-size: 13.5px; cursor: pointer; }
.checklist .done { text-decoration: line-through; color: var(--ink-soft); }

.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.comment { border-left: 3px solid var(--line); padding-left: 12px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; font-size: 13px; }
.comment-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.comment-box textarea { width: 100%; }

.commit-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.commit-msg { font-size: 12px; }

.attachments { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.attachment { margin: 0; max-width: 240px; }
.attachment img { max-width: 240px; max-height: 170px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.attachment video { max-width: 240px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.attachment figcaption { font-size: 11.5px; margin-top: 4px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.file-chip {
    display: inline-block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg); color: var(--ink); font-size: 13px;
}
.upload { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }

/* ---- Review corner ---------------------------------------------------------------- */

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.review-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-title { font-size: 15px; font-weight: 650; color: var(--ink); }
.review-title:hover { color: var(--accent); text-decoration: none; }
.review-note { width: 100%; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Timeline --------------------------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 6px; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-blue { background: var(--blue); }
.dot-purple { background: var(--purple); }
.dot-amber { background: var(--amber); }
.dot-gray { background: var(--ink-soft); }
.timeline-head { display: flex; align-items: baseline; gap: 7px; font-size: 13px; flex-wrap: wrap; }
.timeline-text { font-size: 13px; color: var(--ink-soft); }

/* ---- Markdown --------------------------------------------------------------------- */

.markdown { font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.markdown h1, .markdown h2, .markdown h3 { text-transform: none; letter-spacing: 0; color: var(--ink); margin: 14px 0 6px; }
.markdown h1 { font-size: 17px; } .markdown h2 { font-size: 15px; } .markdown h3 { font-size: 14px; }
.markdown p { margin: 0 0 10px; }
.markdown pre { background: #161b2c; color: #e6e9f2; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; }
.markdown code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; background: var(--gray-soft); padding: 1px 5px; border-radius: 4px; }
.markdown pre code { background: none; padding: 0; }
.markdown blockquote { border-left: 3px solid var(--line); margin: 0 0 10px; padding: 2px 0 2px 12px; color: var(--ink-soft); }
.markdown table { border-collapse: collapse; margin-bottom: 10px; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 5px 10px; font-size: 12.5px; }
.markdown img { max-width: 100%; border-radius: 8px; }
.markdown ul, .markdown ol { margin: 0 0 10px; padding-left: 22px; }

/* ---- Modal ------------------------------------------------------------------------ */

.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 20, 33, 0.45); z-index: 90; }
.modal {
    position: fixed; top: 7vh; left: 50%; transform: translateX(-50%);
    width: min(680px, 94vw); max-height: 84vh; overflow-y: auto;
    background: var(--surface); border-radius: 14px; box-shadow: 0 24px 70px rgba(10, 14, 28, 0.35);
    z-index: 100; display: flex; flex-direction: column;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-head h2 { margin: 0; text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); }
.modal-body { padding: 14px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }

/* ---- Auth / error pages ----------------------------------------------------------- */

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); }
.login-card {
    width: min(380px, 92vw); background: var(--surface); border-radius: 14px;
    padding: 28px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
    display: flex; flex-direction: column; gap: 14px;
}
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-title { font-weight: 700; font-size: 17px; }
.error-panel { background: var(--surface); border-radius: 14px; padding: 34px 40px; text-align: center; }
.error-panel h1 { font-size: 34px; }
