/* LexControl · Sobria legal (ADR-007). Warm-gray surface, navy accent, serif headings. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1c2128;
  --ink-2: #39414d;
  --muted: #5f6b7a;
  --line: #e4e1d9;
  --line-strong: #cdc9bd;
  --brand: #1f3a5f;
  --brand-hover: #17304f;
  --brand-soft: #e9eef5;
  --brand-line: #b9c7da;
  --open: #1f3a5f;
  --open-bg: #e9eef5;
  --paused: #7a5200;
  --paused-bg: #fbf1dc;
  --closed: #4a4f57;
  --closed-bg: #ecebe7;
  --ok: #245b3a;
  --ok-bg: #e8f1ea;
  --warn: #8a5a00;
  --warn-bg: #fbf1dc;
  --danger: #a12d2d;
  --danger-bg: #f8e8e6;
  --shadow: 0 1px 2px rgba(20, 28, 40, 0.05);
  --shadow-lg: 0 18px 44px rgba(20, 28, 40, 0.18);
  --radius: 10px;
  --radius-sm: 8px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; }

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  transition: grid-template-columns 160ms ease;
}

.app.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand h1 {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand p { margin: 2px 0 0; font-size: 0.72rem; color: var(--muted); }

.sidebar-toggle {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sidebar-toggle:hover { background: var(--surface-2); color: var(--ink); }

.menu { display: flex; flex-direction: column; gap: 2px; }

.menu button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}

.menu button .icon { color: var(--muted); }
.menu button:hover { background: var(--surface-2); }

.menu button.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.menu button.active .icon { color: var(--brand); }

.menu button.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.tenant-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.brand-copy { min-width: 0; }
.brand h1 { overflow-wrap: anywhere; }
.platform-tag { margin: 10px 0 0; text-align: center; font-size: 0.7rem; color: var(--muted); }
.platform-tag a { color: inherit; text-decoration: underline; }

.sidebar.collapsed { padding: 18px 10px; }
.sidebar.collapsed .brand-copy,
.sidebar.collapsed .tenant-card,
.sidebar.collapsed .platform-tag,
.sidebar.collapsed .menu-label { display: none; }
.sidebar.collapsed .brand { flex-direction: column; gap: 12px; padding: 0; }
.sidebar.collapsed .sidebar-toggle { margin: 0; }
.sidebar.collapsed .menu button { justify-content: center; padding: 11px 0; }
.sidebar.collapsed .menu button.active::before { left: -10px; }

.sidebar-backdrop { display: none; }

.label { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 500; }

.value { margin: 3px 0 1px; font-size: 0.9rem; font-weight: 600; }

.muted { margin: 0; color: var(--muted); font-size: 0.82rem; }

.main { padding: 22px 28px 64px; min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.topbar h2 {
  margin-top: 1px;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.icon-btn.menu-toggle { display: none; }

.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.sync-status.saved .sync-dot { background: var(--ok); }
.sync-status.saving .sync-dot { background: var(--warn); }
.sync-status.error .sync-dot { background: var(--danger); }

.session-actions { display: flex; align-items: center; gap: 8px; }
.server-notice { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; max-width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); border-left: 4px solid var(--danger); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); padding: 14px 16px; }
.server-notice p { margin: 0 0 10px; font-size: 0.88rem; }
.server-notice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.temp-password-dialog { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(15, 23, 42, 0.45); padding: 16px; }
.temp-password-dialog .card { max-width: 460px; width: 100%; }
.temp-password-dialog code { display: block; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 1rem; word-break: break-all; user-select: all; }
.role-switch { display: flex; align-items: center; gap: 8px; }
.role-switch label { font-size: 0.75rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.role-switch select { padding: 6px 28px 6px 10px; font-weight: 600; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.icon-btn:hover { background: var(--surface-2); }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--bg);
  border-radius: 999px;
  font-size: 0.65rem;
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 700;
}

.profile-chip { display: flex; align-items: center; gap: 9px; padding-left: 4px; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.74rem;
}

.profile-name { margin: 0; font-size: 0.82rem; font-weight: 600; line-height: 1.2; }
.profile-role { margin: 0; font-size: 0.72rem; color: var(--muted); }

.notification-anchor { position: relative; }

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1000;
  width: min(400px, calc(100vw - 28px));
}

.notif-panel > .card { margin: 0; box-shadow: var(--shadow-lg); }

.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.notif-feed { margin-top: 10px; display: grid; gap: 6px; }
.notif-feed.compact { max-height: 380px; overflow: auto; }

.notif-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
}

.notif-item:hover { background: var(--surface-2); }
.notif-item p { margin: 3px 0 5px; color: var(--ink-2); font-size: 0.82rem; }
.notif-item.unread { background: var(--brand-soft); border-color: var(--brand-line); }

/* minmax(0, 1fr) + min-width: 0 let wide tables scroll inside their card instead of
   stretching the whole page sideways on narrow screens. */
