/* ========================================================================
   Scutum Maestro — Design System
   ======================================================================== */

/* --- Design Tokens --- */
:root {
  /* Sidebar */
  --sidebar-bg: #111827;
  --sidebar-border: #1f2937;
  --sidebar-text: #9ca3af;
  --sidebar-text-hover: #f3f4f6;
  --sidebar-active-bg: rgba(59,130,246,0.12);
  --sidebar-active-text: #60a5fa;
  --sidebar-group-text: #6b7280;
  --sidebar-width: 264px;

  /* Top bar */
  --topbar-height: 56px;
  --topbar-bg: #ffffff;
  --topbar-border: #e5e7eb;

  /* Page */
  --page-bg: #f3f4f6;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.06);

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-inverse: #f9fafb;

  /* Accents */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #06b6d4;
  --info-bg: #ecfeff;

  /* Spacing & Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

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

body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

/* ========================================================================
   Layout Shell
   ======================================================================== */
.shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.2s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }

.brand {
  padding: 20px 20px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--sidebar-group-text);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

/* Menu */
.menu {
  padding: 12px 10px;
  flex: 1;
}

.menu-group-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-group-text);
  padding: 10px 10px 3px 10px;
  opacity: 0.55;
}

.menu-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-text);
  margin-right: 3px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

.menu-group {
  margin-bottom: 4px;
}

.menu-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: var(--radius);
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.menu-group-label:hover {
  background: rgba(255,255,255,0.05);
  color: var(--sidebar-text-hover);
}

.menu-group-label .icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.menu-group-label .label { flex: 1; }
.menu-group-label .chevron {
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: var(--sidebar-group-text);
}
.menu-group.open > .menu-group-label .chevron { transform: rotate(90deg); }

.menu-sub {
  display: none;
  padding: 2px 0 4px 0;
}
.menu-group.open > .menu-sub { display: block; }

.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 42px;
  font-size: 0.82rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.menu-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--sidebar-text-hover);
}

.menu-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 500;
}

/* Top-level menu link (no sub) */
.menu-top-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  margin-bottom: 4px;
}

.menu-top-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--sidebar-text-hover);
}

.menu-top-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.menu-top-link .icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }

/* --- Main Content Area --- */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Top Bar --- */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 30;
  flex-shrink: 0;
}

.topbar .spacer { flex: 1; }

.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.topbar .user-info .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

#sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Content --- */
.content {
  padding: 24px;
  flex: 1;
}

/* ========================================================================
   Page Header
   ======================================================================== */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header .subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================================================
   Cards
   ======================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--card-border);
  background: #f9fafb;
}

/* Grid layouts */
.grid-1 { display: grid; gap: 20px; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }

/* ========================================================================
   KPI Cards (Dashboard)
   ======================================================================== */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.kpi-card .kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-card .kpi-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.kpi-card .kpi-icon {
  float: right;
  font-size: 1.5rem;
  opacity: 0.6;
}

/* ========================================================================
   Status Badges
   ======================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: #065f46; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-danger  { background: var(--danger-bg);  color: #991b1b; }
.badge-info    { background: var(--info-bg);    color: #155e75; }
.badge-neutral { background: #f3f4f6; color: #4b5563; }

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-success .badge-dot { background: var(--success); }
.badge-warning .badge-dot { background: var(--warning); }
.badge-danger  .badge-dot { background: var(--danger); }
.badge-info    .badge-dot { background: var(--info); }

/* ========================================================================
   Tables
   ======================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-secondary);
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

.data-table td.mono {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.8rem;
}

.data-table .empty-row td {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* ========================================================================
   Forms
   ======================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label,
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group .form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

input::placeholder { color: var(--text-muted); }

input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.checkbox-row span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ========================================================================
   Buttons
   ======================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--card-border);
}
.btn-outline:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: #f3f4f6;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 0.95rem;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========================================================================
   Toast Notifications
   ======================================================================== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 320px;
  max-width: 480px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border: 1px solid var(--card-border);
  animation: toastIn 0.25s ease;
  font-size: 0.85rem;
}

.toast.leaving {
  animation: toastOut 0.2s ease forwards;
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-msg { color: var(--text-secondary); font-size: 0.8rem; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; padding: 0;
  line-height: 1; flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ========================================================================
   Loading States
   ======================================================================== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  height: 16px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================================================
   Modal / Confirm Dialog
   ======================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: min(460px, calc(100vw - 40px));
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  position: relative;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 12px 24px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 12px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-lg {
  width: min(640px, calc(100vw - 40px));
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-lg .modal-body {
  overflow-y: auto;
  flex: 1;
}

.detail-section {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guide-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.guide-item:last-child {
  border-bottom: none;
}
.guide-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.guide-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.guide-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 6px;
  background: var(--page-bg);
  color: var(--text-muted);
  border-radius: 4px;
  margin-right: 6px;
  font-weight: normal;
}



/* ========================================================================
   Status Dot (inline)
   ======================================================================== */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.running  { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.status-dot.stopped  { background: var(--text-muted); }
.status-dot.error    { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.4); }

/* ========================================================================
   Empty State
   ======================================================================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state .empty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state .empty-desc {
  font-size: 0.8rem;
}

/* ========================================================================
   Auth Page (Login)
   ======================================================================== */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
}

.login-card {
  width: min(400px, calc(100vw - 40px));
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-card .muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.login-card .form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card .error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.login-card button[type="submit"]:hover {
  background: var(--accent-hover);
}

/* ========================================================================
   Utility
   ======================================================================== */
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-mono    { font-family: "JetBrains Mono", "Fira Code", monospace; font-size: 0.82rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 16px 0;
}

/* JSON / Code output (temporary, for pages not yet migrated) */
.output {
  margin-top: 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #f9fafb;
  padding: 12px;
  min-height: 80px;
  overflow: auto;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 35;
    display: none;
  }
  .sidebar-backdrop.show { display: block; }

  .main {
    margin-left: 0;
  }

  #sidebar-toggle {
    display: inline-flex;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 16px;
  }
}
