/* ============================================================
   SALONIQA — Admin Dashboard Styles
   ============================================================ */

.admin-body {
  background: var(--bg);
  cursor: auto;
  min-height: 100vh;
}

.admin-body .custom-cursor { display: none; }

/* ── Auth Screen ───────────────────────── */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ink) 0%, #2a2a2a 100%);
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  margin: 24px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}

.auth-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 4px;
}

.auth-card p {
  color: #888;
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-error {
  display: none;
  background: #f8d7da;
  color: #721c24;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-error.visible { display: block; }

.auth-card .form-group {
  text-align: left;
  margin-bottom: 16px;
}

.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.auth-card input[type="password"],
.auth-card input[type="email"],
.auth-card input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.auth-card input:focus {
  border-color: var(--gold);
}

/* ── Admin Layout ──────────────────────── */
.admin-navbar {
  background: #fff !important;
  border-bottom: 1px solid var(--line) !important;
}

.admin-navbar .logo {
  font-size: 18px !important;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.admin-section {
  margin-bottom: 28px;
}

.admin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 22px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── Stats ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Playfair Display', Georgia, serif;
}

/* ── Tabs ──────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}

.admin-tab {
  padding: 12px 24px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.admin-tab:hover { color: #555; }

.admin-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Admin Forms ───────────────────────── */
.admin-form {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

.form-row .form-group { margin-bottom: 0; }

.admin-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.admin-form input,
.admin-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.admin-form input:focus,
.admin-form select:focus { border-color: var(--gold); }

.admin-form .btn { margin-top: 8px; }

/* ── Data Table ────────────────────────── */
.data-table-wrapper {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  font-weight: 600;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover { background: #fafafa; }

.tx-amount { font-weight: 600; color: var(--emerald-mid); }
.emp-commission { color: #888; }

.text-muted { color: #999; }

/* ── Buttons ───────────────────────────── */
.admin-form .btn-primary {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
}

.admin-form .btn-primary:hover { background: var(--gold-dark); }

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-outline-dark {
  background: transparent;
  border: 1px solid #ccc;
  color: #555;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-outline-dark:hover {
  border-color: #999;
  background: var(--bg);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-danger:hover { background: #c82333; }

/* ── Feedback ──────────────────────────── */
.feedback {
  display: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.feedback.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.feedback.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ── Empty State ───────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  color: #555;
  margin-bottom: 8px;
}

.empty-state p { font-size: 14px; }

/* ── Loading ───────────────────────────── */
.loading-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 40px 0;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: bounce 0.8s ease-in-out infinite alternate;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  from { transform: translateY(0); opacity: 0.4; }
  to { transform: translateY(-8px); opacity: 1; }
}

/* ── Hidden ────────────────────────────── */
.hidden { display: none !important; }

/* ── Field Error ───────────────────────── */
.field-error {
  display: none;
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.field-error.visible { display: block; }

/* ── Admin Badge ───────────────────────── */
.admin-badge {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 8px;
}

/* ── Responsive ────────────────────────── */
@media (max-width: 992px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-main { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .admin-tab { padding: 10px 16px; font-size: 13px; }
  .admin-title { font-size: 18px; }
  .data-table { font-size: 13px; }
  .data-table th,
  .data-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-tabs { gap: 0; }
  .admin-tab { flex: 1; text-align: center; padding: 10px 8px; font-size: 12px; }
}

/* ============================================================
   SALONIQA V2 — Growth Platform theme + modules
   Emerald primary · Luxury gold accent · Ivory surface
   ============================================================ */

.admin-body { background: var(--ivory, #F8F5EF); }

/* Emerald as primary brand accent */
.admin-navbar .logo { color: var(--emerald, var(--emerald)) !important; }
.admin-tab.active { color: var(--emerald, var(--emerald)); border-bottom-color: var(--emerald, var(--emerald)); }
.admin-form input:focus,
.admin-form select:focus { border-color: var(--emerald, var(--emerald)); }
.admin-form .btn-primary { background: var(--emerald, var(--emerald)); }
.admin-form .btn-primary:hover { background: var(--emerald-light, #14685b); }
.admin-badge { background: var(--emerald, var(--emerald)); }
.loading-dots span { background: var(--emerald, var(--emerald)); }

/* ── Section sub-title ─────────────────────── */
.section-subtitle {
  font-size: 13px;
  color: var(--gray-400, #888);
  margin: -12px 0 18px;
  font-family: 'Inter', sans-serif;
}

/* ── Revenue Opportunities ─────────────────── */
.opps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.opp-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(7,47,42,0.08);
  border-left: 4px solid var(--emerald, var(--emerald));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.opp-card.gold   { border-left-color: var(--luxury-gold, var(--gold)); }
.opp-card.danger { border-left-color: #c0392b; }

.opp-card .opp-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-400, #888);
}
.opp-card .opp-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--deep-green, var(--emerald-deep));
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.1;
}
.opp-card .opp-sub { font-size: 12px; color: var(--gray-500, #777); }
.opp-card .opp-icon { font-size: 20px; }

/* ── Value level badges (client value) ─────── */
.value-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.value-badge.vip     { background: var(--luxury-gold, var(--gold)); color: #4a3c0a; }
.value-badge.regular { background: #d8ece6; color: var(--emerald, var(--emerald)); }
.value-badge.new     { background: #e3f0fb; color: #1d5d92; }
.value-badge.risk    { background: #fbe3e3; color: #9b2c2c; }

/* ── Ranking ───────────────────────────────── */
.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ivory, #F8F5EF);
  font-weight: 700;
  font-size: 13px;
  color: var(--deep-green, var(--emerald-deep));
}
.rank-num.top1 { background: var(--luxury-gold, var(--gold)); color: #4a3c0a; }
.rank-num.top2 { background: #d8ece6; color: var(--emerald,var(--emerald)); }
.rank-num.top3 { background: #e9e2cf; color: #7a6420; }

.rank-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.rank-toggle {
  padding: 8px 16px;
  border: 1px solid var(--gray-200, #ddd);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray-700, #555);
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.rank-toggle.active {
  background: var(--emerald, var(--emerald));
  border-color: var(--emerald, var(--emerald));
  color: #fff;
}

/* ── Profit dashboard ──────────────────────── */
.profit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.profit-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(7,47,42,0.08);
}
.profit-card .opp-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-400,#888); }
.profit-card .opp-value { font-size: 26px; font-weight: 700; font-family: 'Playfair Display', Georgia, serif; }
.profit-card.revenue    .opp-value { color: var(--emerald, var(--emerald)); }
.profit-card.commission .opp-value { color: var(--luxury-gold, var(--gold)); }
.profit-card.expenses   .opp-value { color: #c0392b; }
.profit-card.profit     { background: var(--emerald, var(--emerald)); }
.profit-card.profit .opp-label { color: rgba(255,255,255,0.7); }
.profit-card.profit .opp-value { color: #fff; }

.profit-period {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* ── Mini bar (ranking visual) ─────────────── */
.mini-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--emerald, var(--emerald));
  min-width: 2px;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 992px) {
  .opps-grid   { grid-template-columns: repeat(2, 1fr); }
  .profit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .opps-grid   { grid-template-columns: 1fr; }
  .profit-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Reports tab (charts) ───────────────────── */
.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.report-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.report-card h3 {
  font-size: 15px;
  margin-bottom: 14px;
}
.report-hint { font-size: 12px; color: #999; font-weight: 400; }
.report-wide { grid-column: 1 / -1; }
.report-body { position: relative; height: 260px; }
.report-body .report-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #999; font-size: 14px; text-align: center;
}
@media (max-width: 768px) {
  .reports-grid { grid-template-columns: 1fr; }
  .report-body { height: 220px; }
}

/* ── Phase 10: SALONIQA AI Assistant ── */
.ai-card{ background:linear-gradient(135deg,#0D4F45 0%, #072F2A 100%); border-radius:16px; padding:22px; color:#fff; box-shadow:0 12px 30px rgba(0,0,0,.12); }
.ai-head{ display:flex; flex-direction:column; gap:4px; margin-bottom:14px; }
.ai-title{ font-family:'Playfair Display',Georgia,serif; font-size:20px; font-weight:700; display:flex; align-items:center; gap:8px; }
.ai-spark{ color:#D4AF37; }
.ai-disclaimer{ font-size:12px; color:rgba(255,255,255,.7); margin:0; }
.ai-log{ background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); border-radius:12px; padding:14px; max-height:340px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.ai-msg{ font-size:14px; line-height:1.55; white-space:pre-line; padding:10px 14px; border-radius:12px; max-width:90%; }
.ai-bot{ background:rgba(255,255,255,.1); align-self:flex-start; border-bottom-left-radius:3px; }
.ai-user{ background:#D4AF37; color:#1A1A1A; align-self:flex-end; border-bottom-right-radius:3px; font-weight:600; }
.ai-quick{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.ai-chip{ background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.22); color:#fff; border-radius:999px; padding:8px 14px; font-size:13px; font-family:inherit; cursor:pointer; transition:.18s; }
.ai-chip:hover{ background:#D4AF37; color:#1A1A1A; border-color:#D4AF37; }
.ai-form{ display:flex; gap:8px; }
.ai-form input{ flex:1; min-width:0; padding:11px 14px; border-radius:10px; border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.96); color:#1A1A1A; font-size:14px; font-family:inherit; outline:none; }
.ai-form input:focus{ border-color:#D4AF37; }
.ai-send{ background:#D4AF37; color:#1A1A1A; border:0; border-radius:10px; padding:11px 20px; font-weight:700; font-size:14px; cursor:pointer; font-family:inherit; transition:.18s; }
.ai-send:hover{ background:#c39e2f; }
@media(max-width:560px){ .ai-card{ padding:16px; } .ai-msg{ max-width:100%; } .ai-form{ flex-direction:column; } .ai-send{ width:100%; } }