/* =========================================================
   Karteo CRM - Case Management + Detail Page
   ========================================================= */

:root {
  --c-white: #ffffff;
  --c-light-gray: #f5f7fa;
  --c-light-bluegray: #eef2f7;
  --c-blue: #1a6bcc;
  --c-blue-hover: #155aab;
  --c-navy: #1a2a4a;
  --c-navy-2: #243a66;
  --c-gold: #b8860b;
  --c-text: #1f2a3c;
  --c-text-sub: #4a5568;
  --c-text-mute: #7a8699;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e0;
  --c-danger: #d63b3b;
  --c-success: #2f9e5a;

  --shadow-sm: 0 1px 2px rgba(26, 42, 74, 0.05);
  --shadow-md: 0 4px 16px rgba(26, 42, 74, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 42, 74, 0.12);

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --font-serif: "Noto Serif JP", "Yu Mincho", serif;
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-mono: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--c-text);
  background: var(--c-light-gray);
  line-height: 1.75;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--c-blue); text-decoration: none; }
a:hover { color: var(--c-navy); }
button { font-family: inherit; cursor: pointer; }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* ================================================
   CRM LAYOUT — App shell (top bar + sidebar + main)
   ================================================ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--c-navy);
  color: rgba(255,255,255,.75);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar__logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 20px;
}
.sidebar__logo a { display: flex; align-items: center; gap: 10px; color: #fff; }
.sidebar__logo-mark {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--c-blue), #4a95e8);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  color: #fff;
  font-size: 15px;
}
.sidebar__logo-text {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  line-height: 1.2;
}
.sidebar__logo-text sup { font-size: .6em; opacity: .7; }
.sidebar__logo-text small { display: block; font-family: var(--font-sans); font-size: 10px; font-weight: 400; opacity: .55; letter-spacing: .15em; margin-top: 1px; }

.sidebar__section-label {
  padding: 12px 24px 8px;
  font-size: 10px;
  letter-spacing: .18em;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  font-weight: 700;
}
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: rgba(255,255,255,.7);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sidebar__nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.sidebar__nav a.is-active {
  background: rgba(26,107,204,.15);
  color: #fff;
  border-left-color: var(--c-blue);
}
.sidebar__nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar__nav .count {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255,255,255,.1);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.sidebar__foot {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  color: rgba(255,255,255,.4);
  line-height: 1.7;
}
.sidebar__foot a { color: rgba(255,255,255,.55); }
.sidebar__foot a:hover { color: #fff; }

/* ---------- Sidebar scrim (base: hidden on all viewports) ---------- */
.app > .sidebar-scrim,
.sidebar-scrim {
  position: fixed !important;
  inset: 0;
  background: rgba(15, 23, 42, .4);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
  grid-column: 1 / -1;
  grid-row: 1;
}
.sidebar-scrim.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---------- Main area ---------- */
.main {
  min-width: 0; /* prevent grid overflow */
  display: flex;
  flex-direction: column;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar__title .crumbs {
  font-size: 12px;
  color: var(--c-text-mute);
}
.topbar__title .crumbs a { color: var(--c-text-mute); }
.topbar__title .crumbs a:hover { color: var(--c-blue); }
.topbar__title h1 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-navy);
  letter-spacing: .02em;
}
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.topbar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--c-light-gray);
  font-size: 13px;
  color: var(--c-text);
}
.topbar__user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-blue), var(--c-navy));
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.content {
  padding: 24px 32px 48px;
  flex: 1;
}

/* ---------- Stat cards (dashboard tiles) ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card__label {
  font-size: 12px;
  color: var(--c-text-mute);
  font-weight: 500;
  letter-spacing: .04em;
  display: flex; align-items: center; gap: 8px;
}
.stat-card__icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--c-light-bluegray);
  color: var(--c-blue);
  display: grid; place-items: center;
}
.stat-card__icon svg { width: 14px; height: 14px; }
.stat-card__value {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1.1;
  margin-top: 4px;
}
.stat-card__unit {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--c-text-mute);
  font-weight: 400;
  margin-left: 4px;
}
.stat-card__delta { font-size: 11px; color: var(--c-success); font-weight: 500; }
.stat-card__delta.is-neutral { color: var(--c-text-mute); }

/* ---------- Toolbar (search + filters + actions) ---------- */
.toolbar {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.toolbar__search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}
.toolbar__search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  background: var(--c-light-gray);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.toolbar__search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(26,107,204,.1);
}
.toolbar__search svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--c-text-mute);
  pointer-events: none;
}
.filter-select {
  height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") no-repeat right 12px center;
  appearance: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--c-text);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(26,107,204,.1); }
