/* admin/admin.css - Modern Clean Dashboard for SA Admin Hub */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.08);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
}

/* Login Modal / Container */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: radial-gradient(circle at top right, #e0e7ff, #f8fafc);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.logo-badge {
  background: var(--primary);
  color: white;
  font-weight: 800;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #059669;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-page);
  border-color: #cbd5e1;
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.btn-danger:hover {
  background: #fecaca;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* Dashboard Layout */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-page);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Nav Tabs */
.tabs-nav {
  max-width: 1300px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.badge-count {
  background: var(--danger);
  color: white;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
}

/* Dashboard Body */
.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-box-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.stat-box-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Section Header */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Contact Cards & Table */
.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inbox-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.inbox-card.new {
  border-left: 4px solid var(--primary);
  background: #fafbff;
}

.inbox-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.customer-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.inbox-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-pill-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-page);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.contact-pill:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.inbox-service {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: #1d4ed8;
  margin-bottom: 0.75rem;
}

.inbox-message {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
  background: var(--bg-page);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.inbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* Status Select */
.status-select {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
}

.status-select.new { color: #1e40af; background: #eff6ff; }
.status-select.contacted { color: #854d0e; background: #fefce8; }
.status-select.closed { color: #065f46; background: #ecfdf5; }

/* CMS Form Styles */
.cms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.cms-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.cms-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
  .header-container { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .tabs-nav { overflow-x: auto; white-space: nowrap; }
}
