/* =====================================================
   GPC Kottayam - Admin Panel Styling
   ===================================================== */

:root {
  --primary: #0D2B5E;
  --secondary: #C8972B;
  --accent: #1A7FA8;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --dark: #1C1C2E;
  --gray-100: #F1F3F5;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-500: #ADB5BD;
  --gray-600: #6C757D;
  --gray-700: #495057;
  --success: #2E7D32;
  --danger: #C62828;
  --warning: #EF6C00;
  --font-family: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--dark);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s;
}
a:hover {
  color: var(--secondary);
}

/* LOGIN LAYOUT */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #061530 100%);
}

.login-card {
  background: white;
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
}

.login-header {
  background: var(--primary);
  color: white;
  padding: 30px;
  text-align: center;
  border-bottom: 3px solid var(--secondary);
}

.login-header img {
  width: 70px;
  height: 70px;
  margin-bottom: 10px;
}

.login-header h2 {
  font-size: 1.3rem;
  margin: 0;
}

.login-body {
  padding: 30px;
}

/* ADMIN LAYOUT */
.admin-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  width: 250px;
  background: var(--primary);
  color: white;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
}

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

.sidebar-brand img {
  width: 35px;
  height: 35px;
}

.sidebar-brand h3 {
  font-size: 0.95rem;
  margin: 0;
  font-weight: 700;
  color: white;
}

.sidebar-menu {
  list-style: none;
  padding: 15px 0;
  flex: 1;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
  color: white;
  background: rgba(255,255,255,0.05);
  border-left-color: var(--secondary);
}

.sidebar-menu li a i {
  width: 18px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-footer {
  padding: 15px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* MAIN CONTENT */
.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header {
  height: 60px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}

.admin-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--gray-700);
}

.admin-main {
  padding: 30px;
  flex: 1;
  overflow-y: auto;
}

/* STAT CARDS */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--primary);
}

.stat-card.secondary { border-left-color: var(--secondary); }
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }

.stat-info h4 {
  font-size: 0.8rem;
  color: var(--gray-600);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-info .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary);
}

/* CARDS & TABLES */
.admin-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  border: 1px solid var(--gray-200);
  margin-bottom: 30px;
}

.admin-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.admin-card-body {
  padding: 24px;
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,43,94,0.1);
}

textarea.form-control {
  resize: vertical;
}

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  background: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: #061530;
  color: white;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover {
  background: #b08220;
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #a81c1c;
  color: white;
}

.btn-outline {
  border-color: var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover {
  background: var(--gray-100);
}

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

/* ALERTS */
.alert {
  padding: 12px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.alert-success {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  color: var(--success);
}

.alert-danger {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: var(--danger);
}

/* DATA TABLE */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th,
.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.admin-table th {
  font-weight: 700;
  color: var(--primary);
  background: var(--gray-100);
}

.admin-table tr:hover td {
  background: var(--gray-100);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #e8f5e9; color: var(--success); }
.badge-danger { background: #ffebee; color: var(--danger); }
.badge-info { background: #e0f7fa; color: var(--accent); }
.badge-warning { background: #fff3e0; color: var(--warning); }

/* PAGINATION */
.pagination {
  display: flex;
  gap: 5px;
  margin-top: 20px;
  justify-content: flex-end;
}

.pagination-item {
  width: 32px;
  height: 32px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.pagination-item.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ANIMATIONS */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .admin-container {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
  .sidebar-menu {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
  }
  .sidebar-menu li a {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  .sidebar-footer {
    display: none;
  }
}
