/* Logs - Fast Net Fiber. Every colour comes from the Fast Net Fiber logo. */
:root {
  --navy: #001B66;
  --royal: #0058CD;
  --sky: #00AAFA;
  --green: #2D9307;
  --orange: #FCA402;
  --pink: #ED0567;
  --page: #F3F6FB;
  --surface: #FFFFFF;
  --line: #DCE4F2;
  --muted: #5A6A8F;
  --text: #001B66;
  --radius: 10px;
  --font: "Archivo", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--text);
  font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums;
}
a { color: var(--royal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Four logo colours side by side, the Fast Net Fiber signature line */
.fiber {
  height: 5px;
  background: linear-gradient(90deg,
    var(--royal) 0 25%, var(--green) 25% 50%, var(--orange) 50% 75%, var(--pink) 75% 100%);
}

/* Header: blue bar with the logo on a white chip, server status on the right */
.topbar { background: linear-gradient(90deg, var(--royal), color-mix(in srgb, var(--royal) 70%, var(--sky))); color: #fff; }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.logo-chip { background: #fff; border-radius: 10px; padding: 5px 9px; display: block; flex: none; }
.logo-chip img { height: 54px; width: auto; display: block; }
.topbar-title { font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.who { margin-left: auto; text-align: right; }
.who-name { font-size: 17px; font-weight: 800; line-height: 1.2; }
.who-sub { font-size: 12.5px; opacity: .9; margin-bottom: 6px; }
.who-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; background: rgba(0, 27, 102, .45); color: #fff; white-space: nowrap;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: #9FB3D9; }
.chip.ok i { background: #6BE03A; } .chip.warn i { background: var(--orange); } .chip.bad i { background: var(--pink); }
.chip.bad { background: var(--pink); } .chip.bad i { background: #fff; }
.logout { font: 700 13px var(--font); color: #fff; background: none; border: 0; cursor: pointer; padding: 3px 6px; }
.logout:hover { text-decoration: underline; }

nav.menu { background: var(--navy); }
.menu-inner { max-width: 1320px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; }
nav.menu a {
  font: 600 14px var(--font); color: #CFDAF3; padding: 11px 14px; text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
nav.menu a:hover { color: #fff; text-decoration: none; }
nav.menu a.on { color: #fff; border-bottom-color: var(--sky); }
.badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px;
  background: var(--pink); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}

main { max-width: 1320px; margin: 0 auto; padding: 28px 20px 60px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel.tight { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; }

/* Dashboard cards: coloured edge + round icon, like the cards Fast Net Fiber already uses */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--royal));
  border-radius: var(--radius); padding: 18px 18px 18px 20px; display: flex; align-items: center; gap: 14px;
}
.card .label { font-size: 13px; font-weight: 700; color: var(--c, var(--royal)); }
.card .value { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--navy); }
.card .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.card .sub { font-size: 13px; color: var(--muted); }
.card .ico {
  margin-left: auto; width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--c, var(--royal)); color: #fff; display: grid; place-items: center;
}
.card .ico svg { width: 26px; height: 26px; }
.c-royal { --c: var(--royal); } .c-green { --c: var(--green); } .c-pink { --c: var(--pink); }
.c-sky { --c: var(--sky); } .c-orange { --c: var(--orange); } .c-navy { --c: var(--navy); }
.bar { height: 6px; border-radius: 3px; background: var(--page); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--royal)); }

.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.grid2.even { grid-template-columns: 1fr 1fr; }
.grid2 > .panel, .grid2 > .side-col { min-width: 0; }
.side-col > .panel { margin-bottom: 20px; }
.grid2 > .panel { align-self: start; }
@media (max-width: 960px) { .grid2, .grid2.even { grid-template-columns: 1fr; } }

/* 7-day chart */
.chart-wrap { padding: 8px 16px 12px; }
.panel-head.blue { background: linear-gradient(90deg, var(--royal), color-mix(in srgb, var(--royal) 70%, var(--sky))); color: #fff; border-bottom: 0; }
.panel-head.blue h2 { color: #fff; }
.panel-head.blue .small { color: #E4EEFF; }
.panel-head.blue a { color: #fff; font-weight: 700; }
.panel-head.blue .btn.light { border-color: #fff; color: var(--royal); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--royal); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: #fff; stroke: var(--royal); stroke-width: 2.5; }
.chart .pt.today { fill: var(--green); stroke: var(--green); }
.chart text { font-family: var(--font); fill: var(--muted); }
.chart .ylab { font-size: 12px; text-anchor: end; }
.chart .xlab { font-size: 13px; text-anchor: middle; }
.chart .xlab.today { fill: var(--green); font-weight: 700; }
.chart .vlab { font-size: 14px; font-weight: 800; text-anchor: middle; fill: var(--navy); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 20px 0; }
.tabs a { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 20px; border: 1px solid #C5D2EA; color: var(--royal); text-decoration: none; }
.tabs a:hover { background: var(--page); }
.tabs a.on { background: var(--royal); border-color: var(--royal); color: #fff; }

/* Events */
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.events li:last-child { border-bottom: 0; }
.events li.unread { background: #EEF5FF; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--sky); }
.dot.ok { background: var(--green); } .dot.bad { background: var(--pink); } .dot.warn { background: var(--orange); }
.events time { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 13px; }
.empty { padding: 28px 20px; color: var(--muted); text-align: center; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.on { color: var(--green); background: #EAF5E4; }
.pill.off { color: var(--pink); background: #FDE6EF; }
.pill.wait { color: #9A6400; background: #FFF4DC; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid var(--line); white-space: nowrap; background: #FAFBFE; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.nowrap, th.nowrap { white-space: nowrap; }
td .addr { white-space: nowrap; }
td .port { color: var(--muted); }
.logs td { font-size: 13.5px; }
.logs tr.raw td { background: #FAFBFE; color: var(--muted); font-size: 12.5px; word-break: break-all; }
.type { font-weight: 700; font-size: 12.5px; }
.type.Connection { color: var(--royal); } .type.Login { color: var(--green); } .type.Logout { color: var(--orange); }
.type.Firewall, .type.Other { color: var(--muted); }

/* Forms */
form.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 16px; align-items: end; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.hint { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 4px; }
input[type=text], input[type=password], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; font: 15px var(--font); color: var(--navy); background: #fff;
  border: 1px solid #C5D2EA; border-radius: 8px; padding: 9px 11px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--royal); outline: 3px solid rgba(0, 170, 250, .25); outline-offset: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.stack > * + * { margin-top: 14px; }
.narrow { max-width: 560px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 14px var(--font); padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  background: var(--royal); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--navy); text-decoration: none; }
.btn.light { background: #fff; color: var(--royal); border-color: #C5D2EA; }
.btn.light:hover { background: var(--page); }
.btn.danger { background: #fff; color: var(--pink); border-color: #F6B5CD; }
.btn.danger:hover { background: #FDE6EF; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.inline { display: inline; margin: 0; }

/* Messages */
.msg { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-weight: 600; border: 1px solid; }
.msg.ok { background: #EAF5E4; border-color: #B9DDA6; color: #1F6A04; }
.msg.error { background: #FDE6EF; border-color: #F6B5CD; color: #A0034A; }
.msg.info { background: #E6F6FE; border-color: #A6DDF7; color: var(--navy); }

/* MikroTik setup steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li { position: relative; padding: 0 0 26px 52px; }
.steps > li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 38px; bottom: 6px; width: 2px; background: var(--line); }
.steps h3 { margin: 4px 0 6px; font-size: 16px; }
.code { position: relative; background: var(--navy); color: #E8F1FF; border-radius: 8px; margin-top: 10px; }
.code pre { margin: 0; padding: 14px 16px; padding-right: 92px; overflow-x: auto; font: 13px/1.6 Consolas, "Courier New", monospace; white-space: pre; }
.code button {
  position: absolute; top: 8px; right: 8px; font: 700 12px var(--font); padding: 6px 10px; border-radius: 6px;
  border: 0; background: var(--sky); color: var(--navy); cursor: pointer;
}
.code button.done { background: var(--green); color: #fff; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 10px; margin-left: 8px; vertical-align: 2px; }
.tag.add { background: #EAF5E4; color: #1F6A04; }
.tag.change { background: #FFF4DC; color: #9A6400; }
.tag.info { background: #E6F6FE; color: var(--navy); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.login-box .inner { padding: 28px 30px 30px; }
.login-box img { display: block; width: 260px; max-width: 100%; height: auto; margin: 4px auto 18px; }
.login-box h1 { text-align: center; font-size: 22px; margin-bottom: 20px; }
.login-box .btn { width: 100%; padding: 12px; font-size: 15px; }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px; }

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; }
  .logo-chip img { height: 42px; }
  .who { width: 100%; text-align: left; }
  .who-row { justify-content: flex-start; }
  h1 { font-size: 22px; }
  .card .value { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
