/* =====================================================================
   Zetrik Theme — Mac / System Settings style
   Halka sidebar, rang wali icon tile, active solid blue, Inter font.
   Aankhon pe aaram: text ka contrast pura, chubhne wala rang nahi.
   ===================================================================== */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../fonts/inter-700.woff2') format('woff2'); }

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --side: #f9fafc;
  --line: #e2e6ed;
  --line-soft: #eef1f5;
  --text: #1c1f26;
  --muted: #5b6273;
  --blue: #0a66d8;
  --blue-soft: #e8f1fd;
  --green: #1f9d47;
  --green-soft: #e6f6eb;
  --red: #d33a2c;
  --red-soft: #fdecea;
  --amber: #b86e00;
  --amber-soft: #fff4e0;
  --grey: #6b7280;
  --grey-soft: #f0f2f5;
  --purple: #7a3fd1;
  --purple-soft: #f2ebfc;
  --switch: #34c759;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; text-transform: none; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 600; margin-bottom: 12px; }
p { margin: 0 0 8px; }
svg { width: 18px; height: 18px; flex: none; }
small { font-size: .85rem; }

.z-mono { font-family: var(--mono); font-size: .92em; }
.z-muted { color: var(--muted); }
.z-nowrap { white-space: nowrap; }
.z-link { color: var(--blue); font-weight: 500; }
.z-link:hover { text-decoration: underline; }

