/**
 * Goeen Dada Bhai Admin Dashboard Stylesheet
 * Sleek, modern, responsive administrative panel
 */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --admin-primary: #700B1A;
  --admin-primary-dark: #4A040F;
  --admin-accent: #D4AF37;
  --admin-accent-hover: #B45309;

  --sidebar-width: 260px;
  --sidebar-bg: #1A0508;
  --sidebar-text: #E2E8F0;
  --sidebar-hover: rgba(212, 175, 55, 0.15);

  --body-bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --border-color: #E2E8F0;

  --text-main: #0F172A;
  --text-muted: #64748B;

  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #0284C7;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --radius: 10px;
}

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

body {
  font-family: 'Outfit', 'Hind Siliguri', sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
}

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

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 99;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--admin-primary);
  border: 1.5px solid var(--admin-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.sidebar-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.sidebar-brand-subtitle {
  font-size: 0.72rem;
  color: var(--admin-accent);
}

.sidebar-nav {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94A3B8;
  padding: 12px 12px 4px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #CBD5E1;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

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

.sidebar-link.active {
  border-left: 3px solid var(--admin-accent);
  background: rgba(212, 175, 55, 0.2);
}

.sidebar-link .link-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
}

.admin-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
}

.admin-user-role {
  font-size: 0.72rem;
  color: var(--admin-accent);
}

.btn-logout {
  color: #F87171;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.2);
}

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

.admin-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.campaign-status-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-active {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.pill-inactive {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.admin-body {
  padding: 28px;
  flex-grow: 1;
}

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

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.icon-blue { background: #E0F2FE; color: #0284C7; }
.icon-gold { background: #FEF3C7; color: #D97706; }
.icon-green { background: #DCFCE7; color: #16A34A; }
.icon-red { background: #FEE2E2; color: #DC2626; }
.icon-purple { background: #F3E8FF; color: #9333EA; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cards & Tables */
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-body {
  padding: 24px;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background: #F1F5F9;
  color: #475569;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.data-table tr:hover {
  background: #F8FAFC;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-danger { background: #FEE2E2; color: #B91C1C; }
.badge-info { background: #E0F2FE; color: #0369A1; }
.badge-secondary { background: #F1F5F9; color: #475569; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

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

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

.btn-gold {
  background: #F59E0B;
  color: #FFFFFF;
}

.btn-gold:hover {
  background: #D97706;
}

.btn-outline {
  background: transparent;
  border-color: #CBD5E1;
  color: #334155;
}

.btn-outline:hover {
  background: #F1F5F9;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.admin-form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.admin-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.92rem;
  border: 1.5px solid #CBD5E1;
  border-radius: 6px;
  outline: none;
  background: #FFFFFF;
  transition: border-color 0.2s;
  font-family: inherit;
}

.admin-input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(112, 11, 26, 0.1);
}

/* Flash Alerts */
.admin-alert {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.92rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.admin-alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 0.88rem;
}

/* Stock Progress Meter */
.stock-meter-wrap {
  width: 100%;
  background: #E2E8F0;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.stock-meter-bar {
  height: 100%;
  background: var(--admin-primary);
  border-radius: 4px;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 16px;
}

.page-item {
  padding: 6px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  text-decoration: none;
  color: #334155;
  font-size: 0.85rem;
}

.page-item.active {
  background: var(--admin-primary);
  color: #FFFFFF;
  border-color: var(--admin-primary);
}

/* Modal Dialog */
.admin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-modal-backdrop.active {
  display: flex;
}

.admin-modal-box {
  background: #FFFFFF;
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    left: -260px;
  }
  .admin-sidebar.open {
    left: 0;
  }
}
