:root {
  --y: #ffc400; --y2: #ffe27a; --ink: #1c1d21; --muted: #6b7280; --line: #e7e5e0;
  --bg: #f7f6f2; --card: #fff; --pos: #15803d; --neg: #c2410c; --danger: #dc2626;
  --r: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration-color: var(--y); text-underline-offset: 3px; }
h1 { font-size: 24px; margin: 0; } h2 { margin: 0 0 8px; } h3 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
small, .small { font-size: 12.5px; } .muted { color: var(--muted); } .pos { color: var(--pos); } .neg { color: var(--neg); } .r { text-align: right; } .center { text-align: center; }
.big { font-size: 20px; font-weight: 600; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--ink); color: #fff; }
.logo { font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -.02em; }
.logo span { background: var(--y); color: var(--ink); padding: 0 6px; border-radius: 6px; margin-right: 2px; }
.logo small { font-weight: 500; opacity: .6; font-size: 12px; }
.logo.big { font-size: 30px; margin: 10px 0 20px; } .logo.center { display: block; text-align: center; }
.top nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.top nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; opacity: .8; }
.top nav a:hover { opacity: 1; background: #ffffff14; }
.top nav a.active { background: var(--y); color: var(--ink); opacity: 1; font-weight: 600; }
.pill { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; }
.logout { margin-left: auto; } .logout button { background: none; border: 0; color: #fff; opacity: .6; cursor: pointer; font: inherit; }
.burger { display: none; margin-left: auto; font-size: 22px; cursor: pointer; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 20px 60px; }
.wrap.narrow { max-width: 620px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; } .card .pad { padding: 16px 18px 0; }
.grid2, .grid3, .grid4 { display: grid; gap: 16px; margin-bottom: 0; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #cfccc4; }
.btn.primary { background: var(--y); border-color: var(--y); color: var(--ink); font-weight: 600; } .btn.primary:hover { background: #ffb700; }
.btn.danger { color: var(--danger); } .btn.ghost { background: transparent; } .btn.small { padding: 4px 10px; font-size: 13px; } .btn.wide { width: 100%; justify-content: center; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font: inherit; } .link.danger { color: var(--danger); }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--y); border-color: var(--y); }
input[type=checkbox] { width: auto; accent-color: #d9a300; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); align-self: flex-end; padding-bottom: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1 1 150px; } .row > .grow, .grow { flex: 2 1 260px; }
.filters, .bulk { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 14px; }
.filters > input, .filters > select { width: auto; flex: 1 1 160px; } .filters label { flex-direction: row; align-items: center; }
.bulk { align-items: center; background: #fffbea; border-color: var(--y2); } .bulk select, .bulk input { width: auto; } .bulk input { flex: 1 1 220px; }
.search { display: flex; gap: 6px; } .search input { min-width: 220px; }
.inline { display: flex; gap: 6px; } .inline input { width: 120px; }
.copy { font-size: 12px; background: #fafaf7; cursor: pointer; margin-bottom: 6px; }
.total { font-size: 18px; margin: 0; padding: 10px 14px; background: #fffbea; border-radius: 9px; border: 1px dashed var(--y); }

.flash { padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; background: #ecfdf3; border: 1px solid #bbe5c9; }
.flash.err { background: #fef2f2; border-color: #f6caca; }

/* table */
.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid #f0eee9; vertical-align: top; }
.t tbody tr:hover { background: #fdfcf7; } .t tr.hl { background: #fffbea; }
.t tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.t td.desc { max-width: 280px; } .card:not(.flush) .t td { padding-left: 0; }
.t form { margin: 0; } .t select { width: auto; padding: 4px 8px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, white); border: 1px solid color-mix(in srgb, var(--c) 30%, white); }
.badge.big { font-size: 18px; padding: 6px 16px; margin: 8px 0 4px; }

/* dashboard */
.statuses { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 10px 12px; text-decoration: none; display: flex; flex-direction: column; }
.stat b { font-size: 26px; line-height: 1.1; } .stat span { font-size: 12.5px; color: var(--muted); } .stat:hover { border-color: var(--c); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; } .kpi b { font-size: 20px; } .kpi a { font-size: 12.5px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar-pair i { width: 40%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; }
i.in { background: var(--y); } i.out { background: #3f3f46; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin: 10px 0; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; } dt { color: var(--muted); font-size: 13px; } dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, #999); border: 2px solid #fff; }

.login { min-height: 100vh; display: grid; place-items: center; margin: -22px -20px; }
.login .card { width: 340px; display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.track-form .row input { font-size: 18px; }

@media (max-width: 1000px) {
  .statuses { grid-template-columns: repeat(4, 1fr); } .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 8px; } .burger { display: block; }
  .top nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; }
  #navt:checked ~ nav { display: flex; } .logout { margin: 0; padding: 8px 12px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } .statuses { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 16px 12px 50px; } .search input { min-width: 0; } .search { width: 100%; } .search input { flex: 1; }
}
.pw-row{display:flex;gap:8px;flex-wrap:wrap}
.pw-row input{flex:1 1 160px;font-family:ui-monospace,Consolas,monospace;font-size:16px;letter-spacing:.04em;color:var(--ink)}
.creds{border-color:#bbe5c9;background:#f3fbf6}
.creds textarea{font-family:ui-monospace,Consolas,monospace;font-size:15px;line-height:1.6;background:#fff;margin-bottom:12px;resize:none}
.row-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.users-grid{grid-template-columns:1fr}
.row-actions{white-space:nowrap}
.row-actions .btn{white-space:nowrap}
@media (max-width:1000px){.users-grid{grid-template-columns:1fr}}
[hidden]{display:none !important}
.login-card{width:360px;max-width:100%;display:flex;flex-direction:column;gap:14px}
.login-form{display:flex;flex-direction:column;gap:14px}
.login-form label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--muted)}
.btn.tg{background:#2AABEE;border-color:#2AABEE;color:#fff;font-weight:600;padding:11px 14px}
.btn.tg:hover{background:#229ED9}
.tg-wait{display:flex;gap:10px;align-items:center;font-size:13px;color:var(--muted)}
.spin{width:16px;height:16px;flex:none;border-radius:50%;border:3px solid #e5e2da;border-top-color:#2AABEE;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.05em}
.or::before,.or::after{content:"";flex:1;height:1px;background:var(--line)}
.phone-form{display:flex;gap:6px}
.phone-form input{width:150px;padding:5px 8px}
