/* ==========================================================================
   GENERILIFE ADMIN CMS - MODERN DASHBOARD STYLES
   ========================================================================== */

:root {
  --admin-primary: #0077b6;
  --admin-primary-dark: #023e8a;
  --admin-bg: #f8fafc;
  --admin-sidebar: #0f172a;
  --admin-card: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-muted: #64748b;
  --admin-success: #10b981;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand h2 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sidebar-brand span {
  font-size: 0.7rem;
  color: #38bdf8;
  text-transform: uppercase;
  font-weight: 600;
  display: block;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  flex-grow: 1;
}

.sidebar-item {
  margin-bottom: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.925rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--admin-primary);
  color: #ffffff;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--admin-danger);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navbar */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--admin-text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.btn-view-site {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-primary);
  background: #e0f2fe;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-view-site:hover {
  background: #bae6fd;
}

/* Page Content */
.admin-content {
  padding: 2rem;
  flex-grow: 1;
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--admin-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #e0f2fe;
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-info h4 {
  font-size: 0.85rem;
  color: var(--admin-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.stat-info .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1;
}

/* Data Tables */
.table-card {
  background: var(--admin-card);
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-text);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.admin-table th {
  background: #f8fafc;
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--admin-border);
}

table.admin-table td {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--admin-text);
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

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

table.admin-table tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-new { background: #dbeafe; color: #1e40af; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }

/* Action Buttons */
.btn-action {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-action-view { background: #f1f5f9; color: var(--admin-text); border-color: var(--admin-border); }
.btn-action-view:hover { background: #e2e8f0; }

.btn-action-delete { background: #fee2e2; color: #b91c1c; }
.btn-action-delete:hover { background: #fca5a5; }

/* Form Cards */
.form-card {
  background: var(--admin-card);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.form-group.col-full {
  grid-column: 1 / -1;
}

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

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--admin-border);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--admin-text);
  background: #ffffff;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

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

.btn-save {
  background: var(--admin-primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

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

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

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
}
