/* =============================================
   SUITE ESDRAS — CSS
   Guía de estilo exacta: club.tapiceriaesdras.com.ve
   Fuentes: Playfair Display (títulos, weight 900) + Rubik 300 (cuerpo)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Rubik:wght@300;400;500;600&display=swap');

:root {
  --gold:        #C9A84C;
  --gold-light:  #E8C97A;
  --gold-dim:    #7A5F1E;
  --gold-faint:  rgba(201,168,76,0.07);
  --gold-faint2: rgba(201,168,76,0.12);
  --border:      rgba(201,168,76,0.15);
  --border2:     rgba(201,168,76,0.28);

  --black:       #0A0A0A;
  --black-card:  #141414;
  --black-mid:   #1C1C1C;
  --black-high:  #242424;
  --white:       #F8F6F0;
  --white-dim:   rgba(248,246,240,0.6);
  --white-faint: rgba(248,246,240,0.35);

  --success:  #4ade80;
  --danger:   #f87171;
  --warning:  #fbbf24;
  --info:     #60a5fa;

  --radius:    12px;
  --radius-sm: 6px;
  --radius-lg: 20px;
  --shadow:    0 8px 32px rgba(0,0,0,0.6);
  --transition: 0.3s ease;

  --sidebar-w: 260px;
  --topbar-h:  64px;

  --font-title: 'Playfair Display', serif;
  --font-body:  'Rubik', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 900;
  line-height: 1.1;
}

a { text-decoration: none; color: var(--gold); transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ======== LAYOUT ======== */
.app-wrapper { display: flex; min-height: 100vh; }

/* ======== SIDEBAR ======== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--black-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}

.sidebar-brand img {
  width: 40px; height: 40px; object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.3));
}

.sidebar-brand-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
  display: block;
}

.sidebar-brand-sub {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--white-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white-faint);
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--white-dim);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 300;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--gold-faint);
  color: var(--white);
  border-color: var(--border);
}

.nav-item.active {
  background: var(--gold-faint2);
  color: var(--gold);
  border-color: var(--border2);
}

.nav-item .nav-icon { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--black-mid);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-size: 0.9rem; font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0; overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 500; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.6rem; color: var(--white-faint); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 400; }

/* ======== TOPBAR ======== */
.topbar {
  height: var(--topbar-h);
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: fixed; top: 0; right: 0;
  left: var(--sidebar-w);
  z-index: 100;
  transition: left var(--transition);
}

.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 6px;
  color: var(--white-dim); font-size: 1.2rem; line-height: 1;
}

.topbar-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  flex: 1;
  letter-spacing: 0.02em;
}

.topbar-clock { font-size: 0.73rem; color: var(--white-faint); font-weight: 300; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  background: var(--black-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white-dim);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.76rem; font-weight: 400;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.topbar-btn:hover { background: var(--black-high); color: var(--white); border-color: var(--gold-dim); }

/* ======== MAIN ======== */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 32px;
  min-height: calc(100vh - var(--topbar-h));
  flex: 1;
}

.page-header { margin-bottom: 28px; }

.page-title {
  font-family: var(--font-title);
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.page-subtitle { font-size: 0.82rem; color: var(--white-faint); margin-top: 5px; font-weight: 300; }

/* ======== CARDS ======== */
.card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border2); }

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.card:hover::before { opacity: 1; }

.card-gold { background: var(--gold-faint); border-color: var(--border2); }

.card-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 18px;
}

.card-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}

