:root {
  --primary: #18703A; --primary-dark: #12562C; --primary-tint: #E8F5EC;
  --cta: #C8500A; --cta-tint: #FFF1E6; --cta-ink: #9A3412;
  --ok: #17663F; --ok-tint: #E8F5EE; --warn: #8A5A00; --warn-tint: #FFF4D6; --bad: #B42318; --bad-tint: #FDECEA;
  --bg: #F6F7F3; --surface: #fff; --ink: #14181F; --muted: #5B6270; --line: #E3E6EB; --line-2: #EEF0F3;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Rubik, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid #F2A65A; outline-offset: 2px; }
.loading { padding: 48px; text-align: center; color: var(--muted); }
.ic { flex-shrink: 0; }
[dir='auto'] { unicode-bidi: plaintext; }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 250px; min-width: 200px; background: var(--primary); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 760px) { .side { max-width: none; flex-basis: 100%; padding: 14px; gap: 12px; } .side nav { flex-direction: row !important; flex-wrap: wrap; } .side .grow { display: none; } }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo b { display: block; font-size: 17px; } .logo .brand-dash { color: #FFB25C; } .logo b .brand-dash { display: inline; font-size: inherit; color: #FFB25C; } .logo span { font-size: 12px; color: #D2EBD9; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { min-height: 42px; padding: 0 12px; border-radius: 10px; color: #E6F4EA; text-decoration: none; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.side nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 500; }
.side nav a:hover { background: rgba(255, 255, 255, 0.10); }
.badge { margin-inline-start: auto; font-size: 12px; font-weight: 600; background: #fff; color: var(--primary); border-radius: 999px; padding: 1px 8px; }
.grow { flex: 1; }
.side .viewsite { color: #D2EBD9; font-size: 14px; padding: 0 12px; display: flex; align-items: center; gap: 6px; text-decoration: none; }
main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 760px) { main { padding: 18px 14px 40px; } }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.head h1 { margin: 0; font-size: 26px; font-weight: 700; }
.head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn { min-height: 42px; padding: 0 16px; border-radius: 10px; border: 0; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn-cta { background: var(--cta); color: #fff; } .btn-cta:hover { background: #A8430A; color: #fff; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-line { background: #fff; border: 1px solid #D6DBE1; color: var(--ink); font-weight: 500; }
.btn-soft { background: var(--primary-tint); color: var(--primary); }
.btn-danger { background: #fff; border: 1px solid #F0B7B1; color: var(--bad); font-weight: 500; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: 0.6; cursor: default; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-size: 28px; font-weight: 700; }
.stat small { font-size: 13px; color: var(--muted); }
.stat.warn { background: var(--warn-tint); } .stat.warn span, .stat.warn small { color: var(--warn); }

.panel { background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; }
.panel > h2, .panel-head { margin: 0; padding: 16px 18px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: start; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; padding: 12px 10px; white-space: nowrap; }
td { padding: 12px 10px; border-top: 1px solid var(--line-2); vertical-align: middle; }
th:first-child, td:first-child { padding-inline-start: 18px; } th:last-child, td:last-child { padding-inline-end: 18px; }
.num { text-align: end; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 10px; }
.who b { display: block; font-weight: 600; } .who small { color: var(--muted); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.s-active { background: var(--ok-tint); color: var(--ok); } .s-trial { background: var(--primary-tint); color: var(--primary); }
.s-expiring { background: var(--warn-tint); color: var(--warn); } .s-expired { background: var(--bad-tint); color: var(--bad); }
.s-hidden { background: var(--line-2); color: #3B4250; } .p-featured { background: var(--cta-tint); color: var(--cta-ink); } .p-basic { background: var(--line-2); color: #3B4250; }
.s-sample { background: #F3E8FF; color: #6D3FA8; }
.empty-row { padding: 28px 18px; text-align: center; color: var(--muted); }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: #3B4250; }
label.f small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input[type=month], input[type=tel], select, textarea {
  min-height: 42px; border: 1px solid #D6DBE1; border-radius: 10px; padding: 8px 12px; font-size: 15px; background: #fff; width: 100%;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.err { background: var(--bad-tint); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.imgs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { width: 104px; height: 84px; border-radius: 10px; background: #E4EEE0; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; color: #4E6A52; font-size: 12px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; inset-inline-end: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.upload { width: 104px; height: 84px; border-radius: 10px; border: 1.5px dashed #B9C3CC; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
.upload input { display: none; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login form { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 6px 24px rgba(20, 24, 31, 0.08); }
.login h1 { margin: 0; font-size: 22px; }

.cat-row { display: grid; grid-template-columns: 44px repeat(3, minmax(110px, 1fr)) 130px; gap: 8px; align-items: center; }
.cat-row .icprev { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.cat-item { border-top: 1px solid var(--line-2); padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.cat-item:first-child { border-top: 0; }
@media (max-width: 760px) { .cat-row { grid-template-columns: 44px 1fr; } }

.bar { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.list-plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.list-plain li { padding: 10px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.list-plain li:first-child { border-top: 0; }

/* Monthly report card: also prints cleanly */
.report { width: 390px; max-width: 100%; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 24px rgba(20, 24, 31, 0.10); }
.report header { background: var(--primary); color: #fff; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.report header .top { display: flex; justify-content: space-between; font-size: 13px; color: #D2EBD9; }
.report header .top b { color: #fff; font-size: 17px; }
.report .body { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.report .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report .big { background: var(--bg); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.report .big b { font-size: 32px; } .report .big span { font-size: 13px; color: var(--muted); }
.report .big.hot { background: var(--cta-tint); } .report .big.hot b { color: var(--cta-ink); }
.weeks { height: 110px; display: flex; align-items: flex-end; gap: 14px; border-bottom: 1px solid #D6DBE1; padding: 0 4px; }
.weeks div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 12px; font-weight: 600; color: #3B4250; }
.weeks i { width: 100%; max-width: 44px; border-radius: 6px 6px 0 0; background: var(--primary); display: block; }
.wlabels { display: flex; gap: 14px; padding: 0 4px; } .wlabels span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.rank { background: var(--ok-tint); color: var(--ok); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 500; }
@media print {
  .side, .noprint { display: none !important; }
  main { padding: 0; } body { background: #fff; }
  .report { box-shadow: none; margin: 0 auto; }
}

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #14181F; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 70; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); }

.sched-table { border-collapse: collapse; width: auto; font-size: 14px; }
.sched-table td { border: 0; padding: 4px 8px 4px 0; }
.sched-table td:first-child { padding-inline-start: 0; min-width: 130px; }
.sched-table input[type=time] { width: 120px; min-height: 38px; }
.sched[hidden], .sched-table[hidden] { display: none; }
.restore-first { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
