/* NILORA — Admin dashboard */
body.is-admin { background: #F4F1EA; padding-bottom: 0; }
body.is-admin .hdr, body.is-admin .ftr, body.is-admin .tabbar, body.is-admin .app-fab, body.is-admin .app-fab-l, body.is-admin .chat-fab { display: none !important; }
.adm { display: grid; grid-template-columns: 292px minmax(0, 1fr); min-height: 100vh; }
.adm-side { position: sticky; top: 0; height: 100vh; background: var(--night); color: #CFC8BA; display: flex; flex-direction: column; padding: 22px 16px; gap: 6px; overflow-y: auto; }
.adm-side .logo { color: #fff; padding: 4px 8px 22px; }
.adm-side .logo small { color: var(--gold-l); }
.adm-nav { display: grid; gap: 4px; }
.adm-nav button, .adm-side a.out { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 12px; font-weight: 700; font-size: 15px; color: #CFC8BA; text-align: start; transition: background .2s, color .2s; }
.adm-nav button:hover, .adm-side a.out:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.adm-nav button.on { background: linear-gradient(135deg, rgba(233, 210, 154, .18), rgba(201, 160, 78, .06)); color: var(--gold-l); box-shadow: inset 2px 0 0 var(--gold); }
html[dir=rtl] .adm-nav button.on { box-shadow: inset -2px 0 0 var(--gold); }
.adm-nav .cnt { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--nile); color: #fff; font-size: 12px; display: grid; place-items: center; }
.adm-side .foot { margin-top: auto; display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.adm-side .pgc-credit { margin-top: 10px; }
.adm-main { min-width: 0; }
.adm-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px clamp(16px, 3vw, 34px); background: rgba(244, 241, 234, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.adm-top h1 { font-size: clamp(24px, 3vw, 32px); }
.adm-top .sub { color: var(--muted); font-size: 13px; font-weight: 600; }
.adm-top .tools { display: flex; gap: 8px; margin: 0; margin-inline-start: auto; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-l), var(--gold-d)); color: var(--night); display: grid; place-items: center; font-weight: 800; }
.adm-body { padding: clamp(16px, 3vw, 34px); display: grid; gap: 22px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: #fff; border-radius: 18px; padding: 20px; border: 1px solid var(--line); display: grid; gap: 6px; position: relative; overflow: hidden; }
.kpi .ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--sand); color: var(--gold-d); }
.kpi small { color: var(--muted); font-weight: 700; font-size: 13px; }
.kpi b { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; color: var(--lapis); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .delta { font-size: 12px; font-weight: 800; color: #1F8A5B; }
.kpi .delta.neg { color: #C25B4F; }
.kpi:first-child { background: linear-gradient(150deg, var(--lapis-2), var(--night)); color: #fff; border: 0; }
.kpi:first-child b { color: var(--gold-l); }
.kpi:first-child small { color: #B9B3A6; }
.kpi:first-child .ico { background: rgba(233, 210, 154, .15); color: var(--gold-l); }
.kpi:first-child .delta { color: #7FE0B0; }
.panels { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.panel { background: #fff; border-radius: 20px; border: 1px solid var(--line); padding: 22px; min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-h h2 { font-size: 24px; }
.panel-h small { color: var(--muted); font-weight: 600; }
.bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; height: 240px; padding-top: 22px; }
.bars div { display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; gap: 8px; }
.bars i { width: 100%; max-width: 54px; border-radius: 10px 10px 4px 4px; background: linear-gradient(0deg, var(--lapis-3), var(--lapis-2)); position: relative; transition: height .8s var(--ease); min-height: 4px; }
.bars div:last-child i { background: linear-gradient(0deg, var(--gold), var(--gold-l)); }
.bars i span { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 800; font-style: normal; white-space: nowrap; color: var(--lapis); }
.bars small { font-size: 12px; font-weight: 700; color: var(--muted); }
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; gap: 6px; }
.hbar div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 700; }
.hbar div:first-child span:last-child { white-space: nowrap; color: var(--lapis); }
.hbar .track { height: 10px; border-radius: 6px; background: var(--sand); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--nile), var(--nile-l)); }
.stackbar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; margin: 6px 0 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid #F0EBE1; vertical-align: middle; }
.tbl tr:hover td { background: #FBF9F4; }
.tbl .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.tbl .ref { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 13px; white-space: nowrap; }
.who b { display: block; }
.who small { color: var(--muted); }
.st { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.st-pending { background: #FFF3D6; color: #8A6212; }
.st-confirmed { background: #DDF1EC; color: #16685F; }
.st-paid { background: #E1E9F7; color: #1F4A8A; }
.st-cancelled { background: #F7E1DE; color: #9B3A2F; }
select.st { border: 0; appearance: none; -webkit-appearance: none; padding-inline-end: 22px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23555' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; font-family: inherit; }
html[dir=rtl] select.st { background-position: left 8px center; }
.fbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.fbar .field { flex: 1 1 240px; }
.trow { display: grid; grid-template-columns: 76px minmax(0, 1fr) 130px auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid #F0EBE1; }
.trow img { width: 76px; height: 58px; border-radius: 12px; object-fit: cover; }
.trow h3 { font-size: 19px; }
.trow .meta { margin-top: 2px; }
.trow .input { min-height: 42px; text-align: end; font-weight: 800; }
.trow .acts { display: flex; gap: 6px; align-items: center; }
.sw { position: relative; width: 46px; height: 26px; flex: none; }
.sw input { opacity: 0; position: absolute; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.sw span { position: absolute; inset: 0; border-radius: 13px; background: #D8D2C5; transition: background .2s; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.sw input:checked + span { background: var(--nile); }
.sw input:checked + span::after { transform: translateX(20px); }
html[dir=rtl] .sw span::after { left: auto; right: 3px; }
html[dir=rtl] .sw input:checked + span::after { transform: translateX(-20px); }
.trow .acts .swl { gap: 8px; margin-inline-end: 6px; }
.sw input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.swl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.mini { min-height: 38px; padding: 0 14px; font-size: 13px; }
.danger { color: #9B3A2F; }
.danger.arm { background: #9B3A2F; color: #fff; }
.inq { display: grid; gap: 12px; }
.inq-c { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.inq-c.done { opacity: .55; }
.inq-c .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--sand); display: grid; place-items: center; color: var(--gold-d); }
.inq-c p { color: var(--ink); margin-top: 4px; font-size: 15px; overflow-wrap: anywhere; }
.inq-c small { color: var(--muted); font-weight: 600; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.set-grid .panel { display: grid; gap: 14px; align-content: start; }
.img-pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.img-pick label { position: relative; cursor: pointer; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; }
.img-pick input { position: absolute; opacity: 0; }
.img-pick img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; opacity: .6; }
.img-pick input:checked + img { opacity: 1; outline: 3px solid var(--gold); outline-offset: -3px; }
.adm-tabs { display: none; }
/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; isolation: isolate; background: var(--night); }
.login > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: blur(2px) brightness(.55); }
.login::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 40%, rgba(11, 26, 42, .2), rgba(11, 26, 42, .85)); }
.login-card { width: min(420px, 100%); background: rgba(251, 247, 240, .97); border-radius: 26px; padding: 34px 30px; box-shadow: var(--sh-lg); display: grid; gap: 16px; }
.login-card .logo { justify-content: center; margin-bottom: 6px; }
.login-card h1 { font-size: 30px; text-align: center; }
.login-card p { text-align: center; color: var(--muted); font-size: 14px; }
.hint { padding: 10px 14px; border-radius: 12px; background: var(--sand); font-size: 13px; color: var(--muted); text-align: center; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .panels { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { display: none; }
  .adm-main { padding-bottom: calc(72px + var(--safe-b)); }
  .adm-tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 70; inset: auto 0 0; height: calc(66px + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--night); }
  .adm-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: #8F97A3; position: relative; }
  .adm-tabs button.on { color: var(--gold-l); }
  .adm-tabs .ico { width: 23px; height: 23px; }
  .adm-tabs .cnt { position: absolute; top: 8px; inset-inline-end: calc(50% - 22px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--nile); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
  .set-grid { grid-template-columns: 1fr; }
  .trow { grid-template-columns: 64px minmax(0, 1fr); }
  .trow img { width: 64px; height: 50px; }
  .trow .pr, .trow .acts { grid-column: 1 / -1; }
  .trow .acts { justify-content: space-between; flex-wrap: wrap; }
  .adm-top .hide-s { display: none; }
}
@media (max-width: 600px) {
  .kpis { gap: 10px; } .kpi { padding: 14px; } .kpi .ico { width: 34px; height: 34px; padding: 7px; }
  .bars { gap: 6px; height: 200px; } .bars i span { font-size: 10px; }
  .tbl.stack tbody tr { display: grid; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tbl.stack thead { display: none; }
  .tbl.stack td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 0; text-align: end; }
  .tbl.stack td::before { content: attr(data-l); font-size: 12px; font-weight: 800; color: var(--muted); text-align: start; }
  .tbl.stack td.num { justify-content: space-between; }
  .img-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .inq-c { grid-template-columns: auto minmax(0, 1fr); }
  .inq-c > :last-child { grid-column: 1 / -1; }
  .panel { padding: 16px; }
}
