/* kkt61 helpdesk — compact service desk, 1C-Connect inspired */
:root {
  --ink: #1b2433;
  --muted: #5b6778;
  --line: #d7dee8;
  --paper: #ffffff;
  --bg: #e8edf3;
  --navy: #1c2e4a;
  --navy-2: #152338;
  --accent: #1f6feb;
  --accent-2: #174ea8;
  --gold: #d4a017;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --wait: #875900;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: "Segoe UI", "PT Sans", "Noto Sans", "Roboto", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 18px 0 10px; }

.top {
  display: flex;
  align-items: center;
  gap: 28px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 0 22px;
  height: 56px;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; color: #fff; }
.logo {
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 18px;
  color: #fff;
  background: var(--gold);
  color: #1a1403;
  padding: 2px 8px;
  border-radius: 4px;
}
.logo.big { font-size: 28px; display: inline-block; margin-bottom: 8px; }
.brand-sub { font-size: 13px; opacity: .8; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: #d7e0ee;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 600;
}
.nav a:hover, .nav a.is-on { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a b {
  background: var(--gold);
  color: #1a1403;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 99px;
  margin-left: 2px;
}
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #c9d4e4; }
.userbox form { margin: 0; }
.linkish {
  background: none; border: 0; color: #fff; cursor: pointer;
  font: inherit; text-decoration: underline; padding: 0;
}

.page { max-width: 1280px; margin: 0 auto; padding: 22px 22px 60px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px;
  background: var(--paper);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filters .input { min-width: 180px; }
.filters input[type=search] { flex: 1; min-width: 240px; }

.input, select.input, textarea.input {
  font: inherit;
  color: var(--ink);
  border: 1px solid #c5ced8;
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  width: 100%;
}
.input:focus { outline: 2px solid #b6d0f5; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #3d4a5c; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 13px/1 var(--font);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #f3f6fa; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent-2); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 3px 8px; font-size: 12px; }

.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: top; }
.grid th { background: #f4f7fb; font-size: 12px; font-weight: 700; color: #4a586c; white-space: nowrap; position: sticky; top: 0; }
.grid th a { color: inherit; }
.grid tbody tr:hover { background: #f6f9fc; }
.grid .empty { text-align: center; color: var(--muted); padding: 28px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace; letter-spacing: .01em; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { margin: 8px 0 0; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; margin-top: 18px; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.kv div span:first-child { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.prose { white-space: pre-wrap; }
.plain { padding-left: 18px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.section-title { margin: 22px 0 8px; }

.status {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: #eef2f6;
}
.st-new { background: #e6effc; color: #174ea8; }
.st-work { background: #fff3d6; color: #8a5a00; }
.st-wait { background: #fce7c6; color: #9a4d00; }
.st-done { background: #e4f7ec; color: #067647; }
.st-closed { background: #e8eaed; color: #4b5563; }

.timeline { list-style: none; padding: 0; margin: 0 0 16px; }
.timeline li { border-left: 2px solid var(--line); padding: 0 0 14px 14px; }
.timeline .when { font-size: 12px; color: var(--muted); margin-bottom: 2px; }

.flash { list-style: none; padding: 0; }
.flash li, .flash-error {
  background: #e4f7ec; color: #067647;
  padding: 8px 12px; border-radius: 6px; margin: 0 0 12px;
}
.flash .error, .flash-error { background: #fde8e6; color: var(--danger); }

.muted { color: var(--muted); }
.hidden { display: none; }
code.pwd { font-size: 12px; margin-left: 6px; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 10% -10%, #2b4a7a 0%, transparent 50%),
    var(--navy-2);
}
.login-card {
  width: 360px;
  background: #fff;
  padding: 28px 28px 32px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 { font-size: 20px; }

@media (max-width: 900px) {
  .form-grid, .split, .kv { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .nav { width: 100%; }
}

.chk-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; color: #3d4a5c; white-space: nowrap; }
.chk-row input { width: auto; }
.grid tr.is-inactive td { color: #8a93a0; }
.kv .wide { grid-column: 1 / -1; }
