:root {
  --bg: #06101a;
  --bg-soft: #091520;
  --panel: #0c1e2b;
  --surface: #0b1822;
  --surface-2: #091420;
  --stroke-dark: rgba(255, 255, 255, 0.08);
  --stroke-light: rgba(255, 255, 255, 0.09);
  --text: #dde9e3;
  --text-soft: rgba(210, 232, 222, 0.62);
  --ink: #dde9e3;
  --ink-soft: rgba(200, 225, 215, 0.58);
  --accent: #1e9b66;
  --accent-2: #0f6f7d;
  --danger: #e05252;
  --warning: #d4953a;
  --success: #1da870;
  --radius-lg: 22px;
  --radius-md: 17px;
  --radius-sm: 13px;
  --shadow: 0 20px 50px rgba(2, 8, 15, 0.38);
  --font-ui: "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Consolas", "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(30, 155, 102, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(15, 111, 125, 0.14), transparent 30%),
    linear-gradient(180deg, #050e17 0%, #07141e 100%);
}

body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: 0.06;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; min-width: 0; }
button { border: 0; }
textarea { resize: vertical; }

.hidden { display: none !important; }
.screen { min-height: 100vh; min-height: 100dvh; position: relative; }

/* ===== LOADER ===== */
.global-loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; gap: 0.8rem;
  background: rgba(2, 7, 13, 0.9);
  backdrop-filter: blur(16px);
}
.global-loader img { width: 86px; height: 86px; object-fit: contain; }
.global-loader span {
  color: var(--text-soft); font-size: 0.76rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  font-family: var(--font-mono);
}

/* ===== LOGIN ===== */
.login-screen, .app-shell { padding: clamp(0.75rem, 1.5vw, 1rem); }

