/* Project Tracker — plain CSS, no build step. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #dfe3ea;
  --text: #17202e;
  --muted: #5d6877;
  --accent: #0f6e6a;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2f1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --ok: #1f7a3d;
  --ok-soft: #e7f6ec;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --surface: #171d24; --surface-2: #1e252e; --border: #2b3440;
    --text: #e6eaef; --muted: #98a3b1; --accent: #3fb8b1; --accent-ink: #0b1414; --accent-soft: #15302f;
    --danger: #ff8a7a; --danger-soft: #3a1c19; --warn: #f2b45a; --warn-soft: #33270f; --ok: #6fd28f; --ok-soft: #14301e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }

/* ---- Top bar ---- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1.25rem; padding: 0 1.25rem; height: 56px; position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; color: var(--text); letter-spacing: -.01em; display: flex; align-items: center; gap: .5rem; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; }
.nav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.nav a { color: var(--muted); padding: .4rem .65rem; border-radius: 6px; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.bell { position: relative; color: var(--muted); }
.bell .count {
  position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff; border-radius: 999px;
  font-size: .7rem; padding: 0 .35rem; line-height: 1.3rem; min-width: 1.3rem; text-align: center;
}

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: .15rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: 2fr 1fr; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid-2, .grid-cols-2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 1.25rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.1rem 1.25rem; }
.card-head { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-head h2, .card-head h3 { margin: 0; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.actions { text-align: right; white-space: nowrap; }

/* ---- Description lists ---- */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600;
  padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); white-space: nowrap;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sev-low { background: var(--surface-2); color: var(--muted); }
.sev-medium { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.sev-high { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.sev-critical { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.vis-public { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.vis-private { background: var(--surface-2); color: var(--muted); }
.overdue { color: var(--danger); font-weight: 600; }

.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--accent); }

/* ---- Forms ---- */
.form { display: grid; gap: 1rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.hint { color: var(--muted); font-size: .83rem; font-weight: 400; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font: inherit;
}
input[type=color] { width: 3rem; height: 2.2rem; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; margin: 0; }
.check input { margin-top: .25rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0; }
legend { font-weight: 700; padding: 0 .35rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem 1rem; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: .25rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .48rem .9rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: .25rem .6rem; font-size: .85rem; }
.btn-link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; cursor: pointer; font: inherit; }
form.inline { display: inline; }

/* ---- Alerts ---- */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert ul { margin: .25rem 0 0; padding-left: 1.2rem; }

/* ---- Journal ---- */
.journal { list-style: none; margin: 0; padding: 0; }
.journal li { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.journal li:last-child { border-bottom: 0; }
.journal li.is-private { background: repeating-linear-gradient(135deg, transparent 0 12px, var(--surface-2) 12px 13px); }
.journal .meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .87rem; margin-bottom: .35rem; }
.journal .meta strong { color: var(--text); }
.changes { margin: .4rem 0 0; padding: 0; list-style: none; font-size: .88rem; }
.changes li { padding: 0; border: 0; background: none !important; }
.changes del { color: var(--muted); }

/* ---- Filters ---- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.filters > div { min-width: 140px; }
.filters label { font-size: .78rem; color: var(--muted); }

/* ---- Pagination (Laravel default markup) ---- */
nav[role=navigation] { margin-top: 1rem; }
nav[role=navigation] svg { width: 1rem; height: 1rem; }
.pagination { display: flex; gap: .25rem; list-style: none; padding: 0; flex-wrap: wrap; }
.pagination li > * { display: inline-block; padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.pagination .active > * { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pagination .disabled > * { color: var(--muted); }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; margin-bottom: 1.25rem; font-size: 1.15rem; }

.empty { padding: 2rem 1.25rem; text-align: center; color: var(--muted); }
.stat { display: flex; align-items: center; justify-content: space-between; padding: .4rem 0; border-bottom: 1px dashed var(--border); }
.stat:last-child { border-bottom: 0; }
.perm-yes { color: var(--ok); font-weight: 700; }
.perm-no { color: var(--border); }

/* Controls inside inline rows size to content instead of stretching. */
.row > select, .row > input[type=text], .row > input[type=search] { width: auto; flex: 0 1 auto; min-width: 10rem; }
td form.row { flex-wrap: nowrap; }
