:root {
  --rd-red:#e0231a;
  --rd-red-dark:#c91e16;
  --rd-red-light:#fdecea;
  --rd-sidebar:#151923;
  --rd-sidebar-hover:rgba(255,255,255,.08);
  --rd-bg:#f5f6f8;
  --rd-border:#e8eaed;
  --rd-text:#1d2129;
  --rd-muted:#858b96;
}
* { box-sizing:border-box; }
html, body { margin:0; min-height:100%; font-family:"Segoe UI", system-ui, -apple-system, sans-serif; background:var(--rd-bg); color:var(--rd-text); font-size:14px; }
a { color:inherit; text-decoration:none; }
label { display:block; margin:12px 0 5px; font-size:12.5px; font-weight:700; color:#444; }
.auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:#141821 radial-gradient(ellipse 800px 600px at 70% 50%, rgba(224,35,26,.2), transparent 70%); padding:20px; }
.auth-card { width:100%; max-width:560px; background:#fff; border-radius:22px; padding:38px 34px; box-shadow:0 32px 80px rgba(0,0,0,.42); }
.auth-logo { display:flex; justify-content:center; background:#11141b; border-radius:16px; padding:14px 18px; margin-bottom:28px; }
.auth-logo img { width:270px; max-width:100%; }
.auth-tabs { display:flex; gap:8px; margin-bottom:22px; border-bottom:1px solid #eee; }
.auth-tab { appearance:none; border:0; border-bottom:3px solid transparent; border-radius:0; background:none; color:#aaa; cursor:pointer; font:inherit; font-weight:800; padding:10px 6px 12px; transition:color .15s, border-color .15s; }
.auth-tab:hover { color:#555; }
.auth-tab:focus { outline:none; }
.auth-tab:focus-visible { outline:3px solid rgba(224,35,26,.16); outline-offset:4px; border-radius:8px; }
.auth-tab.active { color:var(--rd-red); border-bottom-color:var(--rd-red); margin-bottom:-2px; }
.auth-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.auth-hint { color:#aaa; font-size:12px; text-align:center; line-height:1.5; }
.app-shell { display:flex; min-height:100vh; }
.sidebar { position:fixed; inset:0 auto 0 0; width:248px; background:var(--rd-sidebar); color:white; display:flex; flex-direction:column; z-index:10; }
.sidebar-brand { display:flex; justify-content:center; padding:18px; border-bottom:1px solid rgba(255,255,255,.06); }
.brand-logo { width:184px; max-width:100%; }
.sidebar-nav { flex:1; overflow:auto; padding:14px 10px; }
.nav-section { padding:12px 12px 4px; color:rgba(255,255,255,.28); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; }
.nav-item, .nav-subitem { display:flex; align-items:center; gap:10px; border-radius:9px; color:rgba(255,255,255,.58); transition:.15s; }
.nav-item { padding:9px 12px; font-size:13.5px; font-weight:600; }
.nav-subitem { padding:8px 12px 8px 36px; font-size:13px; }
.nav-item:hover, .nav-subitem:hover { background:var(--rd-sidebar-hover); color:white; }
.nav-item.active { background:var(--rd-red); color:#fff; box-shadow:0 3px 12px rgba(224,35,26,.35); }
.nav-subitem.active { background:rgba(255,255,255,.1); color:#fff; }
.nav-submenu { display:none; }
.nav-submenu.open { display:block; }
.ms-auto { margin-left:auto; }
.sidebar-footer { padding:14px 12px; border-top:1px solid rgba(255,255,255,.06); }
.user-card { display:flex; align-items:center; gap:10px; }
.user-avatar { width:34px; height:34px; border-radius:50%; background:var(--rd-red); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:12px; }
.user-name { font-weight:700; font-size:13px; }
.user-role-txt { color:rgba(255,255,255,.36); font-size:11px; }
.main { margin-left:248px; min-height:100vh; width:calc(100% - 248px); }
.topbar { height:62px; background:#fff; border-bottom:1px solid var(--rd-border); display:flex; align-items:center; justify-content:space-between; padding:0 28px; position:sticky; top:0; z-index:5; }
.topbar-title { font-size:16px; font-weight:800; }
.topbar-breadcrumb { color:var(--rd-muted); font-size:12px; }
.topbar-right { display:flex; align-items:center; gap:10px; }
.content { padding:24px; }
.panel { background:#fff; border:1px solid var(--rd-border); border-radius:14px; overflow:hidden; }
.panel-head { padding:16px 20px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #f2f3f5; gap:12px; }
.panel-title { font-size:14px; font-weight:800; }
.panel-body { padding:20px; }
.mt { margin-top:16px; }
.grid-2 { display:grid; grid-template-columns:minmax(0, 1fr) 360px; gap:16px; align-items:start; }
.grid-2.wide-left { grid-template-columns:minmax(0, 1fr) 380px; }
.stats-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:16px; }
.stat-card { background:#fff; border:1px solid var(--rd-border); border-radius:14px; padding:20px; display:flex; gap:14px; align-items:center; }
.stat-card i { width:46px; height:46px; border-radius:12px; background:var(--rd-red-light); color:var(--rd-red); display:flex; align-items:center; justify-content:center; font-size:22px; }
.stat-card span { color:var(--rd-muted); font-size:12px; font-weight:800; text-transform:uppercase; }
.stat-card strong { display:block; font-size:28px; margin-top:4px; }
.form-control { width:100%; border:1.5px solid var(--rd-border); border-radius:10px; padding:10px 13px; font:inherit; color:var(--rd-text); background:#fff; transition:border-color .15s, box-shadow .15s; }
.form-control:focus { outline:none; border-color:var(--rd-red); box-shadow:0 0 0 4px rgba(224,35,26,.1); }
textarea.form-control { resize:vertical; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.btn-rd, .btn-outline, .btn-topbar { border:0; border-radius:9px; padding:9px 16px; font-weight:800; font-size:13px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.btn-rd { background:var(--rd-red); color:white; margin-top:14px; }
.btn-rd:hover { background:var(--rd-red-dark); }
.btn-outline, .btn-topbar { background:#fff; border:1.5px solid var(--rd-border); color:#444; }
.btn-outline.compact { padding:6px 10px; font-size:12px; margin-left:auto; white-space:nowrap; }
.btn-full { width:100%; justify-content:center; }
.badge-admin, .badge-user-role, .status, .count { border-radius:20px; padding:4px 10px; font-size:11px; font-weight:800; }
.badge-admin { background:#fff3e0; color:#bf360c; }
.badge-user-role { background:#e3f2fd; color:#0d47a1; }
.status { background:#e3f2fd; color:#1565c0; }
.status.approved, .status.ok { background:#e8f5e9; color:#2e7d32; }
.status.pending, .status.warn { background:#fff8e1; color:#f57c00; }
.status.rejected, .status.error { background:#fdecea; color:var(--rd-red); }
.count { background:#f0f1f3; color:#555; }
.table-wrap { overflow:auto; }
.data-table { width:100%; border-collapse:collapse; }
.data-table th { text-align:left; padding:12px 14px; background:#fafbfc; color:#667085; font-size:12px; text-transform:uppercase; }
.data-table td { padding:13px 14px; border-top:1px solid #f2f3f5; vertical-align:top; }
.empty, .empty-cell { color:#aaa; text-align:center; padding:34px; }
.list { display:flex; flex-direction:column; }
.list-item { display:flex; gap:12px; padding:14px 18px; border-bottom:1px solid #f5f5f7; }
.list-item > div { flex:1; min-width:0; }
.list-item i { color:var(--rd-red); }
.list-item strong { display:block; margin-bottom:4px; }
.list-item span { color:var(--rd-muted); font-size:12.5px; }
.actions { margin:12px 0; }
.inline-form { margin-bottom:12px; }
.tabs { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.tabs a { border:1.5px solid var(--rd-border); background:#fff; border-radius:10px; padding:9px 14px; font-weight:800; }
.tabs a.active { background:var(--rd-red); color:white; border-color:var(--rd-red); }
.gift-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:16px; }
.gift-card { background:#fff; border:1px solid var(--rd-border); border-radius:14px; padding:20px; display:flex; flex-direction:column; gap:10px; }
.gift-icon { width:56px; height:56px; border-radius:14px; background:var(--rd-red-light); color:var(--rd-red); display:flex; align-items:center; justify-content:center; font-size:24px; }
.stats-mini { display:flex; gap:10px; flex-wrap:wrap; align-items:center; border-top:1px solid #f2f3f5; }
.alert { border-radius:10px; padding:12px 14px; margin-bottom:16px; }
.alert-success { background:#e8f5e9; color:#2e7d32; }
.alert-danger { background:#fdecea; color:#c62828; }
.help-text { color:var(--rd-muted); font-size:12px; margin-top:6px; }
.calendar-layout { display:grid; grid-template-columns:minmax(0, 1fr) 360px; gap:16px; align-items:start; }
.calendar-title { text-transform:capitalize; text-align:center; flex:1; }
.calendar-grid { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:4px; padding:0 10px 10px; }
.calendar-weekdays { padding:12px 10px 4px; color:var(--rd-muted); font-size:12px; font-weight:800; text-align:center; text-transform:uppercase; }
.calendar-day { min-height:112px; border:1px solid var(--rd-border); border-radius:10px; padding:8px; background:#fff; overflow:hidden; }
.calendar-day.muted { background:#fafbfc; color:#c3c7cf; }
.calendar-day.today { border-color:var(--rd-red); box-shadow:0 0 0 2px rgba(224,35,26,.08); }
.calendar-day-num { font-size:12px; font-weight:800; margin-bottom:6px; }
.calendar-event { border-radius:7px; padding:3px 6px; margin-top:4px; font-size:11px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calendar-event.direct { background:var(--rd-red-light); color:var(--rd-red); }
.calendar-event.partner { background:#e3f2fd; color:#1565c0; }
.event-list-scroll { max-height:520px; overflow:auto; }
hr { border:0; border-top:1px solid #f0f1f3; margin:20px 0 8px; }
@media (max-width: 960px) {
  .sidebar { position:static; width:100%; min-height:auto; }
  .app-shell { display:block; }
  .main { margin-left:0; width:100%; }
  .grid-2, .grid-2.wide-left, .stats-grid, .gift-grid, .calendar-layout { grid-template-columns:1fr; }
  .auth-form-grid { grid-template-columns:1fr; gap:0; }
  .form-row { grid-template-columns:1fr; }
  .calendar-day { min-height:86px; padding:6px; }
}
