@font-face { font-family: "Helvetica Neue LT GEO"; src: url(/assets/fonts/HelveticaNeueLTGEO-45Lt.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(/assets/fonts/HelveticaNeueLTGEO-55Rm.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(/assets/fonts/HelveticaNeueLTGEO-65Md.woff2) format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(/assets/fonts/HelveticaNeueLTGEO-75Bd.woff2) format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --bs-font-sans-serif: "Helvetica Neue LT GEO", Arial, Helvetica, sans-serif;
  --bs-body-font-size: .92rem;
  --side-bg: #0f1b2d;
  --side-w: 240px;
}
body { background: #f3f5f9; font-family: var(--bs-font-sans-serif); }
h1, h2, h3, h4, h5, .h4, .h5 { font-weight: 600; }
.btn, .badge, .form-label, th { font-weight: 500; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: var(--side-bg); color: #cfd8e3; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 1040; transition: transform .2s; }
.sidebar .brand { display: flex; gap: .5rem; align-items: center; padding: 1.1rem 1.2rem; color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { border-radius: 9px; box-shadow: 0 4px 12px rgba(31,111,235,.4); }
.sidebar nav { flex: 1; padding: .6rem; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .6rem .8rem; border-radius: .5rem; color: #cfd8e3; text-decoration: none; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: #1f6feb; color: #fff; }
.sidebar-user { padding: 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user a { color: #fff; text-decoration: none; display: block; }
.sidebar-user small { color: #8796ab; }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; }
.content { padding: 1.5rem; max-width: 1600px; }
.topbar { display: flex; gap: .75rem; align-items: center; padding: .6rem 1rem; background: #fff; border-bottom: 1px solid #e3e7ee; position: sticky; top: 0; z-index: 1030; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
}

.card { border: 1px solid #e3e7ee; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f5; font-weight: 600; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.45rem; margin: 0; }
.stat { padding: 1rem 1.2rem; }
.stat .num { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: #6b7685; font-size: .85rem; }
.stat i { font-size: 1.6rem; opacity: .85; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { color: #6b7685; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; background: #fafbfc; }
.table-hover tbody tr { cursor: default; }
.dl-grid { display: grid; grid-template-columns: 170px 1fr; gap: .45rem 1rem; margin: 0; }
.dl-grid dt { color: #6b7685; font-weight: 400; }
.dl-grid dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid #dbe2ec; padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #1f6feb; position: absolute; left: -6px; top: 5px; }
.timeline .meta { font-size: .8rem; color: #6b7685; }
.pre { white-space: pre-line; }

/* Map */
.map-wrap { display: grid; grid-template-columns: 340px 1fr; gap: 1rem; height: calc(100vh - 150px); min-height: 480px; }
.map-wrap .list { overflow-y: auto; }
.map-wrap #map { border-radius: .75rem; border: 1px solid #e3e7ee; height: 100%; }
.map-item { padding: .6rem .8rem; border-bottom: 1px solid #eef1f5; cursor: pointer; }
.map-item:hover { background: #f5f8ff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin.alert { animation: pulse 1.3s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220,53,69,.7); } 70% { box-shadow: 0 0 0 12px rgba(220,53,69,0); } 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0); } }
@media (max-width: 991.98px) { .map-wrap { grid-template-columns: 1fr; height: auto; } .map-wrap #map { height: 60vh; } .map-wrap .list { max-height: 40vh; } }
#pickmap { height: 320px; border-radius: .5rem; border: 1px solid #dee2e6; }

/* Monitoring */
.cam-grid { display: grid; gap: .75rem; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
@media (max-width: 767.98px) { .cam-grid { grid-template-columns: 1fr !important; } }
.cam { background: #0b0f17; border-radius: .6rem; overflow: hidden; position: relative; }
.cam .screen { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: #6b7685; }
.cam .screen video, .cam .screen img, .cam .screen iframe { width: 100%; height: 100%; object-fit: contain; border: 0; background: #000; }
.cam .bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .6rem; color: #dfe6ef; font-size: .82rem; background: #111827; }
.cam .bar .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam .bar button { color: #dfe6ef; padding: 0 .25rem; }
.cam .live { position: absolute; top: .5rem; left: .5rem; background: #dc3545; color: #fff; font-size: .7rem; padding: .1rem .4rem; border-radius: .25rem; font-weight: 700; }

/* Login */
.auth { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; background: #fff; }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem 3rem; color: #fff;
  background: radial-gradient(900px 500px at 15% 10%, rgba(31,111,235,.35), transparent 60%), radial-gradient(700px 500px at 90% 100%, rgba(77,155,255,.18), transparent 60%), #0b1424; }
.auth-grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); pointer-events: none; }
.auth-logo { position: relative; display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; }
.auth-logo-mark { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 6px 18px rgba(31,111,235,.45); }
.auth-panel .auth-logo { color: #0f1b2d; }
.auth-hero-body { position: relative; max-width: 560px; }
.auth-hero h1 { font-size: 2.3rem; font-weight: 700; line-height: 1.25; margin-bottom: 1rem; }
.auth-hero h1 span { background: linear-gradient(90deg, #4d9bff, #9cc7ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #a9b6c8; font-size: 1.02rem; margin-bottom: 2rem; }
.auth-cams { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 2rem; }
.auth-cam { position: relative; aspect-ratio: 16/9; border-radius: .7rem; display: grid; place-items: center; font-size: 1.6rem; color: rgba(255,255,255,.25);
  background: linear-gradient(160deg, #18263d, #0e1829); border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 0 40px rgba(0,0,0,.35); }
.auth-cam small { position: absolute; left: .6rem; bottom: .45rem; font-size: .7rem; color: #a9b6c8; }
.auth-cam .rec { position: absolute; top: .45rem; left: .55rem; font-size: .62rem; font-weight: 700; letter-spacing: .04em; color: #ff5c6c; animation: blink 1.6s infinite; }
.auth-cam.off .rec { color: #8796ab; animation: none; }
.auth-cam.off { opacity: .6; }
@keyframes blink { 50% { opacity: .35; } }
.auth-features { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-features li { padding: .4rem .8rem; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: #dbe5f2; }
.auth-features i { color: #4d9bff; margin-right: .3rem; }
.auth-foot { position: relative; color: #6b7a90; font-size: .8rem; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: #f7f9fc; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 1.55rem; font-weight: 700; color: #0f1b2d; margin-bottom: .35rem; }
.auth-input { position: relative; }
.auth-input > i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: #8796ab; pointer-events: none; }
.auth-input .form-control { height: 3.1rem; padding-left: 2.6rem; padding-right: 2.8rem; border-radius: .65rem; border-color: #dbe2ec; background: #fff; }
.auth-input .form-control:focus { border-color: #1f6feb; box-shadow: 0 0 0 .25rem rgba(31,111,235,.12); }
.auth-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #8796ab; padding: .35rem .5rem; }
.auth-eye:hover { color: #0f1b2d; }
.auth-submit { height: 3.1rem; border-radius: .65rem; font-weight: 600; font-size: 1rem; background: linear-gradient(135deg, #1f6feb, #3d8bff); border: 0; box-shadow: 0 8px 20px rgba(31,111,235,.3); transition: transform .15s, box-shadow .15s; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(31,111,235,.4); }
.auth-submit i { margin-left: .35rem; }
.auth-help { margin-top: 1.5rem; font-size: .83rem; color: #8796ab; text-align: center; }
@media (max-width: 991.98px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; }
}

.pkg-card { border-top: 4px solid var(--c, #0d6efd); height: 100%; }
.pkg-card .price { font-size: 1.8rem; font-weight: 700; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }

/* ===== Monitoring / ვიდეო-კედელი ===== */
.mon { --mbg: #0a0f1a; --mpanel: #0f1726; --mline: rgba(255,255,255,.07); --mtext: #d6deea; --mmuted: #7f8ca1;
  display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - 3rem); background: var(--mbg); color: var(--mtext); border-radius: .9rem; overflow: hidden; }
.mon.mon-wall, .mon.is-full { height: 100vh; border-radius: 0; }
.mon.side-hidden { grid-template-columns: 0 1fr; }
.mon.side-hidden .mon-side { visibility: hidden; }
.wall-body { background: #0a0f1a; overflow: hidden; }
@media (max-width: 991.98px) { .mon { height: calc(100vh - 6rem); } }

.mon-side { background: var(--mpanel); border-right: 1px solid var(--mline); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.mon-side-head { padding: .9rem; border-bottom: 1px solid var(--mline); display: grid; gap: .7rem; }
.mon-brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: #fff; font-size: 1.05rem; }
.mon-brand img { border-radius: 8px; }
.mon-counters { display: flex; gap: .4rem; }
.mon-chip { flex: 1; border: 1px solid var(--mline); background: rgba(255,255,255,.03); color: var(--mtext); border-radius: .5rem; padding: .35rem .4rem; font-size: .82rem; white-space: nowrap; }
.mon-chip i { font-size: .55rem; vertical-align: middle; }
.mon-chip.ok i { color: #22c55e; } .mon-chip.bad i { color: #ef4444; }
.mon-chip.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.mon-chip.active i { color: #fff; }
.mon-search { position: relative; }
.mon-search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--mmuted); font-size: .85rem; }
.mon-search input { width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--mline); border-radius: .5rem; color: #fff; padding: .45rem .7rem .45rem 2rem; outline: none; }
.mon-search input:focus { border-color: #1f6feb; }
.mon-tree { flex: 1; overflow-y: auto; padding: .4rem .5rem 1rem; scrollbar-width: thin; scrollbar-color: #2a3650 transparent; }
.mon-city { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mmuted); padding: .9rem .6rem .3rem; font-weight: 600; }
.mon-node { display: flex; align-items: center; gap: .45rem; padding: .42rem .6rem; border-radius: .45rem; cursor: pointer; font-size: .86rem; user-select: none; }
.mon-node:hover { background: rgba(255,255,255,.05); }
.mon-node.active { background: rgba(31,111,235,.22); color: #fff; }
.mon-node .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-node .cnt { font-size: .72rem; color: var(--mmuted); background: rgba(255,255,255,.06); border-radius: 999px; padding: 0 .45rem; }
.mon-node .cnt.bad { background: rgba(239,68,68,.2); color: #fca5a5; }
.mon-node .caret { font-size: .7rem; color: var(--mmuted); transition: transform .15s; padding: .2rem; margin: -.2rem; }
.mon-co.open > .mon-node .caret { transform: rotate(90deg); }
.mon-cams { display: none; padding-left: 1.1rem; }
.mon-co.open .mon-cams { display: block; }
.cam-node { font-size: .82rem; color: #b5c1d3; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex: none; }
.sdot.online { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.sdot.offline { background: #ef4444; }
.mon-empty-list { padding: 1rem; color: var(--mmuted); font-size: .85rem; text-align: center; }
.mon-side-foot { border-top: 1px solid var(--mline); padding: .7rem .9rem; display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--mmuted); }
.mon-side-foot a, .mon-side-foot button { color: var(--mtext); background: none; border: 0; padding: 0; font-size: 1rem; }

.mon-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mon-bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-bottom: 1px solid var(--mline); background: var(--mpanel); flex-wrap: wrap; }
.mon-title { flex: 1; min-width: 160px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-title small { color: var(--mmuted); font-weight: 400; margin-left: .4rem; }
.mon-title .bi-chevron-right { font-size: .7rem; color: var(--mmuted); }
.mon-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mon-group { display: flex; align-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--mline); border-radius: .5rem; padding: 2px; }
.mon-btn { display: inline-grid; place-items: center; width: 32px; height: 30px; border: 0; background: transparent; color: var(--mtext); border-radius: .4rem; text-decoration: none; }
.mon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.mon-btn.active { background: #1f6feb; color: #fff; }
.mon-btn:disabled { opacity: .35; }
.mon-page { font-size: .8rem; color: var(--mmuted); min-width: 42px; text-align: center; }
.mon-select { background: rgba(255,255,255,.04); border: 1px solid var(--mline); color: var(--mtext); border-radius: .5rem; height: 34px; font-size: .8rem; padding: 0 .5rem; }
.mon-select option { background: #0f1726; }
.mon-clock { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--mmuted); min-width: 120px; text-align: right; }

.mon-grid { flex: 1; min-height: 0; display: grid; gap: 4px; padding: 4px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); grid-template-rows: repeat(var(--n, 2), minmax(0, 1fr)); }
.tile { position: relative; background: #000; border-radius: .35rem; overflow: hidden; outline: 1px solid rgba(255,255,255,.05); }
.tile.offline { outline: 1px solid rgba(239,68,68,.45); }
.tile .screen { position: absolute; inset: 0; display: grid; place-items: center; color: #4b5870; text-align: center; font-size: .85rem; }
.tile .screen > span i { font-size: 1.8rem; }
.tile .screen video, .tile .screen img, .tile .screen iframe { width: 100%; height: 100%; object-fit: cover; border: 0; background: #000; }
.tile.empty .screen { background: repeating-linear-gradient(45deg, #0b111c, #0b111c 10px, #0d1420 10px, #0d1420 20px); }
.tile-top { position: absolute; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: flex-start; padding: .45rem; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; }
.tile-top .live { font-size: .65rem; font-weight: 700; letter-spacing: .05em; background: #dc2626; color: #fff; padding: .1rem .4rem; border-radius: .25rem; }
.tile-top .live.hd { background: #1f6feb; margin-right: .25rem; }
.tile-top .live.off { background: #374151; color: #fca5a5; }
.tile-actions { display: flex; gap: .2rem; opacity: 0; transition: opacity .15s; pointer-events: auto; }
.tile:hover .tile-actions { opacity: 1; }
.tile-actions button { border: 0; background: rgba(0,0,0,.55); color: #fff; width: 28px; height: 26px; border-radius: .3rem; font-size: .8rem; }
.tile-actions button:hover { background: #1f6feb; }
.tile-bottom { position: absolute; inset: auto 0 0 0; padding: 1.2rem .6rem .45rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); pointer-events: none; }
.tile-name { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.tile-co { color: #b5c1d3; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline-msg { color: #fca5a5; }
.offline-msg i { font-size: 2rem; }
.tile:fullscreen .screen video, .tile:fullscreen .screen img { object-fit: contain; }
@media (max-width: 767.98px) {
  .mon { grid-template-columns: 1fr; }
  .mon-side { position: absolute; z-index: 5; width: 85%; max-width: 320px; height: 100%; }
  .mon.side-hidden .mon-side { display: none; }
  .mon { position: relative; }
  .mon-grid { grid-template-columns: 1fr !important; grid-template-rows: none !important; overflow-y: auto; }
  .mon-grid .tile { aspect-ratio: 16/9; }
  .mon-clock { display: none; }
}

.mon-nvr { margin-left: -.4rem; }
.mon-nvr > .mon-node { font-size: .82rem; color: #c7d2e2; }
.mon-nvr > .mon-node .bi-hdd-stack { color: #8fb8ff; font-size: .8rem; }
.chn { display: inline-block; min-width: 1.5em; margin-right: .35rem; padding: 0 .3rem; border-radius: .25rem; background: rgba(255,255,255,.1); font-size: .7rem; text-align: center; font-variant-numeric: tabular-nums; }
