/* ── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #1a3a5c;
  --navy-light: #2c5f8a;
  --navy-pale:  #e8f1f8;
  --gold:       #f0c040;
  --gold-dark:  #c8960a;
  --red:        #c0392b;
  --teal:       #16a085;
  --purple:     #8e44ad;
  --text:       #2c3e50;
  --text-muted: #718096;
  --border:     #e2e8f0;
  --bg:         #f0f4f8;
  --card-bg:    #ffffff;
  --sidebar-w:  240px;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(26,58,92,.10);
  --shadow-lg:  0 8px 32px rgba(26,58,92,.15);
}

html, body { height: 100%; font-family: 'Inter', 'Segoe UI', Arial, sans-serif; }

body {
  display: flex;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1cdd8; border-radius: 3px; }

/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.logo-icon {
  width: 42px; height: 42px;
  background: var(--gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  color: var(--navy);
  flex-shrink: 0;
  letter-spacing: .5px;
}

.logo-title {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
}

.logo-sub {
  color: #a8d4f5;
  font-size: 10px;
  letter-spacing: .5px;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #a8d4f5;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }

.nav-item.active {
  background: rgba(240,192,64,.15);
  color: var(--gold);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.phone-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 10px 14px;
  color: #a8d4f5;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3px;
}

.phone-badge svg { fill: var(--gold); flex-shrink: 0; }

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 14px;
  background: rgba(192,57,43,.15);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: 8px;
  color: #f08080;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
  letter-spacing: .2px;
}

.logout-btn:hover { background: rgba(192,57,43,.28); color: #ffaaaa; }
.logout-btn svg { fill: currentColor; flex-shrink: 0; }

/* ── MAIN ───────────────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 32px;
  overflow-y: auto;
}

/* ── VIEWS ──────────────────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

.view-header { margin-bottom: 28px; }
.view-header h1 { font-size: 22px; font-weight: 700; color: var(--navy); }
.view-header p { color: var(--text-muted); margin-top: 4px; font-size: 13.5px; }

/* ── CARDS ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ── COMPOSE ────────────────────────────────────────────────────────────────── */
.compose-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.compose-form { padding: 28px; }

.form-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.form-row:last-child { margin-bottom: 0; }

.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row input[type="password"],
.form-row select,
.form-row textarea {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(44,95,138,.12);
}

.form-row textarea { resize: vertical; min-height: 180px; }

.optional { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* TYPE GRID */
.type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-option input[type="radio"] { display: none; }

.type-chip {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: #f8fafc;
  transition: all .15s;
  user-select: none;
  letter-spacing: .3px;
}

.type-option input:checked + .type-chip.comunicado { background: var(--navy); border-color: var(--navy); color: #fff; }
.type-option input:checked + .type-chip.aviso       { background: var(--red); border-color: var(--red); color: #fff; }
.type-option input:checked + .type-chip.novedad     { background: var(--teal); border-color: var(--teal); color: #fff; }
.type-option input:checked + .type-chip.promocion   { background: var(--purple); border-color: var(--purple); color: #fff; }
.type-option input:checked + .type-chip.general     { background: var(--text); border-color: var(--text); color: #fff; }

/* ── BLOCK TOOLBAR ───────────────────────────────── */
.block-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 8px 8px 0 0;
  border-bottom: none;
  align-items: center;
}

.block-toolbar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-right: 4px;
  white-space: nowrap;
}

.bk-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}

.bk-btn svg { width: 14px; height: 14px; fill: var(--navy); flex-shrink: 0; }
.bk-btn:hover { background: var(--navy-pale); border-color: var(--navy-light); color: var(--navy); }

/* ── BLOCK LIST ──────────────────────────────────── */
.block-list {
  border: 1.5px solid var(--border);
  border-radius: 0 0 8px 8px;
  min-height: 120px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
}

.block-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 10px;
  flex: 1;
}
.block-empty svg { fill: var(--text-muted); opacity: .35; }
.block-empty p { font-size: 13px; }

.block-card {
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  position: relative;
  transition: box-shadow .15s;
}
.block-card:last-child { border-bottom: none; }
.block-card:hover { box-shadow: 0 2px 8px rgba(26,58,92,.08); z-index: 1; }

.block-handle {
  width: 52px;
  flex-shrink: 0;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-right: 1px solid var(--border);
  background: #f8fafc;
  align-self: stretch;
}

.block-type-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-pale);
}
.block-type-icon svg { width: 16px; height: 16px; fill: var(--navy); }

