/* سجل فايزين مهرجان 30 سنة رايه */
:root {
  --red: #D0111B;
  --red-700: #B80F18;
  --red-900: #7E0910;
  --red-50: #FDF0F1;
  --red-100: #F9D9DB;
  --ink: #17181C;
  --ink-2: #4A4D55;
  --ink-3: #80838C;
  --line: #E9E6E3;
  --line-2: #F1EEEB;
  --bg: #F7F5F3;
  --card: #FFFFFF;
  --green: #12805C;
  --green-50: #E8F6F0;
  --amber: #B45309;
  --amber-50: #FEF3E2;
  --blue: #1D5FBF;
  --blue-50: #EAF1FC;
  --gold: #C99A2E;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 24, 28, .05), 0 1px 1px rgba(23, 24, 28, .03);
  --shadow: 0 1px 2px rgba(23, 24, 28, .04), 0 6px 20px -6px rgba(23, 24, 28, .10);
  --shadow-lg: 0 20px 50px -12px rgba(23, 24, 28, .25);
  --sidebar: 268px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red-700); text-decoration: none; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

/* ---------- boot / spinner ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--red-100); border-top-color: var(--red);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(255,255,255,.14), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(0,0,0,.18), transparent 60%),
    linear-gradient(160deg, var(--red) 0%, var(--red-700) 45%, var(--red-900) 100%);
  position: relative; overflow: hidden;
}
.login::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.22) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}
.login-hero { position: relative; padding: 48px 24px 28px; text-align: center; color: #fff; }
.login-hero .logo-chip { margin: 0 auto 18px; }
.login-hero h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.2px; }
.login-hero p { margin: 6px 0 0; opacity: .85; font-size: 15px; }
.badge-30 {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25); font-size: 13px; font-weight: 600;
}
.badge-30 svg, .notice svg, .card-head > svg { width: 18px; height: 18px; flex: none; }
.login-card {
  position: relative; width: min(420px, calc(100% - 32px)); margin: 0 auto 40px;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 28px 24px;
}
.login-card h2 { margin: 0 0 4px; font-size: 20px; }
.login-card .sub { margin: 0 0 20px; color: var(--ink-3); font-size: 14px; }
.login-foot { margin-top: auto; text-align: center; color: rgba(255,255,255,.7); font-size: 12px; padding: 0 16px 24px; position: relative; }

.logo-chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 16px; padding: 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.logo-chip img { height: 34px; width: auto; }
.logo-chip.sm { padding: 6px 10px; border-radius: 12px; box-shadow: none; }
.logo-chip.sm img { height: 24px; }

/* ---------- form controls ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.field .err { font-size: 13px; color: var(--red-700); margin-top: 5px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
select.input { appearance: none; padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2380838C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; }
.input:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-50); }
.input.invalid { border-color: var(--red); background: var(--red-50); }
.input[dir="ltr"] { text-align: right; }
.input-wrap { position: relative; }
.input-wrap .suffix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 14px; pointer-events: none; }
.input-wrap .input { padding-left: 52px; }
.pass-toggle { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 8px; color: var(--ink-3); cursor: pointer; border-radius: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 > .field { min-width: 0; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg button {
  height: 64px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  transition: all .15s; font-weight: 700; font-size: 20px;
}
.seg button small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.seg button:hover { border-color: var(--red-100); }
.seg button.on { border-color: var(--red); background: var(--red-50); color: var(--red-700); box-shadow: 0 0 0 3px var(--red-50); }
.seg button.on small { color: var(--red-700); }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg.two button { font-size: 15px; height: 56px; flex-direction: row; gap: 8px; }
.seg.two button svg { width: 20px; height: 20px; flex: none; }
.seg.two button.on.green { border-color: var(--green); background: var(--green-50); color: var(--green); box-shadow: 0 0 0 3px var(--green-50); }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .06s, background .15s, box-shadow .15s, border-color .15s; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: linear-gradient(180deg, var(--red) 0%, var(--red-700) 100%); color: #fff; box-shadow: 0 6px 16px -6px rgba(208,17,27,.55); }
.btn-primary:hover { box-shadow: 0 8px 20px -6px rgba(208,17,27,.65); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #d9d5d1; background: #fcfbfa; }
.btn-soft { background: var(--red-50); color: var(--red-700); }
.btn-soft:hover { background: var(--red-100); }
.btn-green { background: var(--green); color: #fff; }
.btn-danger { background: #fff; border-color: var(--red-100); color: var(--red-700); }
.btn-block { width: 100%; height: 54px; font-size: 16px; border-radius: 14px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-sm svg { width: 16px; height: 16px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: inherit;
  display: inline-grid; place-items: center; cursor: pointer; position: relative;
}
.icon-btn:hover { background: rgba(0,0,0,.05); }
.icon-btn svg { width: 22px; height: 22px; }
.dot { position: absolute; top: 6px; left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--red-700); }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 30; color: #fff;
  background: linear-gradient(120deg, var(--red) 0%, var(--red-700) 60%, var(--red-900) 100%);
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 18px -8px rgba(126, 9, 16, .6);
}
.topbar .who { flex: 1; min-width: 0; line-height: 1.3; }
.topbar .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who span { font-size: 12.5px; opacity: .85; }
.topbar .icon-btn:hover { background: rgba(255,255,255,.12); }

.sidebar { display: none; }
.main { padding: 16px 16px calc(var(--nav-h) + 24px + var(--safe-b)); max-width: 1280px; margin: 0 auto; }

.bottomnav {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 11.5px; font-weight: 600; position: relative;
}
.bottomnav a svg { width: 23px; height: 23px; }
.bottomnav a.on { color: var(--red); }
.bottomnav a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
.bottomnav a.fab-wrap { color: var(--ink-2); }
.bottomnav .fab {
  width: 50px; height: 50px; margin-top: -22px; border-radius: 16px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, var(--red) 0%, var(--red-700) 100%); box-shadow: 0 10px 22px -8px rgba(208,17,27,.7);
  border: 3px solid #fff;
}
.bottomnav a.fab-wrap.on::before { display: none; }
.bottomnav .nav-dot { position: absolute; top: 9px; left: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }

@media (min-width: 900px) {
  .topbar { display: none; }
  .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; right: 0; width: var(--sidebar);
    background: linear-gradient(180deg, var(--red-700) 0%, var(--red-900) 100%); color: #fff; padding: 22px 16px; z-index: 30;
  }
  .sidebar .brand { padding: 0 6px 18px; border-bottom: 1px solid rgba(255,255,255,.14); margin-bottom: 14px; }
  .sidebar .brand .logo-chip { box-shadow: none; }
  .sidebar .brand .t { margin-top: 12px; font-weight: 700; font-size: 15px; line-height: 1.4; }
  .sidebar .brand .t small { display: block; font-weight: 500; opacity: .75; font-size: 12.5px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
    color: rgba(255,255,255,.82); font-weight: 600; font-size: 14.5px; position: relative;
  }
  .sidebar nav a svg { width: 20px; height: 20px; }
  .sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .sidebar nav a.on { background: #fff; color: var(--red-700); box-shadow: 0 8px 20px -10px rgba(0,0,0,.5); }
  .sidebar nav a .pill { margin-right: auto; background: var(--gold); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
  .sidebar .me { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.14); display: flex; align-items: center; gap: 10px; }
  .sidebar .me .avatar { background: rgba(255,255,255,.16); color: #fff; }
  .sidebar .me .n { flex: 1; min-width: 0; line-height: 1.35; }
  .sidebar .me .n b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar .me .n span { font-size: 12px; opacity: .75; }
  .sidebar .me .icon-btn { color: #fff; }
  .sidebar .me .icon-btn:hover { background: rgba(255,255,255,.12); }
  .main { margin-right: var(--sidebar); padding: 28px 32px 48px; max-width: none; }
  .main > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
}

.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--red-50); color: var(--red-700); flex: none; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.page-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 900px) { .page-head h1 { font-size: 26px; } }

/* ---------- cards / KPIs ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; font-size: 16px; }
.card-head .muted { font-size: 13px; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack > *, .card, .main { min-width: 0; }
.input { min-width: 0; }
html, body { overflow-x: hidden; }
@media (min-width: 900px) { .stack { gap: 20px; } }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.kpi { padding: 16px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 13px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.kpi .k-icon svg { width: 19px; height: 19px; }
.kpi .k-val { font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 2px; letter-spacing: -.3px; }
.kpi .k-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.kpi.hero { grid-column: 1 / -1; color: #fff; border: 0;
  background: radial-gradient(500px 200px at 0% 0%, rgba(255,255,255,.16), transparent 60%), linear-gradient(130deg, var(--red) 0%, var(--red-700) 55%, var(--red-900) 100%); }
.kpi.hero .k-label, .kpi.hero .k-sub { color: rgba(255,255,255,.82); }
.kpi.hero .k-val { font-size: 34px; }
@media (min-width: 900px) { .kpi.hero { grid-column: span 2; } .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tone-red { background: var(--red-50); color: var(--red-700); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-blue { background: var(--blue-50); color: var(--blue); }

.progress { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red-700), var(--red)); }
.progress.green > i { background: var(--green); }
.kpi.hero .progress { background: rgba(255,255,255,.2); margin-top: 10px; }
.kpi.hero .progress > i { background: #fff; }

/* ---------- welcome / CTA ---------- */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.welcome h1 { margin: 0; font-size: 21px; }
.welcome p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip.red { background: var(--red-50); color: var(--red-700); }
.chip.green { background: var(--green-50); color: var(--green); }
.chip.amber { background: var(--amber-50); color: var(--amber); }
.chip.blue { background: var(--blue-50); color: var(--blue); }
.prize { display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; background: var(--red-50); color: var(--red-700); white-space: nowrap; }
.prize small { font-size: 11px; font-weight: 600; }
.prize.p500 { background: #FFF4E0; color: #A15C00; }
.prize.p1000 { background: linear-gradient(135deg, #FCEFC7, #F2D78A); color: #7A5200; }

.cta {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); color: #fff; cursor: pointer;
  background: radial-gradient(400px 160px at 0% 100%, rgba(255,255,255,.14), transparent 60%), linear-gradient(120deg, var(--red) 0%, var(--red-700) 100%);
  box-shadow: 0 14px 30px -14px rgba(208,17,27,.75); border: 0; width: 100%; text-align: right;
}
.cta .ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.cta .ic svg { width: 26px; height: 26px; }
.cta b { font-size: 17px; display: block; }
.cta span { font-size: 13px; opacity: .85; }
.cta .go { margin-right: auto; opacity: .9; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--amber-50); color: #7C3D06; border: 1px solid #F6DDB5; cursor: pointer;
}
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.notice b { display: block; }
.notice.red { background: var(--red-50); border-color: var(--red-100); color: var(--red-900); }

/* ---------- lists ---------- */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 12.5px; color: var(--ink-3); }

.wcards { display: grid; gap: 12px; }
@media (min-width: 640px) and (max-width: 899px) { .wcards { grid-template-columns: 1fr 1fr; } }
.wcard { padding: 14px 16px; }
.wcard .top { display: flex; align-items: flex-start; gap: 10px; }
.wcard .top .grow { flex: 1; min-width: 0; }
.wcard .name { font-weight: 700; font-size: 16px; }
.wcard .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.wcard .meta span { display: inline-flex; align-items: center; gap: 5px; }
.wcard .meta svg { width: 14px; height: 14px; color: var(--ink-3); }
.wcard .bottom { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.wcard .bottom .sp { flex: 1; }
.wcard .note { font-size: 12.5px; color: var(--ink-2); background: var(--line-2); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: right; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 11px 14px; background: #FBFAF9; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FCFBFA; }
.tbl tfoot td { font-weight: 700; background: #FBFAF9; border-top: 1px solid var(--line); }
.tbl .c { text-align: center; }
.tbl tr.warn td { background: #FFF8F8; }
.tbl td.wrap { white-space: normal; min-width: 180px; }
.mini-prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-prog .progress { flex: 1; height: 6px; }

.only-pc { display: none; }
@media (min-width: 900px) { .only-pc { display: block; } .only-mobile { display: none !important; } }

/* ---------- filters ---------- */
.filters { display: grid; gap: 10px; padding: 14px; }
.filters .input { height: 44px; font-size: 15px; }
.filters .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) {
  .filters { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-items: end; padding: 16px; }
  .filters .row { display: contents; }
  .filters .search-row > div:first-child, .filters > div:first-child:not(.search-row) { grid-column: span 2; }
}
.filters .search-row { display: flex; gap: 8px; align-items: flex-end; }
.filters .search-row > div { flex: 1; min-width: 0; }
@media (max-width: 899px) { .filters .row.collapsed { display: none; } }
@media (min-width: 900px) { .filters .search-row { display: contents; } }
.filters .lbl { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; display: block; }
.tabs { display: flex; gap: 6px; padding: 4px; background: var(--line-2); border-radius: 12px; overflow-x: auto; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--red-700); box-shadow: var(--shadow-sm); }
.sumline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 2px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- coupon upload ---------- */
.drop {
  border: 2px dashed #DCD6D1; border-radius: 16px; background: #FCFBFA; padding: 18px; text-align: center;
}
.drop .ic { width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 16px; display: grid; place-items: center; background: var(--red-50); color: var(--red-700); }
.drop .ic svg { width: 26px; height: 26px; }
.drop b { display: block; font-size: 15px; }
.drop p { margin: 2px 0 12px; font-size: 13px; color: var(--ink-3); }
.drop .btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.drop.invalid { border-color: var(--red); background: var(--red-50); }
.preview { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; }
.preview img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; flex: none; background: var(--line-2); cursor: zoom-in; }
.preview .grow { flex: 1; min-width: 0; }
.preview .ok { color: var(--green); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.preview .ok svg { width: 16px; height: 16px; }
.preview .s { font-size: 12.5px; color: var(--ink-3); }

.upload-bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.upload-bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .15s; }

.form-card { max-width: 640px; }
@media (min-width: 900px) { .form-card { margin-right: 0; } }
.form-section { padding: 18px; border-bottom: 1px solid var(--line-2); }
.form-section:last-child { border-bottom: 0; }
.form-section h4 { margin: 0 0 14px; font-size: 14px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.form-section h4 .n { width: 22px; height: 22px; border-radius: 7px; background: var(--red-50); color: var(--red-700); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.form-actions { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); padding: 14px 18px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line-2); border-radius: 0 0 var(--radius) var(--radius); }
@media (min-width: 900px) { .form-actions { bottom: 0; } }

/* ---------- chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 10px 4px 0; }
.bars .b { flex: 1; min-width: 6px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bars .b i { display: block; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--red) 0%, var(--red-700) 100%); min-height: 2px; transition: height .4s; }
.bars .b.empty i { background: var(--line); }
.bars .b.today i { background: linear-gradient(180deg, var(--gold), #A9801F); }
.bars .b:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; padding: 5px 8px; border-radius: 8px; white-space: nowrap; z-index: 2;
}
.bars-x { display: flex; gap: 4px; padding: 6px 4px 0; font-size: 10.5px; color: var(--ink-3); }
.bars-x span { flex: 1; text-align: center; min-width: 6px; }

/* ---------- instructions ---------- */
.ins { padding: 16px 18px; cursor: pointer; position: relative; }
.ins + .ins { border-top: 1px solid var(--line-2); }
.ins .h { display: flex; align-items: center; gap: 8px; }
.ins .h b { font-size: 15.5px; flex: 1; }
.ins .body { margin-top: 8px; color: var(--ink-2); white-space: pre-wrap; font-size: 14.5px; }
.ins .foot { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ins.unread { background: linear-gradient(90deg, transparent, var(--red-50)); }
.ins.unread::before { content: ""; position: absolute; right: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 4px 0 0 4px; background: var(--red); }
.ins.collapsed .body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- modal / sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(23,24,28,.5); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-height: 92vh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + var(--safe-b)); animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; }
.sheet .sub { color: var(--ink-3); font-size: 13.5px; margin: 0 0 16px; }
.sheet .acts { display: flex; gap: 10px; margin-top: 18px; }
.sheet .acts .btn { flex: 1; height: 50px; }
@media (min-width: 640px) {
  .overlay { align-items: center; }
  .sheet { max-width: 480px; border-radius: 22px; padding: 22px 24px; }
  .sheet.wide { max-width: 760px; }
  .sheet .grab { display: none; }
}
.sheet.image { background: #111; padding: 10px; }
.sheet.image img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: 12px; }
.sheet.image .acts .btn { background: #222; color: #fff; border-color: #333; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }

.pw-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--line-2); margin: 8px 0; }
.pw-box .num { font-size: 26px; font-weight: 700; letter-spacing: 4px; }

