/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #060c18;
  --panel: rgba(16, 26, 46, 0.78);
  --panel-solid: #0f1a2e;
  --panel-raised: #15233d;
  --line: rgba(148, 163, 184, 0.12);
  --line-strong: rgba(148, 163, 184, 0.24);
  --text: #e7eef9;
  --muted: #8a9bb6;
  --blue: #3b82f6;
  --blue-bright: #60a5fa;
  --blue-soft: rgba(59, 130, 246, 0.16);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 248px;
  --shadow: 0 10px 30px rgba(2, 6, 18, 0.35);
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(14, 165, 233, 0.1), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--blue-bright);
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

code,
pre {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted {
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

.boot {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
}

/* ==========================================================================
   Buttons, pills, form controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--panel-raised);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn.primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #4f8ff7, #2f6df0);
}

.btn.danger {
  background: var(--red);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.08);
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  box-shadow: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pill .icon {
  width: 14px;
  height: 14px;
}

.pill.green {
  background: var(--green-soft);
  color: #4ade80;
}

.pill.role-admin {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
}

.pill.role-operator {
  background: var(--blue-soft);
  color: var(--blue-bright);
}

.pill.role-viewer,
.pill.role-custom {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.checks.stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 560px) {
  .checks.stack {
    grid-template-columns: 1fr;
  }
}

.field {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > span,
.field > legend {
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.action-row select,
.action-row input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(6, 12, 24, 0.6);
}

.field input:disabled {
  color: var(--muted);
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}

.check.wide {
  width: 100%;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.check:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: #fca5a5;
  font-size: 14px;
}

/* Công tắc dạng gạt */
.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  transition: background-color 0.2s, border-color 0.2s;
}

.switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}

.switch[aria-checked="true"] {
  border-color: transparent;
  background: var(--green);
}

.switch[aria-checked="true"] .knob {
  transform: translateX(20px);
  background: #fff;
}

.switch:disabled {
  opacity: 0.55;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.85);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: var(--text);
}

.brand-icon {
  width: 36px;
  height: 36px;
  color: var(--blue-bright);
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.3));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.brand-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand:hover .brand-icon {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 14px rgba(56, 189, 248, 0.5));
}

.brand:hover .brand-img {
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.7);
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: #b4c2d8;
  font-weight: 500;
}

.nav a:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.nav a[aria-current="page"] {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.sidebar-foot {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.clock strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.clock span {
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
}

.content {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px 8px;
}

.greeting h1 {
  font-size: 20px;
}

.greeting p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.menu-btn,
.scrim {
  display: none;
}

.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-weight: 600;
}

.avatar.lg {
  width: 46px;
  height: 46px;
  font-size: 18px;
}

.avatar.square {
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue-bright);
}

.avatar .icon {
  width: 18px;
  height: 18px;
}

.view {
  padding: 16px 28px 40px;
  outline: none;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-head .muted {
  margin: 0;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.panel + .panel {
  margin-top: 16px;
}

.panel-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2,
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.section-head a,
.panel-head a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.section-head .icon,
.panel-head .icon {
  width: 18px;
  height: 18px;
}

.empty {
  display: grid;
  gap: 4px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty strong {
  color: var(--text);
}

/* ==========================================================================
   Tổng quan
   ========================================================================== */

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.overview-prioritize-devices {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Topbar Header Strip: Weather, Stats, Actions */
.overview-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.top-strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Weather Pill in Topbar */
.weather-pill-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
}

.weather-pill-icon {
  display: flex;
  align-items: center;
  color: #38bdf8;
}

.weather-pill-icon .icon {
  width: 18px;
  height: 18px;
}

.weather-pill-temp {
  font-weight: 700;
  color: #38bdf8;
  font-size: 15px;
}

.weather-pill-city {
  color: #cbd5e1;
  font-size: 13px;
}

.weather-pill-refresh {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.3s;
}

.weather-pill-refresh:hover {
  opacity: 1;
  transform: rotate(180deg);
}

/* Top Strip Stats */
.top-strip-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.6);
  font-size: 13px;
  color: var(--text);
}

.stat-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-badge.green .badge-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.stat-badge.blue .badge-dot {
  background: #3b82f6;
}

.stat-badge.yellow .icon {
  width: 15px;
  height: 15px;
  color: #eab308;
}

.stat-badge.red {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.stat-badge.red .icon {
  width: 15px;
  height: 15px;
  color: #f87171;
}

.top-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* Compact Scenes Strip */
.compact-scenes-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.4);
  overflow-x: auto;
}

.strip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--blue-bright);
  white-space: nowrap;
}

.strip-label .icon {
  width: 16px;
  height: 16px;
}

.scene-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.scene-chips::-webkit-scrollbar {
  display: none;
}

.scene-chips .scene-btn {
  padding: 6px 14px;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 999px;
  min-height: auto;
}

.scenes-more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}

.scenes-more-link:hover {
  color: var(--text);
}

/* Overview Main Devices */
.overview-main-devices {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Overview Footer Grid */
.overview-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  .overview-top-strip {
    flex-direction: column;
    align-items: stretch;
  }
  .top-strip-stats {
    justify-content: space-between;
  }
  .top-strip-actions {
    justify-content: flex-end;
  }
  .overview-footer-grid {
    grid-template-columns: 1fr;
  }
}

