@import url('/public/css/theme.css');

body {
  min-height: 100vh;
  background: var(--sc-bg);
}

/* ── Sidebar ── */
.sidebar {
  width: 252px;
  min-height: 100vh;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 55%, #3730a3 100%);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 20px rgba(15, 23, 42, 0.1);
}

.sidebar-brand {
  padding: 1.125rem 1.25rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.975rem;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  padding: 0.625rem 1rem;
  margin: 0.125rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s;
}

.sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
  color: #fff;
  background: var(--sc-primary);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4);
}

.main-content {
  margin-left: 252px;
  min-height: 100vh;
}

.top-navbar {
  background: var(--sc-surface);
  border-bottom: 1px solid var(--sc-border);
  padding: 0.875rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ── Stats ── */
.stat-card {
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  background: var(--sc-surface);
  box-shadow: var(--sc-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--sc-gradient);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sc-shadow-lg);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--sc-muted);
  font-weight: 500;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon-primary { background: rgba(99, 102, 241, 0.12); color: var(--sc-primary); }
.stat-icon-success { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.stat-icon-warning { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.stat-icon-info { background: rgba(59, 130, 246, 0.12); color: #2563eb; }

/* ── Cards & Tables ── */
.card-modern {
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  background: var(--sc-surface);
  box-shadow: var(--sc-shadow);
  overflow: hidden;
}

.card-modern .card-header {
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
  padding: 1rem 1.25rem;
}

.table-modern {
  margin-bottom: 0;
}

.table-modern thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--sc-border);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--sc-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.table-modern tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f5f9;
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

.table-modern tbody tr {
  transition: background 0.12s;
}

.table-modern tbody tr:hover {
  background: #fafbff;
}

.table-modern tbody tr.row-admin {
  background: #f8fafc;
}

.badge-valid {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.badge-expired {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 600;
}

.badge-remaining {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--sc-primary);
  border-color: var(--sc-primary);
  font-weight: 600;
  border-radius: var(--sc-radius-sm);
}

.btn-primary:hover {
  background: var(--sc-primary-dark);
  border-color: var(--sc-primary-dark);
}

.btn-group-sm .btn {
  border-radius: 0.375rem;
}

.btn-outline-primary:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover,
.btn-outline-info:hover {
  transform: translateY(-1px);
}

/* ── Admin login ── */
.admin-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--sc-gradient-dark);
  background-image:
    var(--sc-gradient-dark),
    radial-gradient(circle at 75% 25%, rgba(139, 92, 246, 0.35) 0%, transparent 45%);
}

.admin-login-card {
  max-width: 420px;
  width: 100%;
  background: var(--sc-surface);
  border: none;
  border-radius: 1.125rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.admin-login-icon {
  width: 64px;
  height: 64px;
  border-radius: 0.875rem;
  background: var(--sc-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  margin: 0 auto 1rem;
}

/* ── Admin welcome ── */
.admin-welcome-page {
  min-height: 100vh;
  background: var(--sc-gradient-dark);
  color: #fff;
}

.admin-welcome-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--sc-radius);
  padding: 1.5rem;
  transition: background 0.2s, transform 0.2s;
}

.admin-welcome-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.admin-welcome-icon {
  width: 72px;
  height: 72px;
  border-radius: 1rem;
  background: var(--sc-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    min-height: auto;
  }
  .main-content { margin-left: 0; }
  .table-responsive { font-size: 0.8125rem; }
}
