@font-face { font-family: Rubik; src: url(../assets/fonts/Rubik.ttf) format("truetype"); font-weight: 300 900; font-display: swap; }

:root { --brand: #0f766e; --brand-2: #0f4c5c; --bg: #f1f5f9; }
body { font-family: Rubik, system-ui, sans-serif; background: var(--bg); color: #0f172a; }
.btn-brand { background: linear-gradient(135deg, #14b8a6, var(--brand)); color: #fff; border: 0; box-shadow: 0 8px 20px -10px var(--brand); }
.btn-brand:hover { color: #fff; filter: brightness(1.05); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 15% 10%, #134e4a, #0b2e38 60%); padding: 20px; }
.login-card { background: #fff; padding: 40px 36px; border-radius: 28px; width: min(420px, 100%); text-align: center; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.login-logo { width: 84px; margin-bottom: 8px; }
.login-card h1 { font-weight: 800; margin: 0; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex-shrink: 0; background: linear-gradient(180deg, #0b2e38, #0f4c5c); color: #fff; display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 22px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.side-brand img { width: 46px; border-radius: 13px; }
.side-brand b { display: block; font-size: 22px; font-weight: 800; }
.side-brand small { opacity: .7; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.side-nav a { color: #cbd5e1; text-decoration: none; padding: 12px 14px; border-radius: 14px; display: flex; gap: 12px; align-items: center; font-weight: 500; transition: .15s; }
.side-nav a i { font-size: 19px; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: rgba(20, 184, 166, .22); color: #fff; box-shadow: inset 3px 0 0 #5eead4; }
.side-user { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-user small { display: block; opacity: .6; font-size: 12px; }
.main { flex: 1; min-width: 0; padding: 26px 30px; }
.main-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.main-head h1 { font-size: 26px; font-weight: 700; margin: 0; }
@media (max-width: 991px) {
  .sidebar { position: fixed; inset-block: 0; right: 0; z-index: 1050; transform: translateX(100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: -20px 0 60px rgba(0, 0, 0, .4); }
  .main { padding: 18px 14px; }
}
.loading { display: grid; place-items: center; min-height: 40vh; }
.empty { text-align: center; padding: 60px; color: #64748b; background: #fff; border-radius: 22px; }

.card-x { background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .25); border: 1px solid #e2e8f0; height: 100%; }
.card-x h2 { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.card-x h2 i { color: var(--brand); }
.card-x-head { display: flex; align-items: center; justify-content: space-between; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { --c: var(--brand); background: #fff; border-radius: 20px; padding: 18px; display: flex; gap: 14px; align-items: center; border: 1px solid #e2e8f0; box-shadow: 0 10px 30px -20px rgba(15, 23, 42, .3); }
.kpi > i { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.kpi small { color: #64748b; display: block; }
.kpi b { font-size: 26px; font-weight: 700; }

/* live */
.live-branch { padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.live-branch:last-child { border-bottom: 0; }
.lb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lb-deps { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.lb-dep { --c: var(--brand); border-radius: 18px; padding: 14px; background: color-mix(in srgb, var(--c) 8%, #fff); border: 1px solid color-mix(in srgb, var(--c) 25%, #fff); }
.lbd-name { color: var(--c); font-weight: 600; }
.lbd-now { font-size: 44px; font-weight: 800; line-height: 1.1; }
.lbd-meta { font-size: 13px; color: #475569; }

/* branches */
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
.branch.inactive { opacity: .6; }
.branch-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.branch-head h2 { margin: 0; font-size: 21px; }
.tv-box { display: flex; align-items: center; gap: 12px; background: #f0fdfa; border-radius: 16px; padding: 12px 14px; margin: 16px 0; }
.tv-box > i { font-size: 26px; color: var(--brand); }
.tv-box small { display: block; color: #64748b; font-size: 12px; }
.tv-box b { font-size: 22px; letter-spacing: 3px; }
.dep-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; }
.dep-row.inactive { opacity: .5; }
.dep-row small { color: #64748b; }
.dep-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 18px; }
.branch-foot { display: flex; justify-content: space-between; color: #64748b; font-size: 14px; margin-top: 14px; flex-wrap: wrap; gap: 8px; }

/* forms in swal */
.swal2-popup { font-family: Rubik, sans-serif !important; border-radius: 24px !important; }
.swal-form .form-label { font-size: 14px; color: #334155; margin-bottom: 4px; }
.icon-pick, .type-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick input, .type-pick input { display: none; }
.icon-pick span { width: 44px; height: 44px; border-radius: 12px; border: 2px solid #e2e8f0; display: grid; place-items: center; font-size: 20px; cursor: pointer; }
.icon-pick input:checked + span { border-color: var(--brand); background: #f0fdfa; color: var(--brand); }
.type-pick label { flex: 1; }
.type-pick span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border: 2px solid #e2e8f0; border-radius: 16px; cursor: pointer; font-size: 14px; text-align: center; height: 100%; }
.type-pick span i { font-size: 28px; color: #64748b; }
.type-pick input:checked + span { border-color: var(--brand); background: #f0fdfa; }
.type-pick input:checked + span i { color: var(--brand); }
.pair-code { font-size: 56px; font-weight: 800; letter-spacing: 12px; color: var(--brand); background: #f0fdfa; border-radius: 20px; padding: 10px; margin: 10px 0; }
.howto { display: flex; gap: 14px; align-items: start; background: #f0fdfa; border-color: #99f6e4; }
.howto > i { font-size: 24px; color: var(--brand); }
.filters .quick { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; }
.links li { margin-bottom: 8px; }
table.dataTable thead th { font-weight: 600; color: #475569; }

/* device log */
.log-table td { vertical-align: top; }
.log-row { cursor: pointer; }
.log-msg { word-break: break-word; max-width: 720px; }
.log-detail { white-space: pre-wrap; font-size: 12px; background: #f1f5f9; border-radius: 6px; padding: 8px; margin: 6px 0 0; text-align: left; }
