/* ─── ADMIN VARIABLES ───────────────────────────────────── */
:root {
  --bg: #080e0d;
  --surface: #101918;
  --surface-2: #17211f;
  --surface-3: #1e2d29;
  --text: #edf2f0;
  --text-muted: #88a8a0;
  --text-subtle: #4d6e68;
  --border: #1a2825;
  --border-light: #263b36;
  --accent: #16b898;
  --accent-hover: #1dd4b0;
  --accent-subtle: rgba(22, 184, 152, 0.10);
  --accent-border: rgba(22, 184, 152, 0.25);
  --danger: #dc3545;
  --danger-subtle: rgba(220, 53, 69, 0.1);
  --success: #28a745;

  --font: 'DM Sans', system-ui, sans-serif;
  --sidebar-w: 240px;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #080e0d;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}
.btn-outline:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-light);
}
.btn-danger {
  background: var(--danger);
  color: white;
  font-weight: 600;
}
.btn-danger:hover { background: #c82333; }
.btn-full { width: 100%; justify-content: center; }

/* ─── FORMS ─────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input::placeholder { color: var(--text-subtle); }
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2388a8a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
select option { background: var(--surface-2); }
.form-error {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #f08080;
  margin-bottom: 16px;
}

/* ─── LOGIN SCREEN ──────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201, 140, 42, 0.04) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}
.login-brand em { font-style: normal; color: var(--accent); }
.login-brand-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1px;
}
.login-card h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}
#login-btn { margin-top: 8px; }

/* ─── DASHBOARD LAYOUT ──────────────────────────────────── */
/* Sidebar is position:fixed so it leaves normal flow.
   main-content uses margin-left to clear it. */
.dashboard {
  min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  z-index: 50;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1;
}
.sidebar-brand em { font-style: normal; color: var(--accent); }
.sidebar-brand-sub {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-top: 2px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sidebar-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 11px;
  color: var(--text-subtle);
}
.btn-logout {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-logout:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ─── MAIN CONTENT ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 32px 40px;
  min-height: 100vh;
}
.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.content-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.content-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── STATS BAR ─────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  min-width: 100px;
  flex: 1;
}
.stat-pill-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-pill-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── TABLE TOOLBAR ─────────────────────────────────────── */
.table-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}
.search-wrap input {
  padding-left: 38px;
}
#table-filter { width: 200px; flex-shrink: 0; }

/* ─── TABLE ─────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.table-loading,
.table-empty {
  display: none;
}
.loading-spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.table-empty svg { opacity: 0.3; }
.reservations-table {
  width: 100%;
  border-collapse: collapse;
}
.reservations-table thead {
  border-bottom: 1px solid var(--border);
}
.reservations-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface-2);
}
.reservations-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.reservations-table tr:last-child td { border-bottom: none; }
.reservations-table tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}
.reservations-table tbody tr:hover { background: var(--surface-2); }
.td-id {
  font-size: 12px;
  color: var(--text-subtle);
  font-weight: 500;
}
.td-name { font-weight: 500; white-space: nowrap; }
.td-contact {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.td-contact a {
  color: var(--text-muted);
  font-size: 12px;
}
.td-contact a:hover { color: var(--accent); }
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.td-muted {
  color: var(--text-muted);
  font-size: 12px;
}
.td-date {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
}
.btn-row-delete {
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--text-subtle);
  transition: all var(--transition);
  display: flex;
  align-items: center;
}
.btn-row-delete:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}
.table-count {
  font-size: 12px;
  color: var(--text-subtle);
  padding: 12px 0 0;
}

/* ─── CONFIRM DIALOG ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.confirm-dialog {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 380px;
  width: 100%;
  transform: scale(0.96);
  transition: transform 180ms ease;
}
.modal-overlay.open .confirm-dialog { transform: scale(1); }
.confirm-dialog h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.confirm-dialog p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── DRAWER ────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  background: var(--surface);
  border-left: 1px solid var(--border-light);
  transform: translateX(100%);
  transition: transform 280ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  background: transparent;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.detail-section {
  margin-bottom: 28px;
}
.detail-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.detail-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
.detail-value a {
  color: var(--accent);
}
.detail-value a:hover { text-decoration: underline; }
.detail-value.muted { color: var(--text-muted); font-style: italic; }

/* ─── ATTACHMENT GRID ───────────────────────────────────── */
.attachment-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.attachment-thumb {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.attachment-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.04);
}
.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── AI ESTIMATE (drawer) ───────────────────────────────── */
.ai-estimate-section {
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: rgba(22, 184, 152, 0.04);
  padding: 14px 16px;
}
.ai-estimate-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent) !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 10px !important;
}
.ai-estimate-body {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ─── NOTES ─────────────────────────────────────────────── */
.notes-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
  margin-bottom: 24px;
}
.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.notes-status {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: opacity 300ms ease;
  color: var(--text-subtle);
}
.notes-status.unsaved { color: var(--text-muted); }
.notes-status.saving  { color: var(--text-subtle); }
.notes-status.saved   { color: #4caf7d; }
.notes-status.error   { color: var(--danger); }
.notes-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  font-size: 13px;
  font-family: var(--font);
  line-height: 1.65;
  resize: vertical;
  min-height: 130px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: block;
}
.notes-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.notes-textarea::placeholder { color: var(--text-subtle); font-style: italic; }
.notes-last-saved {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 7px;
  min-height: 16px;
}

