/* ── Admin Panel Styles ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@600;700;800&display=swap');

:root {
  --blue-dark:  #0a1f4e;
  --blue-main:  #1a3a8a;
  --blue-light: #2557d6;
  --blue-accent:#3b82f6;
  --gold:       #f59e0b;
  --sidebar-w:  250px;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --white:      #ffffff;
  --bg:         #f1f5f9;
  --text:       #0f172a;
  --text-mid:   #334155;
  --text-light: #64748b;
  --success:    #10b981;
  --danger:     #ef4444;
  --warning:    #f59e0b;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter',sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--blue-dark); color: #c8d5f0; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; transition: .3s; display: flex; flex-direction: column; }
.sidebar-brand { padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 12px; }
.sidebar-brand .brand-icon { width: 44px; height: 44px; background: var(--blue-light); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sidebar-brand .brand-icon span { color: #fff; font-family: 'Outfit',sans-serif; font-weight: 800; line-height: 1; }
.sidebar-brand .brand-icon .bm { font-size: 1.1rem; }
.sidebar-brand .brand-icon .sub { font-size: .42rem; letter-spacing: 1px; }
.sidebar-brand h2 { font-family: 'Outfit',sans-serif; font-size: .88rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-brand p { font-size: .68rem; color: rgba(255,255,255,.5); }
.sidebar-nav { padding: 20px 12px; flex: 1; }
.nav-section-label { font-size: .65rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.35); padding: 0 8px; margin: 18px 0 8px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: .88rem; color: rgba(255,255,255,.7); transition: .2s; margin-bottom: 2px; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav a.active { background: var(--blue-light); }
.sidebar-nav a i { width: 18px; text-align: center; font-size: .95rem; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: .78rem; color: rgba(255,255,255,.4); }

/* Main */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--white); padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 90; }
.topbar h1 { font-family: 'Outfit',sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--blue-dark); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-actions a { font-size: .85rem; color: var(--text-light); display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; transition: .2s; }
.topbar-actions a:hover { background: var(--bg); color: var(--text); }
.content { padding: 28px; flex: 1; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 18px; border-left: 4px solid var(--blue-main); }
.stat-icon { width: 50px; height: 50px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon.blue { background: #dbeafe; color: var(--blue-main); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.gold { background: #fef3c7; color: var(--warning); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }
.stat-card h3 { font-size: 1.6rem; font-weight: 800; font-family: 'Outfit',sans-serif; color: var(--blue-dark); }
.stat-card p { font-size: .8rem; color: var(--text-light); font-weight: 500; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 18px 24px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-family: 'Outfit',sans-serif; font-size: 1rem; font-weight: 700; color: var(--blue-dark); }
.card-body { padding: 24px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table th { background: var(--bg); color: var(--text-mid); font-weight: 600; font-size: .78rem; letter-spacing: .5px; text-transform: uppercase; padding: 11px 14px; text-align: left; }
table td { padding: 13px 14px; border-bottom: 1px solid #f1f5f9; color: var(--text-mid); vertical-align: middle; }
table tr:hover td { background: #f8fafc; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: .72rem; font-weight: 700; }
.badge-active, .badge-success { background: #dcfce7; color: #166534; }
.badge-inactive { background: #f1f5f9; color: var(--text-light); }
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-read { background: #fef9c3; color: #854d0e; }
.badge-replied { background: #dcfce7; color: #166534; }
.action-btns { display: flex; gap: 6px; }
.btn-action { padding: 5px 12px; border-radius: 6px; font-size: .78rem; font-weight: 600; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: .2s; font-family: inherit; }
.btn-edit { background: #dbeafe; color: var(--blue-main); }
.btn-edit:hover { background: var(--blue-main); color: #fff; }
.btn-delete { background: #fee2e2; color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: #fff; }
.btn-view { background: #d1fae5; color: var(--success); }
.btn-view:hover { background: var(--success); color: #fff; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1/-1; }
.form-group label { display: block; font-size: .83rem; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 13px; border: 1.5px solid #e2e8f0; border-radius: 7px; font-size: .9rem; font-family: inherit; color: var(--text); background: #fafafa; transition: border .2s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--blue-main); background: #fff; }
.form-group textarea { resize: vertical; min-height: 100px; }
.btn-primary { background: var(--blue-main); color: #fff; border: none; padding: 11px 26px; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 8px; transition: .2s; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--bg); color: var(--text-mid); border: 1.5px solid #e2e8f0; padding: 10px 22px; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: .2s; }
.btn-secondary:hover { border-color: var(--blue-main); color: var(--blue-main); }
.btn-danger { background: var(--danger); color: #fff; border: none; padding: 10px 22px; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: .2s; }
.btn-danger:hover { background: #dc2626; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: .88rem; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.img-preview { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--blue-dark), var(--blue-main)); }
.login-card { background: #fff; border-radius: 18px; padding: 44px 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon { width: 64px; height: 64px; background: linear-gradient(135deg,var(--blue-main),var(--blue-light)); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login-logo .icon span { color: #fff; font-family: 'Outfit',sans-serif; font-weight: 900; line-height: 1; }
.login-logo .icon .bm { font-size: 1.5rem; }
.login-logo .icon .sub { font-size: .5rem; letter-spacing: 2px; }
.login-logo h2 { font-family: 'Outfit',sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--blue-dark); }
.login-logo p { font-size: .82rem; color: var(--text-light); }

@media(max-width:768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media(max-width:480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
