/* Ofis Kasası — super admin panel. Desktop first; under 860px the same screens become cards. */
@font-face { font-family: 'Montserrat'; src: url(/fonts/Montserrat-Regular.ttf) format('truetype'); font-weight: 400 500; }
@font-face { font-family: 'Montserrat'; src: url(/fonts/Montserrat-Bold.ttf) format('truetype'); font-weight: 600 700; }
@font-face { font-family: 'Montserrat'; src: url(/fonts/Montserrat-ExtraBold.ttf) format('truetype'); font-weight: 800 900; }
:root { --navy: #0d2350; --navy2: #16357a; --yellow: #f6c343; --yellow-d: #e2ab22; --bg: #eef1f6; --card: #fff; --ink: #14213d;
  --muted: #535d75; --line: #e1e6ef; --green: #12704b; --orange: #94500f; --red: #b3261e; --r: 12px;
  --sh: 0 1px 2px rgba(13,35,80,.06), 0 4px 14px rgba(13,35,80,.06); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Montserrat', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; } button:disabled { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 800; margin: 0 0 12px; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.link { color: var(--navy2); font-weight: 700; background: none; border: 0; padding: 0; }
.loading { min-height: 40vh; display: grid; place-items: center; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #cfd6e4; border-top-color: var(--navy2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; background: linear-gradient(90deg, var(--navy) 232px, transparent 232px); }
.side { background: var(--navy); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 4px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px; }
.side .logo b { display: block; font-size: 17px; font-weight: 800; } .side .logo b span { color: var(--yellow); }
.side .logo small { color: #b9c4dd; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.side a.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-weight: 600; color: #d5dcec; }
.side a.item:hover { background: rgba(255,255,255,.07); }
.side a.item.on { background: var(--yellow); color: var(--navy); }
.side a.item i { width: 20px; text-align: center; font-style: normal; }
.side .sep { margin: 10px 8px 4px; font-size: 10.5px; letter-spacing: .1em; color: #8f9dbd; font-weight: 700; }
.side .me { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; color: #b9c4dd; }
.side .me b { display: block; color: #fff; font-size: 13px; }
.side .me button { color: var(--yellow); background: none; border: 0; padding: 0; font-weight: 700; margin-top: 4px; }
.main { min-width: 0; padding: 0 0 48px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 26px; position: sticky; top: 0; background: rgba(238,241,246,.94); backdrop-filter: blur(6px); z-index: 5; border-bottom: 1px solid var(--line); }
.topbar .title { min-width: 0; } .topbar .gap { flex: 1; }
.topbar .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { display: none; border: 0; background: var(--navy); color: #fff; border-radius: 9px; width: 38px; height: 38px; font-size: 18px; flex: none; }
.nowrap-lg { white-space: nowrap; }
.demo-badge { background: #fff7df; color: #6b4a00; border: 1px solid #f1d98a; border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.content { padding: 22px 26px; display: grid; gap: 18px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px 18px; min-width: 0; }
.card > .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; } .card > .head h2 { margin: 0; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.error-box { background: #fbe9e7; color: var(--red); border-radius: 9px; padding: 9px 12px; font-weight: 600; }
.note-box { background: #eef3fd; color: var(--navy2); border-radius: 9px; padding: 9px 12px; font-weight: 600; }

/* Buttons, badges, fields */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 13px; font-weight: 700; display: inline-block; }
.btn.primary { background: var(--yellow); border-color: var(--yellow-d); color: var(--navy); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--red); border-color: #efc7c4; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.badge.green { background: #e3f4ec; color: var(--green); } .badge.red { background: #fbe9e7; color: var(--red); }
.badge.yellow { background: #fff3cf; color: #6b4a00; } .badge.blue { background: #e6edfb; color: var(--navy2); } .badge.orange { background: #fdecd8; color: var(--orange); }
.field { display: grid; gap: 5px; align-content: start; } .field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea, .filters input, .filters select { border: 1px solid #c9d1e0; border-radius: 9px; padding: 9px 11px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .filters input:focus, .filters select:focus { outline: 2px solid var(--navy2); outline-offset: 1px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Numbers */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; } .stat span { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.bar { height: 8px; border-radius: 99px; background: #e6eaf2; overflow: hidden; margin-top: 8px; } .bar i { display: block; height: 100%; background: var(--navy2); border-radius: 99px; min-width: 3px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -18px -16px; }
.card > .table-wrap:first-child { margin-top: -16px; border-radius: var(--r) var(--r) 0 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8f9fc; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 18px; } th:last-child, td:last-child { padding-right: 18px; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f6f8fc; }
.thumb { width: 54px; height: 40px; border-radius: 7px; object-fit: cover; display: block; background: #dfe5ef; }
.office-name { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; } .filters > * { flex: 1 1 165px; min-width: 0; } .filters .search { flex: 2 1 200px; } .filters .btn { flex: 0 0 auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; }

/* Office detail */
.office-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.office-grid > .col { display: grid; gap: 18px; min-width: 0; } .office-grid > .col.sticky { position: sticky; top: 84px; }
.colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.color { display: flex; align-items: center; gap: 8px; border: 1px solid #c9d1e0; border-radius: 9px; padding: 6px 8px; background: #fff; }
.color input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; border-radius: 6px; }
.color span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.swatches { display: flex; gap: 6px; } .swatches span { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,.08); }
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 22px; }
.flag { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.flag:last-child { border-bottom: 0; }
.switch { width: 40px; height: 23px; border-radius: 99px; background: #c9d1e0; border: 0; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--green); } .switch.on::after { left: 20px; }
.phone { width: 250px; margin: 0 auto; border: 8px solid #101522; border-radius: 34px; overflow: hidden; background: #eef1f6; box-shadow: var(--sh); }
.phone .p-top { padding: 30px 14px 26px; text-align: center; color: #fff; }
.phone .p-top img { height: 20px; max-width: 150px; object-fit: contain; display: block; margin: 0 auto 14px; }
.phone .p-top b { font-size: 19px; font-weight: 800; display: block; } .phone .p-top small { font-size: 9.5px; font-weight: 700; opacity: .85; }
.phone .p-card { margin: -12px 12px 14px; background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--sh); }
.phone .p-seg { display: grid; grid-template-columns: 1fr 1fr; background: #eef1f6; border-radius: 9px; padding: 3px; font-size: 10.5px; font-weight: 700; text-align: center; margin-bottom: 10px; }
.phone .p-seg span { padding: 6px; border-radius: 7px; } .phone .p-seg span:first-child { background: #fff; }
.phone .p-input { height: 30px; border: 1px solid #c9d1e0; border-radius: 8px; margin-bottom: 8px; }
.phone .p-btn { height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.phone .p-foot { padding: 0 12px 16px; font-size: 9.5px; color: var(--muted); text-align: center; }
.logo-chip { height: 34px; padding: 0 10px; border-radius: 8px; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; }
.logo-chip img { height: 14px; max-width: 110px; object-fit: contain; display: block; }

/* Drawer (listing detail) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(13,35,80,.35); z-index: 20; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: #fff; z-index: 21; box-shadow: -8px 0 30px rgba(13,35,80,.18); transform: translateX(102%); transition: transform .2s; overflow-y: auto; }
.drawer-open .drawer-backdrop { display: block; } .drawer-open .drawer { transform: none; }
.drawer img.hero { width: 100%; height: 230px; object-fit: cover; display: block; background: #dfe5ef; }
.drawer .no-photo { height: 90px; display: grid; place-items: center; background: #dfe5ef; color: var(--muted); font-weight: 700; }
.drawer .strip { display: flex; gap: 6px; padding: 6px 18px 0; overflow-x: auto; } .drawer .strip img { width: 62px; height: 46px; object-fit: cover; border-radius: 6px; flex: none; cursor: pointer; background: #dfe5ef; }
.drawer .body { padding: 16px 18px 28px; display: grid; gap: 14px; }
.props { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.props div { padding: 8px 10px; border-bottom: 1px solid var(--line); } .props div:nth-child(odd) { border-right: 1px solid var(--line); }
.props small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; } .props b { font-weight: 700; overflow-wrap: anywhere; }
.internal-box { border: 1.5px dashed #e2c15a; background: #fffaf0; border-radius: 10px; padding: 10px 12px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Dialog and toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(13,35,80,.45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: min(480px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: grid; gap: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.big-code { font-size: 34px; font-weight: 800; letter-spacing: .18em; text-align: center; padding: 12px; background: #f3f6fd; border-radius: 12px; font-variant-numeric: tabular-nums; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; pointer-events: none; }
#toast div { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; box-shadow: var(--sh); }
#toast div.bad { background: var(--red); }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy), var(--navy2)); padding: 20px; }
.signin .brand { text-align: center; color: #fff; margin-bottom: 16px; } .signin .brand b { font-size: 24px; font-weight: 800; } .signin .brand b span { color: var(--yellow); }
.signin .brand div { font-weight: 700; letter-spacing: .1em; font-size: 12px; margin-top: 4px; }
.signin > div { width: min(380px, 100%); } .signin .box { background: #fff; border-radius: 18px; padding: 26px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: grid; gap: 14px; }
.signin .box h2 { margin-bottom: 4px; }
.signin .code-input { font-size: 26px; font-weight: 800; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.signin .qr { display: block; width: 190px; height: 190px; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.signin .secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; text-align: center; background: #f3f6fd; border-radius: 8px; padding: 8px; }
.signin .center { text-align: center; }

/* Phone layout */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; z-index: 30; width: 250px; left: 0; top: 0; bottom: 0; height: auto; transform: translateX(-102%); transition: transform .2s; }
  .menu-open .side { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.3); }
  .menu-btn { display: block; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; } .topbar .gap { display: none; } .topbar .title { flex: 1; }
  .topbar .actions { flex: 1 0 100%; justify-content: flex-start; } .topbar .actions:empty { display: none; }
  .content { padding: 14px; gap: 14px; }
  h1 { font-size: 18px; }
  .stats { grid-template-columns: 1fr 1fr; } .stats .wide { grid-column: 1 / -1; }
  .office-grid, .two, .flags { grid-template-columns: 1fr; } .colors { grid-template-columns: 1fr 1fr; }
  .office-grid > .col.sticky { position: static; }
  .table-wrap, .card > .table-wrap:first-child { margin: 0; overflow: visible; border-radius: 0; }
  table, tbody, tr, td { display: block; } thead { display: none; }
  tbody tr { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
  tbody tr:last-child { margin-bottom: 0; }
  td { padding: 0 !important; border: 0; } td.full { grid-column: 1 / -1; } td.hide-sm { display: none; } td.right { text-align: left; }
  td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: 11.5px; font-weight: 700; }
  .demo-badge { flex: 1 0 100%; text-align: center; white-space: normal; }
  .nowrap-lg { white-space: normal; }
}
