/* Панель управления Тукана. Оригинальное оформление в цветах проекта: графит и синий #178FFF. */
:root {
  --bg: #080c12; --bg-2: #0d131c; --panel: #111926; --panel-2: #162133; --line: #223049; --line-2: #2c3d5c;
  --text: #e9eff9; --muted: #8a9ab3; --faint: #5d6d87;
  --accent: #178fff; --accent-2: #5bbbff; --accent-dim: rgba(23, 143, 255, .16);
  --danger: #ff5d6c; --ok: #35d98a; --warn: #ffb224;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(23, 143, 255, .14), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(23, 143, 255, .08), transparent 60%),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(23, 143, 255, .4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- загрузка и вход ---------- */
.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-orb { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 60% 40%, #fff, #3fa8ff 45%, #06265f 90%);
  box-shadow: 0 0 40px rgba(23,143,255,.7); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.82); opacity: .7; } }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 40px 36px; text-align: center; }
.login-card img { width: 84px; height: 84px; filter: drop-shadow(0 0 22px rgba(23,143,255,.55)); }
.login-card h1 { margin: 18px 0 6px; font-size: 26px; letter-spacing: .02em; }
.login-card p { margin: 0 0 26px; color: var(--muted); }
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; text-align: left; font-size: 14px;
  background: rgba(255, 93, 108, .1); border: 1px solid rgba(255, 93, 108, .35); color: #ffb3ba; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 276px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px;
  background: linear-gradient(180deg, rgba(17,25,38,.95), rgba(10,15,23,.95)); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand img { width: 38px; height: 38px; filter: drop-shadow(0 0 12px rgba(23,143,255,.6)); }
.brand b { display: block; font-size: 18px; letter-spacing: .14em; }
.brand span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.guild-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.guild-chip .avatar { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.guild-chip b { display: block; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-chip small { color: var(--muted); }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-title { margin: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted);
  cursor: pointer; border: 0; background: none; text-align: left; width: 100%; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255,255,255,.04); color: var(--text); text-decoration: none; }
.nav-link.active { color: #fff; background: linear-gradient(90deg, var(--accent-dim), transparent); }
.nav-link.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-link svg { width: 20px; height: 20px; flex: none; }
.nav-link.active svg { color: var(--accent-2); }
.user-box { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.user-box .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); flex: none; }
.user-box div { flex: 1; min-width: 0; }
.user-box b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box a { font-size: 12px; color: var(--muted); }
.main { min-width: 0; padding: 30px 40px 120px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0 0 4px; font-size: 28px; letter-spacing: .01em; }
.page-head p { margin: 0; color: var(--muted); max-width: 70ch; }
.menu-btn { display: none; }