.login-screen {
  display: grid;
  align-items: center;
  background:
    radial-gradient(860px 500px at 12% 0%, rgba(30, 155, 102, 0.17), transparent 60%),
    radial-gradient(860px 500px at 88% 10%, rgba(15, 111, 125, 0.15), transparent 60%),
    linear-gradient(180deg, #04060d 0%, #07101a 100%);
}

.login-screen::before, .login-screen::after {
  content: ""; position: absolute; border-radius: 999px;
  filter: blur(2px); opacity: 0.7;
}
.login-screen::before {
  width: 260px; height: 260px; top: -120px; right: -120px;
  background: radial-gradient(circle, rgba(30,155,102,0.24), transparent 70%);
  animation: loginFloat 10s ease-in-out infinite;
}
.login-screen::after {
  width: 240px; height: 240px; left: -120px; bottom: -120px;
  background: radial-gradient(circle, rgba(15,111,125,0.22), transparent 70%);
  animation: loginFloat 12s ease-in-out infinite reverse;
}

.login-shell, .workspace { width: min(1220px, 100%); margin: 0 auto; }

.login-shell {
  min-height: calc(100dvh - (clamp(0.75rem, 1.5vw, 1rem) * 2)); display: flex;
  align-items: center; justify-content: center;
  position: relative; z-index: 1;
}

.login-brand, .app-header, .app-brand, .app-user, .card-heading, .inline-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.login-brand, .app-brand { justify-content: flex-start; }

.login-stage {
  display: grid; gap: 0; align-items: stretch;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}
.login-card {
  width: min(1040px, 100%); overflow: hidden;
  margin: 0 auto;
  border-radius: 24px; border: 1px solid rgba(148,163,184,0.18);
  background: rgba(12, 20, 38, 0.9);
  box-shadow: 0 28px 80px rgba(0,0,0,0.45);
  animation: loginReveal 0.6s ease both;
}
.login-aside, .login-form-panel { position: relative; overflow: hidden; }
.login-aside {
  padding: 2.8rem 2.6rem;
  background: linear-gradient(145deg, rgba(5, 9, 16, 0.98), rgba(12, 20, 38, 0.94));
}
.login-aside::before {
  content: ""; position: absolute; width: 260px; height: 260px;
  right: -120px; top: -120px;
  background: radial-gradient(circle, rgba(30,155,102,0.26), transparent 70%);
  opacity: 0.85;
}
.login-aside::after {
  content: ""; position: absolute; width: 240px; height: 240px;
  left: -120px; bottom: -120px;
  background: radial-gradient(circle, rgba(15,111,125,0.22), transparent 70%);
  opacity: 0.7;
}
.login-aside__inner {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; gap: 1.8rem;
}
.login-brand img, .app-brand img { width: 54px; height: 54px; }
.login-screen .login-brand { align-items: center; gap: 0.9rem; }
.login-screen .login-brand img {
  width: 68px; height: 68px; padding: 0;
  border-radius: 0; background: transparent;
}
.login-brand__title {
  font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; font-size: 0.9rem; color: #f2f6f4;
}
.login-brand__subtitle {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.28em; color: rgba(148,163,184,0.78);
}
.login-brand strong, .app-brand strong, .app-user strong { display: block; }
.login-brand span, .app-brand span, .app-user span, .muted-copy { color: var(--text-soft); }

.login-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em;
  background: rgba(30,155,102,0.18); border: 1px solid rgba(30,155,102,0.38);
  color: #d7f5e6;
}
.login-pill svg, .field-icon svg, .login-highlight__icon svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.login-hero h1, .login-form__header h2 {
  margin: 0; font-family: var(--font-display); letter-spacing: -0.04em;
}
.login-hero h1 {
  margin-top: 0.75rem; font-size: clamp(2rem, 4.8vw, 2.8rem);
  line-height: 1.05; color: #f5f8fb;
}
.login-hero p { margin: 0; max-width: 24rem; color: rgba(148,163,184,0.82); line-height: 1.55; }
.login-highlights { display: grid; gap: 0.6rem; }
.login-highlight {
  display: flex; align-items: center; gap: 0.7rem;
  color: rgba(226,232,240,0.92); font-size: 0.94rem;
}
.login-highlight__icon {
  width: 24px; height: 24px; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 999px; flex: 0 0 24px; color: var(--accent);
}
.login-aside__footer {
  margin-top: auto; display: flex; align-items: center; gap: 0.5rem;
  color: rgba(148,163,184,0.78); font-size: 0.85rem;
}
.login-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 12px rgba(30,155,102,0.6);
}
.login-form-panel {
  padding: 2.8rem 3rem;
  background: rgba(6, 10, 20, 0.9);
  display: grid;
  align-items: center;
}
.login-form__inner { width: min(420px, 100%); max-width: 420px; margin: 0 auto; }
.login-form__header {
  margin-bottom: 1.6rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.login-form__header > div { flex: 1; min-width: 0; }
.login-eyebrow {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.25em;
  color: rgba(148,163,184,0.78); margin-bottom: 0.35rem;
  font-family: var(--font-mono);
}
.login-form__header h2 { font-size: 2.1rem; line-height: 1.05; color: #f3f7fb; }
.login-form__description, .login-form__hint { color: rgba(148,163,184,0.82); }
.login-form-panel .field span { color: rgba(185,210,200,0.78); }
.input-shell {
  position: relative; display: flex; align-items: center;
  border-radius: 14px; border: 1px solid rgba(148,163,184,0.22);
  background: rgba(2, 6, 18, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-shell:focus-within {
  border-color: rgba(30,155,102,0.55);
  box-shadow: 0 0 0 4px rgba(30,155,102,0.16);
}
.field-icon {
  position: absolute; left: 1rem; color: rgba(185,210,200,0.7);
  display: inline-flex; align-items: center; justify-content: center;
}
.login-form-panel input,
.login-form-panel select,
.login-form-panel textarea { color: #ddeae4; }
.input-shell input {
  min-height: 52px; border: 0; background: transparent;
  box-shadow: none; padding-left: 3rem; color: inherit;
}
.input-shell input:focus { border-color: transparent; box-shadow: none; }
.password-shell input { padding-right: 4rem; }
.login-form-panel .ghost-icon { color: rgba(185,210,200,0.7); }
.login-form-panel .primary-button {
  min-height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(30,155,102,0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.login-form-panel .primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(30,155,102,0.28);
}
.login-form__footer {
  margin-top: 1.4rem; display: flex; justify-content: space-between;
  align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.login-form__footer .text-button { font-weight: 700; }
.login-form-panel .feedback { margin-top: 1rem; }

.maintenance-lock {
  display: grid;
  gap: 1.1rem;
}
.maintenance-lock__pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  background: rgba(224, 82, 82, 0.16);
  border: 1px solid rgba(224, 82, 82, 0.32);
  color: #ffd5d5;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.maintenance-lock__header {
  display: grid;
  gap: 0.45rem;
}
.maintenance-lock__header h2 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.04;
  color: #f3f7fb;
}
.maintenance-lock__panel {
  display: grid;
  gap: 1rem;
<<<<<<< HEAD
}

.app-header {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-dark);
  background: rgba(10, 26, 34, 0.82);
}

.view-tabs {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.tab-button {
  min-height: 50px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke-dark);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 0.7rem 0.9rem;
}

.tab-button.active {
  background: linear-gradient(135deg, rgba(30, 155, 102, 0.32), rgba(15, 111, 125, 0.3));
  border-color: rgba(30, 155, 102, 0.45);
}

.top-feedback {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  color: #def5ea;
  background: rgba(23, 138, 91, 0.22);
  border: 1px solid rgba(23, 138, 91, 0.35);
}

.top-feedback.error {
  color: #ffe1e1;
  background: rgba(196, 62, 62, 0.2);
  border-color: rgba(196, 62, 62, 0.35);
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.summary-grid.tight {
  margin-bottom: 0.9rem;
}

.module-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.module-card {
  text-align: left;
  min-height: 160px;
  border-radius: 16px;
  border: 1px solid var(--stroke-light);
  border-left: 4px solid rgba(15, 111, 125, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 248, 0.92));
  color: var(--ink);
  padding: 1rem;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(2, 18, 22, 0.16);
  border-color: rgba(15, 111, 125, 0.35);
}

.module-card strong {
  font-size: 1.01rem;
}

.module-card span {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.module-icon {
  font-size: 1.45rem;
  color: var(--accent-2);
}

.summary-card {
  background: rgba(255, 255, 255, 0.94);
}

.summary-card span,
.summary-card strong {
  display: block;
}

.summary-card strong {
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: 1.4rem;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
=======
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(224,82,82,0.18);
  background: linear-gradient(180deg, rgba(114, 24, 24, 0.18), rgba(8, 16, 28, 0.78));
}
.maintenance-lock__copy {
>>>>>>> 5d6ffc642dad73fdb0b8aba0c440526032a318af
  margin: 0;
  color: rgba(222, 234, 228, 0.88);
  line-height: 1.6;
}
.maintenance-lock__actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.maintenance-lock__actions > * {
  flex: 1 1 200px;
}

/* ===== CAPTCHA (login) ===== */
.captcha-box { padding: 0.9rem; }
.login-form-panel .captcha-box {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(2, 8, 18, 0.4);
  color: rgba(185,210,200,0.85);
}
.login-form-panel .captcha-box .inline-head span { color: rgba(185,210,200,0.85); }
.login-form-panel .captcha-box input {
  background: rgba(4, 10, 24, 0.6);
  border-color: rgba(148,163,184,0.28);
  color: #ddeae4;
  padding-left: 0.95rem;
}
.captcha-image { width: 100%; max-width: 220px; border-radius: 12px; background: #fff; }

/* ===== DARK FORM INPUTS ===== */
input, select, textarea {
  width: 100%; min-height: 48px; border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.8rem 0.9rem;
  background: rgba(4, 12, 22, 0.7);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(30, 155, 102, 0.52);
  box-shadow: 0 0 0 3px rgba(30, 155, 102, 0.14);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%23a8c4ba' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 10px 7px;
  padding-right: 2.4rem;
  background-color: rgba(4, 12, 22, 0.7);
}
input[readonly], textarea[readonly] {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  cursor: default;
}
::-webkit-calendar-picker-indicator { filter: invert(0.75) brightness(1.2); cursor: pointer; }
::-webkit-search-cancel-button { filter: invert(0.7) brightness(1.3); cursor: pointer; }

.password-field, .suffix-field { position: relative; display: flex; align-items: center; }
.password-field input { padding-right: 4rem; }
.suffix-field input { padding-right: 7rem; }
.suffix-field strong { position: absolute; right: 1rem; color: var(--ink-soft); font-weight: 700; }

/* ===== BUTTONS ===== */
.ghost-icon, .text-button, .primary-button, .secondary-button, .table-action { cursor: pointer; }
.ghost-icon {
  position: absolute; right: 0.4rem; min-width: 44px; min-height: 42px;
  border-radius: 11px; background: transparent; color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.ghost-icon:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.text-button {
  padding: 0; background: transparent;
  color: rgba(30, 200, 130, 0.9); font-weight: 600;
  transition: color 0.15s ease;
}
.text-button:hover { color: var(--accent); }
.text-button.danger-link { color: #ffb4b4; }
.text-button.danger-link:hover { color: #ff7d7d; }
.primary-button, .secondary-button, .table-action {
  min-height: 46px; border-radius: 13px; padding: 0 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; font-weight: 700; transition: all 0.2s ease;
}
.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #1e9b66, #0f7080);
  box-shadow: 0 8px 22px rgba(30,155,102,0.22);
}
.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(30,155,102,0.3);
}
.primary-button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.secondary-button {
  color: var(--text); background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.secondary-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}
.table-action {
  min-height: 36px; font-size: 0.82rem;
  color: rgba(150, 210, 190, 0.9);
  background: rgba(30, 155, 102, 0.1);
  border: 1px solid rgba(30, 155, 102, 0.2);
}
.table-action:hover { background: rgba(30, 155, 102, 0.18); }
.table-action.danger-link {
  color: #ffb4b4;
  background: rgba(224, 82, 82, 0.1);
  border-color: rgba(224, 82, 82, 0.28);
}
.table-action.danger-link:hover { background: rgba(224, 82, 82, 0.18); }
.btn-spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.password-help {
  margin: -0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.password-requirements {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.password-requirements li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.password-rule-status {
  width: 1rem;
  min-width: 1rem;
  text-align: center;
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.9rem;
  font-weight: 700;
}
.password-requirements li.fulfilled,
.password-requirements li.fulfilled .password-rule-status { color: var(--success); }
.password-requirements li.missing,
.password-requirements li.missing .password-rule-status { color: var(--danger); }
.feedback { margin: 0; min-height: 1.1rem; color: var(--danger); font-size: 0.84rem; }
.feedback.success { color: var(--success); }
.feedback.info { color: rgba(100, 200, 230, 0.9); }
.feedback:empty { display: none; }

/* ===== CARDS / PANELS ===== */
.card, .hero-strip, .modal-card { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card, .modal-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.065);
}
.modal-card { width: min(480px, calc(100vw - 2rem)); margin: 0 auto; padding: 1.5rem; }
.card, .hero-strip { padding: 1.25rem; }
.hero-strip {
  background: rgba(6, 18, 28, 0.8);
  border: 1px solid var(--stroke-dark);
}
.hero-strip h2, .card-heading h1, .card-heading h3, .card-heading h2 {
  margin: 0; letter-spacing: -0.03em;
}
.card-heading h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
.card-heading p, .hero-strip p { margin: 0.35rem 0 0; }
.card-heading.compact { align-items: flex-start; }

.kicker, .field span, .profile-grid dt {
  margin: 0; font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.kicker, .field span, .profile-grid dt { color: var(--ink-soft); }
.hero-strip .kicker, .hero-strip p { color: var(--text-soft); }
.hero-strip h2 { color: var(--text); }

/* ===== GRIDS ===== */
.form-stack, .field, .feed-list, .panel-screen { display: grid; gap: 0.85rem; }
.security-line, .view-tabs, .summary-grid, .inline-grid, .grid-two, .profile-grid {
  display: grid; gap: 0.75rem;
}
.workspace,
.panel-screen,
.grid-two,
.inline-grid,
.summary-grid,
.feed-list,
.table-host,
.table-shell,
.field,
.card,
.card > *,
.menu-hero,
.menu-hero__text,
.module-card,
.module-card__body,
.app-brand,
.app-user,
.card-heading,
.card-heading > div {
  min-width: 0;
}
.security-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.security-line span, .summary-card, .tag {
  padding: 0.65rem 0.85rem; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft); font-size: 0.82rem;
}

/* ===== APP SHELL ===== */
.app-shell { display: grid; gap: 1rem; }
.app-header {
  width: min(1220px, 100%); margin: 0 auto;
  padding: 0.8rem 1rem; border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-dark);
  background: rgba(6, 18, 28, 0.86);
}
.app-brand { gap: 0.75rem; }
.app-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}
.app-brand strong {
  font-size: 1rem;
  line-height: 1.05;
}
.app-brand span {
  font-size: 0.82rem;
  line-height: 1.2;
}
.app-user {
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.app-user > div {
  min-width: 0;
  text-align: right;
  display: grid;
  gap: 0.14rem;
}
.app-user strong {
  font-size: 0.96rem;
  line-height: 1.08;
}
.app-user span {
  font-size: 0.8rem;
  line-height: 1.2;
}
.app-user .secondary-button {
  width: auto;
  min-width: 94px;
  min-height: 40px;
  padding: 0 1rem;
  flex: 0 0 auto;
}
.app-user strong,
.app-user span,
.app-brand strong,
.app-brand span,
.menu-hero__text h2,
.card-heading h1,
.card-heading h2,
.card-heading h3,
.feed-item strong,
.feed-item span,
.feed-item small {
  overflow-wrap: anywhere;
}

/* ===== TABS ===== */
.view-tabs {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  align-items: stretch;
  margin-bottom: 0.55rem;
}
.tab-button {
  min-height: 46px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text); font-weight: 600;
  letter-spacing: 0.01em; text-align: center;
  padding: 0.55rem 0.6rem; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center; gap: 0.38rem;
  transition: all 0.2s ease; white-space: nowrap;
}
.tab-button i { font-size: 0.95rem; }
.tab-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}
.tab-button.active {
  background: linear-gradient(135deg, rgba(30,155,102,0.28), rgba(15,111,125,0.25));
  border-color: rgba(30, 155, 102, 0.42);
  color: rgba(200, 245, 225, 0.95);
  box-shadow: 0 10px 24px rgba(6, 18, 28, 0.28);
}

.top-feedback {
  padding: 0.85rem 1rem; border-radius: var(--radius-md);
  color: #cff0df; background: rgba(23, 138, 91, 0.2);
  border: 1px solid rgba(23, 138, 91, 0.3);
}
.top-feedback.error {
  color: #ffd9d9; background: rgba(220, 60, 60, 0.18);
  border-color: rgba(220, 60, 60, 0.3);
}

/* ===== SUMMARY CARDS ===== */
.summary-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.summary-grid.tight { margin-bottom: 0.85rem; }
.summary-card {
  background: rgba(6, 18, 28, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px; padding: 0.9rem 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(30, 155, 102, 0.32);
}
.summary-card span {
  display: block; font-family: var(--font-mono);
  font-size: 0.67rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-soft);
}
.summary-card strong {
  display: block; margin-top: 0.3rem;
  color: var(--text); font-size: 1.45rem;
  font-family: var(--font-display); letter-spacing: -0.03em;
}

/* ===== MENU HERO ===== */
.menu-hero {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(6, 18, 30, 0.92), rgba(8, 22, 38, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.8rem 2rem;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.menu-hero__text { flex: 1; min-width: 220px; }
.menu-hero__text h2 {
  margin: 0.3rem 0 0; color: var(--text);
  font-family: var(--font-display); font-size: 1.8rem;
  letter-spacing: -0.03em;
}
.menu-hero__sub { margin: 0.5rem 0 0; color: var(--text-soft); line-height: 1.5; }
.menu-hero .summary-grid { flex: 1; min-width: 280px; }

/* ===== MODULE CARDS ===== */
.module-grid {
  display: grid; gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.module-card {
  text-align: left; min-height: 96px;
  border-radius: 17px; border: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(6, 18, 28, 0.7);
  color: var(--text); padding: 1.15rem 1.35rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all 0.25s ease; position: relative; overflow: hidden;
}
.module-card::before {
  content: ""; position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.3s ease; border-radius: inherit;
}
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.3);
  border-color: rgba(255, 255, 255, 0.11);
}
.module-card:hover::before { opacity: 1; }
.module-card__icon {
  width: 50px; height: 50px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.35rem; position: relative; z-index: 1;
}
.module-card__body { flex: 1; position: relative; z-index: 1; }
.module-card__body strong { font-size: 0.97rem; display: block; margin-bottom: 0.2rem; }
.module-card__body span { font-size: 0.8rem; color: var(--text-soft); line-height: 1.4; }
.module-card__arrow {
  font-size: 1.1rem; color: var(--text-soft);
  transition: transform 0.2s ease; position: relative; z-index: 1;
}
.module-card:hover .module-card__arrow { transform: translateX(4px); color: var(--text); }

.module-card--blue::before { background: linear-gradient(135deg, rgba(59,130,246,0.1), transparent); }
.module-card--blue .module-card__icon { background: rgba(59,130,246,0.15); color: #60a5fa; }
.module-card--green::before { background: linear-gradient(135deg, rgba(34,197,94,0.1), transparent); }
.module-card--green .module-card__icon { background: rgba(34,197,94,0.15); color: #4ade80; }
.module-card--purple::before { background: linear-gradient(135deg, rgba(168,85,247,0.1), transparent); }
.module-card--purple .module-card__icon { background: rgba(168,85,247,0.15); color: #c084fc; }
.module-card--amber::before { background: linear-gradient(135deg, rgba(245,158,11,0.1), transparent); }
.module-card--amber .module-card__icon { background: rgba(245,158,11,0.15); color: #fbbf24; }
.module-card--cyan::before { background: linear-gradient(135deg, rgba(6,182,212,0.1), transparent); }
.module-card--cyan .module-card__icon { background: rgba(6,182,212,0.15); color: #22d3ee; }
.module-card--teal::before { background: linear-gradient(135deg, rgba(20,184,166,0.1), transparent); }
.module-card--teal .module-card__icon { background: rgba(20,184,166,0.15); color: #2dd4bf; }
.module-card--red::before { background: linear-gradient(135deg, rgba(239,68,68,0.1), transparent); }
.module-card--red .module-card__icon { background: rgba(239,68,68,0.15); color: #f87171; }

.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#budgets-panel.budget-home > .grid-two:first-of-type { grid-template-columns: minmax(0, 1fr); }
#budgets-panel.budget-home #budget-form-card,
#budgets-panel.budget-home #budget-detail-panels { display: none !important; }
.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.inline-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.profile-grid div, .feed-item, .empty-state, .table-shell, .captcha-box {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}
.profile-grid div, .feed-item, .empty-state { padding: 0.85rem; }
.profile-grid dd { margin: 0.3rem 0 0; color: var(--ink); font-weight: 600; }

.feed-item strong, .feed-item span, .feed-item small { display: block; }
.feed-item strong { color: var(--text); }
.feed-item span, .feed-item small, .empty-state { color: var(--text-soft); line-height: 1.5; }
.feed-item { overflow: hidden; }
.budget-item-card { position: relative; }
.budget-item-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(30, 155, 102, 0.55);
}
.budget-item-card-subitem {
  margin-left: 1rem;
  background: rgba(255, 255, 255, 0.045);
}
.budget-item-card-subitem::before { background: rgba(148, 163, 184, 0.42); }
.budget-warning-card {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.08);
}
.budget-history-card {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.06);
}
.budget-signature-card {
  border-color: rgba(30, 155, 102, 0.26);
  background: rgba(30, 155, 102, 0.07);
}
.budget-signature-image-wrap {
  margin-top: 0.45rem;
  padding: 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  text-align: center;
}
.budget-signature-image {
  max-width: 220px;
  max-height: 84px;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.12);
}
.empty-state { color: var(--text-soft); text-align: center; padding: 1.2rem; }
.feed-item-selected {
  border-color: rgba(30, 155, 102, 0.4);
  box-shadow: 0 0 0 1px rgba(30, 155, 102, 0.18) inset;
  background: rgba(30, 155, 102, 0.06);
}

/* ===== CLIENTES / TELEMETRIA ===== */
.credential-host { display: grid; gap: 0.75rem; }
.credential-box,
.site-card,
.device-card,
.customer-summary-card {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}
.credential-box,
.site-card,
.device-card,
.customer-summary-card { padding: 0.95rem; }
.credential-box {
  display: grid;
  gap: 0.38rem;
  background: linear-gradient(180deg, rgba(30,155,102,0.13), rgba(11,24,34,0.88));
}
.credential-box code {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.22rem 0.45rem;
  border-radius: 9px;
  background: rgba(0,0,0,0.25);
  color: #d7f8e7;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  word-break: break-all;
}
.device-capability-block {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.device-capability-block__head {
  display: grid;
  gap: 0.2rem;
}
.device-capability-block__head span {
  color: var(--text-soft);
  line-height: 1.45;
}
.device-capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.7rem;
}
.device-capability-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(9, 20, 31, 0.72);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
}
.device-capability-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.device-capability-chip span {
  font-weight: 800;
  letter-spacing: 0.03em;
}
.device-capability-chip:has(input:checked) {
  border-color: rgba(52, 211, 153, 0.38);
  background: linear-gradient(135deg, rgba(30, 155, 102, 0.22), rgba(12, 29, 43, 0.88));
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.16);
}
.feed-item__row,
.customer-summary-card__head,
.site-card__head,
.device-card__head,
.table-actions,
.command-strip,
.customer-meta-grid,
.device-metrics {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.feed-item__row,
.customer-summary-card__head,
.site-card__head,
.device-card__head {
  align-items: flex-start;
  justify-content: space-between;
}
.customer-summary-card {
  display: grid;
  gap: 0.7rem;
}
.customer-summary-card--hero {
  background:
    radial-gradient(circle at top right, rgba(30,155,102,0.18), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}
.customer-meta-grid small {
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.site-card {
  display: grid;
  gap: 0.75rem;
}
.weather-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}
.weather-strip span,
.device-metrics span {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.48rem 0.62rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  color: var(--ink);
  line-height: 1.35;
}
.weather-strip--hero span {
  background: rgba(30,155,102,0.08);
  border-color: rgba(30,155,102,0.2);
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.device-card {
  display: grid;
  gap: 0.7rem;
}
.device-card--live {
  background:
    linear-gradient(180deg, rgba(15,111,125,0.1), rgba(255,255,255,0.02));
}
.device-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.table-actions,
.command-strip {
  margin-top: 0.1rem;
}
.customer-row.is-selected {
  border-color: rgba(30, 155, 102, 0.4);
  box-shadow: 0 0 0 1px rgba(30,155,102,0.18) inset;
}
.panel-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.maintenance-mode-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.maintenance-mode-summary__card {
  min-height: 100%;
}
.maintenance-mode-summary__card strong {
  display: block;
  margin: 0.35rem 0 0.45rem;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
}
.maintenance-mode-summary__card small {
  display: block;
  color: var(--text-soft);
  line-height: 1.5;
}
.maintenance-panel-note {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(224,82,82,0.18);
  background: rgba(224,82,82,0.08);
}
.maintenance-panel-note strong {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffd5d5;
}
.maintenance-panel-note span {
  color: rgba(222, 234, 228, 0.88);
  line-height: 1.55;
}
.client-password-panel {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
  padding: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.client-dashboard-host {
  display: grid;
  gap: 0.85rem;
}
.client-control-shell {
  display: grid;
  gap: 0.9rem;
}
.client-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}
.client-device-list-card,
.client-device-stage,
.device-focus-card,
.device-focus-section,
.client-batch-toolbar {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}
.client-device-list-card,
.device-focus-card,
.device-focus-section,
.client-batch-toolbar {
  padding: 0.95rem;
}
.client-device-stage {
  display: grid;
  gap: 0.9rem;
  background: transparent;
  border: 0;
}
.client-device-list {
  display: grid;
  gap: 0.8rem;
}
.client-device-group {
  display: grid;
  gap: 0.55rem;
}
.client-device-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.client-device-group__head span {
  color: var(--text-soft);
  font-size: 0.76rem;
}
.device-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: stretch;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.device-selector:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.12);
}
.device-selector.is-active {
  border-color: rgba(30, 155, 102, 0.42);
  box-shadow: 0 0 0 1px rgba(30,155,102,0.18) inset;
  background: rgba(30,155,102,0.08);
}
.device-selector__main,
.device-selector__toggle,
.command-button {
  font: inherit;
}
.device-selector__main {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: grid;
  gap: 0.38rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  cursor: pointer;
}
.device-selector__title {
  display: grid;
  gap: 0.14rem;
}
.device-selector__title span {
  color: var(--text-soft);
  font-size: 0.78rem;
  word-break: break-all;
}
.device-selector__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.device-selector__meta small {
  color: var(--text-soft);
}
.device-selector__toggle {
  min-width: 110px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
  cursor: pointer;
  padding: 0.7rem 0.85rem;
  font-weight: 700;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.device-selector__toggle.is-selected {
  border-color: rgba(30,155,102,0.34);
  background: rgba(30,155,102,0.14);
  color: #d7f8e7;
}
.client-batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  background:
    radial-gradient(circle at top right, rgba(30,155,102,0.16), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.025));
}
.client-batch-toolbar__copy {
  display: grid;
  gap: 0.25rem;
  max-width: 520px;
}
.client-batch-toolbar__copy span {
  color: var(--text-soft);
  line-height: 1.5;
}
.client-batch-toolbar__actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.device-focus-card {
  display: grid;
  gap: 0.95rem;
  background:
    radial-gradient(circle at top right, rgba(15,111,125,0.12), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.025));
}
.device-focus-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.device-focus-card__head span {
  color: var(--text-soft);
}
.device-focus-section {
  display: grid;
  gap: 0.75rem;
}
.device-focus-section--commands {
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(30,155,102,0.22);
  background:
    radial-gradient(circle at top right, rgba(30,155,102,0.2), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    rgba(4, 15, 24, 0.36);
  box-shadow: 0 20px 32px rgba(1, 9, 16, 0.18);
}
.device-focus-note {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}
.command-history-list {
  display: grid;
  gap: 0.65rem;
  max-height: 340px;
  overflow: auto;
  padding-right: 0.2rem;
}
.command-history-list--modal {
  max-height: min(70vh, 640px);
}
.command-history-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.78rem 0.82rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.025);
}
.command-history-item__head,
.command-history-item__meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.command-history-item__head span,
.command-history-item__meta small {
  color: var(--text-soft);
}
.device-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.72rem;
}
.device-status-grid--technical {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.metric-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}
.metric-card span {
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.metric-card strong {
  font-size: 1.06rem;
  line-height: 1.2;
}
.metric-card small {
  color: var(--text-soft);
  line-height: 1.45;
}
.metric-card--hero {
  grid-column: span 2;
  padding: 1rem;
}
.metric-card--hero strong {
  font-size: 1.35rem;
}
.metric-card--neutral {
  background: linear-gradient(180deg, rgba(148,163,184,0.12), rgba(255,255,255,0.03));
}
.metric-card--up {
  background: linear-gradient(180deg, rgba(30,155,102,0.22), rgba(255,255,255,0.03));
  border-color: rgba(30,155,102,0.24);
}
.metric-card--down {
  background: linear-gradient(180deg, rgba(14,165,233,0.2), rgba(255,255,255,0.03));
  border-color: rgba(14,165,233,0.22);
}
.metric-card--alert {
  background: linear-gradient(180deg, rgba(248,113,113,0.2), rgba(255,255,255,0.03));
  border-color: rgba(248,113,113,0.22);
}
.command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.command-button {
  min-height: 68px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  cursor: pointer;
  padding: 0.95rem 1rem;
  font-weight: 800;
  font-size: 0.96rem;
  color: #f5fbff;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.command-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(1, 9, 16, 0.24);
  filter: brightness(1.04);
}
.command-button--up {
  background: linear-gradient(135deg, #1f9b66, #1cb57a);
}
.command-button--stop {
  background: linear-gradient(135deg, #344252, #445466);
}
.command-button--down {
  background: linear-gradient(135deg, #0f6f7d, #148e9f);
}
.command-button--calibrate {
  background: linear-gradient(135deg, #8b5cf6, #6d4df1);
}
.command-button--position {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}
.command-button--relay-on {
  background: linear-gradient(135deg, #1d8f6a, #27c08a);
}
.command-button--relay-off {
  background: linear-gradient(135deg, #7c2d12, #c2410c);
}
.command-button--compact {
  min-height: 46px;
  padding: 0.72rem 0.92rem;
  font-size: 0.84rem;
  font-weight: 700;
}
.position-command-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.position-command-panel__copy {
  display: grid;
  gap: 0.2rem;
}
.position-command-panel__copy span,
.position-command-panel__label {
  color: var(--text-soft);
}
.position-command-panel__label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.position-command-panel__controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.position-command-select {
  min-width: 150px;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(6, 18, 28, 0.72);
  color: var(--text);
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 700;
}
.position-command-panel__controls .command-button {
  flex: 1 1 220px;
}
.position-command-panel--compact {
  flex: 1 1 260px;
  min-width: 240px;
  padding: 0.72rem 0.8rem;
  gap: 0.55rem;
}
.position-command-panel--compact .position-command-panel__controls {
  gap: 0.5rem;
}
.position-command-panel--compact .position-command-select {
  min-height: 46px;
  min-width: 110px;
}
.position-command-panel--compact .command-button {
  flex: 1 1 120px;
}
.command-strip--admin {
  align-items: stretch;
}
.command-strip--admin .table-action,
.command-strip--admin .command-button,
.command-strip--admin .position-command-panel {
  flex: 1 1 130px;
}
.relay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}
.relay-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}
.relay-card--on {
  border-color: rgba(52, 211, 153, 0.28);
  background: linear-gradient(180deg, rgba(30, 155, 102, 0.18), rgba(255,255,255,0.035));
}
.relay-card--off {
  border-color: rgba(248, 113, 113, 0.2);
}
.relay-card--unknown {
  border-color: rgba(148, 163, 184, 0.22);
}
.relay-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.relay-card__head span,
.relay-card small {
  color: var(--text-soft);
}
.relay-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.sensor-scene {
  --scene-accent: rgba(148, 163, 184, 0.55);
  --scene-sky-top: rgba(18, 27, 39, 0.95);
  --scene-sky-bottom: rgba(11, 19, 31, 0.78);
  --scene-ground-a: rgba(61, 88, 47, 0.9);
  --scene-ground-b: rgba(112, 66, 39, 0.92);
  --scene-barn-a: rgba(223, 228, 236, 0.96);
  --scene-barn-b: rgba(149, 160, 176, 0.94);
  --scene-drag-glow: rgba(245, 158, 11, 0.16);
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(4, 13, 22, 0.94), rgba(10, 19, 31, 0.82));
  overflow: hidden;
}
.sensor-scene--sunny {
  --scene-accent: rgba(251, 191, 36, 0.72);
  --scene-sky-top: rgba(120, 158, 214, 0.96);
  --scene-sky-bottom: rgba(236, 187, 97, 0.78);
  --scene-ground-a: rgba(96, 130, 61, 0.92);
  --scene-ground-b: rgba(158, 93, 49, 0.9);
}
.sensor-scene--cloudy {
  --scene-accent: rgba(203, 213, 225, 0.7);
  --scene-sky-top: rgba(103, 121, 146, 0.96);
  --scene-sky-bottom: rgba(77, 89, 108, 0.78);
  --scene-ground-a: rgba(95, 110, 77, 0.9);
  --scene-ground-b: rgba(111, 79, 60, 0.92);
}
.sensor-scene--rainy {
  --scene-accent: rgba(56, 189, 248, 0.72);
  --scene-sky-top: rgba(44, 86, 125, 0.96);
  --scene-sky-bottom: rgba(24, 38, 64, 0.86);
  --scene-ground-a: rgba(56, 93, 80, 0.92);
  --scene-ground-b: rgba(76, 67, 71, 0.94);
}
.sensor-scene--hot {
  --scene-drag-glow: rgba(248, 113, 113, 0.18);
}
.sensor-scene__toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.sensor-scene__toolbar strong {
  display: block;
}
.sensor-scene__toolbar span {
  color: var(--text-soft);
}
.sensor-scene__meta {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sensor-scene__stat {
  min-width: 118px;
  padding: 0.62rem 0.72rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
}
.sensor-scene__stat span,
.sensor-scene__stat strong {
  display: block;
}
.sensor-scene__stat span {
  color: var(--text-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.sensor-scene__stat strong {
  margin-top: 0.22rem;
}
.sensor-scene__viewport {
  position: relative;
  min-height: 320px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    radial-gradient(circle at top, var(--scene-sky-top), transparent 58%),
    linear-gradient(180deg, var(--scene-sky-bottom), rgba(8, 15, 24, 0.92) 70%);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.sensor-scene__viewport.is-dragging {
  cursor: grabbing;
}
.sensor-scene__viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0 58%, rgba(0,0,0,0.1) 58% 100%),
    repeating-linear-gradient(115deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 18px);
  opacity: 0.45;
  pointer-events: none;
}
.sensor-scene__viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--scene-drag-glow);
  pointer-events: none;
}
.sensor-scene__hint {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 3;
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(4, 12, 20, 0.72);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}
.sensor-scene__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.sensor-scene__sun {
  position: absolute;
  top: 6%;
  right: 10%;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.86) 0 14%, rgba(255, 220, 120, 0.94) 14% 38%, rgba(255, 190, 59, 0.32) 38% 62%, transparent 62%);
  filter: blur(0.3px);
  opacity: 0.82;
  animation: sun-pulse 5.6s ease-in-out infinite;
}
.sensor-scene__cloud {
  --cloud-scale: 1;
  position: absolute;
  width: 180px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.78), rgba(189, 199, 213, 0.36));
  box-shadow:
    0 12px 24px rgba(9, 14, 22, 0.12),
    inset 0 -8px 18px rgba(120, 132, 148, 0.14);
  opacity: 0.88;
  animation: cloud-drift linear infinite;
}
.sensor-scene__cloud::before,
.sensor-scene__cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.sensor-scene__cloud::before {
  width: 72px;
  height: 72px;
  left: 20px;
  top: -26px;
}
.sensor-scene__cloud::after {
  width: 88px;
  height: 88px;
  right: 24px;
  top: -34px;
}
.sensor-scene__cloud--one {
  top: 12%;
  left: -6%;
  animation-duration: 22s;
}
.sensor-scene__cloud--two {
  top: 20%;
  left: 30%;
  --cloud-scale: 0.82;
  opacity: 0.76;
  animation-duration: 27s;
}
.sensor-scene__cloud--three {
  top: 8%;
  right: -8%;
  --cloud-scale: 1.08;
  animation-duration: 25s;
}
.sensor-scene__rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.7;
}
.sensor-scene__rain span {
  position: absolute;
  top: -16%;
  left: var(--rain-x);
  width: 2px;
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(191, 219, 254, 0), rgba(191, 219, 254, 0.76));
  transform: rotate(12deg);
  animation: rain-fall var(--rain-duration, 1s) linear infinite;
  animation-delay: var(--rain-delay, 0s);
}
.sensor-scene__heat {
  position: absolute;
  inset: 44% 10% 10%;
  display: grid;
  gap: 0.65rem;
}
.sensor-scene__heat span {
  border-radius: 999px;
  height: 18px;
  background: linear-gradient(90deg, transparent, rgba(255, 208, 112, 0.24), transparent);
  filter: blur(2px);
  animation: heat-shimmer 2.8s ease-in-out infinite;
}
.sensor-scene__heat span:nth-child(2) {
  animation-delay: 0.35s;
}
.sensor-scene__heat span:nth-child(3) {
  animation-delay: 0.7s;
}
.sensor-scene__moon {
  position: absolute;
  top: 7%;
  left: 10%;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, rgba(255,255,228,0.97), rgba(218,216,180,0.9));
  box-shadow:
    inset -16px -3px 0 2px rgba(16,24,40,0.97),
    0 0 22px 6px rgba(255,255,195,0.22),
    0 0 55px 18px rgba(195,195,145,0.10);
  animation: moon-glow 9s ease-in-out infinite;
}
.sensor-scene__stars {
  position: absolute;
  inset: 0 0 44% 0;
  pointer-events: none;
  overflow: hidden;
}
.sensor-scene__stars span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  animation: star-twinkle 3.5s ease-in-out infinite;
  opacity: var(--star-opacity, 0.7);
}
.sensor-scene__lightning {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(200,220,255,0.16);
  pointer-events: none;
  opacity: 0;
  animation: lightning-flash 7s steps(1) infinite;
}
.sensor-scene__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 1800px;
  z-index: 2;
}
.sensor-barn {
  position: relative;
  width: min(90%, 760px);
  height: 240px;
  transform-style: preserve-3d;
  transform: translateY(10px) rotateX(var(--scene-pitch, 74deg)) rotateZ(var(--scene-yaw, 0deg));
  transition: transform 0.28s ease;
}
.sensor-barn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 42px;
  background:
    linear-gradient(90deg, var(--scene-ground-a), rgba(90, 124, 59, 0.82) 45%, var(--scene-ground-b));
  box-shadow:
    0 42px 60px rgba(0,0,0,0.28),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}
.sensor-barn::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 22%;
  bottom: 22%;
  border-radius: 32px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04), rgba(0,0,0,0.16)),
    linear-gradient(90deg, rgba(139, 69, 19, 0.3), rgba(160, 82, 45, 0.22));
}
.sensor-barn__roof,
.sensor-barn__lane,
.sensor-barn__ridge {
  position: absolute;
  border-radius: 999px;
}
.sensor-barn__roof {
  top: 16%;
  bottom: 16%;
  width: 18%;
  background: linear-gradient(180deg, var(--scene-barn-a), var(--scene-barn-b));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.sensor-barn__roof--left { left: 9%; }
.sensor-barn__roof--right { right: 9%; }
.sensor-barn__lane {
  top: 26%;
  bottom: 26%;
  width: 5%;
  background: linear-gradient(180deg, rgba(13, 83, 118, 0.78), rgba(10, 45, 69, 0.86));
}
.sensor-barn__lane--left { left: 32%; }
.sensor-barn__lane--right { right: 32%; }
.sensor-barn__ridge {
  left: 50%;
  top: 14%;
  bottom: 14%;
  width: 3%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--scene-accent), rgba(255,255,255,0.18));
  box-shadow: 0 0 24px rgba(255,255,255,0.08);
}
.sensor-node {
  position: absolute;
  min-width: 92px;
  padding: 0.45rem 0.55rem;
  border-radius: 16px;
  transform: translate(-50%, -50%) translateZ(32px);
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(7, 14, 22, 0.82);
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  text-align: center;
}
.sensor-node span,
.sensor-node strong {
  display: block;
}
.sensor-node span {
  color: var(--text-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sensor-node strong {
  margin-top: 0.18rem;
}
.sensor-node--idle { border-color: rgba(148, 163, 184, 0.24); }
.sensor-node--cold { border-color: rgba(56, 189, 248, 0.36); box-shadow: 0 14px 30px rgba(56, 189, 248, 0.12); }
.sensor-node--mild { border-color: rgba(45, 212, 191, 0.36); box-shadow: 0 14px 30px rgba(45, 212, 191, 0.12); }
.sensor-node--warm { border-color: rgba(251, 191, 36, 0.4); box-shadow: 0 14px 30px rgba(251, 191, 36, 0.12); }
.sensor-node--hot { border-color: rgba(248, 113, 113, 0.44); box-shadow: 0 14px 30px rgba(248, 113, 113, 0.14); }
.sensor-reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.7rem;
}
.sensor-reading-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.78rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.sensor-reading-card span,
.sensor-reading-card small {
  color: var(--text-soft);
}
.sensor-reading-card--cold { border-color: rgba(56, 189, 248, 0.26); }
.sensor-reading-card--mild { border-color: rgba(45, 212, 191, 0.24); }
.sensor-reading-card--warm { border-color: rgba(251, 191, 36, 0.28); }
.sensor-reading-card--hot { border-color: rgba(248, 113, 113, 0.3); }
.relay-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}
.relay-inline-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.72rem 0.78rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.relay-inline-card--on {
  border-color: rgba(52, 211, 153, 0.28);
  background: linear-gradient(180deg, rgba(30, 155, 102, 0.18), rgba(255,255,255,0.03));
}
.relay-inline-card--off {
  border-color: rgba(248, 113, 113, 0.2);
}
.relay-inline-card--unknown {
  border-color: rgba(148, 163, 184, 0.22);
}
.relay-inline-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.relay-inline-card__head span {
  color: var(--text-soft);
  font-size: 0.76rem;
}
.relay-inline-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.sensor-image-map {
  --map-accent: rgba(148, 163, 184, 0.34);
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(5, 15, 24, 0.94), rgba(10, 19, 31, 0.82));
}
.sensor-image-map--sunny { --map-accent: rgba(251, 191, 36, 0.32); }
.sensor-image-map--cloudy { --map-accent: rgba(203, 213, 225, 0.28); }
.sensor-image-map--rainy { --map-accent: rgba(56, 189, 248, 0.28); }
.sensor-image-map__toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.sensor-image-map__toolbar strong {
  display: block;
}
.sensor-image-map__toolbar span {
  color: var(--text-soft);
}
.sensor-image-map__stage,
.layout-editor__stage {
  position: relative;
  min-height: 360px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(135deg, rgba(19, 37, 53, 0.94), rgba(7, 16, 24, 0.96)),
    linear-gradient(90deg, rgba(255,255,255,0.04), transparent);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.sensor-image-map__stage::before,
.layout-editor__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--map-accent, rgba(148, 163, 184, 0.18)), rgba(2, 8, 15, 0.2)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 56px);
  pointer-events: none;
}
.layout-editor__stage::before {
  background:
    linear-gradient(180deg, rgba(8, 15, 24, 0.28), rgba(2, 8, 15, 0.28)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 56px);
}
.sensor-map-node,
.layout-sensor-node {
  position: absolute;
  z-index: 1;
  min-width: 98px;
  padding: 0.45rem 0.55rem;
  border-radius: 15px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(6, 14, 22, 0.84);
  box-shadow: 0 16px 28px rgba(0,0,0,0.24);
  text-align: center;
}
.sensor-map-node {
  pointer-events: none;
}
.layout-sensor-node {
  cursor: grab;
  touch-action: none;
}
.layout-sensor-node.is-dragging {
  cursor: grabbing;
  box-shadow: 0 22px 36px rgba(0,0,0,0.3);
}
.sensor-map-node span,
.sensor-map-node strong,
.sensor-map-node small,
.layout-sensor-node span,
.layout-sensor-node strong {
  display: block;
}
.sensor-map-node span,
.sensor-map-node small,
.layout-sensor-node span {
  color: var(--text-soft);
}
.sensor-map-node span,
.layout-sensor-node span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.sensor-map-node small {
  margin-top: 0.16rem;
  font-size: 0.69rem;
}
.sensor-map-node--idle,
.layout-sensor-node--idle { border-color: rgba(148, 163, 184, 0.24); }
.sensor-map-node--cold,
.layout-sensor-node--cold { border-color: rgba(56, 189, 248, 0.36); box-shadow: 0 16px 28px rgba(56, 189, 248, 0.12); }
.sensor-map-node--mild,
.layout-sensor-node--mild { border-color: rgba(45, 212, 191, 0.36); box-shadow: 0 16px 28px rgba(45, 212, 191, 0.12); }
.sensor-map-node--warm,
.layout-sensor-node--warm { border-color: rgba(251, 191, 36, 0.4); box-shadow: 0 16px 28px rgba(251, 191, 36, 0.12); }
.sensor-map-node--hot,
.layout-sensor-node--hot { border-color: rgba(248, 113, 113, 0.44); box-shadow: 0 16px 28px rgba(248, 113, 113, 0.14); }
.layout-editor {
  display: grid;
  gap: 0.9rem;
}
.layout-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.layout-editor__upload {
  display: grid;
  gap: 0.35rem;
  min-width: 240px;
  color: var(--text-soft);
}
.layout-editor__upload input {
  width: 100%;
}
.layout-editor__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.layout-editor__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 1rem;
}
.layout-editor__stage.has-image {
  border-color: rgba(52, 211, 153, 0.16);
}
.layout-editor__empty-note {
  margin: 0;
  padding: 0.78rem 0.9rem;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.16);
  background: rgba(4, 12, 20, 0.62);
  color: var(--text-soft);
  text-align: center;
}
.layout-editor__list {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}
.layout-sensor-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.layout-sensor-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.layout-sensor-card__head span {
  color: var(--text-soft);
  font-size: 0.78rem;
}
.client-weather-strip span {
  min-height: 52px;
}
.stacked-space { margin-top: 1rem; }

