/* ════════════════════════════════════════════════════════
   LEORA FRENCH WHITE — Admin Dashboard Styles
   Premium Emerald Green Skincare Theme
   ════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ─────────────────────────────────── */
:root {
  --primary: #10b981;
  --primary-light: #34d399;
  --primary-dark: #059669;
  
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --danger: #ef4444;

  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --bg-login: #020617;
  
  --glass: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.08);

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --sidebar-w: 240px;
  --topbar-h: 68px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

body {
  background: radial-gradient(ellipse at 10% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 90% 80%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
              var(--bg);
}

/* ─── Login Screen ─────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-login);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  padding: 40px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}

.login-brand {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
}

.login-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.login-field {
  margin-bottom: 20px;
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.login-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition);
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-dark);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background var(--transition);
}

.login-btn:hover { background: var(--primary); }
.login-btn:disabled { opacity: 0.7; cursor: wait; }

.login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-bottom: 16px;
  background: rgba(239, 68, 68, 0.1);
  padding: 8px;
  border-radius: 6px;
}

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }

/* ─── App Layout ─────────────────────────────────────── */
.app-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background: var(--bg2);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

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

.brand-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(16,185,129,0.5));
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-light);
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

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

.nav-item.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
}

.nav-icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.nav-badge {
  background: var(--primary-dark);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.nav-badge.urgent {
  background: var(--accent);
  color: #000;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sidebar-footer {
  border-top: 1px solid var(--glass-border);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background var(--transition);
}

.status-dot.ready { background: var(--primary); box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.status-dot.connecting { background: var(--accent); animation: pulse 1s infinite; }
.status-dot.disconnected { background: var(--danger); }

.status-label { font-size: 12px; color: var(--text-muted); }

.logout-btn {
  width: 100%;
  padding: 14px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: none;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.logout-btn:hover { background: rgba(239, 68, 68, 0.2); }

/* ─── Main Content ──────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ─── Topbar ────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.page-title { font-size: 18px; font-weight: 700; color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 20px; }

.topbar-brand {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  padding-right: 16px;
  border-right: 1px solid var(--glass-border);
}

.topbar-time {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.topbar-connection {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.conn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.conn-dot.ready { background: var(--primary); box-shadow: 0 0 6px rgba(16,185,129,0.5); }

/* ─── Tab Content ──────────────────────────────────── */
.tab-content { display: none; padding: 28px; }
.tab-content.active { display: block; }

/* ─── Cards ─────────────────────────────────────────── */
.card {
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 24px;
}

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

.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

/* ─── Stat Cards ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

/* Shades of Green for LEORA theme */
.stat-card.green   { background: rgba(16,185,129,0.05); border-color: rgba(16,185,129,0.2); }
.stat-card.teal    { background: rgba(20,184,166,0.05); border-color: rgba(20,184,166,0.2); }
.stat-card.emerald { background: rgba(5,150,105,0.05); border-color: rgba(5,150,105,0.2); }
.stat-card.mint    { background: rgba(52,211,153,0.05); border-color: rgba(52,211,153,0.2); }
.stat-card.sage    { background: rgba(101,163,13,0.05); border-color: rgba(101,163,13,0.2); }
.stat-card.forest  { background: rgba(4,120,87,0.05); border-color: rgba(4,120,87,0.2); }

.stat-icon { font-size: 28px; }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

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

.stat-sparkle {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 14px;
  opacity: 0.3;
}

/* ─── QR Card ──────────────────────────────────────── */
.qr-wrapper {
  display: flex;
  justify-content: center;
  padding: 24px;
  background: white;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.qr-hint { text-align: center; font-size: 12px; color: var(--text-muted); }

/* ─── Badges ─────────────────────────────────────────── */
.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge-warning { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-success { background: rgba(16,185,129,0.2); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-danger  { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* ─── Buttons ────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary-dark);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary:hover { background: var(--primary); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-success {
  background: #059669;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-success:hover { background: #10b981; }

.btn-agent, .btn-return {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-agent { background: rgba(16, 185, 129, 0.2); color: var(--primary-light); border: 1px solid rgba(16, 185, 129, 0.3); }
.btn-agent:hover { background: rgba(16, 185, 129, 0.3); }

.btn-return { background: var(--primary-dark); color: white; }
.btn-return:hover { background: var(--primary); }

.btn-refresh {
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-refresh:hover { color: var(--text); border-color: var(--primary); }

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--glass);
  border: 1px dashed var(--glass-border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-upload:hover { border-color: var(--primary-light); color: var(--primary-light); }

.btn-danger-sm {
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* ─── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 24px; }

.form-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.label-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 14px 16px;
  resize: vertical;
  transition: border-color var(--transition);
}
.form-textarea:focus { outline: none; border-color: var(--primary); }
.form-textarea::placeholder { color: var(--text-dim); }

.upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.upload-sep { font-size: 12px; color: var(--text-dim); }

.input-footer { padding: 6px 4px; font-size: 11px; color: var(--text-muted); }

/* ─── Lists ──────────────────────────────────────────── */
.handoff-list, .followup-list, .conversations-list, .activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
}

.handoff-item, .followup-item, .convo-item, .activity-item {
  background: var(--bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color var(--transition);
}

.handoff-item:hover, .activity-item:hover { border-color: rgba(16, 185, 129, 0.3); }

.item-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.item-info { flex: 1; min-width: 0; }
.item-name { font-weight: 600; font-size: 14px; color: var(--text); }
.item-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.item-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

.item-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ─── Logs ───────────────────────────────────────────── */
.logs-controls { display: flex; align-items: center; gap: 14px; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.logs-container {
  background: var(--bg-login);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  height: 480px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  display: flex;
  gap: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1.5;
}
.log-entry.info { color: #bae6fd; }
.log-entry.success { color: var(--primary-light); background: rgba(16, 185, 129, 0.05); }
.log-entry.error { color: #fca5a5; background: rgba(239, 68, 68, 0.05); }
.log-entry.warning { color: #fde047; }
.log-time { color: var(--text-dim); white-space: nowrap; }
.log-message { color: inherit; word-break: break-word; }

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--glass-border);
}

/* ─── Modal ──────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.modal-title { font-size: 18px; font-weight: 600; color: var(--text); }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-customer { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.chat-history {
  background: var(--bg-login);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  border: 1px solid var(--glass-border);
}

.chat-msg {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.5;
}
.chat-msg.user { background: var(--bg3); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.assistant { background: rgba(16, 185, 129, 0.15); align-self: flex-end; border: 1px solid rgba(16, 185, 129, 0.3); border-bottom-right-radius: 4px; }
.chat-msg-role { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; font-weight: 600; }

.modal-actions { display: flex; gap: 12px; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .app-wrapper { flex-direction: column; }
  .sidebar {
    position: fixed;
    height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .topbar-brand { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { border-radius: 0; box-shadow: none; border-left: none; border-right: none; }
}
