/* ─── NexLog Admin Panel — Core Brand Styles ─────────────────── */
/* Design System: Dark premium theme with emerald/gold accents  */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap");

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
  --cream: #f6f2ea;
  --cream2: #ede8dd;
  --cream3: #e4ddd0;
  --ink: #0e1a10;
  --ink2: #1c2e1f;
  --ink3: #2d4030;
  --emerald: #006644;
  --emerald2: #008855;
  --emerald3: #00aa66;
  --gold: #c9933a;
  --gold2: #dba94e;
  --gold-light: #f3e4c0;
  --muted: #7a8a7c;
  --muted2: #5a6b5c;
  --border: rgba(14, 26, 16, 0.1);
  --border2: rgba(14, 26, 16, 0.06);
  --danger: #dc3545;
  --danger-hover: #c82333;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(0, 102, 68, 0.15);
  --transition: all 0.3s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family:
    "Outfit",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--ink);
  color: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}

a {
  color: var(--emerald3);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--gold);
}

/* ─── Layout ────────────────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  min-height: 100vh;
}

.navbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--ink2);
  border-bottom: 1px solid var(--ink3);
  height: 64px;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-brand img {
  height: 32px;
  width: auto;
}

.navbar-brand h1 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--cream);
}

.navbar-brand span {
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: "Outfit", sans-serif;
  font-weight: 500;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  grid-row: 2;
  background: var(--ink2);
  border-right: 1px solid var(--ink3);
  padding: 24px 0;
  overflow-y: auto;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--cream3);
  font-size: 0.9rem;
  font-weight: 400;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: var(--ink3);
  color: var(--cream);
  border-left-color: var(--emerald2);
}

.sidebar-nav a.active {
  background: rgba(0, 102, 68, 0.15);
  color: var(--emerald3);
  border-left-color: var(--emerald);
  font-weight: 500;
}

.sidebar-nav .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  opacity: 0.7;
}

.sidebar-nav a.active .nav-icon,
.sidebar-nav a:hover .nav-icon {
  opacity: 1;
}

/* ─── Main Content ──────────────────────────────────────────── */
.main-content {
  grid-row: 2;
  padding: 32px;
  overflow-y: auto;
  max-width: 1400px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h2 {
  margin-bottom: 4px;
}

.page-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--ink2);
  border: 1px solid var(--ink3);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--emerald), var(--emerald3));
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--emerald);
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.stat-card .stat-value {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── Tables ────────────────────────────────────────────────── */
.table-container {
  background: var(--ink2);
  border: 1px solid var(--ink3);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-container .table-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--ink3);
}

.table-container .table-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--ink);
  border-bottom: 1px solid var(--ink3);
  font-family: "Outfit", sans-serif;
}

table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--cream2);
  border-bottom: 1px solid var(--ink3);
}

table tbody tr {
  transition: var(--transition);
}

table tbody tr:hover {
  background: rgba(0, 170, 102, 0.06);
}

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

/* ─── Status Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-new {
  background: rgba(0, 170, 102, 0.15);
  color: var(--emerald3);
}
.badge-contacted {
  background: rgba(201, 147, 58, 0.15);
  color: var(--gold2);
}
.badge-qualified {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.badge-customer {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cream3);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--ink);
  border: 1px solid var(--ink3);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(0, 102, 68, 0.2);
}

.form-control::placeholder {
  color: var(--muted2);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

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

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Outfit", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--emerald);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--emerald2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--ink3);
  color: var(--cream);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--ink3);
  color: var(--cream3);
}

.btn-outline:hover {
  border-color: var(--emerald);
  color: var(--emerald3);
}

/* ─── Upload / File ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--ink3);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--emerald);
  background: rgba(0, 102, 68, 0.05);
}

.upload-zone .upload-icon {
  font-size: 2rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.upload-zone p {
  color: var(--muted);
  font-size: 0.85rem;
}

.upload-preview {
  margin-top: 12px;
}

.upload-preview img {
  max-height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink3);
}

/* ─── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ─── Loading ───────────────────────────────────────────────── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink3);
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: var(--ink3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted2);
}

/* ─── SweetAlert2 Custom Theme ──────────────────────────────── */
.swal2-popup {
  background: var(--ink2) !important;
  color: var(--cream) !important;
  border: 1px solid var(--ink3) !important;
  border-radius: var(--radius-lg) !important;
}

.swal2-title {
  font-family: "Playfair Display", serif !important;
  color: var(--cream) !important;
}

.swal2-html-container {
  color: var(--cream2) !important;
}

.swal2-confirm {
  background: var(--emerald) !important;
  border-radius: var(--radius-sm) !important;
  font-family: "Outfit", sans-serif !important;
}

.swal2-cancel {
  background: var(--ink3) !important;
  border-radius: var(--radius-sm) !important;
  font-family: "Outfit", sans-serif !important;
}

.swal2-toast {
  background: var(--ink2) !important;
  border: 1px solid var(--ink3) !important;
}

/* ─── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}

.login-card {
  background: var(--ink2);
  border: 1px solid var(--ink3);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.login-card .login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-card .login-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.login-card .login-header p {
  color: var(--muted);
  font-size: 0.85rem;
}

.login-card .login-header .brand-accent {
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 20px;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