/* ===== TABLE ===== */
.table-host {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table-shell { min-width: 680px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left; vertical-align: top;
}
th {
  color: var(--text-soft); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  background: rgba(255, 255, 255, 0.03);
}
td { color: var(--text); }
tr:last-child td { border-bottom: 0; }

/* ===== PILLS ===== */
.level-pill, .status-pill {
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 0 0.65rem;
  border-radius: 999px; font-size: 0.74rem; font-weight: 700;
}
.level-pill.level-1 { background: rgba(168,85,247,0.16); color: #c084fc; }
.level-pill.level-2 { background: rgba(56,189,248,0.15); color: #7dd3fc; }
.level-pill.level-3 { background: rgba(251,191,36,0.15); color: #fde68a; }
.level-pill.level-4 { background: rgba(52,211,153,0.15); color: #6ee7b7; }
.status-pill.active { background: rgba(52,211,153,0.15); color: #6ee7b7; }
.status-pill.inactive { background: rgba(248,113,113,0.15); color: #fca5a5; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  font-size: 0.71rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge--planning { background: rgba(251,191,36,0.15); color: #fde68a; }
.badge--active { background: rgba(59,130,246,0.16); color: #93c5fd; }
.badge--done { background: rgba(52,211,153,0.15); color: #6ee7b7; }
.badge--cancelled { background: rgba(248,113,113,0.15); color: #fca5a5; }
.badge--low { background: rgba(52,211,153,0.13); color: #6ee7b7; }
.badge--normal { background: rgba(251,191,36,0.13); color: #fde68a; }
.badge--high { background: rgba(251,146,60,0.15); color: #fdba74; }
.badge--urgent { background: rgba(248,113,113,0.16); color: #fca5a5; }
.badge--stock-low { background: rgba(248,113,113,0.16); color: #fca5a5; }
.badge--stock-ok { background: rgba(52,211,153,0.13); color: #6ee7b7; }
.badge--maint-active {
  background: rgba(248,113,113,0.2); color: #f87171;
  animation: pulse-badge 2s ease-in-out infinite;
}
.badge--maint-done { background: rgba(148,163,184,0.12); color: rgba(148,163,184,0.8); }

/* ===== BUDGET STATUS PILLS ===== */
.budget-status-draft { background: rgba(148,163,184,0.12); color: rgba(148,163,184,0.85); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.72rem; font-weight: 700; }
.budget-status-submitted { background: rgba(59,130,246,0.15); color: #93c5fd; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.72rem; font-weight: 700; }
.budget-status-approved { background: rgba(52,211,153,0.15); color: #6ee7b7; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.72rem; font-weight: 700; }
.budget-status-rejected { background: rgba(248,113,113,0.15); color: #fca5a5; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.72rem; font-weight: 700; }

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0; z-index: 120;
  overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 1rem;
}
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(1, 6, 13, 0.84);
  z-index: 0;
}
.modal-card {
  position: relative; z-index: 1;
  flex-shrink: 0; margin: auto;
}
.modal-close {
  position: relative;
  right: auto;
  min-width: 42px;
  min-height: 42px;
  flex: 0 0 auto;
}

.form-divider {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 0.2rem 0;
  padding-top: 0.7rem;
}
.form-divider .kicker { margin-bottom: 0.5rem; }
.modal-note {
  margin: 0 0 0.5rem;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ===== SIGNATURE CANVAS ===== */
.history-modal-card { width: min(760px, calc(100vw - 2rem)); }
.signature-modal-card { width: min(560px, 100%); }
.signature-canvas-wrap {
  border: 2px solid rgba(30, 155, 102, 0.35);
  border-radius: 12px; overflow: hidden;
  background: #ffffff; cursor: crosshair;
  margin: 0.5rem 0;
}
.signature-canvas {
  display: block; width: 100%; height: 200px;
  touch-action: none;
}
.signature-controls {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  margin-top: 0.75rem;
}
.signature-controls .secondary-button { flex: 1; min-width: 90px; }
.signature-controls .primary-button { flex: 2; min-width: 140px; }
.signature-action-row {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.signature-action-row button { flex: 1; min-width: 140px; font-size: 0.84rem; }
.signature-preview {
  padding: 0.7rem; border-radius: 12px;
  border: 1px solid rgba(30, 155, 102, 0.3);
  background: rgba(30, 155, 102, 0.06);
  text-align: center; margin-bottom: 0.75rem;
}
.signature-preview p { margin: 0 0 0.4rem; }
.signature-preview img {
  max-height: 72px; border-radius: 8px;
  background: white; padding: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  display: inline-block;
}

/* ===== KEYFRAMES ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loginFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(20px); } }
@keyframes loginReveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes cloud-drift {
  from { transform: translateX(0) scale(var(--cloud-scale)); }
  to { transform: translateX(34px) scale(var(--cloud-scale)); }
}
@keyframes rain-fall {
  from { transform: translate3d(0, 0, 0) rotate(12deg); opacity: 0; }
  18% { opacity: 0.8; }
  to { transform: translate3d(-28px, 420px, 0) rotate(12deg); opacity: 0; }
}
@keyframes heat-shimmer {
  0%, 100% { transform: translateX(-4px) scaleX(0.96); opacity: 0.28; }
  50% { transform: translateX(6px) scaleX(1.04); opacity: 0.58; }
}
@keyframes sun-pulse {
  0%, 100% { transform: scale(0.98); opacity: 0.78; }
  50% { transform: scale(1.04); opacity: 0.92; }
}
@keyframes moon-glow {
  0%, 100% { box-shadow: inset -16px -3px 0 2px rgba(16,24,40,0.97), 0 0 22px 6px rgba(255,255,195,0.22), 0 0 55px 18px rgba(195,195,145,0.10); opacity: 0.88; }
  50% { box-shadow: inset -16px -3px 0 2px rgba(16,24,40,0.97), 0 0 28px 10px rgba(255,255,195,0.30), 0 0 72px 24px rgba(195,195,145,0.16); opacity: 0.96; }
}
@keyframes star-twinkle {
  0%, 100% { opacity: var(--star-opacity, 0.7); transform: scale(1); }
  50% { opacity: calc(var(--star-opacity, 0.7) * 0.14); transform: scale(0.55); }
}
@keyframes lightning-flash {
  0%, 87%, 90%, 93%, 95%, 100% { opacity: 0; }
  88%, 91%, 94% { opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-aside { border-bottom: 1px solid rgba(148,163,184,0.16); }
  .login-form-panel { padding: 2.2rem 2rem; }
  .grid-two, .profile-grid, .security-line { grid-template-columns: 1fr; }
  .app-header {
    flex-direction: row; flex-wrap: wrap;
    align-items: flex-start; gap: 0.75rem;
  }
  .app-user {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  .app-user > div { text-align: left; }
  .card-heading, .inline-head { flex-wrap: wrap; }
  .module-grid { grid-template-columns: 1fr; }
  .menu-hero { flex-direction: column; }
  .menu-hero .summary-grid { width: 100%; min-width: 0; }
  .client-dashboard-grid { grid-template-columns: 1fr; }
  .metric-card--hero { grid-column: auto; }
}

@media (max-width: 760px) {
  .login-shell {
    min-height: calc(100dvh - (clamp(0.75rem, 1.5vw, 1rem) * 2));
    align-items: stretch;
  }
  .app-header {
    padding: 0.85rem 0.9rem;
    gap: 0.9rem;
  }
  .app-brand img { width: 42px; height: 42px; }
  .app-user {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
  }
  .app-user > div {
    flex: 1 1 180px;
    gap: 0.1rem;
  }
  .app-user strong { font-size: 0.92rem; }
  .app-user span { font-size: 0.76rem; }
  .app-user .secondary-button {
    width: auto;
    min-width: 88px;
    min-height: 38px;
    padding: 0 0.9rem;
  }

  /* Horizontal scrollable tabs */
  .view-tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    position: sticky;
    top: 0.45rem;
    z-index: 16;
    grid-template-columns: unset; gap: 0.55rem;
    padding: 0.38rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(6, 18, 28, 0.9);
    box-shadow: 0 14px 30px rgba(2, 8, 15, 0.22);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 0.38rem;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.8rem;
  }
  .view-tabs::-webkit-scrollbar { display: none; }
  .tab-button {
    flex: 0 0 auto;
    min-width: 96px;
    min-height: 68px;
    padding: 0.7rem 0.8rem;
    border-radius: 15px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    font-size: 0.73rem;
    line-height: 1.15;
    white-space: normal;
    text-wrap: balance;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.045);
  }
  .tab-button i {
    font-size: 1.05rem;
    flex: 0 0 auto;
  }
  .tab-button.active {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(9, 32, 30, 0.28);
  }
  .weather-strip,
  .device-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .device-grid { grid-template-columns: 1fr; }
  .relay-grid,
  .relay-inline-grid,
  .sensor-reading-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-actions,
  .client-batch-toolbar__actions {
    width: 100%;
    justify-content: stretch;
  }
  .panel-actions > *,
  .client-batch-toolbar__actions > * {
    flex: 1 1 180px;
  }
  .device-selector {
    grid-template-columns: 1fr;
  }
  .command-grid {
    grid-template-columns: 1fr;
  }
  .layout-editor__grid {
    grid-template-columns: 1fr;
  }
  .layout-editor__stage,
  .sensor-image-map__stage {
    min-height: 320px;
  }
  .position-command-panel__controls {
    width: 100%;
  }
  .position-command-panel__controls .command-button,
  .position-command-select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .login-screen, .app-shell { padding: 0.75rem; }
  .login-screen::before,
  .login-screen::after { opacity: 0.45; }
  .login-shell {
    min-height: calc(100dvh - 1.5rem);
    align-items: center;
  }
  .login-card { border-radius: 20px; }
  .login-aside { padding: 1.55rem 1.2rem; }
  .login-aside__inner { gap: 1.2rem; }
  .login-screen .login-brand { gap: 0.75rem; }
  .login-screen .login-brand img { width: 56px; height: 56px; }
  .login-brand__subtitle { letter-spacing: 0.18em; }
  .login-hero h1 { font-size: clamp(1.8rem, 9vw, 2.4rem); }
  .login-hero p { max-width: none; font-size: 0.95rem; }
  .login-highlight { align-items: flex-start; font-size: 0.88rem; }
  .login-form-panel { padding: 1.4rem 1rem 1.25rem; }
  .login-form__header { margin-bottom: 1.25rem; }
  .login-form__header h2 { font-size: 1.8rem; }
  .login-form__footer { align-items: stretch; }
  .login-form__footer .text-button { width: 100%; text-align: left; }
  .card, .hero-strip, .modal-card { padding: 1rem; border-radius: 18px; }
  .app-header {
    padding: 0.8rem 0.85rem;
    border-radius: 18px;
  }
  .app-brand strong { font-size: 0.94rem; }
  .app-brand span { font-size: 0.76rem; }
  .menu-hero { padding: 1.1rem; gap: 1rem; }
  .menu-hero__text h2 { font-size: 1.45rem; }
  .module-grid { gap: 0.6rem; }
  .module-card {
    min-height: 0;
    padding: 1rem 1rem 0.95rem;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .module-card__icon { width: 44px; height: 44px; }
  .module-card__arrow { display: none; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { padding: 0.8rem 0.85rem; }
  .summary-card strong { font-size: 1.25rem; }
  .profile-grid div, .feed-item, .empty-state { padding: 0.8rem; }
  .feed-item { display: grid; gap: 0.4rem; }
  .feed-item .inline-grid { margin-top: 0.15rem; }
  .budget-item-card-subitem { margin-left: 0.45rem; }
  .suffix-field input { padding-right: 6.2rem; }
  .suffix-field strong { right: 0.85rem; font-size: 0.82rem; }
  .customer-summary-card,
  .site-card,
  .device-card,
  .credential-box {
    padding: 0.85rem;
  }
  .weather-strip,
  .device-metrics {
    grid-template-columns: 1fr;
  }
  .device-capability-grid,
  .relay-grid,
  .relay-inline-grid,
  .sensor-reading-grid,
  .relay-card__actions {
    grid-template-columns: 1fr;
  }
  .device-status-grid,
  .device-status-grid--technical {
    grid-template-columns: 1fr;
  }
  .sensor-scene {
    padding: 0.85rem;
  }
  .sensor-scene__toolbar,
  .sensor-scene__meta {
    min-width: 0;
  }
  .sensor-scene__meta {
    justify-content: flex-start;
  }
  .sensor-scene__viewport {
    min-height: 260px;
  }
  .sensor-scene__hint {
    right: 1rem;
    font-size: 0.72rem;
  }
  .sensor-image-map,
  .layout-editor {
    padding: 0.85rem;
  }
  .sensor-image-map__stage,
  .layout-editor__stage {
    min-height: 260px;
  }
  .sensor-barn {
    width: 96%;
    height: 180px;
  }
  .sensor-node {
    min-width: 78px;
    padding: 0.38rem 0.48rem;
  }
  .sensor-map-node,
  .layout-sensor-node {
    min-width: 82px;
    padding: 0.38rem 0.48rem;
  }
  .weather-strip span,
  .device-metrics span,
  .customer-meta-grid small {
    min-height: 0;
  }
  .table-actions,
  .command-strip {
    display: grid;
    grid-template-columns: 1fr;
  }
  .panel-actions,
  .client-batch-toolbar__actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .device-selector__toggle,
  .command-button,
  .position-command-panel,
  .position-command-select {
    width: 100%;
  }
  .layout-editor__toolbar,
  .layout-editor__actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .layout-editor__upload {
    min-width: 0;
  }
  .stacked-space { margin-top: 0.7rem; }
  .modal { padding: 0.75rem; align-items: flex-start; }
  .modal-card { padding: 1.1rem; }
  .modal-note { font-size: 0.84rem; }
  .signature-canvas { height: 170px; }
  .signature-action-row,
  .signature-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
  .signature-action-row button,
  .signature-controls .secondary-button,
  .signature-controls .primary-button {
    width: 100%;
    min-width: 0;
    flex: none;
  }
  .inline-grid { grid-template-columns: 1fr; }
  .form-stack { gap: 0.7rem; }
  .primary-button,
  .secondary-button,
  .table-action { width: 100%; }
  .app-user .secondary-button { width: auto; }
  input, select, textarea { font-size: 16px; }

  .table-host { overflow: visible; }
  .table-shell {
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }
  .table-shell table,
  .table-shell thead,
  .table-shell tbody,
  .table-shell tr,
  .table-shell td {
    display: block;
    width: 100%;
  }
  .table-shell thead { display: none; }
  .table-shell tbody {
    display: grid;
    gap: 0.75rem;
  }
  .table-shell tr {
    padding: 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
  }
  .table-shell td {
    padding: 0;
    border: 0;
    display: grid;
    gap: 0.25rem;
  }
  .table-shell td + td { margin-top: 0.65rem; }
  .table-shell td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .table-shell td[data-label=""]::before { display: none; }
  .table-shell td:last-child { margin-top: 0.9rem; }
  .table-shell td:last-child .table-action { width: 100%; }
}

@media (max-width: 460px) {
  .login-screen::before,
  .login-screen::after { display: none; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card strong { font-size: 1.15rem; }
  .view-tabs {
    top: 0.35rem;
    gap: 0.45rem;
    padding: 0.32rem;
    margin-bottom: 0.7rem;
  }
  .tab-button {
    min-width: 88px;
    min-height: 64px;
    padding: 0.62rem 0.65rem;
    font-size: 0.7rem;
  }
  .app-user {
    align-items: flex-start;
  }
  .app-user > div {
    flex-basis: 100%;
  }
  .app-user .secondary-button {
    min-width: 82px;
  }
  .kicker, .field span, .profile-grid dt {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }
}
