/* Maamulka */
:root {
  --bg: #f5f2ee; --card: #fff; --ink: #231d1a; --soft: #6d625b; --line: #e4ddd4; --side: #211b18;
  --gold: #a47a4d; --gold-d: #8a6338; --ok: #2f7a55; --ok-bg: #e2f3ea; --warn: #a8691a; --warn-bg: #fbf0dc; --bad: #a33a3a;
  --c1: #a47a4d; --c2: #2f7a55; --c3: #5f7fa8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 14px; }
a { color: var(--gold-d); }
button { font: inherit; cursor: pointer; }
.soft { color: var(--soft); } .small { font-size: 13px; }

/* gelitaanka */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.gate form { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px; }
.gate h1 { margin-bottom: 6px; }
.gate p { color: var(--soft); margin: 0 0 20px; }

/* qaab-dhismeedka */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: #e9e1d8; padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .logo { font-size: 18px; font-weight: 700; padding: 0 10px 20px; }
.side .logo small { display: block; font-weight: 400; font-size: 12px; opacity: .6; }
.side a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none; opacity: .78; margin-bottom: 2px; }
.side a:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.side a.on { opacity: 1; background: rgba(255, 255, 255, .12); font-weight: 600; }
.side .badge { background: #e0a94a; color: #2a1c08; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.side .grow { flex: 1; }
.main { padding: 28px 32px 80px; min-width: 0; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 15px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: var(--gold); }
.btn.pri { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.pri:hover { background: var(--gold-d); border-color: var(--gold-d); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat b { display: block; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat span { color: var(--soft); font-size: 13px; }
.stat.alert { border-color: #e0a94a; background: var(--warn-bg); }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }

/* jaantuska */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.chart .day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.chart .bars i { width: 28%; max-width: 12px; border-radius: 3px 3px 0 0; background: var(--c1); }
.chart .bars i.has { min-height: 3px; }
.chart .bars i:nth-child(2) { background: var(--c2); } .chart .bars i:nth-child(3) { background: var(--c3); }
.chart .day span { font-size: 10px; color: var(--soft); margin-top: 5px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--soft); margin-top: 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border: 0; }
.feed .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--soft); }
.feed .order_new .dot { background: #e0a94a; } .feed .order_paid .dot { background: var(--ok); } .feed .rsvp .dot { background: var(--c3); } .feed .invite_open .dot { background: var(--gold); }
.feed time { margin-left: auto; color: var(--soft); font-size: 12px; white-space: nowrap; padding-left: 10px; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--soft); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover { background: #faf7f3; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip.pending { background: var(--warn-bg); color: var(--warn); } .chip.active { background: var(--ok-bg); color: var(--ok); } .chip.closed, .chip.off { background: #eceae7; color: #5a534e; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--soft); }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; color: var(--soft); padding: 40px 10px; }

/* foomamka */
label { display: block; font-size: 13px; color: var(--soft); margin-bottom: 12px; }
input, textarea, select { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(164, 122, 77, .15); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 8px 0 0; }
input[type=color] { padding: 2px; height: 40px; cursor: pointer; }
.r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.r4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.check { display: flex; align-items: center; color: var(--ink); font-size: 14px; margin-bottom: 8px; }
.group { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.group:last-child { border: 0; margin: 0; padding: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pills button { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.pills button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.swatches button { width: 44px; height: 30px; border-radius: 8px; border: 1px solid var(--line); padding: 0; overflow: hidden; display: flex; }
.swatches button i { flex: 1; }
.tl-row { display: grid; grid-template-columns: 90px 1fr 36px; gap: 8px; margin-bottom: 8px; }
.tl-row input { margin: 0; }
.tl-row button { border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--soft); }
.file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--soft); }
.file img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.err { color: var(--bad); font-size: 14px; min-height: 1.3em; margin: 8px 0; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.sticky { position: sticky; top: 20px; }
.phone { width: 300px; height: 610px; margin: 0 auto; border-radius: 38px; border: 9px solid #1d1917; background: #1d1917; overflow: hidden; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 28px; background: #fff; }
.pv-acts { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tcard .thumb { position: relative; aspect-ratio: 390/480; overflow: hidden; background: var(--line); }
.tcard iframe { position: absolute; top: 0; left: 0; width: 390px; height: 480px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tcard .b { padding: 14px; }
.tcard h3 { margin: 0 0 4px; font-size: 16px; display: flex; justify-content: space-between; gap: 8px; }
.tcard .acts { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

.linkrow { display: flex; gap: 8px; margin-bottom: 10px; }
.linkrow input { margin: 0; font-size: 13px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px; gap: 4px; }
  .side .logo { padding: 0 10px; white-space: nowrap; } .side .logo small, .side .grow { display: none; }
  .side a { margin: 0; white-space: nowrap; gap: 6px; }
  .main { padding: 20px 16px 60px; }
  .cols, .editor { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 520px) { .r2 { grid-template-columns: 1fr; gap: 0; } .r4 { grid-template-columns: 1fr 1fr; } }
