/* 4 Horseman Security — administrator dashboard and client portal (extends styles.css). */
.dash-wrap { max-width: 1240px; }
.dash { padding: 30px 22px 90px; min-height: 60vh; }
.noscroll { overflow: hidden; }
.grow { flex: 1; }

/* tabs */
.tabs-bar { position: sticky; top: 72px; z-index: 9; background: rgba(6, 8, 14, .86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line2); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 15px 16px 13px; color: var(--muted); font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--gold-hi); border-bottom-color: var(--gold); }

.dash-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.dash-head h1 { font-size: clamp(30px, 4vw, 42px); margin-top: 10px; }
.dash-head p { margin-top: 8px; max-width: 760px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.card h3 { font-size: 20px; }
.small-price { font: 500 34px/1 var(--serif); margin: 6px 0 0; }
.small-price small { font: 500 15px var(--sans); color: var(--muted); }
.bad-text { color: var(--bad); } .warn-text { color: var(--warn); } .ok-text { color: var(--ok); }
.pill.warn { color: var(--warn); border-color: rgba(240, 180, 90, .4); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { display: flex; flex-direction: column; gap: 8px; text-align: start; padding: 18px 20px; border-radius: 16px; background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line2); color: var(--text); font: inherit; cursor: pointer; }
div.tile { cursor: default; }
a.tile:hover, button.tile:hover { border-color: var(--line); text-decoration: none; }
.tile span { color: var(--muted); font-size: 13px; }
.tile b { font: 500 28px/1.1 var(--serif); }

/* toolbars */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.seg-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg-nav .range { margin-inline-start: 8px; font-weight: 600; }
.sel, .form select, .form input, .form textarea { background: #0a0d16; border: 1px solid var(--line2); border-radius: 12px; color: var(--text); font: 15px var(--sans); padding: 10px 12px; outline: none; }
.sel:focus, .form select:focus, .form input:focus, .form textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 182, 126, .12); }
.form input, .form select, .form textarea { width: 100%; }
.form textarea { resize: vertical; }
.form .field { margin-top: 14px; }
.form .field label { display: block; font: 600 11.5px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.form .hint { color: var(--dim); font-size: 13px; margin-top: 6px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.row4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .row2, .row3 { grid-template-columns: 1fr; } }
input[type=date], input[type=time] { color-scheme: dark; }
.btn-link { background: none; border: 0; color: var(--gold-hi); font: 500 14px var(--sans); cursor: pointer; padding: 6px 4px; }
.btn-link:hover { text-decoration: underline; }
.money-in { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.money-in input { width: 96px; text-align: end; background: #0a0d16; border: 1px solid var(--line2); border-radius: 10px; color: var(--text); font: 14px var(--sans); padding: 7px 9px; }
.money-in.big input { width: 100%; }
.days, .checks-row { display: flex; flex-wrap: wrap; gap: 8px; }
.day { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line2); border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 14px; color: var(--muted); }
.day input { accent-color: var(--gold); width: 15px !important; height: 15px; margin: 0; }
.day:has(input:checked) { border-color: var(--gold); color: var(--text); }
.portal-set { border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px 16px; margin: 18px 0 0; }
.portal-set legend { padding: 0 8px; color: var(--gold); font: 600 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; }

/* lists & tables */
.list { list-style: none; margin: 14px 0 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.list li:last-child { border: 0; }
.req-list li { cursor: pointer; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 14px; margin-bottom: 10px; background: var(--panel); }
.req-list li:hover, .req-list li:focus { border-color: var(--line); outline: none; }
.empty { border: 1px dashed var(--line); border-radius: 16px; padding: 26px; text-align: center; color: var(--muted); margin: 14px 0; }
.empty b { color: var(--text); display: block; font-weight: 600; }
.empty p { margin-top: 6px; font-size: 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th { text-align: start; font: 600 11.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 13px 14px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tfoot td { border-top: 1px solid var(--line); font-weight: 600; }
table.data .n { text-align: end; white-space: nowrap; }
table.data.click tbody tr { cursor: pointer; }
table.data.click tbody tr:hover, table.data.click tbody tr:focus { background: rgba(214, 182, 126, .05); outline: none; }
table.lines td { padding: 8px; }
table.lines input { background: #0a0d16; border: 1px solid var(--line2); border-radius: 10px; color: var(--text); font: 14px var(--sans); padding: 8px 10px; width: 100%; }
table.lines input.num { width: 90px; text-align: end; }
.inv-total-box b { display: block; font: 500 26px/1.6 var(--serif); }

/* schedule */
.sched-wrap { overflow-x: auto; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); }
table.sched { border-collapse: collapse; width: 100%; min-width: 980px; table-layout: fixed; }
table.sched th, table.sched td { border-bottom: 1px solid var(--line2); border-inline-start: 1px solid var(--line2); padding: 8px; vertical-align: top; }
table.sched thead th { font-weight: 500; color: var(--muted); text-align: center; padding: 10px 6px; }
table.sched thead th span { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
table.sched thead th b { font: 500 20px var(--serif); color: var(--text); }
table.sched thead th:first-child, table.sched tbody th { width: 190px; text-align: start; border-inline-start: 0; }
table.sched thead th:last-child, table.sched td.tot { width: 92px; text-align: center; }
table.sched tbody th { font-weight: 600; font-size: 14px; }
table.sched tbody th small { display: block; color: var(--dim); font-weight: 400; font-size: 12px; margin-top: 2px; }
table.sched td.tot { font-weight: 600; font-size: 14px; vertical-align: middle; }
table.sched td.tot small { display: block; font-size: 11px; font-weight: 500; }
table.sched .today { background: rgba(214, 182, 126, .05); }
table.sched td { height: 64px; position: relative; }
table.sched td .add { display: block; width: 100%; margin-top: 4px; border: 1px dashed transparent; border-radius: 8px; background: none; color: var(--dim); font-size: 16px; line-height: 22px; cursor: pointer; }
table.sched td:hover .add, table.sched td .add:focus { border-color: var(--line); color: var(--gold); }
.chip { display: block; width: 100%; text-align: start; border: 0; border-radius: 9px; padding: 6px 8px; margin-bottom: 4px; cursor: pointer; font: 12.5px/1.25 var(--sans); color: #14110a; }
.chip b { display: block; font-weight: 600; }
.chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.chip i { font-style: normal; float: inline-end; }
.chip.s0 { background: #d6b67e; } .chip.s1 { background: #8fb7e8; } .chip.s2 { background: #9ad8bd; } .chip.s3 { background: #d8a6e0; }
.chip.clash { outline: 2px solid var(--bad); outline-offset: 1px; }
.sched-foot { margin-top: 10px; }

/* clients */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.client h3 { font-size: 21px; }
.client .kv { grid-template-columns: auto 1fr; }
.portal-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.portal-url { font: 500 17px var(--sans); color: var(--gold-hi); margin: 8px 0 6px; word-break: break-all; }
.thread { display: grid; gap: 10px; margin: 18px 0 6px; max-height: 46vh; overflow-y: auto; }
.bubble { background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; padding: 10px 14px; max-width: 86%; }
.bubble.me { justify-self: end; border-color: var(--line); background: rgba(214, 182, 126, .08); }
.bubble .who { color: var(--dim); font-size: 12px; margin-bottom: 4px; }

/* due banner */
.due-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; margin-bottom: 22px; border-radius: 16px;
  background: rgba(239, 111, 108, .1); border: 1px solid rgba(239, 111, 108, .4); color: #ffd9d7; }
.due-banner p { margin-top: 4px; font-size: 14px; }

/* modal & toast */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(3, 4, 8, .72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { position: relative; width: 100%; max-width: 560px; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 20px; padding: 28px; margin: auto; box-shadow: 0 40px 90px -30px #000; }
.modal.wide { max-width: 900px; }
.modal h2 { font-size: 28px; padding-inline-end: 30px; }
.modal-x { position: absolute; top: 14px; inset-inline-end: 16px; background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.modal-x:hover { color: var(--text); }
.modal .btn-row { align-items: center; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 13px 20px; border-radius: 14px; font-size: 14px; font-weight: 500;
  background: #12261f; color: #c6f3e2; border: 1px solid rgba(79, 209, 161, .4); box-shadow: 0 20px 40px -15px #000; max-width: calc(100vw - 32px); }
.toast.err { background: #2a1414; color: #ffc9c7; border-color: rgba(239, 111, 108, .4); }

/* invoice paper (on screen) */
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-inline-end: 34px; }
.paper { background: #fff; color: #141820; border-radius: 12px; margin-top: 16px; overflow-x: auto; }
.paper .inv-doc { padding: 32px; font-size: 14px; line-height: 1.5; min-width: 560px; }
.paper .inv-top { display: flex; justify-content: space-between; gap: 30px; border-bottom: 2px solid #b8955a; padding-bottom: 18px; }
.paper .inv-from { font: 600 21px var(--serif); } .paper .inv-addr { color: #555; margin-top: 6px; }
.paper .inv-meta { min-width: 220px; } .paper .inv-meta div { display: flex; justify-content: space-between; gap: 14px; } .paper .inv-meta span { color: #666; }
.paper .inv-title { font: 600 28px var(--serif); color: #8e6936; justify-content: flex-end !important; }
.paper .inv-to { margin: 22px 0; }
.paper .inv-to > span, .paper .inv-note > span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8e6936; margin-bottom: 4px; }
.paper .inv-period { color: #555; margin-top: 8px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: #666; border-bottom: 1px solid #ccc; padding: 8px 6px; }
.paper td { padding: 9px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.paper .n { text-align: end; white-space: nowrap; }
.paper .inv-sum { margin: 14px 0 0 auto; max-width: 300px; } .paper .inv-sum div { display: flex; justify-content: space-between; padding: 4px 0; }
[dir="rtl"] .paper .inv-sum { margin: 14px auto 0 0; }
.paper .inv-total { border-top: 2px solid #141820; margin-top: 6px; padding-top: 8px !important; font-size: 17px; }
.paper .inv-note { margin-top: 22px; } .paper .inv-st { font-weight: 600; } .paper .inv-overdue { color: #b42318; } .paper .inv-paid { color: #067647; }

.lang-select.big { max-width: none; width: 100%; padding-top: 12px; padding-bottom: 12px; font-size: 16px; border-radius: 12px; }

/* client portal */
.portal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.rep { border: 1px solid var(--line2); border-radius: 16px; padding: 16px 18px; background: var(--panel); margin-bottom: 12px; }
.rep summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.rep summary::-webkit-details-marker { display: none; }
.rep .body { margin-top: 12px; color: #d7d9e2; font-size: 15px; white-space: pre-wrap; }
.rep .photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rep .photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.rep dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; font-size: 14px; }
.rep dt { color: var(--muted); } .rep dd { margin: 0; }
.type-badge { font: 600 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
@media print { .top, .tabs-bar, footer, .toolbar, .btn { display: none !important; } body { background: #fff; color: #000; } }
.pill { white-space: nowrap; flex: none; }
.inv-doc section, .inv-doc header { padding: 0; }
.form .field label.day, .form label.check { display: inline-flex; text-transform: none; letter-spacing: 0; font: 400 14px/1.3 var(--sans); margin: 0; color: var(--muted); }
.form .field label.day:has(input:checked) { color: var(--text); }
@media (max-width: 760px) { .dash-body .top .hide-sm { display: none; } .dash { padding-top: 22px; } .modal { padding: 22px 18px; } .tiles { gap: 10px; } .tile b { font-size: 22px; } }
@media (max-width: 480px) { .dash-body .brand > span { display: none; } }
.form input[type=checkbox], .form input[type=radio] { width: 16px; height: 16px; flex: none; accent-color: var(--gold); }
.form label.check { gap: 10px; align-items: center; }
table.sched td.tot small { font-size: 10.5px; overflow-wrap: anywhere; }

/* plans */
.plan-name { font-weight: 600; margin-bottom: 4px; }
.plan-opt.off { opacity: .55; cursor: not-allowed; }
.wide-card { grid-column: 1 / -1; }
.list select.inq { width: auto; min-width: 130px; background: #0a0d16; color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 14px; }
