* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px;
  color: #1f2430; background: #f4f6fa; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 22px; background: #0f172a; color: #fff; }
.brand { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.brand .logo { color: #38bdf8; font-size: 20px; }
.brand .sub { font-size: 13px; font-weight: 400; color: #94a3b8; }
.srv { font-size: 13px; color: #cbd5e1; }
.srv b { color: #fff; }
.warn { color: #fca5a5; margin-left: 8px; }

.tabs { display: flex; gap: 2px; padding: 0 18px; background: #fff; border-bottom: 1px solid #e5e9f0; }
.tab { border: none; background: none; padding: 13px 20px; font-size: 14px; font-family: inherit; cursor: pointer;
  color: #475569; border-bottom: 2px solid transparent; }
.tab:hover { color: #0f172a; }
.tab.on { color: #0f172a; font-weight: 600; border-bottom-color: #38bdf8; }

main { padding: 18px 22px 60px; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bar .auto { font-size: 13px; color: #475569; display: flex; align-items: center; gap: 5px; }

.input { padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 14px; font-family: inherit;
  min-width: 240px; background: #fff; }
.input:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.2); }

.btn { padding: 8px 15px; border: 0; border-radius: 7px; background: #0ea5e9; color: #fff; font-size: 14px;
  font-family: inherit; cursor: pointer; font-weight: 500; }
.btn:hover { background: #0284c7; }
.btn.ghost { background: #fff; color: #0f172a; border: 1px solid #cbd5e1; }
.btn.ghost:hover { background: #f1f5f9; }
.btn.danger { background: #fff; color: #dc2626; border: 1px solid #fca5a5; }
.btn.danger:hover { background: #fef2f2; }
.btn.mini { padding: 4px 10px; font-size: 12px; }

.tablewrap { border: 1px solid #e5e9f0; border-radius: 10px; overflow: auto; background: #fff; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid #eef1f6; text-align: left; white-space: nowrap; }
table.grid th { background: #f8fafc; color: #64748b; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: #f8fbff; }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; color: #334155; }
.muted { color: #94a3b8; }
.err { color: #dc2626; padding: 10px 12px; }
.row-acts { display: flex; gap: 6px; flex-wrap: wrap; }

.card { background: #fff; border: 1px solid #e5e9f0; border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid #eef1f6; flex-wrap: wrap; }
.cname { font-weight: 600; font-size: 15px; }
.prefix { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; color: #0ea5e9;
  background: #e0f2fe; padding: 2px 8px; border-radius: 20px; margin-left: 6px; }
table.grid.sub { font-size: 13px; }
table.grid.sub th { background: #fff; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 9px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(15,23,42,.3); z-index: 100; }
.toast.bad { background: #dc2626; }

/* Логин */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0f172a; }
.login-card { background: #fff; border-radius: 14px; padding: 32px 34px; width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); display: flex; flex-direction: column; }
.login-brand { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.login-brand .logo { color: #38bdf8; }
.login-sub { color: #94a3b8; font-size: 13px; margin-bottom: 20px; }
.login-label { font-size: 13px; color: #475569; margin-bottom: 6px; }
.login-btn { margin-top: 16px; width: 100%; padding: 10px; font-size: 15px; }
.login-err { color: #dc2626; font-size: 13px; margin-top: 8px; }
.logout { color: #94a3b8; margin-left: 14px; text-decoration: none; }
.logout:hover { color: #fff; }
.login-input { margin-top: 6px; }

/* модалка «блок подключения» */
[hidden] { display: none !important; }
.modal-ov { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex;
  align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 200; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; max-height: 88vh;
  overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid #eef1f6; font-size: 16px; }
.modal-head .x { border: 0; background: none; font-size: 18px; cursor: pointer; color: #94a3b8; }
.modal-head .x:hover { color: #0f172a; }
.modal-body { padding: 18px; }
.cm-sec { margin-bottom: 22px; }
.cm-lbl { font-size: 13px; color: #475569; margin-bottom: 8px; }
.tokrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.daysbox { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #475569; white-space: nowrap; }
.daysbox input { width: 62px; padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 7px;
  font-family: inherit; font-size: 13px; }
.daysbox input:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.2); }
.tok { flex: 1; font-family: "Cascadia Code", Consolas, monospace; font-size: 12.5px;
  background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px;
  word-break: break-all; color: #0f172a; }
.cm-msg { width: 100%; font-family: inherit; font-size: 13px; border: 1px solid #cbd5e1;
  border-radius: 8px; padding: 10px 12px; resize: vertical; color: #1f2430; background: #fff; }
