/* =========================================
   APLC Admin Console — Styles
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Lato', -apple-system, sans-serif;
  background: #F0F2F5;
  color: #1E2D40;
  line-height: 1.55;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
h1,h2,h3,h4 { line-height: 1.25; }

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: #1B2A4A;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.admin-main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
}
.admin-topbar {
  background: white;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-content { padding: 2rem 1.5rem; max-width: 1100px; }

/* Sidebar */
.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-brand strong { color: white; font-size: 1rem; }
.sidebar-brand span { font-size: .72rem; color: #C9A84C; letter-spacing: .08em; }
.sidebar-nav { padding: .75rem .5rem; flex: 1; }
.sidebar-section { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.3); padding: .75rem .6rem .3rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: rgba(255,255,255,.72);
  font-size: .88rem;
  font-weight: 600;
  transition: all .2s;
  margin-bottom: 2px;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(201,168,76,.15); color: #C9A84C; }
.sidebar-link .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: .75rem .5rem 1rem; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-footer a { font-size: .82rem; color: rgba(255,255,255,.45); display: block; padding: .4rem .75rem; }
.sidebar-footer a:hover { color: white; }

/* Topbar */
.topbar-title { font-size: 1.05rem; font-weight: 700; color: #1B2A4A; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-badge { background: #C9A84C; color: #1B2A4A; font-size: .72rem; font-weight: 700; padding: .25rem .75rem; border-radius: 50px; letter-spacing: .05em; }

/* Cards */
.admin-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.admin-card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.admin-card-header h3 { font-size: 1rem; font-weight: 700; color: #1B2A4A; }
.admin-card-body { padding: 1.5rem; }

/* Stats */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  border-left: 3px solid #C9A84C;
}
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: #1B2A4A; line-height: 1; }
.stat-card .lbl { font-size: .78rem; color: #6B7280; margin-top: .25rem; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  padding: .75rem 1rem;
  background: #F9FAFB;
  font-size: .75rem;
  font-weight: 700;
  color: #6B7280;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid #E5E7EB;
}
.admin-table td {
  padding: .85rem 1rem;
  font-size: .88rem;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFBFC; }
.table-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B2A4A, #243558);
  color: #C9A84C;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}
.table-actions { display: flex; gap: .4rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem; border-radius: 8px; font-size: .85rem; font-weight: 700; border: 1.5px solid transparent; transition: all .2s; white-space: nowrap; }
.btn-primary { background: #C9A84C; color: #1B2A4A; border-color: #C9A84C; }
.btn-primary:hover { background: #D4B862; }
.btn-navy { background: #1B2A4A; color: white; border-color: #1B2A4A; }
.btn-navy:hover { background: #243558; }
.btn-danger { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.btn-danger:hover { background: #DC2626; color: white; border-color: #DC2626; }
.btn-ghost { background: transparent; color: #6B7280; border-color: #E5E7EB; }
.btn-ghost:hover { border-color: #1B2A4A; color: #1B2A4A; }
.btn-sm { padding: .35rem .8rem; font-size: .78rem; border-radius: 6px; }
.btn-success { background: #ECFDF5; color: #059669; border-color: #A7F3D0; }
.btn-success:hover { background: #059669; color: white; }

/* Forms */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .82rem; font-weight: 700; color: #374151; margin-bottom: .35rem; }
.form-control {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: .9rem;
  color: #1E2D40;
  background: white;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus { border-color: #1B2A4A; box-shadow: 0 0 0 3px rgba(27,42,74,.08); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236B7280' d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 14px; padding-right: 2rem; }

/* Badges */
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 50px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.badge-gold  { background: rgba(201,168,76,.15); color: #8a6200; }
.badge-navy  { background: rgba(27,42,74,.1); color: #1B2A4A; }
.badge-green { background: rgba(5,150,105,.1); color: #059669; }
.badge-red   { background: #FEF2F2; color: #DC2626; }

/* Modal */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; padding:1.5rem; overflow-y:auto; }
.modal-overlay.open { display:flex; align-items:flex-start; justify-content:center; }
.modal { background:white; border-radius:16px; width:100%; max-width:620px; margin:2rem auto; overflow:hidden; }
.modal-header { padding:1.25rem 1.5rem; border-bottom:1px solid #E5E7EB; display:flex; align-items:center; justify-content:space-between; }
.modal-header h3 { font-size:1.05rem; font-weight:700; color:#1B2A4A; }
.modal-body { padding:1.5rem; }
.modal-footer { padding:1rem 1.5rem; border-top:1px solid #E5E7EB; display:flex; justify-content:flex-end; gap:.75rem; }
.close-btn { background:none; border:none; font-size:1.2rem; color:#9CA3AF; cursor:pointer; padding:.25rem; }
.close-btn:hover { color:#1B2A4A; }

/* Alerts */
.alert { padding:.9rem 1.1rem; border-radius:8px; font-size:.88rem; margin-bottom:1rem; display:flex; gap:.65rem; align-items:flex-start; }
.alert-success { background:#ECFDF5; color:#059669; border:1px solid #A7F3D0; }
.alert-error { background:#FEF2F2; color:#DC2626; border:1px solid #FECACA; }
.alert-info { background:#EFF6FF; color:#1D4ED8; border:1px solid #BFDBFE; }

/* Login page */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#111D33 0%,#1B2A4A 100%); padding:1.5rem; }
.login-card { background:white; border-radius:20px; padding:2.5rem; width:100%; max-width:400px; text-align:center; }
.login-card h2 { color:#1B2A4A; margin-bottom:.5rem; }
.login-card p { font-size:.88rem; color:#6B7280; margin-bottom:1.5rem; }
.login-error { color:#DC2626; font-size:.85rem; margin-top:.75rem; }

/* Upload area */
.upload-area {
  border: 2px dashed #E5E7EB;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
}
.upload-area:hover { border-color: #C9A84C; }
.upload-area p { font-size: .85rem; color: #6B7280; margin: .5rem 0 0; }

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-main { margin-left: 0; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
}
