/* ===== NoteVpro ABA — Admin Dashboard Styles ===== */

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #059669;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --sidebar-width: 260px;
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== Login Screen ===== */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
}

.login-logo { font-size: 56px; margin-bottom: 12px; }
.login-title { font-size: 28px; font-weight: 800; margin-bottom: 4px; color: #fff; }
.login-subtitle { font-size: 14px; color: #94a3b8; margin-bottom: 40px; }

.login-section { width: 100%; max-width: 360px; }

.btn-google {
  width: 100%;
  padding: 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-google:hover { background: #f8fafc; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.status-msg {
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 16px;
  display: none;
  text-align: left;
}
.status-msg.error { display: block; background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.status-msg.success { display: block; background: #052e16; color: #86efac; border: 1px solid #166534; }
.status-msg.info { display: block; background: #0c1929; color: #93c5fd; border: 1px solid #1e40af; }

.disclaimer { font-size: 11px; color: #64748b; margin-top: 32px; line-height: 1.6; max-width: 360px; }

/* ===== App Layout ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 20;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1e293b;
}
.sidebar-logo { font-size: 28px; }
.sidebar-title { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-subtitle { font-size: 11px; color: #64748b; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
  position: relative;
}
.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { font-size: 16px; width: 24px; text-align: center; }

.nav-badge {
  position: absolute;
  right: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.user-email { font-size: 11px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

.sidebar-actions {
  display: flex;
  gap: 8px;
}

.btn-lang {
  padding: 6px 12px;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-lang:hover { background: #1e293b; color: #fff; }

.btn-logout {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #7f1d1d;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-logout:hover { background: #450a0a; }

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px 32px;
  max-width: 1200px;
}

.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-header h1 { font-size: 24px; font-weight: 700; }

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-refresh {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-refresh:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }

.select-filter {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

/* ===== Metrics Grid ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-icon { font-size: 24px; margin-bottom: 4px; }
.metric-value { font-size: 32px; font-weight: 800; color: var(--text); }
.metric-label { font-size: 13px; color: var(--text-muted); }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}
.card-header .icon { font-size: 16px; }
.card-body { padding: 16px 18px; }

/* ===== Data Tables ===== */
.table-container { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table thead { background: #f8fafc; }

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-light); color: #166534; }
.badge-warning { background: var(--warning-light); color: #854d0e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #075985; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ===== Action Buttons ===== */
.btn-action {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-action:hover { background: var(--bg); }
.btn-action.approve { border-color: var(--success); color: var(--success); }
.btn-action.approve:hover { background: var(--success-light); }
.btn-action.suspend { border-color: var(--danger); color: var(--danger); }
.btn-action.suspend:hover { background: var(--danger-light); }
.btn-action.promote { border-color: var(--primary); color: var(--primary); }
.btn-action.promote:hover { background: var(--primary-light); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Alerts List ===== */
.alerts-list { display: flex; flex-direction: column; gap: 8px; }

.alert-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.alert-item:hover { box-shadow: var(--shadow-md); }

.alert-item.severity-danger { border-left: 4px solid var(--danger); }
.alert-item.severity-warning { border-left: 4px solid var(--warning); }
.alert-item.severity-info { border-left: 4px solid var(--info); }

.alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.alert-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.alert-meta { display: flex; gap: 12px; align-items: center; }
.alert-time { font-size: 11px; color: var(--text-light); }

.alert-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== Invite Form ===== */
.invite-form { display: flex; flex-direction: column; gap: 16px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
}
.input-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.input-field::placeholder { color: var(--text-light); }

.invite-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--success-light);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
}

.invite-code-display {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #166534;
  letter-spacing: 1px;
}

.btn-copy {
  padding: 8px 16px;
  border: 1px solid #166534;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #166534;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-copy:hover { background: #166534; color: #fff; }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}
.pagination button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.pagination button:hover { background: var(--bg); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.modal-footer .btn-cancel {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--info); color: #fff; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 12px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Spinner ===== */
.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }
