:root{
  --bg:#f7f7f8;                           /* soft white background */
  --panel: #ffffff;                       /* card bg */
  --panel2: #fafafa;                      /* subtle alt bg */
  --border: #e5e5e7;                      /* light border */
  --text: #1c1c1e;                        /* premium dark gray text */
  --muted: #6b6b70;
  --muted2: #8e8e93;

  --shadow: 0 18px 45px rgba(0,0,0,0.08);
  --radius: 18px;

  /* BRAND (PRIMARY RED) */
  --brand: #EA0001;
  --brand2: #b80000;                      /* deep red */
  --brand-soft: #ffe5e5;                  /* light red bg */
  --danger: #EA0001;

  --glow: 0 0 0 3px rgba(234,0,1,0.18);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 450px at 20% 0%, rgba(234,0,1,0.06), transparent 60%),
    linear-gradient(180deg, #ffffff, var(--bg) 100%);
}

a{ color: var(--brand); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  width:min(1180px, 92vw);
  margin:0 auto;
  padding: 18px 0 40px;
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid var(--border);
}
.topbar-inner{
  width:min(1180px, 92vw);
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 0;
  gap: 12px;
}
.brand{
  display:flex;
  gap:10px;
  align-items:center;
  min-width: 0;
}
.brand-badge{
  width:38px;height:38px;border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 24px rgba(234,0,1,0.22);
  flex: 0 0 auto;
}
.brand-title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
  min-width:0;
}
.brand-title strong{
  font-size: 14px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.brand-title span{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.topbar-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}

/* Cards */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad{ padding: 16px; }
.card-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.h1{
  font-size: clamp(18px, 3vw, 26px);
  margin:0;
  letter-spacing: .2px;
}
.sub{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height:1.5;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border .12s ease;
  user-select:none;
}
.btn:hover{
  background: #f5f5f7;
  border-color: #dedee2;
  transform: translateY(-1px);
  text-decoration:none;
}
.btn-primary{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(234,0,1,0.20);
}
.btn-primary:hover{ opacity:.96; }
.btn-danger{
  background: var(--brand-soft);
  border-color: rgba(234,0,1,0.25);
  color: var(--brand);
}
.btn-danger:hover{ background: rgba(234,0,1,0.15); }
.btn-ghost{
  background: transparent;
  border-color: transparent;
}
.btn.small{ padding: 7px 10px; font-size: 13px; }

/* Alerts */
.alert{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  margin: 12px 0;
}
.alert-danger{
  border-color: rgba(234,0,1,0.35);
  background: var(--brand-soft);
  color: var(--brand);
}
.alert-success{
  border-color: rgba(22,163,74,0.35);
  background: rgba(22,163,74,0.08);
  color: #166534;
}

/* Forms */
.form{ display:grid; gap:12px; margin-top: 12px; }
.label{ font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input, select, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  outline:none;
}
textarea{ resize: vertical; min-height: 110px; }
.input:focus, select:focus, textarea:focus{
  border-color: var(--brand);
  box-shadow: var(--glow);
}
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap: 12px; }
.grid3{ display:grid; grid-template-columns:1fr 1fr 220px; gap: 12px; }
@media(max-width: 900px){
  .grid2, .grid3{ grid-template-columns:1fr; }
}

/* Tables responsive */
.table-wrap{
  overflow:auto;
  border-radius: 14px;
  border:1px solid var(--border);
  background: #ffffff;
}
.table{
  width:100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #ffffff;
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align:left;
  vertical-align: top;
}
.table th{
  font-size: 12px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
  background: #fafafa;
}

/* Login page */
.center{
  min-height: calc(100vh - 68px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 20px 0;
}
.login-card{ width:min(520px, 92vw); }
.kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size: 12px;
  color: var(--brand);
  border: 1px solid rgba(234,0,1,0.25);
  background: var(--brand-soft);
  padding: 8px 10px;
  border-radius: 999px;
}
.hr{ height:1px; background: var(--border); margin: 14px 0; }
.small-note{ font-size: 12px; color: var(--muted2); }

.brand-logo{
  height:38px;
  border-radius:12px;
  background:#ffffff;
  padding:6px;
  border:1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  display:block;
}