/* ─── DRAWER ACTIONS ────────────────────────────────────── */
.drawer-actions {
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: -8px;
}

/* ─── FOCUS STYLES ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ─── SERVICES MANAGEMENT PAGE ──────────────────────────── */
.svc-info-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.svc-info-bar svg { color: var(--accent); flex-shrink: 0; }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.svc-loading {
  display: none;
}
.svc-empty {
  display: none;
  color: var(--text-subtle);
  font-size: 14px;
}

.svc-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.svc-card:hover { border-color: var(--accent-border); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.svc-card-inactive { opacity: 0.55; }
.svc-card-inactive:hover { opacity: 1; }

.svc-card-img {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
}
.svc-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}
.svc-card:hover .svc-card-img img { transform: scale(1.03); }

.svc-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.svc-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.svc-card-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.svc-card-info { flex: 1; min-width: 0; }
.svc-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-card-partner {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.monthly-freq-badge {
  display: inline-block;
  padding: 1px 7px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field-optional { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.svc-days {
  font-weight: 600;
  color: var(--accent);
}
.svc-days.soon { color: #ffab40; }
.svc-days.urgent { color: #ff6b6b; }
.svc-days.ended { color: var(--text-subtle); }

.svc-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.svc-badge-active {
  background: rgba(22,184,152,0.12);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.svc-badge-inactive {
  background: var(--surface-2);
  color: var(--text-subtle);
  border: 1px solid var(--border);
}

.svc-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.svc-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.svc-card-actions .btn { font-size: 12px; padding: 7px 12px; gap: 5px; }

/* ─── SERVICE MODAL ──────────────────────────────────────── */
.svc-modal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.svc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.svc-modal-header h2 { font-size: 18px; font-weight: 600; color: var(--text); }
.svc-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.svc-form-row { display: flex; gap: 16px; }
.svc-form-row .form-group { flex: 1; min-width: 0; }
#svc-desc {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#svc-desc:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { opacity: 0.5; }

/* Image picker */
.img-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.img-option {
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transition: border-color var(--transition);
}
.img-option img {
  width: 100%;
  aspect-ratio: 8/5;
  object-fit: cover;
  display: block;
}
.img-option span {
  font-size: 10px;
  color: var(--text-muted);
  padding: 4px 2px;
  display: block;
  text-align: center;
  line-height: 1;
}
.img-option:hover { border-color: var(--accent-border); }
.img-option.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Icon picker */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.icon-option {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 4px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.icon-option span { font-size: 9px; line-height: 1; text-align: center; }
.icon-option:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-subtle); }
.icon-option.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

/* Active toggle */
.svc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.toggle-label { font-size: 13px; font-weight: 500; color: var(--text); }
.toggle-switch { position: relative; display: inline-block; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: block;
  width: 44px; height: 24px;
  background: var(--surface-3);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-subtle);
  transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); background: #080e0d; }
.toggle-switch input:focus ~ .toggle-track { box-shadow: 0 0 0 3px var(--accent-subtle); }

.svc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .main-content { padding: 24px; }
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px; }
  .stats-bar { gap: 8px; }
  .stat-pill { padding: 12px 14px; }
  .stat-pill-num { font-size: 22px; }
  .table-toolbar { flex-direction: column; }
  #table-filter { width: 100%; }
  .drawer { width: 100%; }
  .header-actions { flex-direction: column; }
}

/* ─── PARTNER ADMIN ──────────────────────────────────────── */
.partner-filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.partner-stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.partner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.partner-card:hover { border-color: var(--accent-border); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.partner-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.partner-card-name { font-size: 15px; font-weight: 600; color: var(--text); }
.partner-card-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.partner-trade-badge {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; border: 1px solid var(--border-light);
  background: var(--surface-2); color: var(--text-muted);
  letter-spacing: 0.03em;
}
.partner-status-badge {
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; letter-spacing: 0.04em;
}
.partner-status-badge.pending   { background: rgba(255,171,64,0.12); color: #ffab40; border: 1px solid rgba(255,171,64,0.3); }
.partner-status-badge.onboarded { background: rgba(22,184,152,0.12); color: var(--accent); border: 1px solid var(--accent-border); }
.partner-status-badge.offboarded{ background: var(--surface-2); color: var(--text-subtle); border: 1px solid var(--border); }
.partner-status-badge.flagged   { background: rgba(255,107,107,0.12); color: #ff6b6b; border: 1px solid rgba(255,107,107,0.3); }
.partner-card-stars { display: flex; gap: 2px; }
.star { font-size: 14px; color: var(--border-light); }
.star.filled { color: #f5a623; }
.partner-card-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 3px;
}
.partner-card-meta span { display: flex; align-items: center; gap: 5px; }
.partner-card-date { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }
.partner-card-specialties { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.partner-specialty-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}

/* drawer specialties grid */
.pd-specialties-grid { display: flex; flex-direction: column; gap: 12px; }
.pd-spec-group { display: flex; flex-direction: column; gap: 6px; }
.pd-spec-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.pd-spec-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-spec-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  user-select: none;
}
.pd-spec-pill input { display: none; }
.pd-spec-pill:has(input:checked) {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Partner drawer content */
.partner-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.partner-edit-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}
.partner-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.partner-edit-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.partner-edit-form label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.partner-edit-form input,
.partner-edit-form select,
.partner-edit-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.partner-edit-form input:focus,
.partner-edit-form select:focus,
.partner-edit-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.partner-edit-form textarea { resize: vertical; }
.partner-info-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.partner-save-status {
  font-size: 12px;
  color: var(--text-muted);
}
.partner-save-status.saved { color: #22c55e; }
.btn-sm { font-size: 13px; padding: 6px 16px; }

.partner-drawer-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.partner-drawer-status label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.partner-status-select {
  background: var(--surface-3);
  border: 1px solid var(--border-light);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}
.partner-status-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.partner-drawer-rating {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.partner-drawer-rating label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.star-rating-input { display: flex; gap: 6px; }
.star-rating-input button {
  background: none; border: none; cursor: pointer;
  font-size: 24px; color: var(--border-light);
  transition: color var(--transition), transform 80ms ease;
  padding: 2px;
  line-height: 1;
}
.star-rating-input button.filled { color: #f5a623; }
.star-rating-input button:hover { transform: scale(1.2); }
.star-rating-input button:focus-visible { outline: 2px solid var(--accent); border-radius: 2px; }

/* ─── PROJECT TYPES ─────────────────────────────────────── */
.pt-group { margin-bottom: 32px; }
.pt-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.pt-list-inner { display: flex; flex-direction: column; }
.pt-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pt-item--inactive { opacity: 0.5; }
.pt-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.pt-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 72px;
}
.pt-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pt-btn-toggle {
  min-width: 72px;
  text-align: center;
  font-size: 12px;
}
.pt-btn-toggle, .pt-btn-edit, .pt-btn-delete { font-size: 12px; padding: 5px 12px; }

/* service card project type badge */
.svc-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 2px 7px;
  margin-bottom: 3px;
}

/* ─── PARTNER MESSAGES (ADMIN) ──────────────────────────── */
.pm-partner-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.pm-partner-row:hover, .pm-partner-row.pm-selected { background: var(--surface-2); }
.pm-unread { border-left: 3px solid var(--accent); }
.pm-partner-info { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.pm-last-msg { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #000; font-size: 10px; font-weight: 700;
  border-radius: 10px; min-width: 18px; height: 18px; padding: 0 5px;
}

/* ─── PARTNER SUBSCRIPTIONS ─────────────────────────────── */
.partner-sub-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
}
.tier-free {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}
.tier-paid {
  background: rgba(22, 184, 152, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.sub-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.sub-detail-item { display: flex; flex-direction: column; gap: 2px; }
.sub-detail-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sub-detail-val { font-size: 13px; font-weight: 500; color: var(--text); }
.sub-payments-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sub-payments-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 4px 8px 6px; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.sub-payments-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text); }
.sub-payments-table tr:last-child td { border-bottom: none; }
.badge-warning {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
/* Payment method tabs */
.payment-method-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pm-tab {
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.pm-tab:hover { background: var(--surface-2); color: var(--text); }
.pm-tab.active { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent-border); }
/* Stripe card element */
.stripe-card-element {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color var(--transition);
}
.stripe-card-element:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

/* ─── SMART QUOTES ───────────────────────────────────────── */
.quote-builder-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.quote-builder-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.quote-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.quote-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
}
.quote-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quote-section-head h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.quote-section-body {
  padding: 18px;
}
.quote-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.quote-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .quote-grid-2, .quote-grid-3 { grid-template-columns: 1fr; }
}
.quote-items-header {
  display: grid;
  grid-template-columns: 28px 1fr 120px 60px 70px 90px 80px 36px;
  gap: 6px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.quote-items-header span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.q-item-row {
  display: grid;
  grid-template-columns: 28px 1fr 120px 60px 70px 90px 80px 36px;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.q-item-row:last-child { border-bottom: none; }
.q-item-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.q-item-total {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}
.q-item-remove {
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 6px;
}
.q-item-remove:hover { color: var(--danger); }
.quote-add-item {
  margin-top: 12px;
}
.quote-empty-msg {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
}
.quote-generating {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 13px;
  margin-top: 10px;
}
.quote-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.quote-summary {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.quote-summary h3 {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.quote-total-row { color: #111827; }
.quote-total-row .label { color: #374151; }
.quote-totals { width: 100%; max-width: 360px; margin-left: auto; }
.quote-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: #000;
}
.quote-total-row:last-child { border-bottom: none; }
.quote-total-row .label { font-weight: 500; }
.quote-total-row .amount { font-variant-numeric: tabular-nums; }
.quote-grand {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quote-grand .label { font-size: 14px; font-weight: 700; color: #000; }
.quote-grand .amount { font-size: 18px; font-weight: 800; color: #000; font-variant-numeric: tabular-nums; }
.pq-autosave-status {
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.pq-autosave-status.saving { color: var(--text-muted); }
.pq-autosave-status.saved  { color: #16B898; font-weight: 500; }
.pq-autosave-status.error  { color: #ef4444; }

.quote-fp-attach {
  margin: 14px 0 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.quote-fp-attach label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}
.quote-fp-attach input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: #16B898; }
.quote-fp-attach select { font-size: 13px; margin-top: 10px; }
.quote-fp-attach p { font-size: 11px; color: #94a3b8; margin-top: 6px; margin-bottom: 0; }
.quote-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.mono-text { font-family: 'Courier New', monospace; font-size: 12px; }
.badge-success {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-muted {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
@media (max-width: 700px) {
  .quote-items-header { display: none; }
  .q-item-row {
    grid-template-columns: 28px 1fr 1fr 36px;
    grid-template-rows: auto auto;
  }
  .q-item-name { grid-column: 2; }
  .q-item-cat  { grid-column: 3; }
  .q-item-qty, .q-item-unit { grid-column: 2; }
  .q-item-price { grid-column: 3; }
  .q-item-total { grid-column: 2 / 4; text-align: left; }
  .q-item-remove { grid-row: 1; grid-column: 4; }
}

/* ─── ADMIN DASHBOARD ───────────────────────────────────────── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 0 32px 24px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-card-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.dash-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 0 32px 24px;
}
.dash-panel-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}
.dash-panel-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.dash-panels-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 32px 32px;
}
.dash-panel-half {
  margin: 0;
}
.dash-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-bar-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}
.dash-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 48px;
  align-items: center;
  gap: 12px;
}
.dash-bar-label {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-bar-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 400ms ease-out;
}
.dash-bar-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}
.dash-mini-stats {
  display: flex;
  gap: 32px;
  margin-top: 12px;
}
.dash-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-mini-stat span {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.dash-mini-stat.accent span {
  color: var(--accent);
}
.dash-mini-stat small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
@media (max-width: 900px) {
  .dash-cards { padding: 0 16px 20px; grid-template-columns: repeat(2, 1fr); }
  .dash-panel { margin: 0 16px 20px; }
  .dash-panels-row { grid-template-columns: 1fr; padding: 0 16px 24px; }
  .dash-bar-row { grid-template-columns: 120px 1fr 40px; }
}

/* ─── CALENDAR ───────────────────────────────────────────────── */
.cal-container {
  padding: 0 32px 32px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.cal-month-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  min-width: 180px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}
.cal-dow {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cal-day {
  min-height: 100px;
  padding: 6px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background 120ms;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day-empty {
  background: var(--surface-2);
  cursor: default;
}
.cal-day-today .cal-day-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cal-chip {
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter 120ms;
}
.cal-chip:hover { filter: brightness(1.12); }

/* Appointment modal */
.cal-modal {
  width: min(520px, 94vw);
}
.cal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cal-color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cal-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform 120ms, border-color 120ms;
}
.cal-swatch:hover { transform: scale(1.15); }
.cal-swatch.active {
  border-color: var(--text);
  transform: scale(1.1);
}

/* Modal shared */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #dc2626; }

@media (max-width: 700px) {
  .cal-container { padding: 0 16px 24px; }
  .cal-day { min-height: 64px; }
  .cal-form-row { grid-template-columns: 1fr; }
}
