/* admin.css - Professional Modern Admin Panel Stylesheet */

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

:root {
  /* Brand Palettes */
  --primary-color: #007a41;         /* Sage Govt Green */
  --primary-dark: #004d20;
  --primary-light: #e6f5ec;
  --accent-color: #b08968;          /* Classic Brown accent */
  --accent-light: #f7f5f0;
  
  /* Neutral Palette */
  --bg-color: #f4f7f6;
  --surface-color: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Status Colors */
  --color-success: #10b981;
  --color-success-bg: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-danger: #ef4444;
  --color-danger-bg: #fee2e2;
  --color-info: #3b82f6;
  --color-info-bg: #dbeafe;
  
  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Decorative & Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --sidebar-width: 260px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Elements */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

/* Login Page Layout */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(0, 122, 65, 0.15) 0%, rgba(176, 137, 104, 0.1) 90.2%), var(--surface-color);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  height: 70px;
  margin-bottom: 20px;
  object-fit: contain;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 30px;
}

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

/* Sidebar Styling */
.admin-sidebar {
  width: var(--sidebar-width);
  background-color: #0b1f13; /* Very dark green forest background */
  color: #ffffff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition-smooth);
  overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.admin-sidebar::-webkit-scrollbar {
  width: 5px;
}
.admin-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

.sidebar-brand img {
  height: 40px;
  filter: brightness(0) invert(1);
}

.sidebar-brand-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-brand-name span {
  color: var(--accent-color);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  font-size: 14px;
}

.sidebar-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

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

.sidebar-link.active i {
  color: var(--accent-color);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevent flex item from overflowing viewport */
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.header-title-wrap h1 {
  font-size: 28px;
  font-weight: 800;
}

.header-title-wrap p {
  color: var(--text-muted);
  font-size: 14px;
}

.admin-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
}

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

.admin-profile-name {
  font-weight: 600;
  font-size: 13px;
}

.admin-profile-role {
  color: var(--text-muted);
  font-size: 11px;
}

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

.stat-card {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: var(--accent-color);
}

.stat-card.stat-primary::before { background: var(--primary-color); }
.stat-card.stat-success::before { background: var(--color-success); }
.stat-card.stat-warning::before { background: var(--color-warning); }
.stat-card.stat-danger::before { background: var(--color-danger); }

.stat-info h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-card.stat-primary .stat-icon { background: var(--primary-light); color: var(--primary-color); }
.stat-card.stat-success .stat-icon { background: var(--color-success-bg); color: var(--color-success); }
.stat-card.stat-warning .stat-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-card.stat-danger .stat-icon { background: var(--color-danger-bg); color: var(--color-danger); }

/* Table Design */
.data-card {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
}

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

.card-header-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.table-custom {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 900px; /* Force scrollbar only on very small viewports */
}

.table-custom th {
  background-color: #fafbfc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.table-custom td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
  vertical-align: middle;
}

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

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

/* Badges */
.badge-custom {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }

/* Forms & Inputs */
.form-label-custom {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-control-custom {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  background-color: #fafbfc;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--surface-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 69, 0.1);
}

textarea.form-control-custom {
  min-height: 120px;
  resize: vertical;
}

/* Buttons */
.btn-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

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

.btn-accent-custom {
  background-color: var(--accent-color);
  color: #ffffff;
}

.btn-accent-custom:hover {
  background-color: #9c7554;
}

.btn-secondary-custom {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.btn-secondary-custom:hover {
  background-color: #cbd5e1;
}

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

.btn-danger-custom:hover {
  background-color: #dc2626;
}

.btn-sm-custom {
  padding: 6px 12px;
  font-size: 12px;
}

/* Alert Styling */
.alert {
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success { background-color: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger { background-color: var(--color-danger-bg); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-warning { background-color: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.2); }

/* Utilities */
.me-2 { margin-right: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.w-100 { width: 100%; }

/* Grid columns for forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* Action controls */
.action-buttons {
  display: flex;
  gap: 6px;
}

/* Responsive Styles */
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
    padding: 20px;
  }
}

/* Responsive Table Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}