.overview > .panel + .panel {
  margin-top: 0;
}

.overview-devices {
  grid-column: 1 / -1;
}

.hero {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.12), transparent 50%), var(--panel-solid);
  box-shadow: var(--shadow);
}

.hero-art.smart-house-3d {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: auto;
  opacity: 0.95;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 280px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(6, 12, 24, 0.85) 0%, rgba(6, 12, 24, 0.15) 50%, rgba(6, 12, 24, 0.85) 100%);
  pointer-events: none;
}

.hero-content > * {
  pointer-events: auto;
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.hero-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  margin: 0;
  white-space: nowrap;
  color: #f8fafc;
}

.hero-title .icon {
  width: 22px;
  height: 22px;
  color: #38bdf8;
}

.inline-weather-slot {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.inline-weather-slot .weather-pill-top {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  max-width: 180px;
}

.inline-weather-slot .weather-pill-city {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 1-Row Horizontal Stats Strip (Không che 4D House) */
.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
  width: 100%;
  pointer-events: auto;
}

.hero-stats-row::-webkit-scrollbar {
  display: none;
}

.hero-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(6, 12, 24, 0.82);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  font-size: 12px;
  white-space: nowrap;
  color: #cbd5e1;
  flex: none;
}

.hero-stat-chip strong {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
}

.hero-stat-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.hero-stat-chip.green .chip-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.hero-stat-chip.blue .chip-dot {
  background: #3b82f6;
}

.hero-stat-chip.yellow .icon {
  width: 14px;
  height: 14px;
  color: #eab308;
}

.hero-stat-chip.red {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.hero-stat-chip.red .icon {
  width: 14px;
  height: 14px;
  color: #f87171;
}

/* Scene strip bulb icon label */
.strip-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  flex: none;
}

.strip-label-icon .icon {
  width: 18px;
  height: 18px;
}

.hero-stat strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.hero-stat span {
  color: var(--muted);
  font-size: 12px;
}

.hero-stat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.hero-stat-icon.green {
  background: var(--green-soft);
  color: #4ade80;
}

.hero-stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue-bright);
}

.hero-stat-icon.red {
  background: var(--red-soft);
  color: #f87171;
}

.overview-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.overview-side .panel + .panel {
  margin-top: 0;
}

.climate-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(14, 165, 233, 0.12)), var(--panel);
}

.climate-card .climate-icon {
  width: 44px;
  height: 44px;
  color: #fbbf24;
}

.climate-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.climate-card span {
  color: #cbd5e1;
  font-size: 13px;
}

.scene-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scene-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.06));
  font-weight: 500;
  text-align: left;
}

.scene-btn:hover:not(:disabled) {
  border-color: var(--blue);
}

.scene-btn:disabled {
  opacity: 0.6;
}

.scene-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue-bright);
}

.status-ok {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
}

.status-ok > .icon {
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 50%;
  background: var(--green);
  color: #052e16;
}

.status-ok strong {
  display: block;
  color: #4ade80;
}

.status-ok span {
  color: var(--muted);
  font-size: 13px;
}

.alerts,
.timeline,
.schedule-list,
.scene-actions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alerts li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
}

.alerts li > .icon {
  color: var(--amber);
}

.alerts li.danger {
  background: var(--red-soft);
}

.alerts li.danger > .icon {
  color: #f87171;
}

.alerts strong {
  display: block;
  font-size: 14px;
}

.alerts span {
  color: var(--muted);
  font-size: 12px;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.timeline time {
  color: var(--blue-bright);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Ô thiết bị
   ========================================================================== */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 35, 61, 0.9), rgba(13, 22, 40, 0.9));
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.tile.is-on {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(180deg, rgba(22, 101, 52, 0.45), rgba(13, 22, 40, 0.92));
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 10px 30px rgba(34, 197, 94, 0.12);
}

.tile.is-warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(180deg, rgba(120, 72, 6, 0.4), rgba(13, 22, 40, 0.92));
}

.tile.is-offline {
  opacity: 0.75;
}

.tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.tile.is-on .tile-icon {
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
}

.tile.is-warn .tile-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.tile-icon .icon {
  width: 22px;
  height: 22px;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.conn::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  content: "";
}