/* ======== STAT CARDS ======== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 24px;
}

.stat-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 7px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }

.stat-icon { font-size: 1.3rem; opacity: 0.7; }

.stat-value {
  font-family: var(--font-title);
  font-size: 2rem; font-weight: 900;
  color: var(--gold); line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.68rem; color: var(--white-faint);
  text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500;
}

.stat-change { font-size: 0.7rem; font-weight: 400; color: var(--white-faint); display: flex; align-items: center; gap: 3px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ======== GRIDS ======== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }

/* ======== BADGES ======== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}

.badge-draft     { background: rgba(255,255,255,0.05); color: var(--white-dim); border: 1px solid rgba(255,255,255,0.08); }
.badge-scheduled { background: rgba(96,165,250,0.1); color: #93c5fd; border: 1px solid rgba(96,165,250,0.2); }
.badge-published { background: rgba(74,222,128,0.1); color: #86efac; border: 1px solid rgba(74,222,128,0.2); }
.badge-failed    { background: rgba(248,113,113,0.1); color: #fca5a5; border: 1px solid rgba(248,113,113,0.2); }
.badge-sent      { background: var(--gold-faint2); color: var(--gold); border: 1px solid var(--border); }
.badge-active    { background: rgba(74,222,128,0.1); color: #86efac; border: 1px solid rgba(74,222,128,0.2); }
.badge-admin     { background: var(--gold-faint2); color: var(--gold); border: 1px solid var(--border); }
.badge-editor    { background: rgba(255,255,255,0.05); color: var(--white-dim); border: 1px solid rgba(255,255,255,0.08); }
.badge-bronze    { background: rgba(205,127,50,0.12); color: #cd7f32; border: 1px solid rgba(205,127,50,0.25); }
.badge-silver    { background: rgba(192,192,192,0.1); color: #d4d4d4; border: 1px solid rgba(192,192,192,0.2); }
.badge-gold      { background: var(--gold-faint2); color: var(--gold); border: 1px solid var(--border); }
.badge-black     { background: rgba(255,255,255,0.04); color: var(--white-dim); border: 1px solid rgba(255,255,255,0.08); }
.badge-ig        { background: rgba(225,48,108,0.1); color: #f472b6; border: 1px solid rgba(225,48,108,0.2); }
.badge-fb        { background: rgba(24,119,242,0.1); color: #93c5fd; border: 1px solid rgba(24,119,242,0.2); }
.badge-tiktok    { background: rgba(255,255,255,0.05); color: var(--white-dim); border: 1px solid rgba(255,255,255,0.08); }
.badge-yt        { background: rgba(255,0,0,0.1); color: #fca5a5; border: 1px solid rgba(255,0,0,0.2); }
.badge-threads   { background: rgba(255,255,255,0.05); color: var(--white-dim); border: 1px solid rgba(255,255,255,0.08); }

/* ======== API STATUS ======== */
.api-status-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); gap: 10px; }

.api-status-item {
  background: var(--black-mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.76rem; color: var(--white-dim); font-weight: 300;
}

.api-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.api-dot.ok      { background: var(--success); box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.api-dot.demo    { background: var(--warning); }
.api-dot.offline { background: var(--danger); }

/* ======== BUTTONS ======== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.82rem;
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--black);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-light));
  color: var(--black);
  box-shadow: 0 4px 20px rgba(201,168,76,0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--white-dim);
}
.btn-outline:hover { background: var(--gold-faint); color: var(--white); border-color: var(--border2); }

.btn-danger {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(248,113,113,0.15); }

.btn-sm { padding: 5px 12px; font-size: 0.68rem; }
.btn-lg { padding: 13px 30px; font-size: 0.86rem; }
.btn-icon { padding: 8px; width: 34px; height: 34px; letter-spacing: 0; text-transform: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ======== FORMS ======== */
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

label {
  font-family: var(--font-body);
  font-size: 0.68rem; font-weight: 500;
  color: var(--white-faint);
  letter-spacing: 0.12em; text-transform: uppercase;
}

input, textarea, select {
  background: var(--black-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 300;
  padding: 10px 14px; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-faint2);
}

input::placeholder, textarea::placeholder { color: rgba(248,246,240,0.2); }
select option { background: var(--black-card); color: var(--white); }
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.68rem; color: var(--white-faint); font-weight: 300; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }

.checkbox-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--black-mid);
  font-family: var(--font-body); font-size: 0.76rem; font-weight: 300;
  cursor: pointer; transition: all var(--transition); user-select: none;
  color: var(--white-dim);
}

.checkbox-chip input[type=checkbox] { width: auto; accent-color: var(--gold); }
.checkbox-chip:has(input:checked) { background: var(--gold-faint2); border-color: var(--border2); color: var(--gold); }

/* ======== FILE UPLOAD ======== */
.upload-area {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--black-mid);
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--gold); background: var(--gold-faint);
}

