/* Zetrik Theme (ISP Radius Panel Look) - Poora Look Yahin Se Badlo */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --side: #fbfcfe;
  --line: #e2e6ed;
  --line-soft: #eef1f5;
  --text: #1d1d1f;
  --dim: #5f6570;          /* Grey Text Bhi Aaram Se Padha Jaye (Contrast 5.7:1) */
  --blue: #0a64d6;
  --blue-soft: #e8f1fd;
  --green: #1e7b34;  --green-bg: #e6f6ea;  --switch: #34c759;
  --red: #c4151c;    --red-bg: #fdecec;
  --amber: #9a5200;  --amber-bg: #fff3e0;
  --grey: #5f6570;   --grey-bg: #eef0f3;
  --radius: 12px;
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(10, 100, 214, .35); outline-offset: 2px; border-radius: 8px; }
code { font: inherit; font-size: 14px; color: var(--dim); background: var(--grey-bg); padding: 1px 6px; border-radius: 6px; }
small { color: var(--dim); font-size: 13px; }

/* ---------- Sidebar ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; line-height: 1.25; padding: 0 10px 20px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--blue); display: grid; place-items: center; }
.brand .logo svg { width: 18px; height: 18px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 10px; color: var(--text); font-weight: 500; }
.side nav a:hover { background: #eef1f6; text-decoration: none; }
.side nav a.on { background: var(--blue); color: #fff; }
.tile { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.tile svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side nav a.on .tile { box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); }
.who { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 600; flex: none; }
.who div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { color: var(--dim); font-size: 13px; }
.who a { margin-left: auto; font-size: 14px; font-weight: 500; }

/* ---------- Page ---------- */
.page { margin-left: 236px; padding: 28px 36px 56px; max-width: 1560px; }
.page h1 { font-size: 26px; font-weight: 700; margin: 0 0 20px; letter-spacing: -.01em; }
.bare { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.card h2.sub { margin: 24px 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid3 .card { margin-bottom: 0; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bar form { margin: 0; }
.bar .hint { margin-right: auto; }
.hint { color: var(--dim); font-size: 14px; margin: 8px 0; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dt { color: var(--dim); }
dd { margin: 0; font-weight: 500; }

/* ---------- Status Badge (Rang Hamesha Label Ke Saath) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok    { color: var(--green); background: var(--green-bg); }
.badge.bad   { color: var(--red);   background: var(--red-bg); }
.badge.warn  { color: var(--amber); background: var(--amber-bg); }
.badge.muted { color: var(--grey);  background: var(--grey-bg); }

/* ---------- Meters ---------- */
.meter { margin-bottom: 14px; font-size: 14px; }
.meter .top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.meter .track { height: 8px; background: var(--grey-bg); border-radius: 999px; overflow: hidden; }
.meter .track i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.meter.hot .track i { background: var(--red); }
.svc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.svc li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
label small { font-weight: 400; }
input, select { background: #fff; color: var(--text); border: 1px solid #cfd5de; border-radius: 10px; padding: 9px 12px; font: 15px var(--font); min-height: 40px; }
input::placeholder { color: #8a9099; }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 100, 214, .18); }
input:disabled { background: var(--grey-bg); color: var(--dim); }
select { appearance: none; padding-right: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235f6570' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
.filter, .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; align-items: end; }
.span2 { grid-column: span 2; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.form .btns { margin-top: 18px; }
.btns .gap { flex: 1; }

/* Apple-Green Switch */
input.switch { appearance: none; width: 46px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 999px; background: #d1d5db; position: relative; cursor: pointer; transition: background .2s; flex: none; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
input.switch:checked { background: var(--switch); }
input.switch:checked::after { transform: translateX(18px); }
label.toggle { flex-direction: row; align-items: center; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 12px 24px; }
fieldset legend { color: var(--dim); font-size: 14px; padding: 0 6px; }
fieldset:disabled { opacity: .5; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cfd5de; background: #fff; color: var(--text); border-radius: 999px; padding: 8px 18px; font: 500 15px var(--font); cursor: pointer; min-height: 40px; white-space: nowrap; }
.btn:hover { background: #f5f7fa; text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #0856bb; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn.danger { color: var(--red); }
.btn.small { padding: 4px 12px; font-size: 14px; min-height: 32px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips span { color: var(--dim); font-size: 14px; margin-right: 2px; }

/* ---------- Messages ---------- */
.msg { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--green-bg); color: #14532d; font-size: 14px; border: 1px solid #c8ead2; }
.msg.err { background: var(--red-bg); color: #7f1d1d; border-color: #f6caca; }

/* ---------- Grouped Tables ---------- */
.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card .scroll { border: 0; border-radius: 0; margin: 0 -20px -20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { position: sticky; top: 0; background: #f8f9fb; text-align: left; font-weight: 600; font-size: 13px; color: var(--dim); padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-top: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
tr:first-child + tr td, tr:first-child td { border-top: 0; }
tr.off td { color: var(--dim); }
tr.group td { border-top: 1px solid var(--line); }
.num { text-align: right; }
td.msgcol { white-space: pre-wrap; word-break: break-all; min-width: 380px; }
td.actions { display: flex; gap: 6px; align-items: center; }
td.actions form { display: flex; gap: 6px; margin: 0; }
td.when { color: var(--dim); }
td.when b { color: var(--text); font-weight: 500; }
.dimcell { color: var(--dim); }
a.plain { color: inherit; }
a.plain:hover { color: var(--blue); }
.port { color: var(--dim); }
td.natcell { color: var(--amber); font-weight: 500; }
td.natcell .port { color: var(--amber); }
td.iface { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.arr { display: inline-block; width: 16px; font-weight: 700; }
.arr.up { color: var(--blue); }
.arr.down { color: var(--green); }
.userlink { font-weight: 600; }
.proto { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 13px; font-weight: 500; background: var(--grey-bg); color: var(--grey); }
.proto.tcp { background: var(--blue-soft); color: var(--blue); }
.proto.udp { background: var(--green-bg); color: var(--green); }
.proto.icmp, .proto.icmpv6 { background: #f3e8fd; color: #7a2bb8; }
td.stlist div { margin: 3px 0; }
table.streams td { vertical-align: middle; }
table.streams input[name$="[port]"] { width: 100px; }
table.streams input.fname { width: 240px; }

/* Search Result Bar */
.resbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; font-size: 15px; }
.resbar .hint { margin: 0 0 0 auto; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 500; }
.fchip i { font-style: normal; opacity: .7; }
.fchip:hover { text-decoration: none; }
.fchip:hover i { opacity: 1; }
.search .filter + .filter { padding-top: 16px; border-top: 1px solid var(--line-soft); }
.search { display: flex; flex-direction: column; gap: 16px; }

/* Tag (Audit) */
.tag { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--grey-bg); color: var(--grey); }
.tag.login_fail, .tag.nas_delete, .tag.staff_delete { background: var(--red-bg); color: var(--red); }
.tag.download { background: var(--amber-bg); color: var(--amber); }
.tag.login { background: var(--green-bg); color: var(--green); }

/* ---------- Login ---------- */
.login { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 10px 30px rgba(20, 30, 50, .06); }
.login .brand { padding: 0 0 6px; justify-content: center; }
.login .btn { width: 100%; }

/* ---------- Litepicker (Calendar Popup) ---------- */
.litepicker { font-family: var(--font) !important; border-radius: 14px; box-shadow: 0 12px 32px rgba(20, 30, 50, .16); overflow: hidden; }
.litepicker .container__main { border-radius: 14px; }
.litepicker .day-item.is-start-date, .litepicker .day-item.is-end-date { background-color: var(--blue) !important; }
.litepicker .day-item.is-in-range { background-color: var(--blue-soft) !important; }
.litepicker .day-item.is-today { color: var(--blue) !important; font-weight: 700; }
.litepicker .container__predefined-ranges { box-shadow: none; border-right: 1px solid var(--line); }
.litepicker .container__predefined-ranges button { font-family: var(--font); padding: 8px 14px; border-radius: 8px; }
.litepicker .container__predefined-ranges button:hover { background: var(--blue-soft); color: var(--blue); }

@media (max-width: 860px) {
  .side { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .brand { padding: 0 8px; }
  .who { margin: 0 0 0 auto; border: 0; padding: 0 8px; }
  .page { margin-left: 0; padding: 18px; }
  .span2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.chip { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.chip:hover { text-decoration: none; background: #d6e6fb; }
pre.code { background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 0; }
