/* ============================================================
   Hania Agent — Panel Admin
   ============================================================ */

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

:root {
  /* Brand */
  --primary:     #8b5e3c;
  --primary-d:   #6e4a2e;
  --primary-l:   #f0e6dc;
  --accent:      #c4956a;

  /* Sidebar */
  --sb-bg:       #160a04;
  --sb-hover:    rgba(255,255,255,.06);
  --sb-active:   rgba(196,149,106,.15);
  --sb-text:     rgba(255,255,255,.65);
  --sb-text-hi:  #fff;
  --sb-border:   rgba(255,255,255,.08);

  /* UI */
  --bg:          #f5f0ea;
  --surface:     #ffffff;
  --border:      #e5dbd1;
  --text:        #1e1108;
  --muted:       #7a6658;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.05);
  --shadow-md:   0 4px 16px rgba(0,0,0,.1);

  /* Status */
  --green:       #059669;
  --green-bg:    #d1fae5;
  --orange:      #d97706;
  --orange-bg:   #fef3c7;
  --blue:        #2563eb;
  --blue-bg:     #dbeafe;
  --slate:       #64748b;
  --slate-bg:    #f1f5f9;

  /* Dimensions */
  --sidebar-w:   240px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #1e0e05;
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in .25s cubic-bezier(.34,1.56,.64,1);
  min-width: 260px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid var(--blue); }
.toast.out     { animation: toast-out .2s ease forwards; }

@keyframes toast-in  { from { opacity:0; transform: translateY(8px) scale(.96); } to { opacity:1; transform: none; } }
@keyframes toast-out { to   { opacity:0; transform: translateY(8px) scale(.96); } }

/* ══════════════════════════════════════════
   SKELETON LOADERS
══════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 72px;
  background: linear-gradient(90deg, #ede5db 25%, #e4d9ce 50%, #ede5db 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.skeleton-inline {
  display: inline-block;
  width: 48px;
  height: 28px;
  background: linear-gradient(90deg, #ddd4c9 25%, #d4c9bc 50%, #ddd4c9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  vertical-align: middle;
}

/* ══════════════════════════════════════════
   LOGIN
══════════════════════════════════════════ */
.login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #1e0a02 0%, #5c3016 50%, #8b5e3c 100%);
  z-index: 999;
  overflow: hidden;
}

.login-bg-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.login-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  width: 380px;
  box-shadow: 0 32px 80px rgba(0,0,0,.4);
  animation: login-enter .4s cubic-bezier(.34,1.3,.64,1);
}

@keyframes login-enter { from { opacity:0; transform:translateY(20px) scale(.97); } to { opacity:1; transform:none; } }

.login-logo { text-align: center; margin-bottom: 32px; }

.login-monogram {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-family: 'Lora', serif;
  font-size: 28px;
  font-weight: 600;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(139,94,60,.4);
}

.login-logo h1 {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.login-logo p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.input-wrapper { position: relative; }

.input-eye {
  position: absolute;
  right: 11px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); display: flex; padding: 4px;
}

.input-eye:hover { color: var(--text); }

/* ══════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--sb-border);
}

.brand-monogram {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-family: 'Lora', serif;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--sb-text-hi);
  line-height: 1.2;
}

.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--sb-text);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sb-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-item:hover {
  background: var(--sb-hover);
  color: var(--sb-text-hi);
}

.nav-item.active {
  background: var(--sb-active);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  flex-shrink: 0;
  opacity: .7;
}

.nav-item.active .nav-icon { opacity: 1; }

.badge {
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sb-text);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6b7280;
}

.status-dot.active { background: var(--green); box-shadow: 0 0 0 2px rgba(5,150,105,.25); }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--sb-border);
  border-radius: var(--radius-sm);
  color: var(--sb-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  width: 100%;
}

.btn-logout:hover {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  border-color: rgba(239,68,68,.2);
}

/* ══════════════════════════════════════════
   MAIN / PAGES
══════════════════════════════════════════ */
.main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.page {
  display: none;
  padding: 32px 36px;
  max-width: 1080px;
  animation: page-in .2s ease;
}

.page.active { display: block; }

@keyframes page-in { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

/* ══════════════════════════════════════════
   STATS
══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .15s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card.warn  { border-color: #fcd34d; background: #fffdf5; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.blue   { background: var(--blue-bg); color: var(--blue); }
.stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
.stat-icon.green  { background: var(--green-bg); color: var(--green); }

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ══════════════════════════════════════════
   SECTION HEADERS
══════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
}

.link-muted {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.link-muted:hover { text-decoration: underline; }

/* ══════════════════════════════════════════
   CONVERSATION CARDS
══════════════════════════════════════════ */
.conv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .15s, border-color .15s;
}

