:root {
  --bg: #f5f4ee;
  --surface: #fffdf9;
  --surface-alt: #f1f0ea;
  --surface-strong: #e5e5de;
  --text: #1b1f1f;
  --muted: #64706f;
  --line: rgba(0, 53, 53, 0.1);
  --primary: #003535;
  --primary-mid: #0d4d4d;
  --primary-soft: #e2efef;
  --success: #3f6b42;
  --success-soft: #e6f1e7;
  --warning: #a86810;
  --warning-soft: #fff1db;
  --danger: #c54734;
  --danger-soft: #fee8e4;
  --shadow: 0 18px 44px rgba(17, 28, 28, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 188px;
}

* { box-sizing: border-box; }
html { font-size: 12px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.page-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  position: fixed;
  inset: 0 auto 0 0;
  padding: 18px 12px;
  background: #fafaf5;
  border-right: 1px solid rgba(0, 53, 53, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand-block h1, .mobile-brand {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 23px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.04em;
}
.brand-block p, .mobile-sub {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-group { display: grid; gap: 6px; }
.nav-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 12px;
}
.nav-link {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: #50605f;
  font-weight: 700;
}
.nav-link.active, .nav-link:hover {
  background: var(--surface-strong);
  color: var(--primary);
}
.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.sidebar-user, .top-user {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar-user {
  margin-top: auto;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #2f6f6f);
  color: white;
  font-weight: 800;
}
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 244, 238, 0.9);
  backdrop-filter: blur(16px);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(300px, 100%);
  max-width: 360px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
}
.search input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.content { padding: 6px 16px 18px; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}
.page-header h2 {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.05em;
}
.page-header p, .lede {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-mid)); color: white; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }

.grid-4, .grid-3, .grid-2 { display: grid; gap: 18px; }
.grid-4, .grid-3, .grid-2 { display: grid; gap: 10px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow);
}
.stat-card small, .eyebrow {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stat-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.06em;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.chip {
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: #526463;
  padding: 5px 9px;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.chip.active { background: var(--primary); color: white; }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 12px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status.success { color: var(--success); background: var(--success-soft); }
.status.warning { color: var(--warning); background: var(--warning-soft); }
.status.danger { color: var(--danger); background: var(--danger-soft); }
.status.neutral { color: #596363; background: var(--surface-alt); }
.split { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 18px; }
.info-list { display: grid; gap: 12px; }
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.info-item:last-child { border-bottom: none; padding-bottom: 0; }
.info-item span { color: var(--muted); font-size: 14px; }
.info-item strong { text-align: right; }
.hero-panel {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white;
  overflow: hidden;
  position: relative;
}
.hero-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.hero-panel h3 {
  margin: 0 0 10px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 21px;
  line-height: 1.05;
}
.hero-panel p { margin: 0; max-width: 520px; color: rgba(255,255,255,0.82); }
.kpi-row { display: flex; gap: 14px; margin-top: 12px; }
.kpi-row strong { display: block; font-size: 18px; }
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.section-title h3 {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 15px;
  color: var(--primary);
}
.info-item { gap: 10px; padding-bottom: 8px; }
.info-item span { font-size: 12px; }
.info-item strong { font-size: 12px; }

.mobile-shell {
  max-width: 380px;
  margin: 24px auto;
  background: var(--surface);
  border-radius: 34px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(17, 28, 28, 0.16);
  border: 8px solid #203637;
}
.mobile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 12px;
}
.mobile-content { padding: 10px 18px 100px; }
.mobile-hero {
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white;
}
.mobile-hero h2 {
  margin: 10px 0 6px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 24px;
  line-height: 1.1;
}
.period-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
}
.meter-grid { display: grid; gap: 12px; }
.meter-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.meter-main { display: flex; align-items: center; gap: 12px; }
.meter-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.meter-icon.power { background: var(--danger-soft); color: var(--danger); }
.meter-icon.water { background: var(--primary-soft); color: var(--primary); }
.meter-icon.gas { background: var(--warning-soft); color: var(--warning); }
.mobile-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}
.mobile-nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px 14px 18px;
  background: rgba(250, 250, 245, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0, 53, 53, 0.08);
}
.mobile-nav a {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #85918f;
}
.mobile-nav a.active { color: var(--primary); }

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.step {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.step::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-strong);
}
.step.active { color: var(--primary); }
.step.active::before { background: var(--primary); }
.step-line { height: 1px; flex: 1; background: var(--surface-strong); }
.ocr-photo {
  position: relative;
  margin-bottom: 18px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #9eb5b6, #d8dfe0);
  aspect-ratio: 4 / 3;
}
.ocr-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 38%, rgba(255,255,255,0.7), transparent 18%), linear-gradient(135deg, rgba(0,0,0,0.18), rgba(255,255,255,0.05));
}
.ocr-frame {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  width: 56%;
  height: 54px;
  border: 2px solid #8fd7d4;
  border-radius: 14px;
  background: rgba(0,53,53,0.08);
}
.ocr-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0,53,53,0.9);
  color: white;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field { display: grid; gap: 8px; }
.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field-row { position: relative; }
.field-row input {
  width: 100%;
  border: none;
  outline: none;
  background: var(--surface-alt);
  border-radius: 18px;
  padding: 20px 80px 20px 18px;
  font-size: 28px;
  font-family: "Manrope", Arial, sans-serif;
  color: var(--primary);
  font-weight: 800;
}
.unit {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
}
.notice, .success-toast {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.5;
  font-weight: 700;
}
.notice { background: var(--danger-soft); color: var(--danger); }
.success-toast { background: var(--success-soft); color: var(--success); }
.notice.show, .success-toast.show { display: block; }

@media (max-width: 1100px) {
  .grid-4, .grid-3, .grid-2, .split { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .topbar, .page-header { flex-direction: column; align-items: stretch; }
  .search { min-width: 0; max-width: none; }
}
