/* Riven 管理ポータル — Professional UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 240px;
  --topbar-h: 52px;

  /* Color system */
  --ink:       #0d1117;
  --ink-2:     #1c2333;
  --ink-3:     #2d3748;
  --slate:     #64748b;
  --slate-2:   #94a3b8;
  --slate-3:   #cbd5e1;
  --border:    #e8edf2;
  --surface:   #f7f9fc;
  --white:     #ffffff;

  --blue:      #2563eb;
  --blue-l:    #eff6ff;
  --blue-mid:  #bfdbfe;
  --green:     #059669;
  --green-l:   #ecfdf5;
  --amber:     #d97706;
  --amber-l:   #fffbeb;
  --red:       #dc2626;
  --red-l:     #fef2f2;
  --purple:    #7c3aed;
  --purple-l:  #f5f3ff;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.08);

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =====================
   APP SHELL
   ===================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
}
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: -.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.logo-name {
  font-size: 16px; font-weight: 700; color: #fff;
  letter-spacing: -.02em;
}
.logo-sub {
  font-size: 10px; color: rgba(255,255,255,.35);
  font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  margin-top: 1px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-section {
  margin-bottom: 6px;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.28);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.9);
}
.nav-item.active {
  background: rgba(37,99,235,.25);
  color: #fff;
}
.nav-item.active .nav-icon {
  color: #60a5fa;
}
.nav-item-sub {
  padding-left: 16px;
  font-size: 12.5px;
}
.nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: rgba(255,255,255,.4);
  transition: color .12s;
}
.nav-item:hover .nav-icon { color: rgba(255,255,255,.7); }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
}
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #374151, #4b5563);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 20px;
  display: inline-block; margin-top: 2px;
}
.role-1 { background: rgba(220,38,38,.2); color: #fca5a5; }
.role-2 { background: rgba(37,99,235,.2); color: #93c5fd; }
.role-3 { background: rgba(5,150,105,.2); color: #6ee7b7; }

.btn-logout {
  background: none; border: none;
  color: rgba(255,255,255,.3); cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm);
  display: flex; align-items: center;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.btn-logout:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
}

/* =====================
   MAIN AREA
   ===================== */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-breadcrumb {
  font-size: 13px;
  color: var(--slate);
  font-weight: 500;
}
.topbar-right {
  display: flex; align-items: center; gap: 16px;
}
.topbar-date {
  font-size: 12px;
  color: var(--slate-2);
}

.main-content {
  padding: 28px;
  flex: 1;
}

/* =====================
   LOGIN
   ===================== */
body.login-page {
  background: linear-gradient(145deg, #0d1117 0%, #1c2333 40%, #0d1117 100%);
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-wrap {
  width: 100%; max-width: 400px; padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 44px 40px 40px;
  box-shadow: 0 24px 80px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.1);
}
.login-header {
  text-align: center; margin-bottom: 36px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.login-logo-mark {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  box-shadow: 0 8px 24px rgba(37,99,235,.4);
}
.login-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.login-sub   { font-size: 12px; color: var(--slate); }

/* =====================
   PAGE HEADER
   ===================== */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header-left {}
.page-title {
  font-size: 20px; font-weight: 700;
  color: var(--ink); letter-spacing: -.02em; line-height: 1.3;
}
.page-subtitle { font-size: 13px; color: var(--slate); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* =====================
   STATS
   ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.c-blue::before  { background: var(--blue); }
.stat-card.c-green::before { background: var(--green); }
.stat-card.c-amber::before { background: var(--amber); }
.stat-card.c-purple::before { background: var(--purple); }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-card.c-blue  .stat-icon { background: var(--blue-l);   color: var(--blue);   }
.stat-card.c-green .stat-icon { background: var(--green-l);  color: var(--green);  }
.stat-card.c-amber .stat-icon { background: var(--amber-l);  color: var(--amber);  }
.stat-card.c-purple .stat-icon { background: var(--purple-l); color: var(--purple); }
.stat-value { font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -.03em; }
.stat-label { font-size: 12px; color: var(--slate); margin-top: 5px; font-weight: 500; }

/* =====================
   CARD
   ===================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.card-subtitle { font-size: 12px; color: var(--slate); margin-top: 1px; }

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 32px;
}

/* =====================
   TABLE
   ===================== */
.table { width: 100%; border-collapse: collapse; }
.table thead { }
.table th {
  background: #f8fafc;
  padding: 10px 16px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--slate);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: middle;
  color: var(--ink-3);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafbfc; }
.table tfoot td { padding: 12px 16px; border-top: 2px solid var(--border); font-size: 13px; }

/* =====================
   BADGES
   ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge::before { content: '●'; font-size: 7px; }
.badge-success { background: var(--green-l); color: #065f46; }
.badge-success::before { color: var(--green); }
.badge-warning { background: var(--amber-l); color: #78350f; }
.badge-warning::before { color: var(--amber); }
.badge-danger  { background: var(--red-l);   color: #7f1d1d; }
.badge-danger::before  { color: var(--red); }
.badge-blue    { background: var(--blue-l);  color: #1e3a8a; }
.badge-blue::before    { color: var(--blue); }
.badge-purple  { background: var(--purple-l); color: #4c1d95; }
.badge-purple::before  { color: var(--purple); }
.badge-plain   { background: #f1f5f9; color: var(--slate); }
.badge-plain::before   { color: var(--slate-3); }

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -.01em;
}
.btn svg { flex-shrink: 0; }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 1px 2px rgba(37,99,235,.3), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 3px 8px rgba(37,99,235,.35); }
.btn-primary:active { background: #1e40af; transform: translateY(1px); }

.btn-success {
  background: var(--green); color: #fff;
  box-shadow: 0 1px 2px rgba(5,150,105,.3);
}
.btn-success:hover { background: #047857; }

.btn-outline {
  background: var(--white); color: var(--ink-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { background: var(--surface); border-color: var(--slate-3); }

.btn-ghost { background: transparent; color: var(--slate); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--surface); color: var(--ink-3); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: var(--radius-sm); gap: 5px; }
.btn-block { width: 100%; justify-content: center; margin-top: 12px; }

/* =====================
   FORMS
   ===================== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--slate);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-label.required::after { content: ' *'; color: var(--red); }
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-control.is-invalid { border-color: var(--red); }
.form-control::placeholder { color: var(--slate-2); }
.invalid-feedback { color: var(--red); font-size: 12px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.form-hint { font-size: 12px; color: var(--slate); margin-top: 5px; }
.form-actions {
  display: flex; gap: 8px;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-row { display: flex; gap: 16px; }
.flex-1 { flex: 1; }
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* =====================
   SEARCH BAR
   ===================== */
.search-bar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  display: flex; gap: 14px; align-items: flex-end;
  flex-wrap: wrap;
}
.search-bar .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }

/* =====================
   ALERTS
   ===================== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  border-left: 3px solid;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-l); color: #065f46; border-color: var(--green); }
.alert-danger  { background: var(--red-l);   color: #7f1d1d; border-color: var(--red); }

/* =====================
   DETAIL LAYOUT
   ===================== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-list { padding: 20px 24px; }
.detail-list dt {
  font-size: 11px; color: var(--slate); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  margin-top: 16px;
}
.detail-list dt:first-child { margin-top: 0; }
.detail-list dd { font-size: 14px; color: var(--ink); margin-top: 3px; }
.amount-detail dd { font-size: 16px; font-weight: 600; }

/* =====================
   CALC PREVIEW
   ===================== */
.calc-preview {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 4px 0 18px;
  display: flex; gap: 28px; align-items: center;
}
.calc-item .label { font-size: 11px; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.calc-item .value { font-size: 18px; font-weight: 700; color: var(--ink); }
.calc-item.highlight { margin-left: auto; text-align: right; }
.calc-item.highlight .value { font-size: 24px; color: var(--blue); }

/* =====================
   FACILITY SEARCH
   ===================== */
.facility-row {
  display: flex; align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid #f1f5f9;
  gap: 14px; transition: background .1s;
}
.facility-row:last-child { border-bottom: none; }
.facility-row:hover { background: #fafbfc; }
.facility-row-name { font-weight: 600; font-size: 14px; color: var(--ink); flex: 1; }
.facility-row-meta { font-size: 12px; color: var(--slate); margin-top: 2px; }
.facility-row-addr { font-size: 12px; color: var(--slate-2); min-width: 180px; }

/* =====================
   STEP INDICATOR
   ===================== */
.step-indicator { display: flex; margin-bottom: 24px; }
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px;
  font-size: 13px; font-weight: 600;
}
.step.done { background: #f1f5f9; color: var(--slate); border-radius: var(--radius) 0 0 var(--radius); }
.step.active { background: var(--blue); color: #fff; border-radius: 0 var(--radius) var(--radius) 0; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.step.done .step-num { background: var(--slate-3); color: #fff; }
.step.active .step-num { background: rgba(255,255,255,.25); color: #fff; }

/* =====================
   SELECTED FACILITY BANNER
   ===================== */
.facility-banner {
  background: var(--blue-l);
  border: 1.5px solid var(--blue-mid);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px;
}
.facility-banner-label { font-size: 11px; font-weight: 600; color: #1e40af; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.facility-banner-name  { font-size: 16px; font-weight: 700; color: var(--ink); }
.facility-banner-sub   { font-size: 12px; color: var(--slate); margin-top: 2px; }

/* =====================
   COLLECTION SELECT (transfer form)
   ===================== */
.collection-select-list { border: 1.5px solid var(--border); border-radius: var(--radius); max-height: 300px; overflow-y: auto; }
.collection-check-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background .1s; }
.collection-check-item:last-child { border-bottom: none; }
.collection-check-item:hover { background: #fafbfc; }
.collection-check-item input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--blue); }
.check-info { display: flex; gap: 14px; align-items: center; flex: 1; flex-wrap: wrap; }
.check-date { font-size: 13px; color: var(--ink-3); min-width: 82px; font-weight: 500; }
.check-facility { flex: 1; font-size: 12px; color: var(--slate); }
.check-amount { font-weight: 700; font-size: 13px; min-width: 110px; text-align: right; color: var(--ink); }
.total-preview { font-size: 28px; font-weight: 700; color: var(--blue); padding: 10px 0; letter-spacing: -.03em; }

/* =====================
   IMAGES
   ===================== */
.image-gallery { display: flex; flex-wrap: wrap; gap: 14px; padding: 20px 24px; }
.gallery-item { cursor: pointer; transition: transform .15s; }
.gallery-item:hover { transform: scale(1.05); }
.gallery-thumb, .img-thumb {
  width: 120px; height: 96px; object-fit: cover;
  border-radius: var(--radius); border: 1.5px solid var(--border); display: block;
}
.pdf-thumb {
  width: 120px; height: 96px;
  background: var(--red-l); color: #7f1d1d;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius); font-weight: 800; font-size: 18px;
  border: 1.5px solid #fecaca; cursor: pointer; gap: 4px; letter-spacing: .05em;
}
.pdf-thumb span { font-size: 10px; font-weight: 500; opacity: .7; }
.gallery-label { font-size: 11px; color: var(--slate); margin-top: 5px; font-weight: 500; }
.image-list { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 24px 20px; }
.image-item { display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* =====================
   UPLOAD ROWS
   ===================== */
.upload-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.upload-row .form-control { flex: 1; }
.upload-row select.form-control { flex: 0 0 160px; }

/* =====================
   FILTER
   ===================== */
.filter-bar { display: flex; gap: 8px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); background: #fafbfc; flex-wrap: wrap; }

/* =====================
   PAGINATION
   ===================== */
.pagination-wrap { padding: 14px 22px; display: flex; justify-content: flex-end; border-top: 1px solid var(--border); }

/* =====================
   USER MANAGEMENT
   ===================== */
.role-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.role-tag-1 { background: rgba(220,38,38,.08);  color: #dc2626; }
.role-tag-2 { background: rgba(37,99,235,.08);  color: #2563eb; }
.role-tag-3 { background: rgba(5,150,105,.08);  color: #059669; }

/* =====================
   UTILS
   ===================== */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--slate); }
.text-danger { color: var(--red); }
.text-success{ color: var(--green); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.td-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--slate); }
.empty-state p { font-size: 14px; margin-top: 8px; }

/* =====================
   MODAL
   ===================== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 999;
  align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 92vw; max-height: 92vh;
  position: relative; overflow: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface); border: none;
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--slate);
  transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--border); color: var(--ink); }

/* =====================
   TOGGLE SWITCH
   ===================== */
.toggle-switch { position:relative; display:inline-block; width:40px; height:22px; vertical-align:middle; }
.toggle-switch input[type=checkbox]:not([value="0"]) { opacity:0; width:0; height:0; position:absolute; }
.toggle-switch input[type=hidden] { display:none; }
.toggle-track {
  position:absolute; cursor:pointer; inset:0;
  background:#cbd5e1; border-radius:22px; transition:background .2s;
}
.toggle-track::before {
  content:''; position:absolute;
  width:16px; height:16px; left:3px; bottom:3px;
  background:#fff; border-radius:50%;
  box-shadow:0 1px 3px rgba(0,0,0,.2);
  transition:transform .2s;
}
.toggle-switch input[type=checkbox]:checked + .toggle-track { background:#2563eb; }
.toggle-switch input[type=checkbox]:checked + .toggle-track::before { transform:translateX(18px); }