.conv-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d0c4b6;
}

.conv-card.pending-highlight { border-left: 3px solid var(--orange); }

.conv-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.conv-avatar.whatsapp  { background: linear-gradient(135deg, #1da851 0%, #25d366 100%); }
.conv-avatar.instagram { background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%); }

.conv-body { flex: 1; min-width: 0; }

.conv-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-preview {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.conv-meta {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.conv-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   STATUS PILLS
══════════════════════════════════════════ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}

.status-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-active  { background: var(--green-bg);  color: #065f46; }
.status-pending { background: var(--orange-bg); color: #92400e; }
.status-closed  { background: var(--slate-bg);  color: var(--slate); }

/* ══════════════════════════════════════════
   CONVERSATION DETAIL
══════════════════════════════════════════ */
.detail-header {
  align-items: center;
  flex-wrap: nowrap;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.btn-back:hover { background: var(--bg); color: var(--text); }

.detail-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.detail-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.detail-actions { flex-shrink: 0; }

.status-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}

.status-select:focus { border-color: var(--primary); }

.detail-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
}

.meta-chip strong { color: var(--text); font-weight: 600; }

/* ══════════════════════════════════════════
   MESSAGES
══════════════════════════════════════════ */
.messages-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 420px;
  overflow-y: auto;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #faf7f4;
  position: relative;
}

.messages-inner {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-divider {
  text-align: center;
  margin: 12px 0 8px;
}

.date-divider span {
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  padding: 3px 12px;
  border-radius: 99px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.message {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}

.message.user    { align-items: flex-start; }
.message.assistant { align-items: flex-end; }

.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .msg-bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 2px 16px 16px 16px;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.message.assistant .msg-bubble {
  background: linear-gradient(135deg, var(--primary) 0%, #6e4a2e 100%);
  color: #fff;
  border-radius: 16px 2px 16px 16px;
  box-shadow: 0 2px 6px rgba(139,94,60,.3);
}

.msg-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  padding: 0 4px;
}

.message.assistant .msg-meta { text-align: right; }

/* ══════════════════════════════════════════
   NOTES CARD
══════════════════════════════════════════ */
.notes-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.notes-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.notes-hint { color: var(--muted); font-weight: 400; }

/* ══════════════════════════════════════════
   CONTACTS
══════════════════════════════════════════ */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .15s;
}

.contact-card:hover { box-shadow: var(--shadow-md); }

.contact-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.contact-avatar.whatsapp  { background: linear-gradient(135deg, #1da851, #25d366); }
.contact-avatar.instagram { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); }

.contact-body { flex: 1; min-width: 0; }

.contact-name {
  font-weight: 600;
  font-size: 14px;
}

.contact-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.contact-since {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  flex-shrink: 0;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.platform-chip.whatsapp  { background: #dcfce7; color: #166534; }
.platform-chip.instagram { background: #fdf4ff; color: #7c3aed; }

/* ══════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════ */
.settings-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.settings-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-section { padding: 24px; }

.settings-section + .settings-section {
  border-top: 1px solid var(--border);
}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 16px;
}

.settings-help {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.settings-panel .btn { margin: 0 24px 24px; }

.prompt-panel .settings-section { padding-bottom: 0; }
.prompt-panel #cfg-prompt { border-radius: var(--radius-sm); }

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.char-counter {
  font-size: 11px;
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ══════════════════════════════════════════
   FILTERS
══════════════════════════════════════════ */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}

.filter-tab:hover { background: var(--bg); color: var(--text); }

.filter-tab.active { background: var(--primary); color: #fff; }

.filter-tab.warn { color: var(--orange); }
.filter-tab.warn.active { background: var(--orange); color: #fff; }

/* ══════════════════════════════════════════
   SEARCH
══════════════════════════════════════════ */
.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  padding-left: 32px !important;
  min-width: 240px;
}

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.field small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.4;
}

input[type="password"],
input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s, background .15s;
  font-family: inherit;
  line-height: 1.5;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(139,94,60,.1);
}

textarea { resize: vertical; }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(139,94,60,.3);
}

.btn-primary:hover {
  background: var(--primary-d);
  box-shadow: 0 4px 12px rgba(139,94,60,.35);
}

.btn-ghost {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ══════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state svg { opacity: .3; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ══════════════════════════════════════════
   REFRESH BUTTON SPIN
══════════════════════════════════════════ */
.spinning svg { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
}

@media (max-width: 640px) {
  .sidebar { display: none; }
  .page { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-tabs { flex-wrap: wrap; }
}
