:root {
  --saffron: #FF9A1F; --magenta: #E0307A; --indigo: #2B1B7A; --teal: #0B7A6F;
  --ink: #1E1A33; --muted: #6B6585; --line: #E6E2F0; --bg: #F6F4FB; --paper: #FFFFFF; --red: #A3124E;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

.top { background: linear-gradient(100deg, var(--saffron), var(--magenta) 45%, var(--indigo)); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.logo { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 9px; font-weight: 600; opacity: .85; }
nav a.on, nav a:hover { background: rgba(255, 255, 255, .18); opacity: 1; }

main.wrap { padding-top: 26px; padding-bottom: 40px; }
h1 { font-size: 1.5rem; margin-bottom: 18px; }
h2 { font-size: 1.1rem; margin-bottom: 14px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 22px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .9rem; }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; align-items: end; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
input, select { width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--magenta); }
.inline { display: flex; gap: 6px; }
.form-actions { display: flex; gap: 8px; }

.btn { display: inline-block; font: inherit; font-weight: 700; padding: 10px 16px; border-radius: 10px; border: 0; cursor: pointer; background: linear-gradient(90deg, var(--magenta), var(--indigo)); color: #fff; text-decoration: none; white-space: nowrap; }
.btn.sm { padding: 6px 11px; font-size: .85rem; font-weight: 600; }
.btn.ghost { background: #fff; color: var(--indigo); border: 1.5px solid var(--line); }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid #F5C6D8; }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; }
td.actions { display: flex; gap: 6px; }
td.actions form { margin: 0; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.tag.active, .tag.online { background: #E3F7F4; color: var(--teal); }
.tag.blocked { background: #FDEBF2; color: var(--red); }
.tag.expired, .tag.offline { background: #FFF1DF; color: #9A5200; }

.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }
.flash.ok { background: #E3F7F4; color: var(--teal); }
.flash.err { background: #FDEBF2; color: var(--red); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 14px 0; }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--saffron), var(--magenta) 48%, var(--indigo)); }
.auth .panel { width: 100%; max-width: 380px; margin: 0; }
.auth .form { grid-template-columns: 1fr; }
.auth h1 { margin-bottom: 6px; }
.auth p { margin-bottom: 16px; }
