/* ============================================================
   BWF Admin Dashboard — styles
   ============================================================ */

body.admin-body { background: var(--off); min-height: 100vh; }

/* ── LOGIN ── */
.admin-login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy-deep); background-image: radial-gradient(ellipse 60% 60% at 30% 20%, rgba(41,121,201,0.4) 0%, transparent 70%);
  padding: 20px;
}
.login-card { background: white; border-radius: var(--radius-lg); padding: 48px 40px; max-width: 400px; width: 100%; box-shadow: var(--shadow-xl); }
.login-logo { width: 56px; height: 56px; border-radius: 12px; background: var(--navy); display: flex; align-items: center; justify-content: center; color: white; font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0 auto 20px; }
.login-card h1 { font-family: var(--font-display); text-align: center; color: var(--navy-deep); font-size: 1.5rem; margin-bottom: 6px; }
.login-card > p { text-align: center; color: var(--text-sec); font-size: 13.5px; margin-bottom: 28px; }
.login-error { background: rgba(198,40,40,0.08); color: var(--red); font-size: 13px; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; display: none; }
.login-error.show { display: block; }

/* ── SHELL ── */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 250px; background: var(--navy-deep); color: white; flex-shrink: 0;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  transition: transform 0.3s;
}
.sidebar-brand { padding: 26px 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand-box { width: 36px; height: 36px; border-radius: 8px; background: var(--gold); display: flex; align-items: center; justify-content: center; color: var(--navy-deep); font-weight: 800; font-size: 14px; flex-shrink: 0; }
.sidebar-brand div { font-size: 13px; font-weight: 600; line-height: 1.3; }
.sidebar-brand span { display: block; font-size: 10.5px; opacity: 0.55; font-weight: 400; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: rgba(255,255,255,0.68); text-decoration: none; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; margin-bottom: 2px; background: none; border: none; width: 100%; text-align: left;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-link.active { background: var(--gold); color: var(--navy-deep); font-weight: 700; }
.sidebar-link .ic { width: 18px; text-align: center; }
.sidebar-badge { margin-left: auto; background: var(--red); color: white; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 50px; }
.sidebar-link.active .sidebar-badge { background: var(--navy-deep); color: white; }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-logout { width: 100%; background: rgba(255,255,255,0.08); border: none; color: white; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: background 0.2s; }
.sidebar-logout:hover { background: rgba(255,255,255,0.16); }
.sidebar-user { font-size: 12px; opacity: 0.6; margin-bottom: 10px; }

.admin-main { flex: 1; margin-left: 250px; padding: 32px 40px 60px; max-width: 1200px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.admin-topbar h1 { font-family: var(--font-display); font-size: 1.7rem; color: var(--navy-deep); }
.admin-topbar p { font-size: 13.5px; color: var(--text-sec); margin-top: 4px; }
.mobile-topbar { display: none; align-items: center; gap: 12px; background: var(--navy-deep); padding: 14px 20px; color: white; position: sticky; top: 0; z-index: 40; }
.mobile-menu-btn { background: none; border: none; color: white; font-size: 22px; cursor: pointer; }

.admin-panel-view { display: none; }
.admin-panel-view.active { display: block; }

/* ── STAT CARDS ── */
.stat-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card { background: white; border-radius: var(--radius); padding: 22px 24px; border: 1px solid var(--muted); }
.stat-card .sc-icon { font-size: 22px; margin-bottom: 12px; }
.stat-card .sc-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--navy-deep); line-height: 1; }
.stat-card .sc-label { font-size: 12.5px; color: var(--text-sec); margin-top: 6px; }

/* ── CARD / TOOLBAR ── */
.admin-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--muted); overflow: hidden; margin-bottom: 24px; }
.admin-card-head { padding: 20px 24px; border-bottom: 1px solid var(--muted); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.admin-card-head h3 { font-size: 15.5px; font-weight: 600; color: var(--navy-deep); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-sm { padding: 9px 18px; border-radius: 50px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; font-family: var(--font-body); }
.btn-sm.primary { background: var(--navy); color: white; }
.btn-sm.primary:hover { background: var(--navy-mid); }
.btn-sm.gold { background: var(--gold); color: var(--navy-deep); }
.btn-sm.gold:hover { background: var(--gold-light); }
.btn-sm.outline { background: white; border: 2px solid var(--muted); color: var(--navy-deep); }
.btn-sm.outline:hover { border-color: var(--navy); }
.btn-sm.danger { background: #ffebee; color: var(--red); }
.btn-sm.danger:hover { background: #ffcdd2; }
.select-sm, .input-sm {
  padding: 9px 14px; border-radius: 8px; border: 2px solid var(--muted); font-size: 13px; font-family: var(--font-body); outline: none;
}
.select-sm:focus, .input-sm:focus { border-color: var(--navy); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th { text-align: left; padding: 12px 20px; background: var(--off); color: var(--text-sec); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
table.admin-table td { padding: 14px 20px; border-top: 1px solid var(--muted); vertical-align: middle; }
table.admin-table tr:hover td { background: #fafbff; }
.cell-title { font-weight: 600; color: var(--navy-deep); }
.cell-sub { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 50px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.badge.upcoming, .badge.pending, .badge.new, .badge.unread { background: rgba(249,168,37,0.15); color: var(--gold-dark); }
.badge.ongoing, .badge.contacted, .badge.read { background: rgba(41,121,201,0.12); color: var(--navy); }
.badge.completed, .badge.approved, .badge.confirmed { background: rgba(28,138,82,0.12); color: var(--green); }
.badge.cancelled, .badge.rejected { background: rgba(198,40,40,0.1); color: var(--red); }
.row-actions { display: flex; gap: 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--off); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all 0.15s; }
.icon-btn:hover { background: var(--muted); }
.icon-btn.danger:hover { background: #ffcdd2; }
.empty-row td { text-align: center; padding: 60px 20px; color: var(--text-sec); }
.thumb-sm { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--muted); flex-shrink: 0; }
.flex-row { display: flex; align-items: center; gap: 12px; }

/* ── DRAWER / MODAL ── */
.drawer-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(18,63,120,0.5); backdrop-filter: blur(2px); }
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; background: white;
  z-index: 301; transform: translateX(100%); transition: transform 0.3s; display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head { padding: 22px 28px; border-bottom: 1px solid var(--muted); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { font-family: var(--font-display); color: var(--navy-deep); font-size: 1.25rem; }
.drawer-close { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--off); cursor: pointer; font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer-foot { padding: 18px 28px; border-top: 1px solid var(--muted); display: flex; gap: 12px; justify-content: flex-end; }

.field-group { margin-bottom: 18px; }
.field-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-sec); margin-bottom: 6px; }
.field-group input, .field-group textarea, .field-group select {
  width: 100%; border: 2px solid var(--muted); border-radius: 10px; padding: 11px 14px;
  font-size: 14px; font-family: var(--font-body); outline: none; transition: border 0.2s; resize: vertical;
}
.field-group input:focus, .field-group textarea:focus, .field-group select:focus { border-color: var(--navy); }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.field-check input { width: auto; accent-color: var(--navy); }
.upload-drop {
  border: 2px dashed var(--muted); border-radius: 10px; padding: 24px; text-align: center; cursor: pointer;
  background: var(--off); font-size: 13px; color: var(--text-sec); transition: all 0.2s;
}
.upload-drop:hover { border-color: var(--navy); }
.upload-drop img { max-height: 120px; border-radius: 8px; margin-bottom: 10px; }

/* ── FORM BUILDER ── */
.fb-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.fb-item { border: 2px solid var(--muted); border-radius: 10px; padding: 14px 16px; background: var(--off); }
.fb-item-top { display: flex; gap: 10px; margin-bottom: 10px; }
.fb-item-top input[type=text] { flex: 1; }
.fb-item-top select { width: 140px; }
.fb-item-row2 { display: flex; gap: 10px; align-items: center; }
.fb-item textarea.fb-options { flex: 1; font-size: 12.5px; }
.fb-remove { background: #ffebee; color: var(--red); border: none; border-radius: 8px; width: 36px; height: 36px; cursor: pointer; flex-shrink: 0; font-size: 15px; }
.fb-add-btn { width: 100%; border: 2px dashed var(--muted); background: none; padding: 12px; border-radius: 10px; cursor: pointer; color: var(--navy); font-weight: 600; font-size: 13px; }
.fb-add-btn:hover { border-color: var(--navy); background: var(--off); }
.fb-hint { font-size: 12px; color: var(--text-sec); margin-bottom: 10px; }

/* ── TOGGLE ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.toggle-row .tr-label { font-size: 13.5px; color: var(--text); font-weight: 500; }
.toggle-row .tr-sub { font-size: 12px; color: var(--text-sec); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle { position: absolute; cursor: pointer; inset: 0; background: var(--muted); border-radius: 50px; transition: 0.2s; }
.slider-toggle::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider-toggle { background: var(--navy); }
.switch input:checked + .slider-toggle::before { transform: translateX(18px); }

/* ── DETAIL VIEW (message/registration) ── */
.detail-kv { display: flex; padding: 10px 0; border-bottom: 1px solid var(--muted); font-size: 13.5px; }
.detail-kv .k { width: 150px; flex-shrink: 0; color: var(--text-sec); font-weight: 500; }
.detail-kv .v { color: var(--text); flex: 1; word-break: break-word; }

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .mobile-topbar { display: flex; width: 100%; }
  .admin-sidebar { transform: translateX(-100%); top: 56px; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 24px 20px 60px; width: 100%; }
  .field-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px 16px; }
  .stat-card .sc-num { font-size: 1.6rem; }
  .admin-topbar h1 { font-size: 1.4rem; }
  .drawer { max-width: 100vw; }
  table.admin-table th, table.admin-table td { padding: 10px 12px; }
}