.toolbar__spacer { flex: 1; }
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.view-toggle button {
  height: 38px;
  padding: 0 12px;
  background: transparent;
  border: none;
  color: var(--c-text-sub);
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s ease, color .15s ease;
}
.view-toggle button + button { border-left: 1px solid var(--c-border); }
.view-toggle button.is-active { background: var(--c-navy); color: #fff; }
.view-toggle svg { width: 14px; height: 14px; }

/* ---------- Buttons ---------- */
.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }
.btn--primary { background: var(--c-blue); color: #fff; }
.btn--primary:hover { background: var(--c-navy); color: #fff; }
.btn--ghost { background: #fff; color: var(--c-text); border-color: var(--c-border-strong); }
.btn--ghost:hover { border-color: var(--c-blue); color: var(--c-blue); }
.btn--danger { background: #fff; color: var(--c-danger); border-color: #f4c9c9; }
.btn--danger:hover { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn--lg { height: 44px; padding: 0 22px; font-size: 14px; }

/* ---------- Data table ---------- */
.table-wrap {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  background: var(--c-light-gray);
  color: var(--c-text-sub);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  user-select: none;
}
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--c-blue); }
.data-table thead th .sort-ind { display: inline-block; margin-left: 4px; opacity: .4; font-size: 10px; }
.data-table thead th.is-sorted { color: var(--c-navy); }
.data-table thead th.is-sorted .sort-ind { opacity: 1; color: var(--c-blue); }
.data-table tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background .15s ease;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--c-light-gray); }
.data-table td {
  padding: 14px 16px;
  vertical-align: middle;
}
.data-table td.clinic-cell strong {
  display: block;
  color: var(--c-navy);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}
.data-table td.clinic-cell .sub {
  font-size: 11.5px;
  color: var(--c-text-mute);
}
.data-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.data-table td.actions {
  text-align: right;
  white-space: nowrap;
}
.data-table td.actions .btn { margin-left: 4px; }

/* ---------- Status badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--c-light-gray);
  color: var(--c-text-sub);
  border: 1px solid var(--c-border);
  letter-spacing: .02em;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge--lead       { color: #7a8699; background: #f5f7fa; border-color: #e2e8f0; }
.badge--hearing    { color: #92680a; background: #fdf6e3; border-color: #f0dfae; }
.badge--inprogress { color: #1a6bcc; background: #e8f1fb; border-color: #b7d3ee; }
.badge--delivered  { color: #1f7a44; background: #e6f5ec; border-color: #b0dcc1; }
.badge--published  { color: #1a2a4a; background: #dfe6f0; border-color: #b8c5d8; }

.badge--pub-yes { color: var(--c-success); background: #e6f5ec; border-color: #b0dcc1; }
.badge--pub-no  { color: var(--c-text-mute); background: var(--c-light-gray); border-color: var(--c-border); }

/* ---------- Card grid view ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.case-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
}
.case-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--c-blue); }
.case-card__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.case-card__title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1.4;
}
.case-card__sub {
  font-size: 12px;
  color: var(--c-text-mute);
  margin-top: 2px;
}
.case-card__quote {
  font-size: 13px;
  color: var(--c-text-sub);
  line-height: 1.8;
  padding: 12px 14px;
  background: var(--c-light-gray);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--c-blue);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.case-card__quote:empty { display: none; }
.case-card__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}
.case-card__meta div { display: flex; flex-direction: column; gap: 2px; }
.case-card__meta .label { font-size: 10px; color: var(--c-text-mute); letter-spacing: .08em; }
.case-card__meta .val { font-family: var(--font-serif); font-size: 14px; font-weight: 700; color: var(--c-navy); font-variant-numeric: tabular-nums; }
.case-card__meta .val small { font-family: var(--font-sans); font-size: 10px; font-weight: 400; color: var(--c-text-mute); margin-left: 2px; }
.case-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  background: var(--c-light-bluegray);
  color: var(--c-navy);
  border-radius: 4px;
  font-weight: 500;
}

/* ---------- Empty state ---------- */
.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--c-text-mute);
}
.empty h3 { font-family: var(--font-serif); color: var(--c-navy); font-size: 18px; margin-bottom: 8px; }
.empty p { font-size: 13px; margin-bottom: 20px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform .25s ease;
}
.modal-backdrop.is-open .modal { transform: translateY(0); }
.modal__head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal__head h2 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-navy);
}
.modal__close {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--c-text-sub);
  font-size: 20px;
  display: grid; place-items: center;
  transition: background .15s ease, color .15s ease;
}
.modal__close:hover { background: var(--c-light-gray); color: var(--c-navy); }
.modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--c-border);
  background: var(--c-light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal__foot .left { display: flex; gap: 8px; }
.modal__foot .right { display: flex; gap: 8px; }

/* ---------- Form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-navy);
  display: flex; align-items: center; gap: 6px;
}
.field label .hint { font-weight: 400; color: var(--c-text-mute); font-size: 11px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--c-text);
  background: #fff;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(26,107,204,.1);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.field-inline input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--c-blue);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  background: var(--c-navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-success { background: var(--c-success); }
.toast.is-danger { background: var(--c-danger); }
.toast svg { width: 16px; height: 16px; }

/* ================================================
   DETAIL PAGE — public case study view
   ================================================ */
.detail-page {
  background: var(--c-light-gray);
  min-height: 100vh;
}
.detail-header {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.detail-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.detail-header .logo { display: flex; align-items: center; gap: 10px; color: var(--c-navy); }
.detail-header .logo-mark {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--c-blue), var(--c-navy));
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  color: #fff;
  font-size: 15px;
}
.detail-header .logo-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1;
}
.detail-header .logo-text { font-family: var(--font-serif); font-weight: 700; font-size: 18px; line-height: 1; color: var(--c-navy); letter-spacing: .03em; }
.detail-header .logo-text sup { font-size: .5em; color: var(--c-blue); vertical-align: super; margin-left: 1px; }
.detail-header .logo-divider { display: inline-block; width: 1px; height: 13px; background: var(--c-border-strong); transform: translateY(1px); }
.detail-header .logo-sub { font-family: var(--font-sans); font-size: 11px; font-weight: 500; color: var(--c-text-mute); letter-spacing: .18em; line-height: 1; }