.upload-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.4; }
.upload-text { font-size: 0.82rem; color: var(--white-dim); font-weight: 300; }
.upload-hint { font-size: 0.68rem; color: var(--white-faint); margin-top: 4px; }
.upload-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 10px; }

/* ======== MODALS ======== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(8px);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--black-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8);
  animation: modalIn 0.22s ease; position: relative;
}

.modal::before {
  content: ''; position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

@keyframes modalIn {
  from { opacity:0; transform:scale(0.96) translateY(10px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.1rem; font-weight: 700; color: var(--gold);
}

.modal-close {
  background: none; border: none; color: var(--white-faint);
  font-size: 1.2rem; cursor: pointer; padding: 4px;
  border-radius: 4px; transition: color var(--transition); line-height: 1;
}
.modal-close:hover { color: var(--white); }

.modal-body { padding: 22px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ======== TOASTS ======== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 320px; pointer-events: none; }

.toast {
  background: var(--black-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px;
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: var(--shadow); animation: toastIn 0.25s ease;
  pointer-events: auto; position: relative; overflow: hidden;
}

@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
.toast.fade-out { animation: toastOut 0.25s ease forwards; }
@keyframes toastOut { to { opacity:0; transform:translateX(20px); } }

.toast::before { content:''; position:absolute; left:0; top:0; bottom:0; width:2px; }
.toast.success::before { background: var(--success); }
.toast.error::before   { background: var(--danger); }
.toast.warning::before { background: var(--warning); }
.toast.info::before    { background: var(--gold); }

.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-title { font-size: 0.82rem; font-weight: 500; color: var(--white); }
.toast-msg   { font-size: 0.74rem; color: var(--white-dim); margin-top: 2px; font-weight: 300; }

/* ======== CALENDAR ======== */
.calendar-header-row { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; margin-bottom: 1px; }

.cal-day-name {
  text-align: center; font-size: 0.64rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--white-faint); padding: 8px 4px;
  font-family: var(--font-body);
}

