/* =======================================================
 * Forestbrook Admin Panel Stylesheet
 * Modern, Clean, High-Conversion Dashboard
 * PHP 7.x Compatible Web UI
 * ======================================================= */

:root {
  --admin-primary: #1d4ed8;
  --admin-primary-dark: #1e40af;
  --admin-primary-light: #eff6ff;
  --admin-secondary: #0ea5e9;
  --admin-dark: #0f172a;
  --admin-dark-card: #1e293b;
  --admin-sidebar-bg: #0b1329;
  --admin-sidebar-hover: #1e293b;
  --admin-body-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #1e293b;
  --admin-text-muted: #64748b;
  --admin-success: #10b981;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
  --admin-radius: 12px;
  --admin-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --admin-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--admin-body-bg);
  color: var(--admin-text-main);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

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

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

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

.sidebar-header .brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.sidebar-header .brand-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.sidebar-header .brand-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.sidebar-menu-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  padding: 0.75rem 0.75rem 0.35rem;
  font-weight: 600;
}

.sidebar-item {
  margin-bottom: 4px;
}

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

.sidebar-link i {
  font-size: 1.15rem;
  color: #94a3b8;
  transition: color 0.2s ease;
}

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

.sidebar-link:hover i {
  color: #38bdf8;
}

.sidebar-link.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

.sidebar-link.active i {
  color: #ffffff;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* Top Navbar */
.admin-topbar {
  background: #ffffff;
  height: 64px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--admin-text-main);
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  cursor: pointer;
}

.sidebar-toggle-btn:hover {
  background: #f1f5f9;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.topbar-user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--admin-text-main);
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

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

/* Page Header */
.page-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title-box h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.page-title-box p {
  color: var(--admin-text-muted);
  font-size: 0.88rem;
  margin: 0.2rem 0 0 0;
}

/* Metric / Stat Cards */
.stat-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--admin-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.stat-icon.primary {
  background: #eff6ff;
  color: #2563eb;
}

.stat-icon.success {
  background: #ecfdf5;
  color: #10b981;
}

.stat-icon.warning {
  background: #fffbeb;
  color: #f59e0b;
}

.stat-icon.info {
  background: #f0fdfa;
  color: #0d9488;
}

.stat-label {
  font-size: 0.83rem;
  color: var(--admin-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

/* Card Style */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

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

.admin-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Modern Tables */
.table-custom {
  margin: 0;
}

.table-custom th {
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #475569;
  border-bottom: 1px solid var(--admin-border);
  padding: 0.85rem 1rem;
}

.table-custom td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.88rem;
  color: #334155;
}

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

/* Badges */
.badge-custom {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-active {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-inactive {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-class {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-pdf {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* PDF Upload Dropzone */
.drop-zone {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.drop-zone-icon {
  font-size: 3rem;
  color: #2563eb;
  margin-bottom: 0.75rem;
}

.drop-zone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Login Page Specific */
.login-body {
  background: linear-gradient(135deg, #0b1329 0%, #1e293b 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  padding: 2rem 1.5rem;
  text-align: center;
  color: #ffffff;
}

.login-header .logo-badge {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.login-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.login-header p {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.login-body-content {
  padding: 2rem 1.75rem;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
  }
  .admin-sidebar.show {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1035;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}