.block-type-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.block-body { flex: 1; padding: 12px 14px; }

.block-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  flex-shrink: 0;
}

.block-action-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 5px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .12s;
  padding: 0;
}
.block-action-btn:hover { background: var(--navy-pale); color: var(--navy); border-color: var(--navy-light); }
.block-action-btn.del:hover { background: #fde8e8; color: var(--red); border-color: #f5c6c6; }
.block-action-btn svg { width: 13px; height: 13px; fill: currentColor; }

.block-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
  line-height: 1.5;
  box-sizing: border-box;
}
.block-input:focus { border-color: var(--navy-light); box-shadow: 0 0 0 2px rgba(44,95,138,.10); }
.block-input.ta { resize: vertical; min-height: 80px; }

.block-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.block-row:first-child { margin-top: 0; }
.block-row label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; padding-top: 9px; min-width: 56px; }

.block-select {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
}

.hl-chips,.dv-chips,.sz-chips,.al-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.hl-chip, .dv-chip, .sz-chip, .al-chip {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .12s;
  background: #f0f4f8;
  color: var(--text);
}
.hl-chip.info    { background:#e8f4fd; color:#1a5276; }
.hl-chip.success { background:#e9f7ef; color:#1a5c33; }
.hl-chip.warning { background:#fef9e7; color:#7d5a00; }
.hl-chip.danger  { background:#fdedec; color:#7b241c; }
.hl-chip.tip     { background:#f0e6ff; color:#5b2c8e; }
.hl-chip.active,.dv-chip.active,.sz-chip.active,.al-chip.active { border-color: currentColor; outline: 2px solid currentColor; outline-offset: 1px; }
.dv-chip.active,.sz-chip.active,.al-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; outline: none; }

/* RECIPIENTS */
.recipients-box {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.recipients-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.rtab {
  flex: 1;
  border: none;
  background: none;
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}

.rtab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  background: #fff;
  font-weight: 600;
}

.rtab-content { display: none; padding: 14px; }
.rtab-content.active { display: block; }

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

.group-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #f8fafc;
  transition: all .15s;
}

.group-check:has(input:checked) {
  background: var(--navy-pale);
  border-color: var(--navy-light);
  color: var(--navy);
  font-weight: 600;
}

/* TAG INPUT */
.tag-input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  align-items: center;
}

.tag-input-area input {
  border: none !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 200px;
  font-size: 13.5px;
  padding: 4px 0 !important;
  outline: none;
}

.recipient-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--navy-pale);
  color: var(--navy);
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
}

.recipient-tag button {
  border: none; background: none; cursor: pointer;
  color: var(--navy-light); font-size: 14px; line-height: 1;
  padding: 0; display: flex;
}

.tag-hint { color: var(--text-muted); font-size: 11.5px; margin-top: 6px; }

/* FILE DROP */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.file-drop:hover, .file-drop.drag-over {
  border-color: var(--navy-light);
  background: var(--navy-pale);
}

.file-drop svg { fill: var(--text-muted); margin-bottom: 8px; }
.file-drop p { color: var(--text-muted); font-size: 13px; }
.file-label { color: var(--navy-light); cursor: pointer; text-decoration: underline; font-weight: 600; }

.file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.file-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--navy-pale);
  color: var(--navy);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px; font-weight: 500;
}

.file-item button {
  border: none; background: none; cursor: pointer;
  color: var(--red); font-size: 14px;
}

