/* ==========================================================================
   UNIQUE POLY - RESPONSIVE ADMIN PANEL CSS
   Mobile-First Admin Architecture
   ========================================================================== */

:root {
  --admin-primary: #2b6cb0;
  --admin-primary-hover: #1d4ed8;
  --admin-sidebar: #0f172a;
  --admin-sidebar-hover: #1e293b;
  --admin-bg: #f8fafc;
  --admin-card: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --admin-danger: #ef4444;
  --admin-success: #10b981;
  --admin-warning: #f59e0b;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Sidebar Navigation */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar);
  color: #f1f5f9;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1050;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 1023px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}

.sidebar-backdrop.open {
  display: block;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-brand span {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--admin-primary);
  border-radius: 4px;
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
}

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

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

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Admin Content Wrapper */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (min-width: 1024px) {
  .admin-main {
    margin-left: 260px;
  }
}

/* Admin Top Bar */
.admin-topbar {
  background-color: var(--admin-card);
  border-bottom: 1px solid var(--admin-border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: transparent;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .topbar-toggle {
    display: none;
  }
}

.admin-body {
  padding: clamp(1rem, 3vw, 2rem);
  flex: 1;
}

/* Dashboard Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background-color: var(--admin-card);
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-info h4 {
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-info .stat-val {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-top: 0.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #eff6ff;
  color: var(--admin-primary);
}

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

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

.admin-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.admin-card-body {
  padding: 1.5rem;
}

/* Mobile-Friendly Table / Card Pattern */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.admin-table th, .admin-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table th {
  background-color: #f8fafc;
  color: var(--admin-text-muted);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-new { background-color: #eff6ff; color: #1d4ed8; }
.badge-contacted { background-color: #fef3c7; color: #92400e; }
.badge-completed { background-color: #ecfdf5; color: #065f46; }

/* Responsive Form Styling */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

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

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background-color: #ffffff;
  font-size: 0.9rem;
  color: var(--admin-text);
  outline: none;
  transition: border-color 0.2s;
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

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

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

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

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

.btn-admin-secondary {
  background-color: #ffffff;
  border-color: var(--admin-border);
  color: var(--admin-text);
}
.btn-admin-secondary:hover {
  background-color: #f1f5f9;
}