/* ---------- App shell ---------- */
.z-app { display: flex; min-height: 100vh; }
.z-side { width: 248px; background: var(--side); border-right: 1px solid var(--line); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.z-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.z-brand b { display: block; font-size: 1.15rem; }
.z-brand small { color: var(--muted); }
.z-brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--blue); color: #fff; display: grid; place-items: center; }
.z-nav { display: grid; gap: 2px; }
.z-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 500; color: var(--text); }
.z-nav a:hover { background: #eceff4; }
.z-nav a.active { background: var(--blue); color: #fff; }
.z-nav a.active .z-tile { background: rgba(255, 255, 255, .22); color: #fff; }
.z-side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); }
.z-side-foot small { display: block; color: var(--muted); }

/* Rang wali icon tile */
.z-tile { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.z-tile svg { width: 16px; height: 16px; }
.z-tile.z-blue { background: #0a84ff; }
.z-tile.z-indigo { background: #5856d6; }
.z-tile.z-teal { background: #0fa3b1; }
.z-tile.z-green { background: #28a745; }
.z-tile.z-orange { background: #f08c00; }
.z-tile.z-purple { background: #9b51e0; }
.z-tile.z-pink { background: #e64980; }
.z-tile.z-cyan { background: #1c7ed6; }
.z-tile.z-grey { background: #8e8e93; }
.z-tile.z-red { background: #e03131; }
.z-tile.z-amber { background: #f59f00; }

.z-main { margin-left: 248px; flex: 1; min-width: 0; }
.z-top { height: 64px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.z-search { display: flex; align-items: center; gap: 8px; background: var(--grey-soft); border-radius: 999px; padding: 0 14px; width: min(460px, 100%); color: var(--muted); }
.z-search input { border: 0; background: transparent; padding: 9px 0; width: 100%; font: inherit; color: var(--text); outline: none; }
.z-top-right { display: flex; align-items: center; gap: 14px; }
.z-switcher select { border-radius: 999px; padding: 7px 36px 7px 14px; max-width: 260px; }
.z-me { display: flex; align-items: center; gap: 10px; }
.z-me b { display: block; font-size: .95rem; }
.z-me small { color: var(--muted); }
.z-avatar { border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 600; display: inline-grid; place-items: center; flex: none; }
.z-icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.z-icon-btn:hover { background: var(--grey-soft); color: var(--text); }
.z-content { padding: 26px 28px 40px; max-width: 1500px; }

/* ---------- Page head ---------- */
.z-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.z-head p { color: var(--muted); margin: 4px 0 0; }
.z-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards / grid ---------- */
.z-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.z-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.z-card-head h2 { margin: 0; }
.z-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.z-grid-2 > .z-card { margin-bottom: 18px; }

.z-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 18px; }
.z-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.z-stat small { color: var(--muted); display: block; }
.z-stat b { font-size: 1.5rem; font-weight: 700; }
.z-stats-sm { margin: 16px 0 0; }
.z-stats-sm .z-stat { box-shadow: none; background: var(--bg); border: 0; padding: 12px; }
.z-stats-sm .z-stat b { font-size: 1.25rem; }
.z-chart { position: relative; height: 260px; }

.z-progress { height: 8px; background: var(--grey-soft); border-radius: 99px; overflow: hidden; min-width: 90px; }
.z-progress span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.z-progress.z-warn span { background: var(--amber); }
.z-usage { display: grid; gap: 4px; min-width: 150px; }
.z-usage small { color: var(--muted); }
.z-pool-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.z-pool-row:last-child { border-bottom: 0; }
.z-pool-row small.z-muted { display: block; }

/* ---------- Grouped table ---------- */
.z-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.z-table { width: 100%; border-collapse: collapse; }
.z-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .88rem; background: #f8f9fb; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.z-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.z-table tr:last-child td { border-bottom: 0; }
.z-check-col { width: 40px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--blue); }

/* ---------- Badge (rang + label hamesha saath) ---------- */
.z-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.z-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.z-badge.z-green { background: var(--green-soft); color: var(--green); }
.z-badge.z-blue { background: var(--blue-soft); color: var(--blue); }
.z-badge.z-red { background: var(--red-soft); color: var(--red); }
.z-badge.z-amber { background: var(--amber-soft); color: var(--amber); }
.z-badge.z-grey { background: var(--grey-soft); color: var(--grey); }
.z-badge.z-purple { background: var(--purple-soft); color: var(--purple); }

/* ---------- Alerts ---------- */
.z-alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.z-alert.z-green { background: var(--green-soft); color: #156b31; border-color: #c7ebd2; }
.z-alert.z-red { background: var(--red-soft); color: #a1271c; border-color: #f6cbc6; }
.z-alert.z-amber { background: var(--amber-soft); color: #8a5200; border-color: #f8dfae; }

/* ---------- Buttons (gol) ---------- */
.z-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.z-btn:hover { background: var(--grey-soft); }
.z-btn svg { width: 16px; height: 16px; }
.z-btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.z-btn-primary:hover { background: #0857bb; }
.z-btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.z-btn-danger:hover { background: #b62f23; }
.z-btn-sm { padding: 5px 12px; font-size: .88rem; }
.z-btn-block { width: 100%; padding: 11px; }
.z-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.z-form label { display: grid; gap: 6px; font-weight: 500; font-size: .93rem; margin-bottom: 12px; }
.z-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.z-span-2 { grid-column: 1 / -1; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid #d5dae2; border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 102, 216, .15); }
input:disabled { background: var(--grey-soft); color: var(--muted); }
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; background-image: 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 1l5 5 5-5' stroke='%235b6273' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input[type=file] { padding: 7px; }
.z-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.z-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.z-filters input, .z-filters select { width: auto; min-width: 170px; flex: 1 1 170px; }
.z-filters input[name=q] { flex: 2 1 240px; }
.z-inline-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 10px 14px; background: var(--amber-soft); border-radius: var(--radius-sm); color: #8a5200; }

/* Apple green switch */
.z-switch-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.z-switch { position: relative; width: 50px; height: 30px; flex: none; }
.z-switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.z-switch i { position: absolute; inset: 0; background: #d9dce1; border-radius: 99px; transition: background .2s; }
.z-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.z-switch input:checked + i { background: var(--switch); }
.z-switch input:checked + i::after { transform: translateX(20px); }

/* Chips / Tabs (segmented) */
.z-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.z-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.z-chip.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(10, 102, 216, .15); }
.z-tabs { display: inline-flex; background: #e6e9ef; border-radius: 999px; padding: 3px; margin-bottom: 18px; }
.z-tabs a { padding: 7px 18px; border-radius: 999px; font-weight: 500; color: var(--muted); }
.z-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Key-value list */
.z-kv { margin: 0; display: grid; }
.z-kv > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.z-kv > div:last-child { border-bottom: 0; }
.z-kv dt { color: var(--muted); }
.z-kv dd { margin: 0; word-break: break-word; }

.z-hero-ip { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.z-hero .z-kv { margin-top: 12px; }
.z-profile { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.z-profile h2 { margin: 0 0 4px; }

/* Timeline */
.z-timeline { display: grid; }
.z-event { display: grid; grid-template-columns: 18px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.z-event::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.z-event:last-child::before { display: none; }
.z-event-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); margin-top: 4px; }
.z-event-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.z-event-head time { color: var(--muted); font-size: .88rem; }
.z-changes { list-style: none; margin: 6px 0; padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm); display: grid; gap: 3px; font-size: .92rem; }
.z-changes span { color: var(--muted); min-width: 110px; display: inline-block; }
.z-changes s { color: var(--red); }

/* Pager */
.z-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; color: var(--muted); }
.z-pager span { margin-right: auto; }

/* Modal (gol) */
.z-modal { position: fixed; inset: 0; background: rgba(20, 24, 33, .38); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.z-modal.open { display: flex; }
.z-modal-box { background: var(--surface); border-radius: 18px; padding: 24px; width: min(640px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .2); }
.z-modal-box h2 { margin-bottom: 6px; }
.z-modal-box .z-form { margin-top: 14px; }

/* Login page */
.z-auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.z-auth-card { background: var(--surface); width: min(420px, 100%); border-radius: 20px; padding: 32px; box-shadow: 0 10px 40px rgba(16, 24, 40, .08); border: 1px solid var(--line); }
.z-auth-card h1 { margin-top: 6px; }
.z-auth-card .z-form { margin-top: 18px; }

/* ---------- Date picker / Clock popups (zetrik-date.js, zetrik-time.js) ---------- */
.litepicker { font-family: var(--font) !important; }
.litepicker .container__months { border-radius: 14px !important; box-shadow: 0 12px 40px rgba(0, 0, 0, .14) !important; }
.litepicker .container__predefined-ranges { border-radius: 14px 0 0 14px !important; box-shadow: none !important; padding: 8px !important; }
.litepicker .container__predefined-ranges button { padding: 6px 10px !important; border-radius: 8px !important; font-family: var(--font) !important; }
.litepicker .container__predefined-ranges button:hover { background: var(--blue-soft) !important; }
.litepicker .container__days .day-item.is-start-date, .litepicker .container__days .day-item.is-end-date { background: var(--blue) !important; }

.zt-pop { position: absolute; z-index: 200; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, .16); padding: 14px; display: flex; gap: 14px; }
.zt-cal { min-width: 250px; }
.zt-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.zt-cal-head button, .zt-mode button { border: 0; background: var(--grey-soft); border-radius: 999px; padding: 4px 10px; cursor: pointer; font: inherit; }
.zt-grid { display: grid; grid-template-columns: repeat(7, 34px); gap: 2px; text-align: center; }
.zt-grid span { font-size: .78rem; color: var(--muted); padding: 4px 0; }
.zt-grid button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font: inherit; }
.zt-grid button:hover { background: var(--grey-soft); }
.zt-grid button.on { background: var(--blue); color: #fff; }
.zt-grid button.today { box-shadow: inset 0 0 0 1px var(--blue); }
.zt-clock-wrap { display: grid; justify-items: center; gap: 8px; }
.zt-read { font-size: 1.6rem; font-weight: 600; letter-spacing: .02em; }
.zt-read b { cursor: pointer; padding: 0 4px; border-radius: 6px; }
.zt-read b.on { background: var(--blue-soft); color: var(--blue); }
.zt-clock { position: relative; width: 220px; height: 220px; border-radius: 50%; background: var(--grey-soft); }
.zt-clock button { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font: inherit; font-size: .9rem; }
.zt-clock button.inner { font-size: .78rem; color: var(--muted); }
.zt-clock button:hover { background: #dfe3ea; }
.zt-clock button.on { background: var(--blue); color: #fff; }
.zt-hand { position: absolute; left: 50%; top: 50%; height: 2px; background: var(--blue); transform-origin: 0 50%; pointer-events: none; }
.zt-foot { display: flex; gap: 8px; justify-content: flex-end; width: 100%; }
.zd-grid { position: absolute; z-index: 200; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 48px rgba(0, 0, 0, .16); padding: 10px; display: grid; grid-template-columns: repeat(7, 34px); gap: 3px; }
.zd-grid button { border: 0; background: transparent; height: 34px; border-radius: 50%; cursor: pointer; font: inherit; }
.zd-grid button:hover { background: var(--grey-soft); }
.zd-grid button.on { background: var(--blue); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .z-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .z-side { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .z-app { flex-direction: column; }
  .z-nav { grid-auto-flow: column; overflow-x: auto; }
  .z-nav a { white-space: nowrap; }
  .z-side-foot, .z-brand { display: none; }
  .z-main { margin-left: 0; }
  .z-top { padding: 0 14px; height: auto; flex-wrap: wrap; padding-block: 10px; }
  .z-content { padding: 18px 14px; }
  .z-form-grid { grid-template-columns: 1fr; }
  .z-kv > div { grid-template-columns: 1fr; gap: 2px; }
  .z-me div { display: none; }
}

/* ---------- Print (Who Had This IP report) ---------- */
@media print {
  .z-side, .z-top, .z-tabs, .z-filters, .z-btn, .z-head-actions { display: none !important; }
  .z-main { margin: 0; }
  .z-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body { background: #fff; }
}
