/* HOLVPN BOT — admin panel theme */
:root{
  --bg:#f5f6fb; --panel:#ffffff; --ink:#0f172a; --ink-2:#334155; --muted:#64748b;
  --line:#e6e9f3; --line-2:#eef1f8;
  --brand:#4f46e5; --brand-2:#7c3aed; --brand-soft:#eef0ff;
  --ok:#0e9f6e; --ok-soft:#e7f8f1;
  --warn:#b45309; --warn-soft:#fef4e6;
  --bad:#dc2626; --bad-soft:#fdecec;
  --radius:16px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow:0 1px 2px rgba(16,24,40,.04), 0 12px 32px -18px rgba(16,24,40,.28);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"Inter","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:var(--bg); color:var(--ink);
  font-size:14px; line-height:1.55; -webkit-font-smoothing:antialiased;
}
a{color:var(--brand); text-decoration:none}
code{font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12.5px; background:#f3f5fb; border:1px solid var(--line); border-radius:6px; padding:1px 6px; color:#334155}
h1,h2,h3{margin:0; letter-spacing:-.01em}
.shell{display:flex; min-height:100vh}

/* ---------- sidebar ---------- */
.sidebar{
  width:264px; flex:0 0 264px; position:sticky; top:0; height:100vh;
  display:flex; flex-direction:column; padding:20px 16px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(124,58,237,.30), transparent 60%),
    radial-gradient(90% 50% at 100% 100%, rgba(56,189,248,.16), transparent 60%),
    linear-gradient(180deg,#0b1220 0%,#0e1526 60%,#0b1220 100%);
  color:#e2e8f0;
}
.logo{display:flex; align-items:center; gap:12px; padding:6px 8px 20px}
.logo-mark{
  width:38px; height:38px; border-radius:11px; flex:0 0 38px;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:17px; color:#fff; letter-spacing:-.03em;
  background:linear-gradient(135deg,#6366f1,#8b5cf6 55%,#22d3ee);
  box-shadow:0 6px 18px -6px rgba(99,102,241,.9);
}
.logo-title{font-weight:700; font-size:15px; color:#fff; letter-spacing:.01em}
.logo-sub{font-size:11.5px; color:#93a3bd; letter-spacing:.06em; text-transform:uppercase; margin-top:1px}
.nav{display:flex; flex-direction:column; gap:4px; margin-top:6px}
.nav-item{
  display:flex; align-items:center; gap:11px;
  padding:10px 12px; border-radius:11px; color:#b6c2d6; font-size:13.5px; font-weight:500;
  transition:background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item .nav-icon{display:flex; width:18px; height:18px; align-items:center; justify-content:center; opacity:.85}
.nav-item:hover{background:rgba(255,255,255,.07); color:#fff}
.nav-item.active{background:linear-gradient(90deg,rgba(99,102,241,.32),rgba(139,92,246,.16)); color:#fff; box-shadow:inset 0 0 0 1px rgba(148,163,255,.22)}
.nav-item.active .nav-icon{opacity:1}
.nav-item svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round}
.sidebar-foot{margin-top:auto; padding-top:16px; border-top:1px solid rgba(255,255,255,.08)}
.who{font-size:12.5px; color:#93a3bd; margin-bottom:10px}
.who b{color:#fff; font-weight:600}
.sidebar-foot .btn{width:100%; justify-content:center}

/* ---------- content ---------- */
.content{flex:1 1 auto; min-width:0; padding:26px 32px 60px; max-width:1240px; animation:rise .28s ease both}
@keyframes rise{from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none}}
.topbar{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px}
.topbar h1{font-size:25px; font-weight:700}
.topbar .sub{color:var(--muted); font-size:13.5px; margin-top:4px; max-width:640px}
.user-chip{
  display:flex; align-items:center; gap:10px; padding:6px 12px 6px 6px;
  background:var(--panel); border:1px solid var(--line); border-radius:999px; box-shadow:var(--shadow-sm);
}
.avatar{
  width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#6366f1,#a855f7); color:#fff; font-weight:700; font-size:13px; text-transform:uppercase;
}
.user-chip .name{font-size:13px; font-weight:600; color:var(--ink-2)}
.user-chip form{margin:0}

/* ---------- tiles ---------- */
.tiles{display:grid; grid-template-columns:repeat(auto-fit,minmax(215px,1fr)); gap:14px; margin-bottom:20px}
.tile{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px 18px; box-shadow:var(--shadow-sm); display:flex; gap:13px; align-items:flex-start;
  transition:transform .18s ease, box-shadow .18s ease;
}
.tile:hover{transform:translateY(-2px); box-shadow:var(--shadow)}
.tile-icon{
  width:38px; height:38px; border-radius:11px; flex:0 0 38px; display:flex; align-items:center; justify-content:center;
  background:var(--brand-soft); color:var(--brand);
}
.tile-icon svg{width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round}
.tile-icon.ok{background:var(--ok-soft); color:var(--ok)}
.tile-icon.warn{background:var(--warn-soft); color:var(--warn)}
.tile-icon.bad{background:var(--bad-soft); color:var(--bad)}
.tile-value{font-size:23px; font-weight:700; line-height:1.15; letter-spacing:-.02em}
.tile-value.text{font-size:17px; line-height:1.3; padding-top:3px}
.tile-label{font-size:12.5px; color:var(--muted); margin-top:2px}
.tile-note{font-size:11.5px; margin-top:6px; color:var(--muted)}

/* ---------- cards ---------- */
.card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); padding:20px 22px; margin-bottom:18px;
}
.card > h2{font-size:16px; font-weight:700; margin-bottom:2px}
.card-sub{color:var(--muted); font-size:13px; margin:2px 0 14px}
.card + .card{margin-top:0}
.card-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px}
.card-head h2{font-size:16px; font-weight:700}

/* ---------- tables ---------- */
.table-wrap{overflow-x:auto; margin:2px -22px -20px; padding:0 22px 20px}
.table{width:100%; border-collapse:separate; border-spacing:0; font-size:13.5px}
.table th{
  text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);
  font-weight:600; padding:0 12px 10px; white-space:nowrap;
}
.table td{padding:13px 12px; border-top:1px solid var(--line-2); vertical-align:middle}
.table tbody tr:hover td{background:#fafbff}
.table td:first-child, .table th:first-child{padding-left:4px}
.table td:last-child, .table th:last-child{padding-right:4px; text-align:right}
.table .actions{display:flex; gap:6px; justify-content:flex-end; align-items:center}
.table .actions form{margin:0}
.mono{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace; font-size:12.5px; color:#334155}
.muted{color:var(--muted)}

/* ---------- badges ---------- */
.badge{
  display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border-radius:999px;
  font-size:11.5px; font-weight:600; letter-spacing:.01em;
  background:#f1f5f9; color:#475569; border:1px solid #e2e8f0;
}
.badge::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.85}
.badge.ok{background:var(--ok-soft); color:#067a55; border-color:#c7f0e0}
.badge.warn{background:var(--warn-soft); color:#92600b; border-color:#fbe3bd}
.badge.bad{background:var(--bad-soft); color:#b91c1c; border-color:#fbcdcd}
.badge.plain::before{display:none}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:38px; padding:0 16px; border-radius:10px; cursor:pointer;
  font:inherit; font-size:13.5px; font-weight:600; color:var(--ink-2);
  background:#fff; border:1px solid var(--line); box-shadow:var(--shadow-sm);
  transition:background .14s ease, border-color .14s ease, transform .14s ease, box-shadow .14s ease;
  white-space:nowrap;
}
.btn:hover{background:#f8f9fd; border-color:#d9deee}
.btn:active{transform:translateY(1px)}
.btn.primary{
  background:linear-gradient(135deg,#5b53e8,#7c3aed); color:#fff; border-color:transparent;
  box-shadow:0 8px 20px -12px rgba(79,70,229,.9);
}
.btn.primary:hover{background:linear-gradient(135deg,#4f46e5,#6d28d9)}
.btn.ghost{background:transparent; border-color:rgba(255,255,255,.18); color:#cbd5e1; box-shadow:none}
.btn.ghost:hover{background:rgba(255,255,255,.08); color:#fff}
.btn.danger{color:#b91c1c; border-color:#f6c6c6; background:#fff}
.btn.danger:hover{background:#fdeeee; border-color:#f0a9a9}
.btn.small{height:31px; padding:0 11px; font-size:12.5px; border-radius:8px}
.btn svg{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}

/* ---------- forms ---------- */
.form{display:flex; flex-direction:column; gap:16px}
.grid-form{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 18px; align-items:start}
.grid-form .full{grid-column:1 / -1}
label{display:flex; flex-direction:column; gap:7px; font-size:13px; font-weight:600; color:var(--ink-2)}
label > span.hint{font-weight:400}
input,select,textarea{
  font:inherit; font-size:13.5px; color:var(--ink); background:#fff;
  border:1px solid #dfe4f0; border-radius:10px; padding:9px 12px; width:100%;
  transition:border-color .15s ease, box-shadow .15s ease;
}
input:focus,select:focus,textarea:focus{
  outline:none; border-color:#a5b4fc; box-shadow:0 0 0 4px rgba(99,102,241,.13);
}
input::placeholder,textarea::placeholder{color:#9aa6bd}
select{appearance:none; background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; padding-right:32px}
textarea{min-height:120px; resize:vertical; font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace; font-size:12.5px; line-height:1.6}
.hint{color:var(--muted); font-size:12.5px; line-height:1.5; margin:0}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.fieldset{border:1px dashed var(--line); border-radius:12px; padding:12px 14px}
.fieldset legend{font-size:12px; font-weight:600; color:var(--muted); padding:0 6px}
.check{display:flex; align-items:center; gap:8px; font-weight:500; font-size:13px; color:var(--ink-2)}
.check input{width:auto}
.form.inline{flex-direction:row; align-items:flex-end; gap:10px}
.form.inline label{min-width:280px}

/* ---------- flash ---------- */
.flash{
  display:flex; align-items:center; gap:10px; padding:12px 16px; border-radius:12px; margin-bottom:16px;
  font-size:13.5px; font-weight:500; animation:slide .25s ease both;
}
@keyframes slide{from{opacity:0; transform:translateY(-4px)} to{opacity:1; transform:none}}
.flash::before{font-size:15px}
.flash.ok{background:var(--ok-soft); color:#045e41; border:1px solid #c2efdc}
.flash.ok::before{content:"✓"}
.flash.bad{background:var(--bad-soft); color:#991b1b; border:1px solid #f8cfcf}
.flash.bad::before{content:"!"; font-weight:800}

/* ---------- misc blocks ---------- */
.brand-preview{
  border-radius:14px; padding:22px 24px; margin-bottom:12px;
  background:linear-gradient(135deg,#f7f5ff,#eef2ff 55%,#ecfeff);
  border:1px solid #e6e6fb;
}
.brand-preview .big-brand{font-size:26px; font-weight:800; letter-spacing:-.02em; margin:0}
.brand-preview .tag{font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:#7c3aed; font-weight:700}
.quick{display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px}
.quick a{
  display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:12px;
  background:#fff; border:1px solid var(--line); color:var(--ink); box-shadow:var(--shadow-sm);
  transition:border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.quick a:hover{border-color:#c7cdf5; transform:translateY(-2px); box-shadow:var(--shadow)}
.quick .q-ico{width:34px; height:34px; border-radius:10px; background:var(--brand-soft); color:var(--brand); display:flex; align-items:center; justify-content:center}
.quick .q-ico svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:1.7}
.quick .q-title{font-weight:600; font-size:13.5px}
.quick .q-sub{font-size:12px; color:var(--muted)}
.empty{text-align:center; padding:26px 16px; color:var(--muted); font-size:13px}
.log{
  background:#0b1220; color:#cbd5e1; border-radius:12px; padding:16px;
  font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace; font-size:12px; line-height:1.65;
  max-height:440px; overflow:auto; white-space:pre-wrap; word-break:break-word; margin:0;
  box-shadow:inset 0 0 0 1px rgba(148,163,184,.15);
}
.result{margin-top:6px; font-size:13px; color:var(--muted); min-height:20px}
.result.ok{color:#067a55; font-weight:600}
.result.bad{color:#b91c1c; font-weight:600}
.flash{cursor:default; transition:opacity .35s ease, transform .35s ease}
.flash.hide{opacity:0; transform:translateY(-4px)}
.table td b{font-weight:600}
.selector{display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap}
.selector select{max-width:340px}
.kv{display:grid; grid-template-columns:180px 1fr; gap:10px 16px; font-size:13.5px}
.kv dt{color:var(--muted)}
.kv dd{margin:0; font-weight:500}

/* ---------- auth ---------- */
body.centered{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:28px;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(124,58,237,.16), transparent 60%),
    radial-gradient(55% 45% at 92% 92%, rgba(34,211,238,.14), transparent 60%),
    var(--bg);
}
.auth-card{
  width:100%; max-width:412px; background:#fff; border:1px solid var(--line);
  border-radius:20px; padding:30px 30px 28px; box-shadow:0 30px 60px -30px rgba(16,24,40,.35), var(--shadow-sm);
  animation:rise .3s ease both;
}
.auth-card .logo{padding:0 0 22px}
.auth-card h1{font-size:20px; font-weight:700; margin-bottom:4px}
.auth-card .hint{margin-bottom:18px}
.auth-card .form{gap:14px}
.auth-card .btn{margin-top:4px; height:42px}

/* ---------- responsive ---------- */
@media (max-width:1000px){
  .shell{flex-direction:column}
  .sidebar{width:auto; flex:none; height:auto; position:static; padding:14px 16px; border-radius:0}
  .logo{padding:2px 2px 12px}
  .nav{flex-direction:row; overflow-x:auto; gap:6px; padding-bottom:2px}
  .nav-item{white-space:nowrap; padding:8px 12px}
  .sidebar-foot{margin-top:12px; padding-top:12px; display:flex; align-items:center; gap:12px; justify-content:space-between}
  .sidebar-foot .who{margin:0}
  .sidebar-foot .btn{width:auto}
  .content{padding:18px 16px 48px}
  .grid-form{grid-template-columns:1fr}
  .topbar{flex-direction:column; align-items:flex-start}
  .card{padding:16px}
  .table-wrap{margin:2px -16px -16px; padding:0 16px 16px}
  .kv{grid-template-columns:1fr}
}

/* --- таблицы-формы, конструктор кнопок --- */
.table input:not([type="checkbox"]), .table select{
  width:100%; min-width:80px; padding:8px 10px; border:1px solid var(--line);
  border-radius:9px; font:inherit; font-size:13px; background:#fff; color:var(--ink);
}
.table input:not([type="checkbox"]):focus, .table select:focus{
  outline:none; border-color:#b9b4f5; box-shadow:0 0 0 3px #efedff;
}
.table input.narrow{min-width:72px; max-width:110px}
.table input.tiny{min-width:56px; max-width:72px}
.table td:has(> .check) .check{justify-content:flex-start}
.inline-form{display:flex; gap:8px; align-items:center; margin:0}
.inline-form input{flex:1 1 auto; min-width:120px}
.inline-form button{flex:0 0 auto}
.fieldset-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px}
.fieldset-head .btn{flex:0 0 auto}
.selector label{display:flex; gap:8px; align-items:center; font-weight:600; font-size:13px}
.selector select{min-width:260px}
.form .row{display:flex; gap:10px; align-items:center}
@media (max-width:720px){
  .table input.narrow, .table input.tiny{min-width:60px}
}
