/* CoreCRM — hand-written responsive stylesheet, no framework. */
/* Component sheets (kanban, timelog, contacts, mindmap, pipeline, forecast) are
   loaded as their own versioned <link> tags in lib/layout.php so a single ?v=N
   busts every sheet. They used to be @import-ed here, but @import URLs can't be
   cache-busted, which caused stale CSS after a version bump. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-strong: #cdd5e3;
  --text: #1f2937;
  --text-soft: #5b6675;
  --text-faint: #94a0b3;
  --primary: #2f6bff;
  --primary-dark: #1d4fd8;
  --primary-soft: #e8f0ff;
  --green: #18a957;
  --green-soft: #e3f6ec;
  --amber: #e8920b;
  --amber-soft: #fdf1dc;
  --red: #e23b46;
  --red-soft: #fde7e9;
  --purple: #7a5af8;
  --sidebar: #141c2e;
  --sidebar-soft: #9aa6bf;
  --sidebar-active: #2f6bff;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-w: 240px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 650; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.ic { flex: none; vertical-align: middle; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--sidebar); color: var(--sidebar-soft);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40;
  overflow-y: auto;
}
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.content { padding: 22px clamp(14px, 3vw, 34px) 60px; width: 100%; }

.brand { padding: 18px 18px 10px; }
.brand a { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; }
.brand a:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; font-weight: 800; }

.side-nav { padding: 6px 10px 20px; }
.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #5e6a85; margin: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px;
  color: var(--sidebar-soft); font-weight: 550; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item .ic { opacity: .9; }
.nav-dot { margin-left: auto; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--sidebar); }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border); padding: 10px clamp(14px, 3vw, 34px); min-height: 58px;
}
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 0 11px; color: var(--text-faint);
  transition: border-color .12s ease, box-shadow .12s ease; }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
/* The field itself is bare — the .search wrapper is the visible box (beats the
   global input[type=search] border/radius, which would otherwise box-in-a-box). */
.search input[type=search] { flex: 1; width: 100%; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; padding: 9px 0; font-size: 14px; color: var(--text); outline: none;
  -webkit-appearance: none; appearance: none; }
.search input[type=search]:focus { border: 0; box-shadow: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--text); font-weight: 600; padding: 4px; }
.navtoggle-btn, .navtoggle-cb { display: none; }
.nav-scrim { display: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #c92f3a; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text-soft); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

/* ---- Dropdowns ---- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 180px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px;
  display: none; z-index: 50;
}
.dropdown-menu.dropdown-right { left: auto; right: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px;
  color: var(--text); width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }

/* ---- Page head ---- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { margin: 2px 0 0; color: var(--text-soft); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-main { grid-template-columns: 2fr 1fr; align-items: start; }

/* ---- Stat tiles ---- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { color: var(--text-soft); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 26px; font-weight: 750; margin-top: 4px; }
.stat .value small { font-size: 14px; color: var(--text-faint); font-weight: 600; }
.stat .stat-note { margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-faint); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); font-weight: 650; background: var(--surface-2); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 40px; text-align: center; color: var(--text-faint); }

/* ---- Timesheet (my-hours) week grouping ---- */
table.data.tt tr.tt-week td { background: var(--surface-2); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text); }
table.data.tt tr.tt-week:hover td { background: var(--surface-2); }
table.data.tt tr.tt-total td { border-top: 2px solid var(--border); background: var(--surface); }

