:root {
  color-scheme: dark;
  --bg-base: #070a11;
  --bg-gradient: radial-gradient(circle at 50% 0%, #16243d 0%, #070a11 75%);
  --card-bg: rgba(15, 23, 42, 0.75);
  --card-border: rgba(255, 255, 255, 0.1);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.45);
  --accent-cyan: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 95px;
  user-select: none;
  overflow-x: hidden;
}

.app-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px 14px;
}

/* Header & Live Clock */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-status {
  font-size: 0.75rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.clock-card {
  text-align: right;
}

.clock-time {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.clock-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Master Control Banner */
.master-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-master {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-master:active {
  transform: scale(0.96);
}

.btn-all-off {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-all-off:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.btn-all-on {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.25);
}

.btn-all-on:hover {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

/* Quick Scenes */
.scenes-section {
  margin-bottom: 20px;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 10px;
}

.scenes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.scene-btn {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  padding: 12px 8px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.scene-btn:hover, .scene-btn:active {
  background: rgba(30, 41, 59, 0.85);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.scene-icon {
  font-size: 20px;
}

.scene-title {
  font-size: 0.76rem;
  font-weight: 600;
}

/* Room Filter Pills */
.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
  font-weight: 600;
}

/* =================================================== */
/* TOMBOL RUANGAN MINIMALIS (1 Baris 2 Tombol)         */
/* Sesuai Desain: Status ON/OFF, Power, Nama & Ruangan */
/* =================================================== */
.devices-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.room-btn-card {
  position: relative;
  width: 100%;
  min-height: 145px;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: #0d1527;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.room-btn-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.room-btn-card:active {
  transform: scale(0.97);
}

/* Background Ruangan */
.room-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  transition: all 0.4s ease;
  filter: grayscale(70%) brightness(0.4) contrast(0.95);
  z-index: 1;
}

/* Overlay gradient agar teks selalu terbaca tajam */
.room-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.5) 0%, rgba(8, 12, 20, 0.88) 100%);
  z-index: 2;
  transition: all 0.35s ease;
}

/* Status ON: Highlight & Glow */
.room-btn-card.is-on {
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.35), inset 0 0 20px rgba(245, 158, 11, 0.15);
}

.room-btn-card.is-on .room-bg-image {
  filter: grayscale(0%) brightness(1.08) contrast(1.05);
  transform: scale(1.03);
}

.room-btn-card.is-on .room-overlay {
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.3) 0%, rgba(8, 12, 20, 0.78) 100%);
}

/* Status OFF */
.room-btn-card.is-off {
  border-color: rgba(255, 255, 255, 0.08);
}

/* Konten di atas background */
.room-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 14px 14px 12px 14px;
}

/* Baris Atas: • ON / • OFF & Power Icon */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  padding: 3px 9px 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator.on {
  color: #ffffff;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(0, 0, 0, 0.65);
}

.status-indicator.on .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b, 0 0 14px rgba(245, 158, 11, 0.8);
}

.status-indicator.off {
  color: #94a3b8;
}

.status-indicator.off .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #64748b;
}

/* Power Icon di pojok kanan atas */
.power-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s ease;
}

.power-icon-btn.on {
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fef08a;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.8), 0 0 6px #f59e0b;
}

.power-icon-btn.off {
  color: #94a3b8;
}

.power-svg {
  display: block;
}

/* Baris Bawah: Nama Perangkat & Ruangan */
.card-footer-row {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
}

.card-device-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.card-room-name {
  font-size: 0.74rem;
  color: #cbd5e1;
  font-weight: 500;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.room-btn-card.is-off .card-device-name {
  color: #e2e8f0;
}

.room-btn-card.is-off .card-room-name {
  color: #94a3b8;
}

/* Slider Kecerahan pada WiZ */
.room-slider-bar {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 5px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.slider-icon {
  font-size: 0.72rem;
  line-height: 1;
}

.slider-input {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: pointer;
  box-shadow: 0 0 12px var(--accent-amber-glow);
}

.slider-val {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: #fbbf24;
  min-width: 28px;
  text-align: right;
}

/* =================================================== */
/* JADWAL RENTANG WAKTU (TIME RANGE)                   */
/* =================================================== */
.schedule-item {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.schedule-item:hover {
  border-color: rgba(14, 165, 233, 0.3);
}

.sch-time-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.sch-arrow {
  color: var(--accent-amber);
  font-size: 1rem;
}

.sch-tag-on {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-radius: 4px;
}

.sch-tag-off {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-radius: 4px;
}

.sch-meta-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 3px;
}

.sch-days {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.sch-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-switch {
  width: 52px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  position: relative;
  transition: background 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.switch-thumb {
  width: 20px;
  height: 20px;
  background: #94a3b8;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 4px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-del-sch {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 17px;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s ease;
}

.btn-del-sch:hover {
  color: var(--accent-red);
  transform: scale(1.15);
}

.btn-edit-sch {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s ease;
}

.btn-edit-sch:hover {
  color: var(--accent-amber);
  transform: scale(1.15);
}

.btn-add-schedule {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Riwayat Log */
.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.log-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Bottom Navigation Bar (Lebar Penuh Layar) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 68px;
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  margin: 0;
  padding: 0;
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 540px;
  height: 100%;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
  width: 25%;
  flex: 1;
  padding: 8px 0;
}

.nav-item.active {
  color: var(--accent-amber);
}

.nav-icon {
  font-size: 20px;
}

/* Modal Popup Form */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 540px;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #ffffff;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: #1a2234;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  color-scheme: dark;
}

.form-select {
  cursor: pointer;
}

.form-select option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-cyan);
}

/* Target Checkbox List */
.target-chk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-toggle-all-chk {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-amber);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-all-chk:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
}

