/* =============================================
   VARIABLES & RESET
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f0f2f8;
  --border: #e2e6f0;
  --text: #1a1d2e;
  --text-muted: #7b82a0;
  --primary: #4f6ef7;
  --primary-light: #eef1ff;
  --primary-dark: #3a56d4;
  --accent: #ff6b6b;
  --accent-light: #fff0f0;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --worker1: #7c3aed;
  --worker1-light: #f5f3ff;
  --worker2: #0891b2;
  --worker2-light: #ecfeff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(79,110,247,.08), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(79,110,247,.12), 0 2px 8px rgba(0,0,0,.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --transition: 0.2s ease;
  --font: 'Sora', sans-serif;
  --mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =============================================
   LOGIN
   ============================================= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8ecff 0%, #f4f6fb 50%, #fce8f3 100%);
  padding: 20px;
  position: relative;
}
.login-screen::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(79,110,247,.12) 0%, transparent 70%);
  top: -100px; left: -100px;
  border-radius: 50%;
}
.login-screen::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,107,107,.1) 0%, transparent 70%);
  bottom: -80px; right: -80px;
  border-radius: 50%;
}
.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: slideUp 0.4s ease;
}
.login-logo {
  width: 72px; height: 72px;
  background: var(--primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(79,110,247,.35);
  overflow: hidden;
  transition: background 0.3s;
}
.login-logo.has-img { background: transparent; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.login-card h1 {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 26px;
}
.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
.input-group i { color: var(--text-muted); font-size: .9rem; }
.input-group input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text);
  flex: 1;
  width: 100%;
}
.input-group input::placeholder { color: var(--text-muted); }
.login-error {
  color: var(--accent);
  font-size: .8rem;
  min-height: 20px;
  margin-bottom: 4px;
  text-align: center;
}
.login-hint {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.login-hint span {
  font-size: .72rem;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 20px;
  flex: 1;
  text-align: center;
}

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
.dashboard { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1.5px solid var(--border);
  gap: 8px;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: .82rem;
  color: var(--primary);
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.sidebar-logo span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  letter-spacing: -.2px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  min-width: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  box-shadow: 0 4px 12px rgba(79,110,247,.3);
  overflow: hidden;
  transition: background 0.3s;
}
.sidebar-logo-icon.has-img { background: transparent; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.sidebar-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px;
  flex-shrink: 0;
}
.sidebar-nav {
  list-style: none;
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav li { margin-bottom: 3px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-link i { width: 18px; text-align: center; font-size: .95rem; }
.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,110,247,.3);
}
.sidebar-user {
  padding: 14px;
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 38px; height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
  border: 2px solid var(--border);
}
.user-info { flex: 1; overflow: hidden; }
.user-info p { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 6px;
  border-radius: 8px;
  transition: all var(--transition);
}
.logout-btn:hover { background: var(--accent-light); color: var(--accent); }
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* MAIN */
.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
  padding: 6px;
  border-radius: 8px;
  transition: background var(--transition);
}
.menu-btn:hover { background: var(--surface2); }
.topbar-title { font-weight: 700; font-size: 1rem; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  overflow: hidden;
  border: 2px solid var(--border);
}
.topbar-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* SECTIONS */
.section { display: none; padding: 24px 20px; flex: 1; animation: fadeIn 0.3s ease; }
.section.active { display: block; }
.section-header { margin-bottom: 22px; }
.section-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.section-header p { color: var(--text-muted); font-size: .85rem; }

/* =============================================
   CARDS (INGRESOS)
   ============================================= */
.cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-icon {
  width: 42px; height: 42px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.card-body { flex: 1; min-width: 0; }
.card-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.card-value { font-size: 1.3rem; font-weight: 700; font-family: var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .8rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.edit-btn:hover { background: var(--primary-light); color: var(--primary); }

/* CHART */
.chart-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1.5px solid var(--border); }
.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-header h3 { font-size: .95rem; font-weight: 600; margin-bottom: 2px; }
.chart-subtitle { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.chart-legend { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); opacity: .7; flex-shrink: 0; }
.chart-wrap { position: relative; height: 220px; }

/* =============================================
   TAREAS
   ============================================= */
.task-toolbar { margin-bottom: 16px; }
.input-row { display: flex; gap: 10px; }
.input-row input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.12); }
.task-stats { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.done-badge { background: var(--success-light); color: var(--success); padding: 3px 10px; border-radius: 20px; }
.task-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  animation: slideIn 0.25s ease;
}
.task-item:hover { box-shadow: var(--shadow); }
.task-item.done { background: var(--success-light); border-color: #bbf7d0; }
.task-item.done .task-text { text-decoration: line-through; color: var(--text-muted); }
.task-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  font-size: .75rem;
  color: transparent;
  background: var(--surface);
}
.task-item.done .task-checkbox { background: var(--success); border-color: var(--success); color: #fff; }
.task-text { flex: 1; font-size: .875rem; font-weight: 500; }
.task-status { font-size: .7rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.task-item:not(.done) .task-status { background: #fff3e0; color: #f59e0b; }
.task-item.done .task-status { background: #dcfce7; color: var(--success); }
.task-delete { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .8rem; padding: 4px; border-radius: 6px; transition: all var(--transition); }
.task-delete:hover { background: var(--accent-light); color: var(--accent); }
.task-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: .875rem; background: var(--surface); border-radius: var(--radius-sm); border: 1.5px dashed var(--border); display: flex; align-items: center; justify-content: center; gap: 8px; }

/* =============================================
   TIKTOK
   ============================================= */
.tiktok-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tiktok-column { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tiktok-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }

/* Worker badge with optional photo */
.worker-badge {
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.worker-badge-photo {
  width: 26px; height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.worker1 { background: var(--worker1-light); color: var(--worker1); }
.worker2 { background: var(--worker2-light); color: var(--worker2); }
.worker1-bg { background: var(--worker1-light); color: var(--worker1); }
.worker2-bg { background: var(--worker2-light); color: var(--worker2); }

.account-count { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.add-account-row { display: flex; gap: 8px; margin-bottom: 12px; }
.add-account-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: .82rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
}
.add-account-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.1); }
.account-list { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.account-list::-webkit-scrollbar { width: 4px; }
.account-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.account-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; background: var(--surface2); border-radius: var(--radius-xs); border: 1px solid var(--border); transition: all var(--transition); animation: slideIn 0.2s ease; }
.account-item:hover { border-color: var(--primary); }
.account-item i.fa-tiktok { color: var(--text-muted); font-size: .85rem; flex-shrink: 0; }
.account-name { flex: 1; font-size: .82rem; font-weight: 500; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-delete { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .75rem; padding: 3px 5px; border-radius: 5px; transition: all var(--transition); flex-shrink: 0; }
.account-delete:hover { background: var(--accent-light); color: var(--accent); }
.account-empty { text-align: center; padding: 24px 10px; color: var(--text-muted); font-size: .8rem; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--border); border-radius: var(--radius-xs); }

/* =============================================
   AJUSTES (SETTINGS)
   ============================================= */
.settings-group { margin-bottom: 24px; }
.settings-group-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-card { background: var(--surface); border-radius: var(--radius); border: 1.5px solid var(--border); padding: 20px; box-shadow: var(--shadow-sm); }
.settings-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.settings-row:last-child { margin-bottom: 0; }
.settings-field { flex: 1; min-width: 160px; }
.settings-field label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 6px; }
.settings-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.settings-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.1); }
.field-hint { font-size: .75rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.btn-sm { padding: 8px 16px !important; font-size: .78rem !important; white-space: nowrap; flex-shrink: 0; }

/* Upload button */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.upload-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Logo preview */
.logo-preview-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.logo-preview-wrap img { height: 48px; max-width: 160px; object-fit: contain; border-radius: 6px; }
.remove-img-btn {
  width: 26px; height: 26px;
  background: var(--accent-light);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--accent);
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.remove-img-btn:hover { background: var(--accent); color: #fff; }

/* Profile edit row */
.profile-edit-row { display: flex; align-items: flex-start; gap: 18px; }
.profile-photo-big {
  width: 76px; height: 76px;
  min-width: 76px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  overflow: hidden;
  position: relative;
  border: 3px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
}
.profile-photo-big:hover { border-color: var(--primary); }
.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  cursor: pointer;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
}
.profile-photo-big:hover .photo-overlay { opacity: 1; }
.profile-edit-info { flex: 1; min-width: 0; }
.profile-edit-name { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.profile-edit-role { font-size: .78rem; color: var(--text-muted); margin-bottom: 10px; }
.profile-edit-info input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.profile-edit-info input:focus { border-color: var(--primary); }
.remove-img-btn-inline {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .75rem;
  font-family: var(--font);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  transition: color var(--transition);
  margin-top: 8px;
}
.remove-img-btn-inline:hover { color: var(--accent); }

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(79,110,247,.3);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,110,247,.4); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-accent:hover { background: var(--primary-dark); }

/* =============================================
   MODALES
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1.5px solid var(--border); }
.modal-header h3 { font-size: .95rem; font-weight: 700; }
.modal-header button { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1rem; padding: 4px; border-radius: 6px; transition: background var(--transition); }
.modal-header button:hover { background: var(--surface2); }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.modal-body label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.modal-body input {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  color: var(--text);
  outline: none;
  background: var(--surface2);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.modal-body input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.12); background: var(--surface); }
.modal-hint { font-size: .8rem; color: var(--text-muted); padding: 8px 12px; background: var(--primary-light); border-radius: var(--radius-xs); line-height: 1.5; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1.5px solid var(--border); background: var(--surface2); }

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1d2e;
  color: #fff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: .82rem;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =============================================
   UTILITIES
   ============================================= */
.hidden { display: none !important; }
.admin-only { display: none; }
body.is-admin .admin-only { display: flex; }
body.is-admin li.admin-only { display: list-item; }
body.is-admin .admin-only.btn-primary { display: inline-flex; }
body.is-admin .admin-only.edit-btn { display: inline-flex; }
body.is-admin .task-delete { display: flex; }
body.is-admin .account-delete { display: flex; }
.account-delete { display: none; }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-close { display: flex; }
  .overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .menu-btn { display: flex; }
  .cards-row { grid-template-columns: 1fr; }
  .tiktok-grid { grid-template-columns: 1fr; }
  .section { padding: 18px 14px; }
  .card-value { font-size: 1.1rem; }
  .chart-wrap { height: 180px; }
  .profile-edit-row { flex-direction: column; align-items: center; text-align: center; }
  .settings-row { flex-direction: column; align-items: stretch; }
  .topbar-badge { display: none; }
}
@media (max-width: 380px) {
  .login-card { padding: 28px 20px; }
}