.content { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.content > * { min-width: 0; }

/* ---------- Grids ---------- */
.grid-asuntos { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.grid-agenda { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: 1 / -1; }

/* ---------- Cards, stats ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card h3 { margin: 0 0 8px; font-size: 0.98rem; font-weight: 600; }

.kpi {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.kpi.mono { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 500; }

.stat { padding: 16px 18px; }
.stat-note { margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }
.stat.alert { border-color: #e2b8b3; background: #fdf6f5; }
.stat.alert .kpi { color: var(--danger); }

.mono { font-family: var(--font-mono); font-size: 0.86em; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
.table-card { padding: 0; overflow: hidden; }
.table-card .table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 11px 12px;
  font-size: 0.86rem;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }

.cell-sub { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--muted); }
.muted-cell { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.empty-cell { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty-cell .icon { display: block; margin: 0 auto 8px; width: 24px; height: 24px; opacity: 0.6; }
.empty-note { color: var(--muted); font-size: 0.85rem; padding: 14px 4px; margin: 0; }
.center-cell { text-align: center; }
.order-cell { white-space: nowrap; }
.order-cell .icon-btn + .icon-btn { margin-left: 4px; }
.archived-row { opacity: 0.55; }
.audit-table td { font-size: 0.78rem; }

.click-row, .click-client-tramite { cursor: pointer; }
.click-row:hover, .click-client-tramite:hover { background: var(--surface-2); }
.selected-row { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--closed-bg);
  color: var(--closed);
  white-space: nowrap;
}

.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.tag.open { background: var(--open-bg); color: var(--open); }
.tag.paused, .tag.warn { background: var(--paused-bg); color: var(--paused); }
.tag.closed { background: var(--closed-bg); color: var(--closed); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.blocked { background: var(--danger-bg); color: var(--danger); }
.tag.archived { background: var(--closed-bg); color: var(--closed); }
.tag.active-case { background: var(--open-bg); color: var(--open); }

.urgency { white-space: nowrap; }
.urgency.overdue { color: var(--danger); font-weight: 600; }
.urgency.today { color: var(--warn); font-weight: 600; }
.urgency.soon { color: var(--brand); font-weight: 600; }

/* ---------- Forms ---------- */
input, select, textarea, button { font: inherit; }

input, select, textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  min-width: 0;
}

input::placeholder, textarea::placeholder { color: #98a1ad; }
input:hover, select:hover, textarea:hover { border-color: #b7b2a5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; padding: 0; }
textarea { resize: vertical; }

.input-wrap { display: grid; gap: 5px; align-content: start; }
.input-wrap.grow { min-width: 300px; }
.input-wrap label { font-size: 0.76rem; color: var(--ink-2); font-weight: 600; }
.req { color: var(--danger); margin-left: 2px; }
.field-hint { margin: 0; font-size: 0.76rem; color: var(--muted); }

.toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.toolbar.actions { margin-bottom: 12px; grid-template-columns: 1fr auto auto; }

.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 14px; }
.inline-form .input-wrap { flex: 1 1 180px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--ink-2); }

.search-input { position: relative; }
.search-input .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search-input input { width: 100%; padding-left: 34px; }

.form-error {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #e2b8b3;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--brand);
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn .icon { width: 16px; height: 16px; }

.btn.secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: #b7b2a5; }
.btn.small { padding: 5px 10px; font-size: 0.78rem; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #8b2424; border-color: #8b2424; }
.btn.link { background: transparent; border-color: transparent; color: var(--muted); padding-left: 4px; padding-right: 4px; font-weight: 500; }
.btn.link:hover { background: transparent; color: var(--ink); text-decoration: underline; }

.actions-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.actions-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-count { margin-top: 12px; }
.advanced-filters { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }

.create-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.create-actions { margin-top: 12px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #bfd8c6;
  border-radius: var(--radius-sm);
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 500;
}

.flash span { flex: 1; }
.flash-close { border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 6px; }
.flash-close:hover { background: rgba(0, 0, 0, 0.06); }

/* ---------- Chips, alerts, notes ---------- */
.deadline-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }

.deadline-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  color: var(--ink-2);
}

.deadline-chip:hover { border-color: var(--line-strong); }
.deadline-chip strong { display: block; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.deadline-chip span { font-size: 0.78rem; color: var(--muted); }
.deadline-chip.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.deadline-chip.danger strong { color: var(--danger); }
.deadline-chip.warn strong { color: var(--warn); }

.alert-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  background: var(--warn-bg);
  border: 1px solid #ecd6a4;
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-weight: 600;
  font-size: 0.84rem;
}

.assistant-access-note {
  margin: 12px 0 0;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-soft);
  padding: 9px 12px;
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 500;
}

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.section-heading h3, .section-heading p { margin-bottom: 3px; }
.step-kicker { margin: 0 0 4px; color: var(--brand); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Detail (drawer summary) ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0 0 16px; }
.detail-item dt { font-size: 0.74rem; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.detail-item dd { margin: 0; font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.detail-text { margin: 2px 0 12px; }
.card-actions { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.edit-card { border-color: var(--brand-line); box-shadow: inset 3px 0 0 var(--brand); }
.edit-card textarea { width: 100%; }
.edit-card .form-error { margin-top: 12px; }
.tramite-drawer > .flash { margin-bottom: 14px; }
.connected-fields-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

/* ---------- Timelines ---------- */
.timeline { display: grid; gap: 12px; }
.timeline .item { border-left: 2px solid var(--line-strong); padding-left: 12px; }
.timeline .item strong { display: block; font-size: 0.86rem; font-weight: 600; }
.timeline .item span { color: var(--muted); font-size: 0.78rem; }

.process-timeline { display: grid; gap: 0; }
.process-event { position: relative; padding: 0 0 18px 26px; }
.process-event::before { content: ""; position: absolute; left: 4px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.process-event::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.process-event:last-child::after { display: none; }
.process-event p { margin: 2px 0; }

/* ---------- Clients ---------- */
.client-groups { display: grid; gap: 14px; }
.client-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.client-create-panel { padding: 20px; }
.form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.form-section-heading h3, .form-section-heading p { margin-bottom: 3px; }
.required-note { color: var(--muted); font-size: 0.74rem; }
.client-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.alternate-contact-box { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 14px; }
.contact-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.contact-toggle input { margin-top: 3px; }
.contact-toggle span, .contact-toggle small { display: block; }
.contact-toggle small { color: var(--muted); margin-top: 3px; }
.alternate-contact-box .client-form-grid { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.alternate-contact-box .client-form-grid.hidden { display: none; }

.role-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.role-card.active { background: var(--brand-soft); border-color: var(--brand-line); }

/* ---------- Reimbursements & documents ---------- */
.attachment-preview { max-width: 72px; max-height: 48px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; }
.reimbursement-step { margin: 14px 0; }
.reimbursement-summary { grid-template-columns: 1fr 1fr 1.15fr; }
.settlement-action { display: grid; gap: 7px; min-width: 190px; }
.settlement-action input { max-width: 210px; font-size: 0.75rem; }

.document-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.document-stats div { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 14px; }
.document-stats strong, .document-stats span { display: block; }
.document-stats strong { color: var(--brand); font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; }
.document-stats span { color: var(--muted); font-size: 0.76rem; }
.docs-toolbar { grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(150px, 1fr)); }
.document-actions { display: flex; gap: 6px; white-space: nowrap; }

.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.list li { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); }

/* ---------- Interns ---------- */
.intern-assignment { margin-bottom: 14px; background: var(--surface-2); }
.intern-choice-grid { display: grid; gap: 7px; }
.intern-choice { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 8px 10px; cursor: pointer; }
.intern-choice input { margin: 0; }
.intern-task-list { display: grid; gap: 10px; }
.intern-task-row { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 12px; opacity: 0.6; }
.intern-task-row.selected { border-color: var(--brand-line); background: var(--brand-soft); opacity: 1; }
.intern-specific-fields { margin-top: 9px; }

.intern-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: var(--radius); background: var(--brand); color: #fff; padding: 22px 24px; }
.intern-hero h3, .intern-hero p { margin: 3px 0; }
.intern-hero h3 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; }
.intern-hero .step-kicker { color: #b9c7da; }
.intern-hero-stat { min-width: 104px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: var(--radius); padding: 12px; background: rgba(255, 255, 255, 0.08); }
.intern-hero-stat strong, .intern-hero-stat span { display: block; }
.intern-hero-stat strong { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 600; }
.intern-workspace .input-wrap { margin-bottom: 10px; }
.independent-activity { border-left: 3px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--brand-soft); margin: 10px 0; padding: 12px; }
.independent-activity.hidden { display: none; }
.activity-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; }
.activity-header h3, .activity-header p { margin: 3px 0; }
.activity-header > .tag { align-self: flex-start; }
.activity-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.activity-overview .card { border-top: 3px solid var(--brand); }
.activity-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Calendar ---------- */
.calendar-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-weekdays { margin-top: 10px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; color: var(--muted); font-size: 0.72rem; text-align: center; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.calendar-grid { margin-top: 6px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-btn, .day-empty { min-height: 64px; border-radius: var(--radius-sm); }
.day-empty { background: var(--surface-2); border: 1px dashed var(--line); }
.day-btn { border: 1px solid var(--line); background: var(--surface); text-align: left; padding: 7px 8px; cursor: pointer; display: grid; align-content: space-between; }
.day-btn:hover { border-color: var(--line-strong); }
.day-btn small { color: var(--brand); font-size: 0.68rem; font-weight: 600; }
.day-btn.selected { background: var(--brand-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* ---------- Quick links ---------- */
.quick-fab { position: fixed; right: 24px; bottom: 24px; z-index: 30; display: grid; justify-items: end; gap: 8px; }
.quick-fab-btn { display: inline-grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(20, 28, 40, 0.26); transition: transform 120ms ease, background 120ms ease; }
.quick-fab-btn .icon { width: 22px; height: 22px; }
.quick-fab-btn:focus-visible { outline: 3px solid var(--brand-line); outline-offset: 3px; }
.quick-fab-btn:hover { background: var(--brand-hover); }
.quick-links { display: none; width: min(320px, calc(100vw - 28px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.quick-fab.open .quick-links { display: block; }
.quick-links[hidden] { display: none; }
.quick-title { margin: 0; padding: 10px 14px 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.quick-fab-btn:hover { transform: scale(1.05); }
.quick-links a { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none; color: var(--ink-2); padding: 11px 14px; font-size: 0.84rem; border-bottom: 1px solid var(--line); }
.quick-links a .icon { width: 14px; height: 14px; color: var(--muted); }
.quick-links a:last-child { border-bottom: 0; }
.quick-links a:hover { background: var(--surface-2); color: var(--brand); }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(20, 28, 40, 0.42); display: flex; justify-content: flex-end; }
.tramite-drawer { width: min(720px, 100vw); height: 100vh; overflow: auto; background: var(--bg); padding: 0 22px 28px; box-shadow: -18px 0 48px rgba(20, 28, 40, 0.2); animation: drawer-in 180ms ease-out; }
.tramite-drawer.no-anim, .wizard.no-anim { animation: none; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 20px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-header h2 { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 500; margin-top: 2px; }
.drawer-close { display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: var(--radius-sm); width: 36px; height: 36px; cursor: pointer; }
.drawer-close:hover { background: var(--surface-2); }
.drawer-tabs { display: flex; gap: 4px; overflow-x: auto; position: sticky; top: 74px; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.drawer-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 9px 12px; white-space: nowrap; cursor: pointer; font-size: 0.84rem; font-weight: 600; margin-bottom: -1px; }
.drawer-tab:hover { color: var(--ink); }
.drawer-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tramite-drawer .card + .card { margin-top: 14px; }
body.drawer-open { overflow: hidden; }

/* ---------- Wizard deadlines (Primer plazo, Segundo plazo...) ---------- */
.plazo-list { display: grid; gap: 12px; }
.plazo-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.plazo-actions { display: flex; gap: 6px; min-width: 36px; }
.icon-btn.add-plazo { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.icon-btn.add-plazo:hover { background: var(--brand); color: #fff; }
@media (max-width: 520px) {
  .plazo-row { grid-template-columns: minmax(0, 1fr) auto; }
  .plazo-row .input-wrap:first-child { grid-column: 1 / -1; }
}

/* ---------- Accounts and roles ---------- */
.user-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.user-form-card { border-color: var(--brand-line); box-shadow: inset 3px 0 0 var(--brand); }
.user-form-card .field-hint { margin-top: 10px; }
.roles-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.roles-list dt { font-weight: 600; margin-bottom: 2px; }
.roles-list dd { margin: 0; color: var(--ink-2); font-size: 0.86rem; }
@media (max-width: 980px) {
  .user-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roles-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) { .user-form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Assign activity to an intern ---------- */
.assign-grid { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.6fr) minmax(220px, 2fr) minmax(150px, 0.9fr) auto; gap: 12px; align-items: end; }
.assign-action { display: flex; }
.assign-card .form-error { margin-top: 12px; }
@media (max-width: 1180px) {
  .assign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assign-grid .span-assign { grid-column: 1 / -1; }
  .assign-action { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 520px) {
  .assign-grid { grid-template-columns: minmax(0, 1fr); }
  .assign-action .btn { width: 100%; }
}

/* ---------- Confirmation dialog and draft banner ---------- */
.confirm-backdrop { position: fixed; inset: 0; z-index: 1400; background: rgba(20, 28, 40, 0.35); display: flex; align-items: center; justify-content: center; padding: 20px; }
.confirm-dialog { width: min(440px, 100%); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 22px 22px 18px; animation: modal-in 140ms ease-out; }
.confirm-dialog h3 { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; margin-bottom: 6px; }
.confirm-dialog p { margin: 0 0 18px; color: var(--ink-2); }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.confirm-extra { display: grid; gap: 8px; margin: -6px 0 18px; }
.confirm-extra input { width: 100%; }
.document-actions { flex-wrap: wrap; }
.requests-card { border-color: #ecd6a4; box-shadow: inset 3px 0 0 var(--warn); }
.draft-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--brand-line); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); }
.draft-banner > div:first-of-type { flex: 1; display: grid; gap: 1px; min-width: 0; }
.draft-banner strong { font-weight: 600; }
.draft-banner span { color: var(--ink-2); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-actions { display: flex; gap: 6px; align-items: center; }
@media (max-width: 520px) {
  .draft-banner { flex-wrap: wrap; }
  .draft-actions { width: 100%; justify-content: flex-end; }
  .confirm-actions .btn { flex: 1 1 100%; }
}

/* ---------- Wizard (modal) ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 1300; background: rgba(20, 28, 40, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.wizard { width: min(780px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); animation: modal-in 160ms ease-out; }
@keyframes modal-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.wizard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; }
.wizard-head h2 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; margin-top: 2px; }
.wizard-steps { display: flex; gap: 0; list-style: none; margin: 0; padding: 12px 24px 16px; border-bottom: 1px solid var(--line); }
.wizard-steps li { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; font-weight: 500; min-width: 0; position: relative; }
.wizard-steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line); margin: 0 10px; border-radius: 2px; }
.wizard-steps li.done:not(:last-child)::after { background: var(--brand); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; background: var(--surface); }
.step-dot .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.wizard-steps li.current { color: var(--ink); font-weight: 600; }
.wizard-steps li.current .step-dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.wizard-steps li.done .step-dot { border-color: var(--brand); color: var(--brand); }
.step-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wizard-body { padding: 20px 24px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.wizard .form-error { margin: 0 24px 4px; }
.wizard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.wizard-actions { display: flex; gap: 8px; }

.type-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.type-card { display: grid; gap: 6px; align-content: start; text-align: left; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius); padding: 18px; cursor: pointer; color: var(--ink); }
.type-card .icon { width: 26px; height: 26px; color: var(--brand); margin-bottom: 4px; }
.type-card strong { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; }
.type-card span { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.type-card:hover { border-color: var(--brand); background: var(--surface-2); }
.type-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }

.wizard-summary { border-top: 1px solid var(--line); padding-top: 14px; }
.wizard-summary h3 { font-size: 0.92rem; margin-bottom: 10px; }
.wizard-summary .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; gap: 10px 16px; }

/* ---------- Configuration ---------- */
.config-intro { padding-bottom: 14px; }
.cfg-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-top: 6px; }
.cfg-tab { display: inline-flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 9px 12px; color: var(--muted); font-weight: 600; font-size: 0.86rem; cursor: pointer; margin-bottom: -1px; }
.cfg-tab:hover { color: var(--ink); }
.cfg-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.cfg-tab.add { margin-left: auto; color: var(--brand); }
.config-table td { vertical-align: top; }
.config-table td input[type="text"], .config-table td textarea { width: 100%; }
.config-table td:nth-child(2) { min-width: 200px; }
.config-table td:nth-child(5) { min-width: 220px; }
.config-lists { align-items: start; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app, .app.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(290px, 86vw);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-lg);
  }

  .app.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar.collapsed { padding: 18px 14px; }
  .sidebar.collapsed .brand-copy, .sidebar.collapsed .menu-label { display: block; }
  .sidebar.collapsed .tenant-card, .sidebar.collapsed .platform-tag { display: block; }
  .sidebar.collapsed .brand { flex-direction: row; gap: 10px; padding: 0 4px; }
  .sidebar.collapsed .menu button { justify-content: flex-start; padding: 9px 11px; }
  .sidebar-toggle { display: none; }
  .menu button.active::before, .sidebar.collapsed .menu button.active::before { left: -14px; }

  .app.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1050; background: rgba(20, 28, 40, 0.45); }

  .main { padding: 14px 14px 80px; }
  .icon-btn.menu-toggle { display: inline-grid; }
  .topbar { flex-wrap: wrap; }
  .topbar h2 { font-size: 1.4rem; }
  .profile-text { display: none; }
  .sync-label { display: none; }

  .grid-3, .grid-2, .grid-4, .grid-asuntos, .grid-agenda { grid-template-columns: minmax(0, 1fr); }
  .toolbar, .toolbar.actions { grid-template-columns: minmax(0, 1fr); }
  .actions-header { flex-direction: column; align-items: stretch; }
  .input-wrap.grow { min-width: 0; }
  .deadline-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-fab { right: 14px; bottom: 14px; }
  .notif-panel { position: fixed; top: 70px; right: 12px; left: 12px; width: auto; }
  .tramite-drawer { width: 100vw; padding: 0 14px 24px; }
  .drawer-tabs { top: 70px; }
  .client-form-grid, .reimbursement-summary, .document-stats, .docs-toolbar, .activity-overview, .activity-filters, .connected-fields-summary { grid-template-columns: minmax(0, 1fr); }
  .form-section-heading, .section-heading, .activity-header, .intern-hero { flex-direction: column; align-items: stretch; }
  .intern-hero-stat { width: 100%; }

  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .wizard { width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .wizard-foot { border-radius: 0; }
  .wizard-head, .wizard-steps, .wizard-body, .wizard-foot { padding-left: 16px; padding-right: 16px; }
  .wizard .form-error { margin-left: 16px; margin-right: 16px; }
  .step-name { display: none; }
  .wizard-steps li.current .step-name { display: inline; }
  .type-cards { grid-template-columns: minmax(0, 1fr); }
  .wizard-summary .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cfg-tab.add { margin-left: 0; }
}

@media (max-width: 520px) {
  .role-switch label { display: none; }
  .wizard-summary .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Usability session mode (ui/feedback.js, ?feedback=1) ---------- */
.fb-root { position: fixed; left: 20px; bottom: 20px; z-index: 1400; display: grid; justify-items: start; gap: 10px; font-family: var(--font-sans); }
.fb-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: #8a3b12; color: #fff; font-weight: 600; font-size: 0.84rem; padding: 11px 16px; cursor: pointer; box-shadow: 0 8px 20px rgba(20, 28, 40, 0.25); }
.fb-toggle .icon { width: 16px; height: 16px; }
.fb-toggle:focus-visible, .fb-panel button:focus-visible, .fb-panel textarea:focus-visible, .fb-panel input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fb-count { background: #fff; color: #8a3b12; border-radius: 999px; min-width: 20px; padding: 1px 6px; font-size: 0.74rem; text-align: center; }
.fb-panel { display: none; width: min(380px, calc(100vw - 28px)); max-height: min(78vh, 680px); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; }
.fb-root.open .fb-panel { display: grid; gap: 10px; }
.fb-head { display: flex; align-items: center; justify-content: space-between; }
.fb-head > div { display: flex; align-items: baseline; gap: 10px; }
.fb-timer { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.fb-x { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.fb-context { margin: 0; font-size: 0.78rem; color: var(--muted); }
.fb-context span { color: var(--ink); font-weight: 600; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: 0.78rem; cursor: pointer; color: var(--ink); }
.fb-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fb-panel textarea, .fb-panel input { width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; font-size: 0.88rem; resize: vertical; }
.fb-row { display: grid; gap: 8px; }
.fb-save { border: 0; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-weight: 600; padding: 10px; cursor: pointer; }
.fb-save:hover { background: var(--brand-hover); }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fb-note { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 0.84rem; }
.fb-note.fb-p-alta { border-left-color: var(--danger); }
.fb-note.fb-p-media { border-left-color: var(--warn); }
.fb-note p { margin: 4px 0; white-space: pre-wrap; }
.fb-note small { color: var(--muted); }
.fb-note-head { display: flex; gap: 8px; align-items: center; }
.fb-note-head span { color: var(--muted); font-size: 0.76rem; margin-left: auto; }
.fb-del { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1.1rem; }
.fb-empty { color: var(--muted); font-size: 0.82rem; }
.fb-foot { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.fb-foot button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.78rem; cursor: pointer; color: var(--ink); }
.fb-foot .fb-danger { color: var(--danger); margin-left: auto; }
@media (max-width: 980px) { .fb-root { left: 14px; bottom: 14px; } .fb-toggle span:not(.fb-count) { display: none; } }
@media print { .fb-root { display: none; } }
.fb-rec { display: grid; gap: 4px; }
.fb-rec-btn { border: 1px dashed var(--danger); background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-sm); padding: 7px 10px; font-weight: 600; font-size: 0.8rem; cursor: pointer; text-align: left; }
.fb-rec-btn.on { border-style: solid; background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.fb-rec small { color: var(--muted); font-size: 0.74rem; }
.fb-min { font-family: var(--font-mono); }
.fb-where { display: block; color: var(--brand) !important; font-weight: 600; margin-top: 2px; }