.device-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.device-checkbox-list::-webkit-scrollbar {
  width: 4px;
}

.device-checkbox-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sch-device-chk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: #141c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sch-device-chk-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #192438;
}

.sch-device-chk-item.checked {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.5);
}

.sch-chk-input {
  display: none;
}

.sch-chk-box {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sch-device-chk-item.checked .sch-chk-box {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
}

.sch-device-chk-item.checked .sch-chk-box::after {
  content: '✓';
  color: #000000;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}

.sch-chk-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sch-chk-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.25;
}

.sch-chk-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.time-range-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.time-range-separator {
  color: var(--accent-amber);
  font-weight: 700;
  font-size: 1.1rem;
}

.day-selector {
  display: flex;
  gap: 5px;
}

.day-btn {
  flex: 1;
  padding: 8px 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.day-btn.selected {
  background: var(--accent-amber);
  color: #000000;
  border-color: var(--accent-amber);
}

.btn-submit-sch {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  background: var(--accent-amber);
  color: #000000;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  margin-top: 10px;
}

/* =================================================== */
/* MODUL SKENARIO PINTAR (SCENES)                      */
/* =================================================== */
.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scene-manage-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
}

.scene-manage-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.scene-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-info-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scene-big-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.scene-name-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.scene-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-run-scene {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-run-scene:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

.scene-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-action {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid transparent;
}

.chip-action.on {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.chip-action.off {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

/* Emoji Picker */
.emoji-picker-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.emoji-chip {
  width: 34px;
  height: 34px;
  font-size: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.emoji-chip:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  transform: scale(1.1);
}

/* Scene Device Action Rows */
.scene-device-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.scene-dev-row {
  background: #141c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-dev-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-dev-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.scene-dev-room {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.scene-dev-radios {
  display: flex;
  gap: 6px;
}

.btn-state-radio {
  flex: 1;
  padding: 6px 0;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-state-radio.active-ignore {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-state-radio.active-on {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: #10b981;
}

.btn-state-radio.active-off {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

.scene-dim-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* ===================================================
   TOAST NOTIFICATION SYSTEM (MODERN GLASSMORPHISM)
   =================================================== */
.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  position: relative;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.toast-leaving {
  opacity: 0;
  transform: translateY(-20px) scale(0.92);
  margin-bottom: -50px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-25px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-inner {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 12px;
}

.toast-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.toast-item.toast-success .toast-icon-wrap {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.toast-item.toast-error .toast-icon-wrap {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.toast-item.toast-warning .toast-icon-wrap {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.toast-item.toast-info .toast-icon-wrap {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  font-family: var(--font-display);
}

.toast-msg {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.toast-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}

.toast-item.toast-success .toast-progress {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.toast-item.toast-error .toast-progress {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.toast-item.toast-warning .toast-progress {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.toast-item.toast-info .toast-progress {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ===================================================
   CUSTOM CONFIRMATION DIALOG MODAL
   =================================================== */
.confirm-modal-overlay {
  align-items: center !important;
  justify-content: center !important;
  padding: 20px;
}

.confirm-modal-content {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 20px !important;
  padding: 26px 22px 22px !important;
  width: 100%;
  max-width: 360px !important;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
  animation: confirmPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes confirmPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confirm-icon-box {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.18);
}

.confirm-icon-box.warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.18);
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 22px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.btn-confirm-cancel {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-confirm-ok {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-confirm-ok.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-confirm-ok.danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

.btn-confirm-ok.primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-confirm-ok.primary:hover {
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
  transform: translateY(-1px);
}

