/* Admin Panel Styles */
:root {
  --primary: #8B1A1A;
  --accent: #D4A017;
  --navy: #1a2044;
  --sidebar-bg: #1a2044;
  --white: #fff;
  --bg: #f0f2f5;
  --border: #dde0e8;
  --text: #222;
  --muted: #666;
  --success: #16a34a;
  --error: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; color: var(--primary); }

.admin-wrap { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: 240px; background: var(--sidebar-bg);
  color: #c8d0e8; display: flex; flex-direction: column;
  flex-shrink: 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
}
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo img { width: 48px; height: 48px; object-fit: contain; }
.sidebar-logo h2 { font-size: 13px; color: white; margin-top: 10px; line-height: 1.4; }
.sidebar-logo span { font-size: 10px; color: #D4A017; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-title { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #5a6a9a; padding: 12px 20px 4px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: 13px; color: #c8d0e8;
  transition: background 0.2s, color 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,0.08); color: white; }
.sidebar-nav a .icon { width: 18px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; }

/* MAIN */
.admin-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }
.admin-topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.topbar-title { font-size: 18px; font-weight: 700; color: var(--navy); }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.topbar-user strong { color: var(--text); }
.topbar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.admin-content { padding: 28px; flex: 1; }

/* CARDS */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: white; border-radius: 10px; padding: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06); display: flex; align-items: center; gap: 16px;
}
.stat-card-icon { width: 54px; height: 54px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.ic-blue { background: #dbeafe; }
.ic-green { background: #dcfce7; }
.ic-yellow { background: #fef9c3; }
.ic-red { background: #fee2e2; }
.stat-card-info h3 { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat-card-info p { font-size: 12px; color: var(--muted); }

/* TABLE */
.card { background: white; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); overflow: hidden; margin-bottom: 28px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 16px; color: var(--navy); }
.card-body { padding: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: #f8f9fb; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
tr:hover td { background: #fafbff; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warn { background: #fef9c3; color: #a16207; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.btn-action { padding: 6px 12px; border-radius: 4px; border: none; cursor: pointer; font-size: 12px; font-weight: 600; }
.btn-del { background: #fee2e2; color: #dc2626; }
.btn-del:hover { background: #fca5a5; }
.btn-view { background: #dbeafe; color: #1d4ed8; }
.btn-view:hover { background: #93c5fd; }
.action-btns { display: flex; gap: 6px; }

/* FORM */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 6px; font-size: 14px; color: var(--text);
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.full-width { grid-column: 1/-1; }
.upload-zone {
  border: 2px dashed var(--border); border-radius: 8px;
  padding: 40px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover { border-color: var(--primary); background: #fff5f5; }
.upload-zone input[type=file] { display: none; }
.upload-zone .upload-icon { font-size: 40px; margin-bottom: 10px; }
.upload-zone p { font-size: 14px; color: var(--muted); }
.upload-zone .file-selected { color: var(--primary); font-weight: 700; margin-top: 8px; }
.btn-submit { background: var(--primary); color: white; border: none; padding: 12px 32px; border-radius: 6px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.btn-submit:hover { background: #5e1010; }
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid #16a34a; }
.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc2626; }

/* LOGIN */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a2044, #8B1A1A); }
.login-box { background: white; border-radius: 16px; padding: 48px 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.login-box .login-logo { text-align: center; margin-bottom: 28px; }
.login-box .login-logo img { height: 70px; }
.login-box h2 { font-size: 22px; color: var(--navy); margin: 12px 0 4px; }
.login-box p { font-size: 13px; color: var(--muted); }
.login-box .form-group { margin-bottom: 18px; }
.btn-login { width: 100%; background: var(--primary); color: white; border: none; padding: 13px; border-radius: 6px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn-login:hover { background: #5e1010; }

@media (max-width: 992px) { .stat-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: none; }
  .admin-main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}
