/* ============================================================================
   Admin Panel Stylesheet — SMT. SONI DEVI SHIKSHAN AND SEWA SANSTHAN, SEWARI
   ============================================================================ */

:root {
  --navy: #0B245B;
  --navy-dark: #071940;
  --saffron: #E86F12;
  --maroon: #7A121C;
  --green: #1E6B2B;
  --bg: #F4F6FA;
  --white: #FFFFFF;
  --ink: #1A2233;
  --muted: #5F6B80;
  --border: #E2E7F0;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* Login Screen */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1B428F 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.login-logo {
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  display: block;
  object-fit: contain;
}

.login-card h1 {
  text-align: center;
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0 0 4px;
}

.login-card .sub {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 24px;
}

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

.sidebar {
  width: 264px;
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 3px solid var(--saffron);
}

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

.sidebar-brand img {
  width: 44px;
  height: 44px;
  background: var(--white);
  border-radius: 50%;
  padding: 3px;
  flex-shrink: 0;
}

.sidebar-brand strong {
  display: block;
  font-size: 0.9rem;
  color: var(--white);
  line-height: 1.25;
}

.sidebar-brand span {
  font-size: 0.74rem;
  color: #FFD26F;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  padding: 14px 12px;
  margin: 0;
  flex: 1;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.91rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  transition: all 0.2s ease;
}

.sidebar-nav a i {
  width: 20px;
  text-align: center;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.10);
  color: var(--white);
}

.sidebar-nav a.active {
  background: var(--saffron);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(232, 111, 18, 0.35);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--navy);
}

.admin-content {
  padding: 26px;
  flex: 1;
}

/* Cards & Stats */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(11, 36, 91, 0.04);
}

.kpi-card .num {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}

.kpi-card .lbl {
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(11, 36, 91, 0.09);
  color: var(--navy);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(11, 36, 91, 0.04);
}

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

.card-header h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--navy);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #D5DCE8;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: #FAFBFD;
}

.form-control:focus {
  outline: none;
  border-color: var(--navy);
  background: var(--white);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: #163987; }

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

.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #155220; }

.btn-outline { background: var(--white); color: var(--navy); border-color: #CBD4E4; }
.btn-outline:hover { background: #EEF2F9; }

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
}

th, td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  background: #F7F9FC;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thumb-sm {
  width: 68px;
  height: 46px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-green { background: #E3F6E8; color: #16652A; }
.badge-orange { background: #FFF0E1; color: #B85100; }
.badge-blue { background: #E5EEFF; color: #0B245B; }
.badge-red { background: #FDE8E8; color: #A61B1B; }
.badge-gray { background: #ECEFF5; color: #526075; }

.alert {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: #E4F6EA; color: #145B26; border: 1px solid #B7E4C7; }
.alert-error { background: #FDECEC; color: #9B1C1C; border: 1px solid #F8C4C4; }

.mobile-menu-btn {
  display: none;
  background: var(--navy);
  color: var(--white);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
}

.badge-count {
  margin-left: auto;
  background: var(--maroon);
  color: var(--white);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
}

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    bottom: 0;
    z-index: 200;
    transition: left 0.25s ease;
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