.calendar-grid {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 1px; background: var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.cal-cell { background: var(--black); min-height: 88px; padding: 7px; transition: background var(--transition); cursor: pointer; }
.cal-cell:hover { background: var(--black-mid); }
.cal-cell.today { background: var(--gold-faint); }
.cal-cell.other-month { opacity: 0.3; }

.cal-date {
  font-family: var(--font-body);
  font-size: 0.74rem; font-weight: 400;
  color: var(--white-dim); margin-bottom: 4px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

.cal-cell.today .cal-date { background: var(--gold); color: var(--black); font-weight: 600; }

.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }
.cal-dot.ig     { background: #e1306c; }
.cal-dot.fb     { background: #1877f2; }
.cal-dot.tiktok { background: var(--white-dim); }
.cal-dot.yt     { background: #ff0000; }
.cal-dot.threads{ background: #888; }

.cal-post-chip {
  font-family: var(--font-body); font-size: 0.58rem; font-weight: 400;
  background: var(--gold-faint2); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 4px; color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; margin-top: 2px; display: block;
}

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.cal-month { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; color: var(--gold); }

/* ======== POST LIST ======== */
.post-list { display: flex; flex-direction: column; gap: 10px; }

.post-item {
  background: var(--black-mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color var(--transition);
}

.post-item:hover { border-color: var(--border2); }

.post-thumb {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  object-fit: cover; border: 1px solid var(--border); flex-shrink: 0;
  background: var(--black-card);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.post-info { flex: 1; min-width: 0; }
.post-title { font-size: 0.84rem; font-weight: 500; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta  { font-size: 0.7rem; color: var(--white-faint); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; font-weight: 300; }
.post-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ======== EMAIL EDITOR ======== */
.email-editor { background: var(--black-mid); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

.email-toolbar { background: var(--black-card); padding: 8px 10px; border-bottom: 1px solid var(--border); display: flex; gap: 3px; flex-wrap: wrap; }

.email-toolbar button { background: none; border: none; color: var(--white-dim); padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-family: var(--font-body); transition: all var(--transition); }
.email-toolbar button:hover { background: var(--black-high); color: var(--white); }

.email-body { min-height: 260px; padding: 16px; outline: none; font-size: 0.85rem; color: var(--white); font-family: var(--font-body); font-weight: 300; line-height: 1.7; }

/* ======== ANALYTICS ======== */
.analytics-section { margin-bottom: 32px; }

.analytics-platform-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.platform-logo { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.platform-logo.ig     { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.platform-logo.fb     { background: #1877f2; }
.platform-logo.tiktok { background: #000; border: 1px solid var(--border); }
.platform-logo.yt     { background: #ff0000; }
.platform-logo.threads{ background: #000; border: 1px solid var(--border); }
.platform-logo.ga4    { background: #f9ab00; }
.platform-logo.gads   { background: #4285f4; }

.platform-title { font-family: var(--font-title); font-size: 1.05rem; font-weight: 700; color: var(--white); }

.demo-label { font-family: var(--font-body); font-size: 0.6rem; letter-spacing: 0.16em; background: rgba(251,191,36,0.1); color: var(--warning); border: 1px solid rgba(251,191,36,0.2); border-radius: 20px; padding: 2px 8px; text-transform: uppercase; }

/* ======== SETTINGS ======== */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.api-item { background: var(--black-mid); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: border-color var(--transition); }
.api-item:hover { border-color: var(--border2); }

.api-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.api-name { font-family: var(--font-title); font-size: 0.9rem; font-weight: 700; color: var(--white); }

.how-to-btn { font-family: var(--font-body); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em; color: var(--gold); background: var(--gold-faint); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; cursor: pointer; transition: all var(--transition); text-transform: uppercase; }
.how-to-btn:hover { background: var(--gold-faint2); border-color: var(--border2); }

/* ======== TABLES ======== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.81rem; }
th { text-align: left; padding: 10px 14px; font-family: var(--font-body); font-size: 0.63rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--white-faint); border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid rgba(201,168,76,0.05); color: var(--white); vertical-align: middle; font-weight: 300; }
tr:hover td { background: var(--gold-faint); }

/* ======== CHART ======== */
.chart-wrap { position: relative; width: 100%; height: 220px; }
canvas { max-width: 100%; }

/* ======== MISC ======== */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--white-faint); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state-text { font-size: 0.82rem; line-height: 1.7; font-weight: 300; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 150; }
.gold-text { color: var(--gold); }
.text-muted { color: var(--white-faint); }
.text-sm { font-size: 0.78rem; }
.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:20px}
.mb-1{margin-bottom:6px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:20px}
.flex{display:flex}.flex-center{display:flex;align-items:center}
.gap-1{gap:6px}.gap-2{gap:12px}.between{justify-content:space-between}

/* ======== LOGIN ======== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--black); padding: 24px; position: relative; overflow: hidden;
}

.login-page::before {
  content: ''; position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.07) 0%, transparent 65%);
  top: -200px; right: -200px; pointer-events: none;
}

.login-card {
  background: var(--black-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 44px 40px;
  width: 100%; max-width: 420px;
  position: relative; box-shadow: 0 40px 100px rgba(0,0,0,0.7);
}

.login-card::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { height: 60px; object-fit: contain; filter: drop-shadow(0 0 20px rgba(201,168,76,0.35)); }

.login-title {
  font-family: var(--font-title);
  font-size: 1.8rem; font-weight: 900;
  color: var(--gold); text-align: center;
  margin-bottom: 4px; letter-spacing: -0.01em;
}

.login-subtitle { font-family: var(--font-body); font-size: 0.72rem; color: var(--white-faint); text-align: center; margin-bottom: 28px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 300; }
.login-card .btn-primary { width: 100%; margin-top: 8px; }
.login-footer { margin-top: 20px; text-align: center; font-size: 0.7rem; color: var(--white-faint); font-weight: 300; }

/* ======== RESPONSIVE ======== */
@media (max-width: 1024px) { .grid-2 { grid-template-columns: 1fr; } .settings-grid { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,0.7); }
  .sidebar-overlay.open { display: block; }
  .topbar { left: 0; }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .hamburger { display: flex; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .topbar-clock { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .main-content { padding: 16px 12px; }
  .login-card { padding: 28px 20px; }
  .cal-cell { min-height: 60px; }
  .modal { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}