.detail-hero {
  background:
    radial-gradient(ellipse 80% 60% at 80% 20%, rgba(26,107,204,.06) 0%, transparent 60%),
    linear-gradient(135deg, var(--c-light-bluegray) 0%, #f8fafc 100%);
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--c-border);
}
.detail-hero__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.detail-hero__crumbs {
  font-size: 12px;
  color: var(--c-text-mute);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.detail-hero__crumbs a { color: var(--c-text-mute); }
.detail-hero__crumbs a:hover { color: var(--c-blue); }
.detail-hero__crumbs .sep { opacity: .5; }
.detail-hero__meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.detail-hero__category {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--c-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: .06em;
}
.detail-hero__area {
  font-size: 12px;
  color: var(--c-text-sub);
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 4px;
}
.detail-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1.5;
  margin-bottom: 12px;
  letter-spacing: .02em;
}
.detail-hero__contact {
  font-size: 14px;
  color: var(--c-text-sub);
}

.detail-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.detail-main { min-width: 0; }
.detail-quote {
  background: #fff;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-blue);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 32px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.detail-quote::before {
  content: "“";
  position: absolute;
  top: 12px; left: 20px;
  font-family: var(--font-serif);
  font-size: 60px;
  color: var(--c-blue);
  opacity: .2;
  line-height: 1;
  font-weight: 700;
}
.detail-quote p {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.9;
  color: var(--c-navy);
  font-weight: 500;
  padding-left: 40px;
}

.detail-section { margin-bottom: 40px; }
.detail-section h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--c-blue);
  display: inline-block;
}
.detail-section p {
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--c-text);
}

.detail-side {
  position: sticky;
  top: 90px;
}
.detail-side-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.detail-side-card__head {
  background: var(--c-navy);
  color: #fff;
  padding: 12px 18px;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}
.detail-side-card__body { padding: 16px 18px; }
.detail-side-card dl { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.detail-side-card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--c-border); }
.detail-side-card .row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-side-card dt {
  font-size: 11.5px;
  color: var(--c-text-mute);
  font-weight: 500;
  letter-spacing: .04em;
}
.detail-side-card dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.detail-side-card dd small { font-family: var(--font-sans); font-size: 10px; color: var(--c-text-mute); font-weight: 400; margin-left: 2px; }

.detail-side-cta {
  background: linear-gradient(135deg, var(--c-navy), #0f1a35);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.detail-side-cta h3 { font-family: var(--font-serif); font-size: 15px; margin-bottom: 6px; letter-spacing: .04em; }
.detail-side-cta p { font-size: 12px; color: rgba(255,255,255,.75); line-height: 1.7; margin-bottom: 16px; }
.detail-side-cta .btn { width: 100%; background: var(--c-gold); color: #fff; }
.detail-side-cta .btn:hover { background: #a07609; color: #fff; }

.detail-footer {
  background: var(--c-navy);
  color: rgba(255,255,255,.7);
  padding: 32px 0;
  text-align: center;
  font-size: 12px;
}
.detail-footer a { color: rgba(255,255,255,.8); }
.detail-footer a:hover { color: #fff; }

.not-found {
  max-width: 560px;
  margin: 80px auto;
  padding: 48px 32px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.not-found h1 { font-family: var(--font-serif); color: var(--c-navy); font-size: 22px; margin-bottom: 12px; }
.not-found p { color: var(--c-text-sub); margin-bottom: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 260px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle {
    width: 38px; height: 38px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--c-navy);
  }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 20px; }
  .topbar { padding: 0 20px; }
  .detail-body { grid-template-columns: 1fr; gap: 28px; }
  .detail-side { position: static; }
}
@media (min-width: 961px) {
  .menu-toggle { display: none; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 12px; border-bottom: 1px solid var(--c-border); }
  .data-table td { padding: 4px 0; border: none; }
  .data-table td.actions { padding-top: 12px; text-align: left; }
  .topbar__title h1 { font-size: 15px; }
  .topbar__user span { display: none; }
  .detail-hero { padding: 32px 0 28px; }
  .detail-body { padding: 24px 20px 40px; }
}