/* FORM ACTIONS */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.btn-primary:hover { background: var(--navy-light); border-color: var(--navy-light); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline:hover { background: var(--navy-pale); }

.btn-sm { padding: 7px 16px; font-size: 12.5px; }

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

/* ── PREVIEW PANEL ───────────────────────────────────────────────────────────── */
.preview-panel {
  padding: 0;
  overflow: hidden;
}

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

.preview-header h3 { font-size: 15px; font-weight: 600; color: var(--navy); }

.close-preview {
  border: none; background: none; cursor: pointer;
  font-size: 18px; color: var(--text-muted);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: background .15s;
}

.close-preview:hover { background: #f0f4f8; }

.preview-device iframe {
  width: 100%;
  height: 600px;
  border: none;
}

/* ── CONTACTS ────────────────────────────────────────────────────────────────── */
.contacts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  flex: 1;
  max-width: 380px;
}

.search-box svg { fill: var(--text-muted); flex-shrink: 0; }

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.contact-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: box-shadow .15s, border-color .15s;
}

.contact-card:hover { box-shadow: var(--shadow); border-color: #c1cdd8; }

.contact-avatar {
  width: 44px; height: 44px;
  background: var(--navy-pale);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.contact-name { font-weight: 600; font-size: 14px; color: var(--text); }
.contact-email { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; word-break: break-all; }
.contact-company { color: var(--navy-light); font-size: 12px; margin-top: 4px; font-weight: 500; }

.contact-group-tag {
  display: inline-block;
  background: var(--navy-pale);
  color: var(--navy);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}

.contact-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.contact-actions button {
  flex: 1;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  transition: background .15s;
}

.contact-actions button:hover { background: var(--navy-pale); color: var(--navy); }
.contact-actions .del-btn:hover { background: #fde8e8; color: var(--red); }

.no-contacts {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-contacts svg { fill: var(--text-muted); opacity: .4; margin-bottom: 12px; }

/* ── HISTORY ─────────────────────────────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-item {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.history-badge {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--navy);
  flex-shrink: 0;
}

.history-subject { font-weight: 600; font-size: 14px; color: var(--text); }
.history-meta { color: var(--text-muted); font-size: 12px; margin-top: 3px; }

.history-stats {
  text-align: right;
  flex-shrink: 0;
}

.history-stats .sent-count { font-weight: 700; font-size: 16px; color: var(--navy); }
.history-stats .sent-label { color: var(--text-muted); font-size: 11px; }

.history-type-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--navy-pale);
  color: var(--navy);
  margin-right: 8px;
}

.no-history {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}

/* ── SETTINGS ────────────────────────────────────────────────────────────────── */
.settings-card { padding: 28px; max-width: 680px; }

.settings-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff8e1;
  border: 1px solid #f0c040;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #7a5c00;
  line-height: 1.6;
}

.settings-info svg { fill: #f0c040; flex-shrink: 0; margin-top: 1px; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.conn-status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
}

.conn-status.success { background: #e6f9f1; color: #1a7a4a; border: 1px solid #a8d8b9; }
.conn-status.error   { background: #fde8e8; color: var(--red); border: 1px solid #f5c6c6; }

.toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
}

/* ── MODAL ───────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 440px;
  padding: 28px;
  animation: modalIn .2s ease;
}

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

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

.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--navy); }

.close-btn {
  border: none; background: none; cursor: pointer;
  font-size: 18px; color: var(--text-muted);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}

.close-btn:hover { background: #f0f4f8; }

/* ── TOAST ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: toastIn .25s ease;
  max-width: 360px;
}

@keyframes toastIn {
  from { opacity:0; transform: translateY(12px); }
  to   { opacity:1; transform: none; }
}

/* ── SPINNER ─────────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

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

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .form-row[style*="grid-column"] { grid-column: 1; }
}

@media (max-width: 700px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; min-height: auto; position: relative; flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav { flex-direction: row; padding: 8px; }
  .main { margin-left: 0; padding: 16px; }
}