.conn.online::before {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.conn.offline {
  color: #fca5a5;
}

.conn.offline::before {
  background: var(--red);
}

.tile-name {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-zone {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.tile-body {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.tile-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tile-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.tile.is-on .tile-state {
  color: #4ade80;
}

.tile-sub {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.tile-reading {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.tile-reading strong {
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.tile-reading span {
  color: var(--muted);
  font-size: 15px;
}

.tile.is-warn .tile-reading strong {
  color: #fbbf24;
}

.tile-foot {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.range .icon {
  width: 16px;
  height: 16px;
}

.range input {
  flex: 1;
  min-width: 0;
  accent-color: var(--blue);
}

.range output {
  flex: none;
  min-width: 36px;
  font-size: 12px;
  text-align: right;
}

.tile-climate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tile-climate strong {
  font-size: 24px;
}

.step {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}

.step .icon {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Tabs, thẻ kịch bản, lịch trình, bảng
   ========================================================================== */

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  width: fit-content;
  max-width: 100%;
}

.page-head .tabs {
  margin-bottom: 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.tab span {
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  font-size: 12px;
}

.tab[aria-selected="true"] {
  background: var(--blue);
  color: #fff;
}

.tab[aria-selected="true"] span {
  background: rgba(255, 255, 255, 0.2);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card-grid .panel + .panel {
  margin-top: 0;
}

.scene-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scene-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scene-card-head h3 {
  flex: 1;
  font-size: 16px;
}

.scene-actions {
  flex: 1;
  gap: 6px;
}

.scene-actions li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.scene-actions b {
  font-weight: 500;
}

.scene-actions b.on {
  color: #4ade80;
}

.scene-actions b.off {
  color: var(--muted);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.schedule {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.schedule time {
  width: 64px;
  color: var(--blue-bright);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.schedule > div:not(.row-actions) {
  flex: 1;
}

.schedule strong {
  display: block;
}

.schedule span {
  color: var(--muted);
  font-size: 13px;
}

.schedule.is-paused {
  opacity: 0.55;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.table tr.is-muted td {
  opacity: 0.55;
}

.matrix td:not(:first-child),
.matrix th:not(:first-child) {
  text-align: center;
}

.matrix .yes {
  color: var(--green);
}

.matrix .no {
  color: var(--muted);
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person strong {
  display: block;
}

.person span {
  color: var(--muted);
  font-size: 12px;
}

.settings-form {
  display: grid;
  gap: 16px;
  max-width: 420px;
}

.settings-form .btn {
  justify-self: start;
}

.esp-guide ol {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 20px;
}

.esp-guide .icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.esp-guide pre {
  overflow-x: auto;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(2, 6, 18, 0.6);
  color: #cbd5e1;
}

/* ==========================================================================
   Đăng nhập
   ========================================================================== */

.auth {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 16px;
  width: min(400px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-card .brand {
  padding: 0;
  margin-bottom: 8px;
}

.auth-card h1 {
  font-size: 22px;
}

.auth-card .muted {
  margin: -8px 0 4px;
  font-size: 14px;
}

/* ==========================================================================
   Hộp thoại và thông báo
   ========================================================================== */

.dialog {
  width: min(640px, calc(100% - 24px));
  overflow: auto;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.dialog::backdrop {
  background: rgba(2, 6, 18, 0.7);
  backdrop-filter: blur(4px);
}

.dialog-body {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.dialog-head h2 {
  font-size: 18px;
}

.dialog-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.fields {
  display: grid;
  gap: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.action-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 110px;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.action-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.action-extra {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-extra em {
  color: var(--muted);
  font-style: normal;
}

.secret {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--blue);
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
}

.secret code {
  flex: 1;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in 0.2s ease-out;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.5);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}

.energy-panel {
  grid-column: 1 / -1;
}

.energy-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(180px, 240px);
  gap: 18px;
  align-items: end;
}

.energy-totals {
  display: grid;
  gap: 12px;
}

.energy-totals strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.energy-totals span,
.energy-rank h3 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.energy-bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 96px;
}

.energy-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: 6px;
}

.energy-bar i {
  display: block;
  width: 100%;
  max-width: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #64b5ff, #0a84ff);
}

.energy-bar span {
  color: var(--muted);
  font-size: 10px;
}

.energy-top {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.energy-top li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ==========================================================================
   Liquid Glass (kiểu iOS 26)
   ========================================================================== */

:root {
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --glass-blur: blur(28px) saturate(180%);
  --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 26px;
  --radius-sm: 16px;
  --blue: #0a84ff;
  --blue-bright: #64b5ff;
  --blue-soft: rgba(10, 132, 255, 0.2);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.18);
}

body {
  background:
    radial-gradient(900px 700px at 0% 0%, rgba(10, 132, 255, 0.35), transparent 60%),
    radial-gradient(800px 600px at 100% 10%, rgba(191, 90, 242, 0.25), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(48, 209, 88, 0.16), transparent 60%),
    #05070d;
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar,
.sidebar-foot,
.panel,
.hero,
.tile,
.tabs,
.auth-card,
.dialog,
.toast,
.tabbar {
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  box-shadow: var(--glass-shine), var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.sidebar {
  top: 12px;
  height: calc(100vh - 24px);
  margin: 12px 0 12px 12px;
  border-radius: 30px;
}

.sidebar-foot {
  background: var(--glass);
  box-shadow: var(--glass-shine);
}

.nav a {
  border-radius: 999px;
  color: rgba(235, 240, 250, 0.78);
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav a[aria-current="page"] {
  background: var(--glass-strong);
  color: #fff;
  box-shadow: var(--glass-shine), 0 4px 16px rgba(0, 0, 0, 0.25);
}

.nav a[aria-current="page"] .icon {
  color: var(--blue-bright);
}

.hero-content {
  background: linear-gradient(90deg, rgba(5, 7, 13, 0.55), transparent 55%);
}

.hero-stats,
.field input,
.field select,
.action-row select,
.action-row input {
  border-color: var(--glass-edge);
  background: rgba(255, 255, 255, 0.05);
}

.field input,
.field select,
.action-row select,
.action-row input {
  border-radius: 14px;
}

.tile {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.25s, box-shadow 0.25s;
}

.tile:active {
  transform: scale(0.98);
}

.tile.is-on {
  border-color: rgba(48, 209, 88, 0.45);
  background: linear-gradient(160deg, rgba(48, 209, 88, 0.32), rgba(48, 209, 88, 0.08));
  box-shadow: var(--glass-shine), 0 12px 40px rgba(48, 209, 88, 0.18);
}

.tile.is-warn {
  border-color: rgba(255, 159, 10, 0.45);
  background: linear-gradient(160deg, rgba(255, 159, 10, 0.26), rgba(255, 159, 10, 0.06));
}

.tile-icon {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.tile.is-on .tile-icon {
  background: #fff;
  color: #ff9f0a;
}

.tile.is-on .tile-state {
  color: #7ee2a0;
}

.btn {
  border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: var(--glass-shine);
  transition: transform 0.15s, background-color 0.15s;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn.primary,
.btn.primary:hover:not(:disabled) {
  background: var(--blue);
  box-shadow: var(--glass-shine), 0 6px 20px rgba(10, 132, 255, 0.4);
}

.btn.ghost {
  border-color: var(--glass-edge);
  background: rgba(255, 255, 255, 0.05);
}

.icon-btn,
.step {
  border-color: var(--glass-edge);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.switch {
  width: 52px;
  height: 32px;
  border: 0;
  background: rgba(120, 120, 128, 0.36);
}

.switch .knob {
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.switch[aria-checked="true"] .knob {
  transform: translateX(20px);
}

.tabs {
  border-radius: 999px;
}

.tab {
  border-radius: 999px;
}

.tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: var(--glass-shine);
}

.check {
  border-color: var(--glass-edge);
  border-radius: 14px;
}

.dialog {
  border-radius: 30px;
  background: rgba(28, 30, 38, 0.72);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.toast {
  border-radius: 999px;
  background: rgba(28, 30, 38, 0.72);
}

.auth-card {
  border-radius: 32px;
}

.tabbar {
  display: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar,
  .panel,
  .hero,
  .tile,
  .tabs,
  .auth-card,
  .dialog,
  .toast,
  .tabbar {
    background: rgba(22, 26, 36, 0.94);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .overview {
    grid-template-columns: 1fr;
  }

  .overview-side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar);
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .tabbar {
    position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    gap: 2px;
    padding: 6px;
    border-radius: 999px;
  }

  .tabbar a,
  .tabbar button {
    display: grid;
    flex: 1;
    justify-items: center;
    gap: 2px;
    min-width: 0;
    padding: 6px 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(235, 240, 250, 0.7);
    font-size: 10px;
    font-weight: 600;
  }

  .tabbar span {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabbar a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.14);
    color: var(--blue-bright);
  }

  .toasts {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .layout.menu-open .sidebar {
    transform: none;
  }

  .layout.menu-open .scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    background: rgba(2, 6, 18, 0.6);
  }

  .menu-btn {
    display: inline-grid;
  }

  .topbar {
    padding: 14px 16px 4px;
  }

  .topbar .avatar.lg,
  .sync,
  .topbar .btn span {
    display: none;
  }

  .view {
    padding: 12px 16px calc(104px + env(safe-area-inset-bottom));
  }

  .overview-side,
  .energy-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .tile {
    border-radius: 18px;
  }
}

@media (max-width: 480px) {
  .tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .hero-stats .btn {
    width: 100%;
    margin-left: 0;
  }

  .action-row {
    grid-template-columns: 1fr 1fr;
  }

  .action-row > span:first-child {
    grid-column: 1 / -1;
  }

  .schedule {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Bảo vệ giao diện Hộp thoại (Dialog / Modal) & Tabbar trên điện thoại
   ========================================================================== */

body:has(#dialog[open]),
body:has(dialog[open]) {
  overflow: hidden !important;
}

body:has(#dialog[open]) .tabbar,
body:has(dialog[open]) .tabbar {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

@media (max-width: 768px) {
  .dialog {
    width: calc(100vw - 20px) !important;
    max-width: 500px !important;
    max-height: calc(100dvh - 24px) !important;
    margin: auto !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75) !important;
  }

  .dialog-body {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100dvh - 24px) !important;
    padding: 18px 16px 14px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .dialog-head {
    flex: none;
    margin-bottom: 12px;
  }

  .dialog-head h2 {
    font-size: 17px;
  }

  .fields,
  .action-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
    padding-bottom: 12px;
    margin-bottom: 6px;
  }

  .dialog-actions {
    flex: none;
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: auto;
    padding-top: 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--panel-solid);
    width: 100%;
    display: flex;
    gap: 10px;
  }

  .dialog-actions .btn {
    flex: 1;
    min-height: 46px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-head .btn {
    width: 100%;
    justify-content: center;
  }

  .tabs {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

/* ==========================================================================
   Ô thiết bị vuông: mọi kích thước bên trong tính theo chiều rộng ô (cqw)
   ========================================================================== */

.tile-grid {
  align-items: start;
}

.tile {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 0;
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 0;
  padding: 7%;
  overflow: hidden;
}

.tile > * {
  flex: none;
  min-width: 0;
}

.tile-head {
  align-items: center;
  margin: 0;
}

.tile-icon {
  width: 21cqw;
  height: 21cqw;
}

.tile-icon .icon {
  width: 11cqw;
  height: 11cqw;
}

.tile .conn {
  gap: 2cqw;
  font-size: min(5.5cqw, 12px);
}

.tile .conn::before {
  width: 3cqw;
  height: 3cqw;
}

.tile-name {
  height: 2.4em;
  min-height: 0;
  margin: 4cqw 0 0;
  font-size: min(8.5cqw, 17px);
  line-height: 1.2;
}

.tile-zone {
  overflow: hidden;
  margin: 1.5cqw 0 0;
  font-size: min(7cqw, 13px);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-body {
  grid-template-columns: minmax(0, 1fr);
  gap: 4cqw;
  margin-top: auto;
  padding: 3cqw 0 0;
}

.tile-row {
  gap: 4cqw;
  min-width: 0;
}

.tile-state,
.tile-sub {
  overflow: hidden;
  font-size: min(6.5cqw, 13px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile .switch {
  width: 27cqw;
  height: 16.5cqw;
}

.tile .switch .knob {
  top: 1.5cqw;
  left: 1.5cqw;
  width: 13.5cqw;
  height: 13.5cqw;
}

.tile .switch[aria-checked="true"] .knob {
  transform: translateX(10.5cqw);
}

.tile-climate {
  gap: 3cqw;
}

.tile-climate strong {
  font-size: min(11cqw, 24px);
  line-height: 1;
}

.tile .step {
  width: 15cqw;
  height: 15cqw;
}

.tile .step .icon {
  width: 7cqw;
  height: 7cqw;
}

.tile .range {
  gap: 2cqw;
}

.tile .range .icon {
  width: 6cqw;
  height: 6cqw;
}

.tile .range input {
  width: 100%;
  min-width: 0;
}

.tile .range output {
  min-width: 0;
  font-size: min(6cqw, 12px);
}

.tile-reading strong {
  font-size: min(20cqw, 40px);
}

.tile-reading span {
  font-size: min(8cqw, 16px);
}

.tile-foot {
  overflow: hidden;
  margin: 0;
  font-size: min(6cqw, 12px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile.is-openable {
  cursor: pointer;
}

.tile.is-openable:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.tile-climate strong {
  font-size: min(14cqw, 30px);
}

/* On Desktop (> 768px), keep tiles compact, elegant, and balanced */
@media (min-width: 769px) {
  .tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }

  .tile {
    aspect-ratio: auto;
    min-height: 160px;
    padding: 16px;
  }

  .tile-icon {
    width: 42px;
    height: 42px;
  }

  .tile-icon .icon {
    width: 22px;
    height: 22px;
  }

  .tile-name {
    height: 2.2em;
    margin-top: 10px;
    font-size: 15px;
  }

  .tile-zone {
    margin-top: 4px;
    font-size: 12px;
  }

  .tile-body {
    gap: 8px;
    padding-top: 8px;
  }

  .tile-row {
    gap: 8px;
  }

  .tile-state,
  .tile-sub {
    font-size: 13px;
  }

  .tile .switch {
    width: 48px;
    height: 28px;
  }

  .tile .switch .knob {
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
  }

  .tile .switch[aria-checked="true"] .knob {
    transform: translateX(20px);
  }

  .tile-climate strong {
    font-size: 26px;
  }

  .tile-reading strong {
    font-size: 32px;
  }

  .tile-reading span {
    font-size: 14px;
  }

  .tile-foot {
    font-size: 12px;
  }
}

/* ==========================================================================
   Nhóm thiết bị / cảm biến
   ========================================================================== */

.device-group + .device-group {
  margin-top: 24px;
}

.section-head .count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   Bảng điều khiển điều hòa
   ========================================================================== */

.bubble-layer {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 18, 0.35);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.bubble-layer.is-open {
  opacity: 1;
}

.bubble {
  width: min(340px, 100%);
  padding: 16px;
  border: 1px solid var(--glass-edge);
  border-radius: 26px;
  background: rgba(22, 28, 44, 0.88);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  transform: scale(0.92);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.bubble:focus {
  outline: none;
}

.bubble-layer.is-open .bubble {
  transform: scale(1);
}

.sheet {
  display: grid;
  gap: 12px;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-head > div {
  flex: 1;
  min-width: 0;
}

.sheet-head h2 {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-head p {
  margin: 4px 0 0;
}

.sheet-head .conn {
  display: inline-flex;
}

.sheet-power {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.sheet-power .icon {
  width: 20px;
  height: 20px;
}

.sheet-power[aria-pressed="true"] {
  border-color: transparent;
  background: #34c759;
  box-shadow: 0 6px 18px rgba(52, 199, 89, 0.4);
  color: #fff;
}

.sheet-power:disabled,
.sheet-dial .step:disabled {
  opacity: 0.4;
}

.sheet-dial {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.sheet-dial .step {
  flex: none;
  width: 42px;
  height: 42px;
}

.sheet-dial .step .icon {
  width: 18px;
  height: 18px;
}

.sheet-target {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.sheet-target strong {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}

.sheet-target small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.sheet-target span {
  color: var(--muted);
  font-size: 12px;
}

.sheet:not(.is-on) .sheet-target strong {
  color: var(--muted);
}

.sheet-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sheet-row {
  display: flex;
  gap: 4px;
}

.sheet-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sheet-pill .icon {
  width: 13px;
  height: 13px;
}

.sheet-pill.active {
  border-color: rgba(10, 132, 255, 0.6);
  background: rgba(10, 132, 255, 0.22);
  color: #60a5fa;
  font-weight: 600;
}

.sheet-pill:disabled,
.sheet-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sheet-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sheet-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sheet-toggle .icon {
  width: 15px;
  height: 15px;
}

.sheet-toggle.active {
  border-color: rgba(52, 199, 89, 0.6);
  background: rgba(52, 199, 89, 0.18);
  color: #4ade80;
  font-weight: 600;
}

.sheet-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  text-align: center;
}

.sheet-stats div {
  padding: 8px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.sheet-stats dt {
  color: var(--muted);
  font-size: 11px;
}

.sheet-stats dd {
  overflow: hidden;
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Hẹn giờ & Phân nhóm loại thiết bị
   ========================================================================== */

.tabs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.category-tabs {
  margin-top: 4px;
}

.tab-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 20px;
}

.tile-head-side {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tile-timer-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tile-timer-btn .icon {
  width: 14px;
  height: 14px;
}

.tile-timer-btn:hover {
  background: rgba(10, 132, 255, 0.15);
  color: #60a5fa;
  border-color: rgba(10, 132, 255, 0.4);
}

.tile-timer-btn.has-timer {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
  font-weight: 600;
}

.timer-bubble {
  max-width: 340px;
}

.timer-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 12px;
}

.timer-banner .icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.timer-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.timer-preset {
  padding: 8px 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.timer-preset:hover,
.timer-preset.active {
  background: rgba(10, 132, 255, 0.25);
  border-color: #0a84ff;
  color: #60a5fa;
  font-weight: 600;
}

.timer-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.timer-custom-input {
  width: 90px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 14px;
  text-align: center;
}

.timer-actions {
  margin-top: 6px;
}

.timer-toggle {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   Nâng cấp Ô Cảm biến & Thông số chuyên biệt (Metric Readout Card)
   ========================================================================== */
.tile.tile-sensor {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6)) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

.tile.tile-sensor:hover {
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.18) !important;
}

.tile.tile-sensor.is-warn {
  background: linear-gradient(145deg, rgba(69, 10, 10, 0.75), rgba(30, 41, 59, 0.85)) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25) !important;
}

.tile.tile-sensor .tile-icon {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border-radius: 50%;
}

.tile.tile-sensor.is-warn .tile-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.sensor-readout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.sensor-val-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sensor-num {
  font-size: clamp(1.35rem, 5.5cqw, 1.85rem);
  font-weight: 700;
  line-height: 1.1;
  color: #f8fafc;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sensor-unit {
  font-size: clamp(0.85rem, 3.5cqw, 1.05rem);
  font-weight: 600;
  color: #38bdf8;
}

.sensor-na {
  font-size: clamp(0.8rem, 3cqw, 0.92rem);
  color: #94a3b8;
  font-style: italic;
}

.sensor-status-line {
  display: flex;
  align-items: center;
}

.sensor-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: clamp(0.68rem, 2.7cqw, 0.76rem);
  font-weight: 500;
  line-height: 1.2;
}

.sensor-pill.info {
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.sensor-pill.alert {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.sensor-pill.muted {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Thời tiết (Weather Widget)
   ========================================================================== */
.weather-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.28), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 16px 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weather-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #7dd3fc;
}

.weather-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weather-temp-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-degree {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff, #e0f2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.weather-condition {
  font-size: 13px;
  color: #cbd5e1;
}

.weather-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fde047;
}

.weather-icon-box .icon {
  width: 26px;
  height: 26px;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #94a3b8;
}

.weather-detail-item strong {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

/* ==========================================================================
   Mô hình Nhà 4D Isometric Tương tác Siêu cấp (Interactive 4D Smart House)
   ========================================================================== */
.hero-art.smart-house-3d {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: auto;
  opacity: 0.96;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  animation: levitate4D 8s ease-in-out infinite alternate;
}

@keyframes levitate4D {
  0% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.005);
  }
  100% {
    transform: translateY(0px) scale(1);
  }
}

.house-zone {
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease, opacity 0.35s ease;
}

.house-zone:hover {
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.75)) !important;
}

.house-zone.is-lit text {
  font-weight: 700;
  filter: drop-shadow(0 0 8px rgba(254, 240, 138, 0.9));
}

/* 4D Micro-Animations */
.spin-fan {
  transform-origin: center;
  animation: spinFan 1.8s linear infinite;
}

@keyframes spinFan {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animated-water path {
  animation: flowWater 1.2s linear infinite;
}

@keyframes flowWater {
  0% {
    stroke-dashoffset: 18;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.animated-breeze {
  animation: breezePulse 2s ease-in-out infinite alternate;
}

@keyframes breezePulse {
  0% {
    opacity: 0.3;
    stroke-dashoffset: 10;
  }
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

.star-field circle {
  animation: starTwinkle 3s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  0% { opacity: 0.3; }
  100% { opacity: 0.95; }
}




/* ==========================================================================
   KITECH SMART HOME - CYBER LUXURY THEME (MATCHING MOCKUP)
   ========================================================================== */

/* --- Brand Logo & Sidebar --- */
.brand-logo-glow {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kitech-brand-logo {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 10px rgba(2, 132, 199, 0.45));
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.brand-tagline {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-badge-pill {
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.user-meta {
  display: flex;
  flex-direction: column;
}
.user-display-name {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}
.user-status-online {
  font-size: 11px;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.pulse-green-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.sidebar-logout-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

/* --- Topbar Home Selector --- */
.topbar-home-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 26, 52, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  padding: 6px 14px;
  border-radius: 20px;
  backdrop-filter: blur(12px);
  color: #38bdf8;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.topbar-home-selector:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.15);
}
.topbar-home-selector .home-icon {
  display: flex;
  color: #38bdf8;
}
.topbar-home-select {
  background: transparent;
  color: #f8fafc;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}
.topbar-home-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* --- Topbar Right Tools --- */
.topbar-side-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-weather-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 26, 52, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
}
.weather-sun-icon {
  color: #f59e0b;
  display: flex;
}
.weather-txt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.weather-txt strong {
  color: #ffffff;
}
.weather-txt span {
  color: #94a3b8;
  font-size: 12px;
}
.notif-bell {
  position: relative;
  color: #94a3b8;
}
.notif-badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* --- Overview Root Container --- */
.kitech-overview-root {
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- 1. Hero Banner --- */
.kitech-hero-card {
  background: linear-gradient(135deg, rgba(16, 26, 52, 0.8) 0%, rgba(10, 18, 38, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.kitech-hero-left {
  flex: 1;
  z-index: 2;
}
.kitech-hero-greeting {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.kitech-hero-sub {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 16px;
}
.kitech-system-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.pill-check-icon {
  display: flex;
  color: #22c55e;
}
.kitech-hero-right {
  max-width: 380px;
  height: 130px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.kitech-villa-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  mask-image: linear-gradient(to right, transparent 0%, black 30%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 30%);
}

/* --- 2. 4 Stat Cards Row --- */
.kitech-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kitech-stat-card {
  background: rgba(16, 26, 52, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.kitech-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}
.kitech-stat-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kitech-stat-icon-circle.blue {
  background: rgba(2, 132, 199, 0.18);
  color: #38bdf8;
}
.kitech-stat-icon-circle.yellow {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}
.kitech-stat-icon-circle.red {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}
.kitech-stat-icon-circle.cyan {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
}
.kitech-stat-info {
  display: flex;
  flex-direction: column;
}
.kitech-stat-title {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
.kitech-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin: 2px 0;
}
.kitech-stat-sub {
  font-size: 11px;
  font-weight: 500;
}
.kitech-stat-sub.green {
  color: #22c55e;
}
.kitech-stat-sub.muted {
  color: #64748b;
}

/* --- 3. Middle Section: Devices (Left) + Ambient (Right) --- */
.kitech-middle-grid {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 20px;
}
.kitech-devices-panel,
.kitech-ambient-panel {
  background: rgba(16, 26, 52, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 20px 22px;
}
.kitech-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.kitech-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kitech-header-title h2 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}
.header-icon-wrap {
  display: flex;
  color: #38bdf8;
}
.header-icon-wrap.green {
  color: #22c55e;
}
.header-icon-wrap.yellow {
  color: #fbbf24;
}
.kitech-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.kitech-select:focus {
  border-color: #38bdf8;
}

/* --- Device Tile Grid (Matching Mockup) --- */
.kitech-devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.kitech-tile {
  background: rgba(11, 20, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: all 0.25s ease;
  position: relative;
}
.kitech-tile.is-on {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(180deg, rgba(16, 32, 68, 0.8) 0%, rgba(11, 20, 42, 0.9) 100%);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.12);
}
.kitech-icon-glow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.25s;
}
.kitech-tile.is-on .kitech-icon-glow.icon-bulb {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
}
.kitech-tile.is-on .kitech-icon-glow.icon-fan {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}
.kitech-tile.is-on .kitech-icon-glow.icon-water,
.kitech-tile.is-on .kitech-icon-glow.icon-drop {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.15);
  box-shadow: 0 0 18px rgba(14, 165, 233, 0.45);
}
.kitech-tile.is-on .kitech-icon-glow.icon-ac {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.45);
}
.kitech-tile.is-on .kitech-icon-glow.icon-camera {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}
.kitech-tile-info {
  width: 100%;
}
.kitech-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.kitech-tile-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
}
.kitech-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.kitech-dot.kitech-dot-on {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}
.kitech-dot.kitech-dot-off {
  background: #64748b;
}
.kitech-dot.kitech-dot-sensor {
  background: #38bdf8;
}
.kitech-switch {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.25s;
  padding: 2px;
  display: inline-flex;
  align-items: center;
}
.kitech-switch.switch-on {
  background: #22c55e;
}
.kitech-switch.switch-off {
  background: #334155;
}
.kitech-slider {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  display: block;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.kitech-switch.switch-on .kitech-slider {
  transform: translateX(20px);
}
.kitech-switch.switch-off .kitech-slider {
  transform: translateX(0);
}
.kitech-sensor-unit {
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* --- Ambient Panel (Right Column) --- */
.kitech-ambient-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.kitech-ambient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.kitech-ambient-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kitech-ambient-icon-box.red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.kitech-ambient-icon-box.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}
.kitech-ambient-icon-box.yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.ambient-name {
  font-size: 12px;
  color: #94a3b8;
  display: block;
}
.ambient-val {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}
.kitech-wave-chart-container {
  width: 100%;
  height: 75px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}
.kitech-wave-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- 4. Bottom Grid (3 Cards) --- */
.kitech-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.kitech-bottom-card {
  background: rgba(16, 26, 52, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}
.kitech-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.kitech-card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}
.kitech-badge-chip {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  color: #94a3b8;
  font-weight: 500;
}
.kitech-more-link {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 600;
}
.kitech-more-link:hover {
  text-decoration: underline;
}

/* Energy Bars Chart */
.kitech-energy-chart-box {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 120px;
  padding-top: 8px;
}
.kitech-energy-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100px;
  font-size: 10px;
  color: #64748b;
  padding-bottom: 18px;
}
.kitech-energy-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex: 1;
  height: 100px;
  padding-bottom: 18px;
}
.kitech-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.kitech-bar-track {
  height: 80px;
  width: 18px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.kitech-bar-fill {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transition: height 0.3s ease;
}
.kitech-bar-col.is-today .kitech-bar-fill {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.6);
}
.kitech-bar-label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

/* Quick Scenes Grid */
.kitech-quick-scenes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kitech-scene-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}
.kitech-scene-btn:hover {
  background: rgba(2, 132, 199, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}
.scene-btn-icon {
  color: #38bdf8;
  display: flex;
}
.scene-btn-text {
  font-size: 12px;
  font-weight: 600;
}

/* Notifications List */
.kitech-notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kitech-notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notif-bullet {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-bullet.green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.notif-bullet.blue {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
}
.notif-bullet.orange {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.notif-body {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-title {
  font-size: 12px;
  font-weight: 500;
  color: #e2e8f0;
}
.notif-time {
  font-size: 11px;
  color: #64748b;
}

/* --- Responsive Rules --- */
@media (max-width: 1024px) {
  .kitech-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kitech-middle-grid {
    grid-template-columns: 1fr;
  }
  .kitech-bottom-grid {
    grid-template-columns: 1fr;
  }
  .kitech-hero-right {
    max-width: 260px;
  }
}

@media (max-width: 640px) {
  .kitech-overview-root {
    padding: 8px 10px 80px;
    gap: 14px;
  }
  .kitech-hero-card {
    padding: 16px;
  }
  .kitech-hero-greeting {
    font-size: 20px;
  }
  .kitech-hero-right {
    display: none;
  }
  .kitech-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kitech-devices-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kitech-tile {
    padding: 12px 8px;
  }
  .kitech-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   KiTech Auth & Login Cyber Luxury Styling
   ========================================================================== */
.kitech-auth-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 30%, #0f1c3f 0%, #060b18 100%);
  overflow: hidden;
}

.kitech-auth-bg-overlay {
  position: absolute;
  inset: 0;
  background: url('/assets/villa_hero.jpg') center/cover no-repeat;
  filter: blur(28px) brightness(0.28);
  transform: scale(1.08);
  pointer-events: none;
}

.kitech-auth-card {
  position: relative;
  z-index: 2;
  background: rgba(14, 23, 47, 0.82) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(56, 189, 248, 0.18) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

.kitech-auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-bottom: 12px;
}



/* ==========================================================================
   UNIFIED CYBER LUXURY SYSTEM (ALL PAGES SYNCHRONIZED TO TRANG CHỦ)
   ========================================================================== */

/* --- Page Headers --- */
.kitech-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.kitech-head-title h1 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
}
.kitech-head-title p {
  color: #94a3b8;
  font-size: 13px;
  margin: 0;
}

/* --- Device Groups (Trang Thiết Bị) --- */
.kitech-group {
  margin-bottom: 28px;
}
.kitech-group-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.kitech-group-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}
.group-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kitech-group-head .count {
  font-size: 12px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
}

/* --- Scenes Page Grid & Cards --- */
.kitech-scenes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.kitech-scene-card {
  background: rgba(14, 23, 47, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.kitech-scene-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 12px 32px rgba(56, 189, 248, 0.12);
  transform: translateY(-2px);
}
.kitech-scene-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kitech-scene-icon-glow {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}
.kitech-scene-title-box {
  flex: 1;
}
.kitech-scene-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}
.kitech-scene-count {
  font-size: 12px;
  color: #94a3b8;
}
.kitech-scene-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
}
.kitech-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.action-dev-name {
  color: #cbd5e1;
}
.action-state-badge {
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
}
.action-state-badge.badge-on {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}
.action-state-badge.badge-off {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.kitech-scene-run-btn {
  margin-top: auto;
  border-radius: 12px !important;
}

/* --- Activity Logs Stream --- */
.kitech-logs-container {
  background: rgba(14, 23, 47, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(16px);
}
.kitech-logs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kitech-log-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  transition: background 0.2s;
}
.kitech-log-item:hover {
  background: rgba(56, 189, 248, 0.04);
  border-color: rgba(56, 189, 248, 0.15);
}
.log-indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.log-indicator.action-green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.log-indicator.action-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.log-indicator.action-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}
.log-indicator.action-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.log-main {
  flex: 1;
}
.log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.log-action {
  font-size: 14px;
  font-weight: 600;
}
.log-action.action-green { color: #4ade80; }
.log-action.action-red { color: #f87171; }
.log-action.action-blue { color: #38bdf8; }
.log-action.action-amber { color: #fbbf24; }
.log-time {
  font-size: 12px;
  color: #64748b;
}
.log-detail {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
}
.actor-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
}

/* --- Energy Page Ranking & Table --- */
.kitech-rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kitech-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.rank-badge {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.rank-name {
  flex: 1;
  color: #cbd5e1;
}
.rank-val {
  color: #4ade80;
  font-weight: 600;
}
.kitech-val-green {
  color: #4ade80;
}