.success { text-align: center; padding: 10px 0 4px; }
.success .ring { width: 74px; height: 74px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--green-50); color: var(--green); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.success .ring svg { width: 38px; height: 38px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 200; top: 12px; left: 12px; right: 12px; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: 440px; width: 100%; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-weight: 500; animation: drop .2s; }
.toast svg { width: 20px; height: 20px; flex: none; }
.toast.ok svg { color: #5BD6A3; }
.toast.bad { background: var(--red-900); }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } }
@media (min-width: 900px) { #toasts { top: auto; bottom: 20px; left: 20px; right: auto; justify-items: start; } }

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty .ic { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px; background: var(--line-2); display: grid; place-items: center; color: var(--ink-3); }
.empty .ic svg { width: 28px; height: 28px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.skel { background: linear-gradient(90deg, var(--line-2) 0%, #fbfaf9 50%, var(--line-2) 100%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 12px; }
@keyframes sh { to { background-position: -200% 0; } }

.menu { position: absolute; top: calc(100% + 6px); left: 8px; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 50; border: 1px solid var(--line-2); }
.menu .mh { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; line-height: 1.4; }
.menu .mh b { display: block; }
.menu .mh span { font-size: 12.5px; color: var(--ink-3); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; font-weight: 500; text-align: right; }
.menu button:hover { background: var(--line-2); }
.menu button svg { width: 18px; height: 18px; color: var(--ink-3); }

.sms-note { display: flex; gap: 8px; align-items: flex-start; margin: -6px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--blue-50); color: #17407D; font-size: 13px; line-height: 1.6; }
.sms-note svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--blue); }

/* ---------- export buttons ---------- */
.btn-xl svg { color: #107C41; }
.btn-pdf svg { color: #C4161C; }
.actions-inline { display: flex; gap: 6px; }
.actions-inline .btn { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }

/* ---------- selection / pending ---------- */
.cb { width: 20px; height: 20px; accent-color: var(--red); cursor: pointer; flex: none; margin: 0; }
.tbl tr.sel td { background: var(--red-50) !important; }
.wcard.sel { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50), var(--shadow); }
.wcard .top .cb { margin-top: 3px; }
.selbar { position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); display: flex; justify-content: center; pointer-events: none; animation: up .25s cubic-bezier(.2,.8,.2,1); }
.selbar-in { pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: min(760px, 100%); padding: 10px 12px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); }
.selbar-in b { font-size: 14px; padding: 0 4px; }
.selbar-in .sp { flex: 1; }
.selbar-in .btn-ghost { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.selbar-in .icon-btn { color: #fff; width: 36px; height: 36px; }
.selbar-in .icon-btn:hover { background: rgba(255,255,255,.12); }
@media (min-width: 900px) { .selbar { right: calc(var(--sidebar) + 24px); left: 24px; bottom: 20px; } }
.linkish { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.linkish svg { width: 15px; height: 15px; }
.bubble { position: relative; background: #E9F3EC; color: #12261A; border-radius: 18px 18px 18px 4px; padding: 12px 14px; font-size: 15px; line-height: 1.7; max-width: 420px; white-space: pre-wrap; word-break: break-word; }

/* ---------- settings ---------- */
.settings-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .settings-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; } }
.sec-t { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.sec-t svg { width: 20px; height: 20px; color: var(--red); }
.card.danger { border-color: var(--red-100); }
.card.danger .sec-t svg { color: var(--red-700); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: #D9D5D1; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(-20px); }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: linear-gradient(160deg, var(--red) 0%, var(--red-700) 50%, var(--red-900) 100%); transition: opacity .45s ease, visibility .45s; }
.splash.gone { opacity: 0; visibility: hidden; }
.splash .in { display: grid; justify-items: center; gap: 22px; }
.splash .logo-chip img { height: 44px; }
.splash .line { width: 120px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; }
.splash .line i { display: block; width: 40%; height: 100%; background: #fff; border-radius: 4px; animation: slide 1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(150%); } 100% { transform: translateX(-250%); } }

/* ---------- install banner ---------- */
.install { position: fixed; z-index: 90; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--line-2); animation: up .35s cubic-bezier(.2,.8,.2,1); max-width: 520px; margin: 0 auto; }
.install img { width: 46px; height: 46px; border-radius: 12px; flex: none; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.install .grow { flex: 1; min-width: 0; line-height: 1.4; }
.install b { display: block; font-size: 14.5px; }
.install span { font-size: 12.5px; color: var(--ink-3); }
.install .icon-btn { width: 34px; height: 34px; color: var(--ink-3); }
.login ~ .install, .install.top { bottom: calc(16px + var(--safe-b)); }
@media (min-width: 900px) { .install { right: auto; left: 24px; bottom: 24px; } }
.ios-steps { display: grid; gap: 12px; margin: 6px 0 4px; }
.ios-steps div { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--line-2); font-weight: 500; }
.ios-steps .n { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.ios-steps svg { width: 20px; height: 20px; color: var(--blue); flex: none; }

.leave { animation: leave .38s cubic-bezier(.4,0,.2,1) forwards !important; pointer-events: none; }
@keyframes leave { to { opacity: 0; transform: translateX(-40px) scale(.97); } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
  .main { animation: fadein .3s ease both; }
  @keyframes fadein { from { opacity: 0; } }
  .progress > i { animation: grow 1.1s cubic-bezier(.2,.8,.2,1) both .25s; transform-origin: right center; }
  @keyframes grow { from { transform: scaleX(0); } }
  .bars .b i { animation: barup .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 18ms + .25s); transform-origin: bottom center; }
  @keyframes barup { from { transform: scaleY(0); } }
  .login-hero .logo-chip { animation: popin .7s cubic-bezier(.2,1.5,.4,1) both .1s; }
  @keyframes popin { from { opacity: 0; transform: scale(.6) rotate(-6deg); } }
  .login-hero h1 { animation: rise .6s cubic-bezier(.2,.8,.2,1) both .2s; }
  .login-hero p { animation: rise .6s cubic-bezier(.2,.8,.2,1) both .28s; }
  .login-hero .badge-30 { animation: rise .6s cubic-bezier(.2,.8,.2,1) both .36s; }
  .login-card { animation: rise .75s cubic-bezier(.2,.8,.2,1) both .3s; }
  .login::after { content: ""; position: absolute; inset: -50%; pointer-events: none; background: radial-gradient(closest-side, rgba(255,255,255,.12), transparent); animation: drift 14s ease-in-out infinite alternate; }
  @keyframes drift { from { transform: translate(-20%, -10%); } to { transform: translate(20%, 15%); } }
  .kpi.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.18) 50%, transparent 65%); transform: translateX(120%); animation: sheen 3.2s ease-in-out 1s infinite; pointer-events: none; }
  @keyframes sheen { 0% { transform: translateX(120%); } 35%, 100% { transform: translateX(-120%); } }
  .cta { transition: transform .2s, box-shadow .2s; }
  .cta:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px rgba(208,17,27,.8); }
  .card.kpi { transition: transform .2s, box-shadow .2s; }
  .card.kpi:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(23,24,28,.04), 0 12px 28px -10px rgba(23,24,28,.18); }
  .sidebar nav a { transition: background .2s, color .2s, transform .2s; }
  .sidebar nav a:hover { transform: translateX(-3px); }
}
.login > * { position: relative; z-index: 1; }

@media print {
  .sidebar, .topbar, .bottomnav, .page-head .actions, .filters, .no-print { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
