/* ============================================
   Danantara Raffle — Admin Panel CSS
   ============================================ */
:root {
  --maroon: #8a1c1c;
  --maroon-dark: #5C0000;
  --maroon-light: #b3402e;
  --red: #D11927;
  --ink: #1f2430;
  --muted: #6b7280;
  --border: #e5e2df;
  --bg: #faf6f6;
  --success: #0f5132;
  --warning: #8a5a00;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: .92rem; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: 0 0 220px; background: var(--maroon-dark); color: #fff;
  padding: 20px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 0 20px 18px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 12px; }
.sidebar .brand b { font-size: 1.05rem; letter-spacing: .5px; }
.sidebar .brand span { display: block; font-size: .72rem; opacity: .75; margin-top: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.85);
  text-decoration: none; padding: 11px 20px; font-size: .9rem; transition: background .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar nav a.active { background: var(--red); color: #fff; }
.main { flex: 1; min-width: 0; padding: 24px 28px; }
.container { width: min(1600px, 100%); margin-inline: auto; }

/* ---------- Head ---------- */
.page-title { font-size: 1.35rem; font-weight: 800; color: var(--maroon-dark); margin-bottom: 4px; }
.page-desc { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- Card ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-header h5 { font-size: 1rem; color: var(--maroon-dark); }
.card-body { padding: 18px; }
.card-title { color: var(--maroon-dark); font-weight: 800; margin-bottom: 12px; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.stat-card .v { font-size: 1.6rem; font-weight: 800; color: var(--maroon-dark); }
.stat-card .l { color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
tbody.is-loading { opacity: .55; transition: opacity .15s; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--maroon-dark); font-weight: 700; background: #faf6f6; white-space: nowrap; font-size: .82rem; text-transform: uppercase; letter-spacing: .3px; }
.table tr:hover td { background: #fdfafa; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; cursor: pointer;
  padding: 9px 16px; border-radius: 9px; font-family: inherit; font-size: .88rem; font-weight: 600;
  text-decoration: none; transition: filter .12s, transform .05s; line-height: 1;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--maroon-dark); color: #fff; }
.btn-red     { background: var(--red); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border-color: var(--maroon-dark); color: var(--maroon-dark); }
.btn-outline:hover { background: var(--maroon-dark); color: #fff; }
.btn-light   { background: #fff; color: var(--maroon-dark); }
.btn-sm      { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--maroon-dark); font-size: .85rem; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-family: inherit; font-size: .9rem; background: #fff; color: var(--ink);
}
.form-control:focus { outline: 2px solid var(--maroon-light); outline-offset: 1px; }
.form-control-sm { padding: 8px 12px; font-size: .85rem; border-radius: 8px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .88rem; font-weight: 500; }
.alert-success { background: #e6f4ea; color: var(--success); border: 1px solid #bfe3cc; }
.alert-error   { background: #fde8e8; color: var(--maroon); border: 1px solid #f5c2c2; }
.alert-info    { background: #eef4fb; color: #1f4e79; border: 1px solid #cfe0f1; }

/* ---------- Badge ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-green { background: #e6f4ea; color: var(--success); }
.badge-red   { background: #fde8e8; color: var(--maroon); }
.badge-gray  { background: #eef0f2; color: var(--muted); }
.badge-blue  { background: #eef4fb; color: #1f4e79; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--maroon-dark); }
.modal-close { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.modal-close:hover { background: #f3f3f3; color: var(--maroon); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }

.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 14px; }
.mb0 { margin-bottom: 0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #5C0000, #8a1c1c); padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 34px 30px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box .logo { text-align: center; margin-bottom: 8px; }
.login-box h2 { text-align: center; color: var(--maroon-dark); margin-bottom: 2px; }
.login-box .sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 20px; }