/* ---- Badges / tags / chips ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-soft); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--primary-soft); color: var(--primary-dark); }
.badge-new { background: var(--amber); color: #fff; letter-spacing: .03em; }
/* New, unviewed website leads — bumped to the top of the callbacks list & highlighted. */
table.data tr.lead-row { background: #fff7e0; }
table.data tr.lead-row:hover { background: #fff0cc; }
table.data tr.lead-row td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
/* Top-of-dashboard heads-up bar for outstanding new website leads. */
.lead-alert { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, var(--amber), #f0a330);
  color: #fff; padding: 12px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 15px; box-shadow: var(--shadow); }
.lead-alert:hover { text-decoration: none; filter: brightness(1.04); }
.lead-alert .lead-alert-bell { display: inline-flex; }
.lead-alert .lead-alert-cta { margin-left: auto; font-weight: 700; white-space: nowrap; }
/* Same bar in red: a backup failed or has stopped reporting (jobs.php). */
.lead-alert.job-alert { background: var(--red); }
/* And in green: count of successful backup reports in the last 24 hours. */
.lead-alert.job-ok { background: var(--green); }
/* A job run's log — untrusted server text, shown verbatim in its own scroll box. */
.job-notes { margin: 0; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 700; flex: none; }
.avatar-img { object-fit: cover; }

/* ---- Forms ---- */
.form-row { margin-bottom: 15px; }
.form-grid { display: grid; gap: 15px 18px; grid-template-columns: 1fr 1fr; }
.form-row.full, .form-grid .full { grid-column: 1 / -1; }
label.field-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--text-soft); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  font: inherit; color: var(--text); background: var(--surface); outline: none;
}
textarea { resize: vertical; min-height: 90px; }
/* Auto-growing time-log comment boxes: start at one line, expand with content (via JS). */
textarea.tl-note { min-height: 38px; resize: none; overflow: hidden; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-actions { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.hint { color: var(--text-faint); font-size: 12.5px; margin-top: 4px; }

/* ---- Flash ---- */
.flash { padding: 11px 15px; border-radius: 9px; margin-bottom: 16px; font-weight: 550; border: 1px solid transparent; }
.flash-success { background: var(--green-soft); color: #0f7a3e; border-color: #bce6cd; }
.flash-error { background: var(--red-soft); color: #b3242f; border-color: #f3c7cb; }
.flash-info { background: var(--primary-soft); color: var(--primary-dark); border-color: #cfe0ff; }

/* ---- Filters / segmented ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.alpha { display: flex; flex-wrap: wrap; gap: 4px; }
.alpha a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--border); color: var(--text-soft); font-weight: 600; text-transform: uppercase; }
.alpha a:hover { background: var(--surface-2); text-decoration: none; }
.alpha a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Misc ---- */
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex { display: flex; align-items: center; gap: 10px; }
.gap-sm { gap: 6px; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 26px; } .mb { margin-bottom: 16px; }
.pill-link { color: var(--text-soft); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; }
.pill-link.active { background: var(--text); color: #fff; border-color: var(--text); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-faint); }
/* .notmob keeps its natural display (inline span, table-cell, …) and is hidden on
   small screens by the media query below. Don't set display here — forcing
   `inline` would break table cells (kick them out of the table). */

/* ---- Toasts ---- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); z-index: 100;
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 9px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--red); }
.toast-success { background: var(--green); }

/* ---- Pipeline table ---- */
.pipeline-table th, .pipeline-table td { vertical-align: middle; }
/* Fixed-width inner div caps the comment column regardless of table layout. */
.pipeline-table .comment-cell > div { width: 300px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text-soft); font-size: 13px; }
.status-select { width: 100%; max-width: 140px; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 5px 8px; font: inherit; font-size: 12.5px; font-weight: 650; background: var(--surface); cursor: pointer; }
.status-select.status-open { color: var(--primary-dark); border-color: #cfe0ff; background: var(--primary-soft); }
.status-select.status-won  { color: #0f7a3e; border-color: #bce6cd; background: var(--green-soft); }
.status-select.status-lost { color: #b3242f; border-color: #f3c7cb; background: var(--red-soft); }
.status-select.status-other { color: var(--text-soft); }
.row-edit { color: var(--text-soft); font-weight: 600; font-size: 13px; }
.row-edit:hover { color: var(--primary); }

/* ---- Typeahead combobox ---- */
.combo { position: relative; }
.combo-input { width: 100%; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); max-height: 260px;
  overflow-y: auto; z-index: 70; padding: 4px; }
.combo-opt { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.combo-opt:hover, .combo-opt.active { background: var(--primary-soft); color: var(--primary-dark); }
.combo-empty { padding: 8px 10px; color: var(--text-faint); }
.combo-create { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--primary-dark); border-top: 1px solid var(--border); margin-top: 4px; }
.combo-create::before { content: "＋ "; }
.combo-create:hover, .combo-create.active { background: var(--primary-soft); }

/* ---- Documents ---- */
.doc-upload { display: flex; gap: 8px; align-items: center; }
.doc-drop { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.doc-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.doc-drop-text { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px dashed var(--border-strong);
  border-radius: 8px; color: var(--text-soft); font-size: 13px; background: var(--surface); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.doc-drop:hover .doc-drop-text { border-color: var(--primary); color: var(--primary-dark); }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.doc-link { grid-column: 1; display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none;
  color: var(--text); font-weight: 600; font-size: 14px; }
.doc-link:hover .doc-name { text-decoration: underline; }
.doc-ic { color: var(--primary); flex: 0 0 auto; display: inline-flex; }
.doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { grid-column: 1; font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.doc-meta a { color: var(--text-soft); }
.doc-del { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.doc-del-btn { width: 30px; height: 30px; color: var(--text-faint); }
.doc-del-btn:hover { color: var(--red); background: var(--red-soft); }

/* ---- Linked notes (task editor) ---- */
.tasknote-add { position: relative; display: flex; gap: 8px; }
.tasknote-search { flex: 1; min-width: 0; }
.tasknote-add .btn { flex: none; }
.tasknote-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); overflow: hidden; }
.tasknote-results:empty { display: none; }
.tasknote-opt { display: block; width: 100%; text-align: left; padding: 9px 11px; border: 0; background: none;
  cursor: pointer; font: inherit; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasknote-opt:hover { background: var(--surface-2); }
.tasknote-noresult { padding: 9px 11px; font-size: 13px; }
.tasknote-list { display: flex; flex-direction: column; gap: 8px; }
.tasknote-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.tasknote-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.tasknote-ic { color: var(--primary); flex: 0 0 auto; display: inline-flex; }
.tasknote-body { min-width: 0; }
.tasknote-title { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasknote-link:hover .tasknote-title { text-decoration: underline; }
.tasknote-snippet { display: block; font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasknote-unlink { width: 30px; height: 30px; flex: none; color: var(--text-faint); }
.tasknote-unlink:hover { color: var(--red); background: var(--red-soft); }

/* ---- Completed tasks: multi-column grid + pager ---- */
.task-done-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 20px 0 6px; }
.pager a, .pager .pager-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--text); text-decoration: none; background: var(--surface); }
.pager .pager-gap { border: 0; background: none; min-width: 18px; padding: 0; color: var(--text-faint); }
.pager a:hover { border-color: var(--border-strong); }
.pager a.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager a.disabled { opacity: .45; pointer-events: none; }

/* ---- Edit drawer ---- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(10,15,25,.42); z-index: 60; opacity: 0; transition: opacity .25s; }
.drawer-scrim.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 640px; max-width: 94vw; background: var(--bg);
  z-index: 61; box-shadow: -10px 0 40px rgba(16,24,40,.22); transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
/* Roomier drawer on desktop (~50% wider); small screens keep the 94vw cap. */
@media (min-width: 1024px) { .drawer { width: 960px; } }
/* The task editor earns more room than a plain edit form — it carries the time
   log, documents and linked notes alongside the fields. `drawer-wide` is set by
   drawer.js before the panel opens (so there's no resize flash). The 960px floor
   keeps it from getting *narrower* than a standard drawer on smaller laptops,
   where 75vw would be under 960px. */
@media (min-width: 1024px) {
  .drawer.drawer-wide { width: 75vw; min-width: 960px; max-width: 94vw; }
}
.drawer-body { flex: 1; overflow-y: auto; padding: 0 22px 28px; }
.drawer-titlebar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 -22px 20px; padding: 15px 22px; background: var(--surface); border-bottom: 1px solid var(--border); }
.drawer-titlebar h2 { margin: 0; }
.drawer-body .page-head { display: none; } /* title comes from the drawer titlebar */
.drawer-body .card[style] { max-width: none !important; }
.drawer-loading { padding: 60px 20px; text-align: center; color: var(--text-faint); }
/* Task drawer (desktop, 2-column): pin the whole right-hand column — time log,
   documents and linked notes — as one unit so docs/notes don't scroll under the
   time-log panel and stay the same width as it. The form scrolls; if the column
   is taller than the drawer it scrolls within itself. */
@media (min-width: 1101px) {
  .drawer-body .stack { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 84px); overflow-y: auto; }
  .drawer-body .timelog-panel { position: static; top: auto; }
  /* Even 50/50 split in the wide task drawer, rather than the 2fr/1fr the same
     page uses full-width — the panels are the point of opening it. */
  .drawer-wide .drawer-body .grid-main { grid-template-columns: 1fr 1fr; }
}
body.drawer-open { overflow: hidden; }

/* ---- Responsive ---- */
@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .notmob { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .main { margin-left: 0; }
  .navtoggle-cb:checked ~ .layout .sidebar { transform: translateX(0); }
  .navtoggle-cb:checked ~ .layout .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(10,15,25,.4); z-index: 35; }
  .navtoggle-btn { display: inline-grid; }
}
@media (max-width: 480px) { .grid-4 { grid-template-columns: 1fr; } }

/* ---- Hover tooltip (assets/js/tooltip.js) ----
   Replaces native title= tooltips: appears fast, styled, wraps long text and
   keeps the line breaks from the original description. */
.tip {
  position: fixed; z-index: 80; max-width: 460px; padding: 9px 12px;
  background: #1b2432; color: #f2f5fa; border-radius: 8px; font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 6px 22px rgba(16,24,40,.28);
  white-space: pre-wrap;          /* keep paragraph breaks from the typed-in text */
  overflow-wrap: anywhere;         /* never let one long token blow out the width */
  pointer-events: none;            /* the panel must never eat the hover it describes */
}
.tip[hidden] { display: none !important; }   /* author display beats UA [hidden] */

/* ---- Servers (servers.php, server-edit.php) ---- */
.srv-table [hidden] { display: none !important; }
.srv-table code, .srv-cmd code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.srv-tog-col { width: 40px; padding-right: 0 !important; }
.srv-tog .ic { transition: transform .15s; }
.srv-tog[aria-expanded="true"] .ic { transform: rotate(90deg); }
.srv-name { margin-right: 6px; }
.srv-table td:nth-child(2) { min-width: 230px; }
.srv-edit { margin-left: 8px; font-size: 12.5px; }
.srv-note { font-size: 12.5px; margin-top: 2px; }
.srv-cmd { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.srv-cmd code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; user-select: all; }
.srv-copy { width: 28px; height: 28px; }
table.data tr.srv-detail, table.data tr.srv-detail:hover { background: var(--surface-2); }
.srv-kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px 32px; align-items: start; }
.srv-kids h4 { margin: 2px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
table.srv-sub { border-collapse: collapse; }
table.srv-sub td { padding: 4px 12px 4px 0; border: 0; vertical-align: top; }
.srv-vhosts { margin: 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 24px; font-size: 13px; }
.srv-vhosts li { padding: 2px 0; break-inside: avoid; overflow-wrap: anywhere; }
table.data.srv-form td { padding: 6px 10px; }
table.data.srv-form input[type=number] { max-width: 110px; }