/* ---------- карточки ---------- */
.card { position: relative; padding: 22px 24px; margin-bottom: 18px; background: linear-gradient(180deg, var(--panel), #0f1723);
  border: 1px solid var(--line); border-radius: var(--radius); }
.card::before, .card::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; border: 0 solid var(--accent); opacity: .85; }
.card::before { left: 0; top: 0; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.card::after { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.card { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card .sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.card.dim { opacity: .62; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }

/* ---------- форма ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: #c5d2e8; }
.hint { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; background: #0b111a; border: 1px solid var(--line-2); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13.5px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input[type=number] { max-width: 150px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.row .field { margin-bottom: 0; }
.inline { display: flex; align-items: center; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 19px; height: 19px; border-radius: 5px; border: 1px solid var(--line-2); background: #0b111a; display: grid; place-items: center; cursor: pointer; flex: none; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #273650; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); box-shadow: 0 0 14px rgba(23,143,255,.5); }
.switch input:checked + span::after { transform: translateX(20px); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); cursor: pointer; font-weight: 600; transition: filter .15s, transform .05s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #2a9bff, var(--accent)); border-color: #4aa8ff; color: #fff; box-shadow: 0 6px 20px rgba(23,143,255,.3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(255, 93, 108, .1); border-color: rgba(255, 93, 108, .4); color: #ff9aa4; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.discord { background: #5865f2; border-color: #7983f5; color: #fff; padding: 12px 22px; box-shadow: 0 6px 22px rgba(88,101,242,.35); }
.btn svg { width: 17px; height: 17px; }

/* ---------- чипы и выбор из списка ---------- */
.chips { position: relative; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 8px; border-radius: 9px; border: 1px solid var(--line-2); background: #0b111a; min-height: 46px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--accent-dim); border: 1px solid rgba(23,143,255,.4); font-size: 13px; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.chip button { border: 0; background: rgba(255,255,255,.1); width: 18px; height: 18px; border-radius: 50%; cursor: pointer; line-height: 1; padding: 0; color: var(--text); }
.chip button:hover { background: var(--danger); }
.chips .add { border: 1px dashed var(--line-2); background: none; border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
.chips .add:hover { color: var(--text); border-color: var(--accent); }
.popover { position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); width: min(340px, 100%); max-height: 300px; display: flex; flex-direction: column;
  background: #0e1521; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.6); overflow: hidden; }
.popover input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.popover ul { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
.popover li { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.popover li:hover { background: var(--accent-dim); }
.popover li.empty { color: var(--muted); cursor: default; }
.popover li.empty:hover { background: none; }

/* ---------- правила автомодератора ---------- */
.rule { margin-bottom: 14px; }
.rule-head { display: flex; align-items: center; gap: 14px; }
.rule-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent-2); flex: none; }
.rule-icon svg { width: 22px; height: 22px; }
.rule-head > div { flex: 1; min-width: 0; }
.rule-head h3 { margin: 0; font-size: 16px; }
.rule-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.rule-body { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-2); display: grid; gap: 16px; }
.rule.off .rule-body { display: none; }
.actions-box { padding: 14px 16px; border-radius: 10px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.actions-box .label { display: block; margin-bottom: 10px; }
.actions-box .row { gap: 22px; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 12px 10px; font-weight: 700; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.02); }
td.num { font-variant-numeric: tabular-nums; color: var(--muted); }
td.reason { max-width: 320px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.07); border: 1px solid var(--line-2); }
.badge.ok { background: rgba(53,217,138,.12); border-color: rgba(53,217,138,.4); color: #7be8b4; }
.badge.warn { background: rgba(255,178,36,.12); border-color: rgba(255,178,36,.4); color: #ffd07a; }
.badge.bad { background: rgba(255,93,108,.12); border-color: rgba(255,93,108,.4); color: #ff9aa4; }
.badge.blue { background: var(--accent-dim); border-color: rgba(23,143,255,.5); color: var(--accent-2); }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; color: var(--muted); }
.empty-state { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- обзор ---------- */
.hero { display: flex; align-items: center; gap: 20px; }
.hero .avatar { width: 76px; height: 76px; border-radius: 18px; background: var(--panel-2); flex: none; box-shadow: 0 0 0 2px var(--line-2), 0 0 30px rgba(23,143,255,.25); }
.hero h2 { font-size: 24px; margin: 0; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.stat b { display: block; font-size: 32px; line-height: 1.1; letter-spacing: .01em; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat.accent b { color: var(--accent-2); text-shadow: 0 0 20px rgba(23,143,255,.5); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.checklist .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 800; }
.checklist .ok .mark { background: rgba(53,217,138,.18); color: var(--ok); }
.checklist .todo .mark { background: rgba(255,178,36,.18); color: var(--warn); }
.checklist li > div { flex: 1; }
.checklist small { display: block; color: var(--muted); }
.cmd { padding: 14px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 230px 1fr; gap: 16px; }
.cmd:first-of-type { border-top: 0; }
.cmd code, code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; background: #0b111a; border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; color: var(--accent-2); }
.cmd p { margin: 0 0 4px; }
.cmd small { color: var(--muted); }

/* ---------- сохранение, окна, уведомления ---------- */
.savebar { position: fixed; left: 276px; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; padding: 16px; pointer-events: none; transform: translateY(120%); transition: transform .25s; }
.savebar.show { transform: none; }
.savebar > div { pointer-events: auto; display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 20px; border-radius: 14px; background: #0e1623; border: 1px solid var(--accent); box-shadow: 0 18px 50px rgba(0,0,0,.65), 0 0 30px rgba(23,143,255,.25); }
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(3,6,10,.72); backdrop-filter: blur(4px); }
.modal { width: min(460px, 100%); padding: 26px; }
.modal h3 { margin: 0 0 8px; font-size: 19px; }
.modal p { margin: 0 0 22px; color: var(--muted); }
.modal .row { justify-content: flex-end; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 18px; border-radius: 11px; background: #0e1623; border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0,0,0,.6); max-width: 380px; animation: slide .25s; }
.toast.ok { border-color: rgba(53,217,138,.6); } .toast.error { border-color: rgba(255,93,108,.7); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* ---------- мобильная версия ---------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-102%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(3,6,10,.7); }
  .menu-btn { display: inline-flex; margin-bottom: 14px; }
  .main { padding: 18px 16px 120px; }
  .savebar { left: 0; }
  .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .cmd { grid-template-columns: 1fr; gap: 6px; }
}
