   :root {
      --teal: #146c63;
      --teal-d: #0b3f3a;
      --teal-m: #1b8f82;
      --teal-l: #d9f5ee;
      --bg: #eef3f6;
      --card: #ffffff;
      --text: #1e293b;
      --muted: #64748b;
      --line: #e2e8f0;
      --green: #16a34a;
      --red: #dc2626;
      --amber: #f59e0b;
      --blue: #2563eb;
      --shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    [hidden] { display: none !important; }

    body {
      font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    /* ================= LOGIN ================= */
    .login-screen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #062e2a;
      position: relative;
      overflow: hidden;
      padding: 28px 18px;
    }

    .login-bg {
      position: absolute;
      inset: 0;
      background-image: url("greenhouse-in.jpg");
      background-size: cover;
      background-position: center;
      filter: brightness(0.45) saturate(1.05);
      transform: scale(1.04);
    }

    .login-overlay {
      position: absolute;
      inset: 0;
      background:
        linear-gradient(120deg, rgba(6, 46, 42, 0.92) 0%, rgba(11, 63, 58, 0.78) 40%, rgba(6, 46, 42, 0.88) 100%);
      pointer-events: none;
    }

    .login-wrap {
      position: relative;
      z-index: 2;
      width: 100%;
      max-width: 980px;
      margin: auto;
      display: grid;
      grid-template-columns: 1.05fr 0.95fr;
      gap: 0;
      min-height: 540px;
      border-radius: 24px;
      overflow: hidden;
      box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
      background: #fff;
    }

    .login-showcase {
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 0;
      color: #fff;
      overflow: hidden;
      min-height: 320px;
    }

    .login-showcase .photo-main {
      position: absolute;
      inset: 0;
    }

    .login-showcase .photo-main img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .login-showcase .photo-thumbs {
      position: absolute;
      top: 18px;
      right: 18px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 2;
    }

    .login-showcase .photo-thumbs img {
      width: 72px;
      height: 54px;
      object-fit: cover;
      border-radius: 10px;
      border: 2px solid rgba(255,255,255,0.7);
      box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    }

    .login-showcase-content {
      position: relative;
      z-index: 2;
      padding: 28px 28px 30px;
      background: linear-gradient(to top, rgba(6, 40, 36, 0.95) 0%, rgba(6, 40, 36, 0.7) 55%, transparent 100%);
    }

    .login-showcase h2 {
      font-size: 24px;
      font-weight: 800;
      margin-bottom: 8px;
      color: #fff;
      letter-spacing: 0.2px;
    }

    .login-showcase p {
      font-size: 13.5px;
      line-height: 1.55;
      color: #d9f5ee;
      max-width: 340px;
    }

    .login-showcase .tags {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 14px;
    }

    .login-showcase .tag {
      padding: 5px 11px;
      border-radius: 16px;
      background: rgba(255,255,255,0.14);
      border: 1px solid rgba(255,255,255,0.28);
      font-size: 11px;
      font-weight: 700;
      color: #fff;
    }

    .login-card {
      width: 100%;
      background: #fff;
      padding: 42px 38px;
      text-align: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .login-card .logo {
      width: 86px;
      height: 86px;
      margin: 0 auto 12px;
      display: block;
      border: 1px solid var(--line);
      border-radius: 50%;
      object-fit: contain;
      background: #fff;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
    }

    .login-card h1 { font-size: 22px; margin-bottom: 4px; color: var(--teal-d); }
    .login-card .sub-t { color: var(--muted); font-size: 13px; margin-bottom: 26px; }

    .login-card .field { text-align: left; margin-bottom: 14px; }
    .login-card label.lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #334155; }
    .login-card input[type="text"], .login-card input[type="password"] {
      width: 100%; padding: 12px 14px; border: 1.5px solid #cbd5e1; border-radius: 10px;
      font-size: 15px; background: #f8fafc; color: var(--text); font-family: inherit;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .login-card input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.15); }

    .remember { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 18px; text-align: left; cursor: pointer; }
    .remember input { width: 18px; height: 18px; accent-color: var(--teal); }

    .login-msg { min-height: 20px; font-size: 13px; font-weight: 700; color: #b91c1c; margin-bottom: 12px; }
    .login-card button { width: 100%; flex: none; padding: 13px; font-size: 15px; border-radius: 12px; }

    .login-footer {
      margin-top: 22px;
      font-size: 11px;
      color: var(--muted);
      line-height: 1.4;
    }

    @media (max-width: 860px) {
      .login-wrap {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: 420px;
        border-radius: 20px;
      }
      .login-showcase { min-height: 210px; }
      .login-showcase .photo-thumbs { top: 12px; right: 12px; }
      .login-showcase .photo-thumbs img { width: 56px; height: 42px; }
      .login-showcase-content { padding: 20px 18px 22px; }
      .login-showcase h2 { font-size: 20px; }
      .login-card { padding: 28px 22px; }
    }

    .topbar {
      position: relative;
      z-index: 5;
      max-width: 1100px;
      margin: 0 auto 12px;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
    }
    .topbar .who { font-size: 13px; color: var(--teal-l); }
    .btn-logout {
      flex: none;
      padding: 8px 16px;
      background: rgba(255, 255, 255, 0.18);
      border: 1px solid rgba(255, 255, 255, 0.45);
      border-radius: 20px;
      font-size: 13px;
      color: #fff;
      cursor: pointer;
      font-weight: 700;
      font-family: inherit;
    }
    .btn-logout:hover {
      background: rgba(255, 255, 255, 0.28);
      transform: none;
      opacity: 1;
    }

    /* ================= HERO ================= */
    .hero {
      position: relative;
      color: #fff;
      padding: 24px 20px 92px;
      overflow: hidden;
      background: #0b3f3a;
    }

    .hero-bg {
      position: absolute;
      inset: 0;
      background-image: url("greenhouse-out.jpg");
      background-size: cover;
      background-position: center 40%;
      filter: brightness(0.5) saturate(1.1);
      transform: scale(1.02);
    }

    .hero-overlay {
      position: absolute;
      inset: 0;
      background:
        linear-gradient(135deg, rgba(11, 63, 58, 0.9) 0%, rgba(20, 108, 99, 0.78) 50%, rgba(11, 63, 58, 0.88) 100%),
        radial-gradient(circle at 90% 10%, rgba(126, 240, 220, 0.15), transparent 40%);
    }

    .hero-inner {
      position: relative;
      z-index: 2;
      max-width: 1100px;
      margin: auto;
      display: grid;
      grid-template-columns: 1fr 1.2fr;
      gap: 28px;
      align-items: center;
    }

    .brand-block {
      display: flex;
      flex-direction: column;
      gap: 16px;
      padding: 4px 0;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 16px;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.16);
      border-radius: 18px;
      padding: 16px 18px;
      backdrop-filter: blur(8px);
    }

    .logo {
      width: 76px; height: 76px; object-fit: contain;
      background: #fff; border-radius: 50%; padding: 4px; flex-shrink: 0;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    }

    .brand h1 { font-size: 24px; margin-bottom: 2px; letter-spacing: 0.2px; }
    .brand h2 { font-size: 14px; font-weight: 600; color: var(--teal-l); margin-bottom: 4px; }
    .brand p { font-size: 12.5px; color: #c8ebe3; opacity: 0.95; line-height: 1.45; max-width: 340px; }

    /* Foto di kanan */
    .hero-photos {
      display: grid;
      grid-template-columns: 1.45fr 1fr;
      grid-template-rows: 1fr 1fr;
      gap: 10px;
      min-height: 240px;
    }

    .hero-photos img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 14px;
      border: 2px solid rgba(255,255,255,0.4);
      box-shadow: 0 8px 24px rgba(0,0,0,0.32);
      transition: transform 0.2s, border-color 0.2s;
    }

    .hero-photos img:first-child {
      grid-row: 1 / -1;
      min-height: 240px;
    }

    .hero-photos img:hover {
      transform: scale(1.02);
      border-color: #7ef0dc;
    }

    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 8px;
      padding: 5px 11px;
      border-radius: 20px;
      background: rgba(74, 222, 128, 0.15);
      border: 1px solid rgba(74, 222, 128, 0.35);
      font-size: 11px;
      font-weight: 700;
      color: #bbf7d0;
    }

    .hero-badge span {
      width: 7px; height: 7px; border-radius: 50%;
      background: #4ade80;
      box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
    }

    @media (max-width: 820px) {
      .hero-inner {
        grid-template-columns: 1fr;
        gap: 20px;
      }
      .brand h1 { font-size: 22px; }
      .logo { width: 68px; height: 68px; }
      .hero-photos {
        min-height: 180px;
        grid-template-columns: 1.3fr 1fr;
      }
      .hero-photos img:first-child { min-height: 180px; }
    }

    /* ================= JAM (di bawah logo) ================= */
    .clock-panel {
      display: flex; align-items: center; gap: 12px;
      padding: 12px 16px; border-radius: 16px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.22);
      backdrop-filter: blur(10px);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
      width: fit-content;
    }

    .analog { width: 48px; height: 48px; flex-shrink: 0; }

    .greet { font-size: 10px; color: #bff3e8; letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 2px; }

    .time { display: flex; align-items: baseline; gap: 2px; flex-wrap: wrap; }

    .hm {
      font-size: clamp(18px, 3vw, 26px); font-weight: 800; line-height: 1;
      letter-spacing: 0.4px; font-variant-numeric: tabular-nums;
      text-shadow: 0 0 12px rgba(120, 255, 230, 0.35);
    }

    .sec {
      font-size: clamp(12px, 2vw, 15px); font-weight: 700; color: #7ef0dc;
      font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(126, 240, 220, 0.45);
    }

    .zone {
      margin-left: 4px; padding: 2px 7px; border-radius: 12px;
      background: rgba(255, 255, 255, 0.18); font-size: 10px; font-weight: 700; align-self: center;
    }

    .date { margin-top: 3px; font-size: 11px; color: #d9f5ee; }

    /* ================= MENU TAB ================= */
    .tabs-wrap { position: sticky; top: 8px; z-index: 30; max-width: 1100px; margin: -34px auto 22px; padding: 0 16px; }

    .tabs {
      display: flex; gap: 6px; background: #fff; border-radius: 16px; padding: 6px;
      box-shadow: 0 6px 22px rgba(15, 23, 42, 0.16);
    }

    .tab {
      flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
      padding: 12px 8px; background: transparent; color: var(--muted);
      border-radius: 12px; font-size: 14px;
    }
    .tab svg { width: 20px; height: 20px; flex: none; }
    .tab:hover { transform: none; opacity: 1; background: #f1f5f9; }
    .tab.active { background: var(--teal); color: #fff; }
    .tab:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

    /* ================= LAYOUT ================= */
    main { max-width: 1100px; margin: 0 auto 25px; padding: 0 16px; position: relative; }

    .sec-head { margin: 4px 2px 14px; }
    .sec-head h2 { font-size: 20px; margin-bottom: 4px; }
    .sec-head p { font-size: 13px; color: var(--muted); }

    .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }

    .stat {
      background: var(--card); border-radius: 16px; padding: 16px 18px;
      box-shadow: var(--shadow); border-left: 5px solid var(--teal);
    }
    .stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
    .stat .v { font-size: 21px; font-weight: 800; margin-top: 5px; display: flex; align-items: center; }
    .stat .s { font-size: 12px; color: var(--muted); margin-top: 3px; }

    .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #94a3b8; margin-right: 9px; flex-shrink: 0; }
    .dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2); }
    .dot.bad { background: var(--red); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15); }
    .dot.wait { background: var(--amber); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }

    .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 22px; }

    .card { background: var(--card); padding: 24px; border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 22px; }
    .grid .card { margin-bottom: 0; }
    .card h2 { font-size: 19px; margin-bottom: 4px; }
    .card-description { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.5; }
    .card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
    .card-head h2 { margin-bottom: 0; }
    .muted { color: var(--muted); font-size: 13px; }

    /* ================= TOMBOL ================= */
    .buttons { display: flex; gap: 10px; }

    button {
      flex: 1; padding: 12px; border: none; border-radius: 10px; color: #fff;
      font-weight: 700; cursor: pointer; font-size: 14px; transition: 0.2s; font-family: inherit;
    }
    button:hover { transform: translateY(-1px); opacity: 0.92; }
    button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

    .btn-off { background: var(--red); }
    .btn-save { background: var(--teal); }
    .btn-cancel { background: #64748b; }
    .btn-edit { background: var(--blue); }
    .btn-ghost { background: #fff; color: var(--teal); border: 1.5px solid var(--teal); width: 100%; margin-top: 12px; }
    .btn-sm { flex: none; padding: 7px 12px; font-size: 12px; }

    .link-btn {
      flex: none; background: none; color: var(--teal); padding: 0; margin-top: 12px;
      font-size: 13px; text-decoration: underline; text-align: left;
    }
    .link-btn:hover { transform: none; opacity: 0.75; }

    /* ================= RINGKASAN ================= */
    .on-list, .run-list { display: grid; gap: 10px; }

    .on-item {
      display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
      background: var(--soft); border: 1px solid rgba(0, 0, 0, 0.05);
    }
    .on-ic {
      width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--accent); flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; box-shadow: 0 0 14px var(--accent);
    }
    .on-ic svg { width: 22px; height: 22px; }
    .on-name { font-weight: 800; font-size: 15px; }
    .on-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

    .run-item { padding: 14px; border-radius: 14px; background: #ecfdf5; border: 1px solid #86efac; }
    .run-time { font-weight: 800; font-size: 16px; color: #166534; margin-bottom: 8px; }
    .run-acts { margin-bottom: 6px; }
    .run-meta { font-size: 13px; color: #166534; }

    .empty-state { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; background: #f8fafc; border-radius: 12px; border: 1px dashed #cbd5e1; }

    /* ================= KARTU AKTUATOR ================= */
    .act-top { display: flex; align-items: center; gap: 18px; }
    .act-info { min-width: 0; flex: 1; }

    .nm-row { display: flex; align-items: center; gap: 8px; }
    .nm-row h2 { margin-bottom: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .icon-btn {
      flex: none; width: 28px; height: 28px; padding: 0; border-radius: 8px;
      background: #f1f5f9; color: #475569; display: inline-flex; align-items: center; justify-content: center;
    }
    .icon-btn svg { width: 15px; height: 15px; }

    .nm-edit { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
    .nm-edit input {
      flex: 1; min-width: 110px; padding: 7px 10px; border: 1.5px solid var(--teal); border-radius: 8px;
      font-size: 15px; font-weight: 700; font-family: inherit; color: var(--text);
    }
    .nm-edit input:focus { outline: none; box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.15); }
    .nm-msg { flex-basis: 100%; font-size: 12px; font-weight: 700; color: #b91c1c; }

    .icon-wrap {
      width: 76px; height: 76px; border-radius: 50%; background: #f1f5f9; color: #94a3b8;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: 0.3s;
    }
    .icon-wrap svg { width: 38px; height: 38px; }

    .act-card.on .icon-wrap {
      background: var(--accent-soft); color: var(--accent);
      box-shadow: 0 0 0 6px var(--accent-soft), 0 0 26px var(--accent);
      animation: glow 2.4s ease-in-out infinite;
    }

    @keyframes glow {
      50% { box-shadow: 0 0 0 10px var(--accent-soft), 0 0 38px var(--accent); }
    }

    .state-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

    .state {
      display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 20px;
      font-size: 12px; font-weight: 800; background: var(--line); color: #475569; letter-spacing: 0.4px;
    }
    .act-card.on .state { background: var(--accent-soft); color: var(--accent-dark); }

    .chip { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: var(--muted); }
    .chip.auto { background: #dcfce7; color: #166534; }
    .chip.manual { background: #dbeafe; color: #1e40af; }

    .sch-box {
      margin: 18px 0; padding: 14px; border-radius: 12px; background: #f8fafc;
      border: 1px dashed #cbd5e1; font-size: 13px; line-height: 1.55;
    }
    .sch-box.run { background: #ecfdf5; border: 1px solid #86efac; }
    .sch-t { font-weight: 800; margin-bottom: 3px; }
    .sch-box.run .sch-t { color: #166534; }

    .bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 9px; }
    .bar span { display: block; height: 100%; width: 0; border-radius: 6px; transition: width 0.5s; background: linear-gradient(90deg, var(--teal), var(--green)); }

    .sch-warn { margin-top: 9px; color: #92400e; background: #fef3c7; padding: 7px 10px; border-radius: 8px; font-size: 12px; }

    /* ================= TOMBOL GESER ON/OFF ================= */
    .toggle {
      position: relative; width: 100%; height: 64px; border-radius: 40px; padding: 0;
      flex: none; overflow: hidden; display: flex; align-items: center;
      background: #cbd5e1; color: #475569; transition: background 0.3s, box-shadow 0.3s;
    }
    .toggle:hover { transform: none; opacity: 1; }
    .toggle:active:not(:disabled) { transform: scale(0.99); }
    .toggle:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

    .toggle .knob {
      position: absolute; top: 6px; left: 6px; width: 52px; height: 52px; border-radius: 50%;
      background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
      display: flex; align-items: center; justify-content: center; transition: left 0.3s;
    }
    .toggle .knob svg { width: 26px; height: 26px; color: #94a3b8; transition: color 0.3s; }

    .toggle .tlabel {
      position: absolute; right: 26px; font-size: 15px; font-weight: 800; letter-spacing: 1px;
    }

    .toggle.on {
      background: var(--accent); color: #fff;
      box-shadow: 0 0 0 4px var(--accent-soft), 0 6px 18px rgba(0, 0, 0, 0.12);
    }
    .toggle.on .knob { left: calc(100% - 58px); }
    .toggle.on .knob svg { color: var(--accent); }
    .toggle.on .tlabel { right: auto; left: 26px; }

    .toggle.pending { opacity: 0.7; cursor: wait; }
    .toggle.pending .knob svg { animation: pulse 0.9s ease-in-out infinite; }
    @keyframes pulse { 50% { opacity: 0.3; } }

    .thint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }

    /* ================= PENJADWALAN ================= */
    .badge { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--line); color: #475569; }
    .badge.ok { background: #dcfce7; color: #166534; }
    .badge.wait { background: #fef3c7; color: #92400e; }
    .badge.bad { background: #fee2e2; color: #991b1b; }

    .sched-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
    .field label.lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #334155; }
    .field input[type="time"],
    .field input[type="number"] {
      width: 100%; padding: 11px; border: 1.5px solid #cbd5e1; border-radius: 10px;
      font-size: 15px; background: #f8fafc; color: var(--text); font-family: inherit;
    }
    .field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.15); }
    .field.wide { grid-column: 1 / -1; }

    .days { display: flex; flex-wrap: wrap; gap: 8px; }
    .day { position: relative; }
    .day input { position: absolute; opacity: 0; }
    .day span {
      display: inline-block; min-width: 58px; text-align: center; padding: 10px 14px;
      border: 2px solid var(--line); border-radius: 12px; background: #f8fafc;
      font-weight: 700; font-size: 14px; cursor: pointer; transition: 0.15s; user-select: none;
    }
    .day input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
    .day input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
    .day.all span { border-color: var(--teal); color: var(--teal); }
    .day.all input:checked + span { color: #fff; }
    .days-sep { width: 1px; background: var(--line); margin: 2px 4px; }

    .checks { display: flex; gap: 10px; flex-wrap: wrap; }
    .tile { position: relative; }
    .tile input { position: absolute; opacity: 0; }
    .tile-body {
      display: flex; align-items: center; gap: 10px; padding: 10px 16px;
      border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
      background: #f8fafc; font-weight: 700; font-size: 14px; transition: 0.15s;
    }
    .tile-ic svg { width: 22px; height: 22px; display: block; color: var(--accent); }
    .tile input:checked + .tile-body { border-color: var(--accent); background: var(--accent-soft); }
    .tile input:focus-visible + .tile-body { outline: 2px solid var(--teal); }

    .hint { color: var(--muted); font-size: 12px; margin-top: 12px; }
    .form-msg { min-height: 20px; margin: 10px 0; font-size: 13px; font-weight: 700; }
    .form-msg.err { color: #b91c1c; }
    .form-msg.ok { color: #166534; }
    .form-buttons { max-width: 380px; }

    .sub { margin: 28px 0 12px; font-size: 16px; }
    .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
    table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 14px; }
    th { background: #f8fafc; text-align: left; padding: 12px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
    td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
    tr.running td { background: #f0fdf4; }
    .empty { text-align: center; color: var(--muted); padding: 30px; }

    .dchip {
      display: inline-block; width: 28px; text-align: center; font-size: 10px; font-weight: 700;
      padding: 4px 0; margin: 1px; border-radius: 6px; background: #f1f5f9; color: #94a3b8;
    }
    .dchip.on { background: var(--teal); color: #fff; }
    .all-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; background: var(--teal-l); color: var(--teal-d); }

    .act-badge {
      display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px;
      font-size: 12px; font-weight: 700; margin: 2px 4px 2px 0;
    }
    .act-badge svg { width: 13px; height: 13px; margin-right: 5px; flex-shrink: 0; }

    .pill { display: inline-block; padding: 4px 11px; border-radius: 12px; font-size: 12px; font-weight: 700; }
    .pill.wait { background: #fef3c7; color: #92400e; }
    .pill.run { background: #dcfce7; color: #166534; }
    .pill.off { background: #fee2e2; color: #991b1b; }
    .st-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

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

    .switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
    .switch input { opacity: 0; width: 0; height: 0; }
    .switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 24px; cursor: pointer; transition: 0.2s; }
    .switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
    .switch input:checked + span { background: var(--green); }
    .switch input:checked + span::before { transform: translateX(18px); }

    /* ================= KUALITAS UDARA ================= */
    .air {
      --air: #94a3b8; --air-soft: #f1f5f9; --air-dark: #475569;
      background: var(--air-soft); border-radius: 16px; padding: 22px; transition: background 0.5s;
    }

    .air-main { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }

    .air-ic {
      width: 84px; height: 84px; border-radius: 50%; background: #fff; color: var(--air);
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
      box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.6), 0 0 24px var(--air);
      transition: color 0.5s, box-shadow 0.5s;
    }
    .air-ic svg { width: 46px; height: 46px; }

    .air-k { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--air-dark); opacity: 0.75; margin-bottom: 4px; }
    .air-cat { font-size: clamp(28px, 6vw, 40px); font-weight: 800; color: var(--air-dark); line-height: 1.1; }
    .air-desc { font-size: 14px; color: var(--air-dark); margin-top: 6px; line-height: 1.5; }

    .air-mini { padding: 18px; }
    .air-mini .air-main { margin-bottom: 0; gap: 16px; }
    .air-mini .air-ic { width: 64px; height: 64px; }
    .air-mini .air-ic svg { width: 34px; height: 34px; }
    .air-mini .air-cat { font-size: 26px; }
    .air-mini .air-desc { font-size: 13px; margin-top: 4px; }

    .scale-bar {
      position: relative; height: 14px; border-radius: 10px;
      background: linear-gradient(90deg, #16a34a 0 25%, #f59e0b 25% 50%, #ea580c 50% 75%, #dc2626 75% 100%);
    }
    .scale-bar i {
      position: absolute; top: -5px; left: 0; width: 8px; height: 24px; border-radius: 5px;
      background: #0f172a; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
      transform: translateX(-50%); transition: left 0.6s;
    }
    .scale-lbl { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--air-dark); text-align: center; }

    .sensor-info { margin-top: 18px; padding: 14px; background: #f8fafc; border-radius: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }

    /* ================= KELEMBAPAN TANAH ================= */
    .soil {
      --soil: #94a3b8; --soil-soft: #f1f5f9; --soil-dark: #475569;
      background: var(--soil-soft); border-radius: 16px; padding: 22px; transition: background 0.5s;
    }
    .soil-main { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; }

    .ring { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
    .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
    .ring .trk { fill: none; stroke: rgba(255, 255, 255, 0.8); stroke-width: 11; }
    .ring .val {
      fill: none; stroke: var(--soil); stroke-width: 11; stroke-linecap: round;
      stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
      transition: stroke-dashoffset 0.8s ease, stroke 0.5s;
    }
    .ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--soil-dark); }
    .ring-pct { font-size: 32px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
    .ring-pct small { font-size: 15px; font-weight: 700; margin-left: 1px; }
    .ring-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; opacity: 0.7; margin-top: 5px; }

    .soil-k { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--soil-dark); opacity: 0.75; margin-bottom: 4px; }
    .soil-cat { font-size: clamp(26px, 5vw, 36px); font-weight: 800; color: var(--soil-dark); line-height: 1.1; }
    .soil-desc { font-size: 14px; color: var(--soil-dark); margin-top: 6px; line-height: 1.5; }

    .soil-mini { padding: 16px; }
    .soil-mini .soil-main { margin-bottom: 0; gap: 16px; }
    .soil-mini .ring { width: 92px; height: 92px; }
    .soil-mini .ring-pct { font-size: 23px; }
    .soil-mini .ring-pct small { font-size: 12px; }
    .soil-mini .soil-cat { font-size: 24px; }
    .soil-mini .soil-desc { font-size: 13px; margin-top: 4px; }

    .scale-bar.soil-scale { background: linear-gradient(90deg, #dc2626 0 20%, #f59e0b 20% 40%, #16a34a 40% 70%, #2563eb 70% 100%); }
    .scale-lbl.soil-lbl { grid-template-columns: 20fr 20fr 30fr 30fr; color: var(--soil-dark); font-size: 11px; }

    /* ================= LOG ================= */
    .log {
      background: #0f172a; color: #e2e8f0; padding: 15px; border-radius: 10px; font-family: monospace;
      font-size: 13px; min-height: 45px; max-height: 360px; overflow-y: auto; word-break: break-word; line-height: 1.7;
    }
    .log div:first-child { color: #7ef0dc; }

    footer { text-align: center; padding: 25px 15px; color: var(--muted); font-size: 12px; }

    /* ================= RESPONSIVE ================= */
    @media (max-width: 860px) {
      .hero-inner { grid-template-columns: 1fr; }
      .clock-panel { margin-left: 0; }
      .brand-block { align-items: flex-start; }
    }

    @media (max-width: 600px) {
      .hero { padding: 16px 12px 70px; }
      .brand { flex-direction: column; text-align: center; align-items: center; }
      .brand-block { align-items: center; }
      .logo { width: 64px; height: 64px; }
      .brand h1 { font-size: 20px; }
      .brand h2 { font-size: 13px; }
      .brand p { margin-left: auto; margin-right: auto; font-size: 12px; }
      .hero-badge { margin-left: auto; margin-right: auto; }
      .clock-panel { margin: 0 auto; padding: 8px 12px; gap: 8px; }
      .analog { width: 44px; height: 44px; }
      .hero-photos {
        min-height: 160px;
        grid-template-columns: 1.2fr 1fr;
      }
      .hero-photos img:first-child { min-height: 160px; }
      .tabs-wrap { padding: 0 10px; margin-top: -36px; }
      .tab { flex-direction: column; gap: 3px; font-size: 11px; padding: 9px 4px; }
      .tab svg { width: 20px; height: 20px; }
      .card { padding: 20px; }
      .air-main { flex-direction: column; text-align: center; }
      .air-mini .air-main { flex-direction: row; text-align: left; }
      .soil-main { flex-direction: column; text-align: center; }
      .soil-mini .soil-main { flex-direction: row; text-align: left; }
      .day span { min-width: 52px; padding: 9px 11px; }
      .days-sep { display: none; }
      .form-buttons { max-width: none; }
      .form-buttons.buttons { flex-direction: column; }
      .form-buttons button { width: 100%; }
      .btn-sm { width: auto; }
    }

/* ===== Grafik & Riwayat ===== */
.chart-box { position: relative; height: 200px; margin: 6px 0 16px; }
.chart-box.tall { height: 320px; margin-top: 16px; }
.hist-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.hist-form select, .hist-form input[type="date"] {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
.hist-form select:focus, .hist-form input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.15); }

/* ===== Pemilih ikon aktuator ===== */
.ic-pick { display: flex; gap: 6px; flex-basis: 100%; }
.ic-opt { cursor: pointer; }
.ic-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ic-opt span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 62px;
  padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted);
}
.ic-opt svg { width: 22px; height: 22px; }
.ic-opt em { font-style: normal; font-size: 11px; font-weight: 600; }
.ic-opt input:checked + span { border-color: var(--teal); background: var(--teal-l); color: var(--teal); }
.ic-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.25); }

/* ===== Kartu DHT22 (suhu & kelembapan udara) ===== */
.contents { display: contents; }
.dh { --dh-c: #94a3b8; }
.dh-body { display: flex; align-items: center; gap: 20px; margin: 4px 0 6px; }
.dh-svg { flex-shrink: 0; height: auto; }
.dh-thermo { width: 56px; }
.dh-drop { width: 72px; }
.dh-glass-bg { fill: #f1f5f9; }
.dh-glass { fill: none; stroke: #94a3b8; stroke-width: 2; }
.dh-ticks line { stroke: #94a3b8; stroke-width: 1.2; }
.dh-merc { fill: var(--dh-c); transition: transform 1s cubic-bezier(.3,.8,.3,1), fill .8s; }
.dh-liquid { transition: transform 1s cubic-bezier(.3,.8,.3,1); }
.dh-wave { fill: var(--dh-c); transition: fill .8s; }
.dh-wave.w1 { animation: jsm-wave 3.2s linear infinite; }
.dh-wave.w2 { opacity: .5; animation: jsm-wave 5s linear infinite reverse; }
.dh.waiting .dh-wave { animation-duration: 8s; }
@keyframes jsm-wave { to { transform: translateX(80px); } }
.dh-num { font-size: 42px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.dh-num small { font-size: 18px; font-weight: 700; margin-left: 4px; color: var(--muted); }
.dh-state { margin-top: 8px; font-weight: 700; color: var(--muted); }
.dh.dh-ok .dh-state { color: #166534; }
.dh.dh-cold .dh-state { color: #1d4ed8; }
.dh.dh-warm .dh-state { color: #b45309; }
.dh.dh-hot .dh-state { color: #b91c1c; }
.dh-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.dh-topic { margin-top: 10px; font-size: 12px; }
.dh-topic code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .dh-wave, .dh-merc, .dh-liquid { animation: none !important; transition: none !important; }
}

/* ================= DEVICE DIAGNOSTIC + INDUSTRIAL POLISH ================= */
.diag-card {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.diag-card .card-head {
  align-items: flex-start;
  gap: 12px;
}
.diag-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.muted-ts {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.diag-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px 11px;
  border-radius: 12px;
  background: #f8fafb;
  border: 1px solid var(--line);
  min-height: 64px;
}
.diag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}
.diag-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}
.diag-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.diag-dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}
.diag-dot.wait {
  background: #94a3b8;
}
.diag-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.diag-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}
.diag-relays {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.diag-relays-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.diag-relay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.diag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
}
.diag-chip.on {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.diag-chip.off {
  background: #f8fafc;
  color: var(--muted);
}
.diag-chip .c-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.diag-chip.on .c-dot { background: var(--green); }

/* Overview stats more industrial */
.stats {
  gap: 12px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.stat:hover {
  border-color: #c5d4de;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.09);
}
.stat .k {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
.stat .v {
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Cards / tables polish */
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
}
.card-head h2 {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.badge {
  font-weight: 700;
  letter-spacing: 0.02em;
}
table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.btn-save, .btn-on, .btn-off, .btn-edit, .ctl {
  border-radius: 10px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .diag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diag-head-meta { width: 100%; margin-left: 0; }
}
@media (max-width: 420px) {
  .diag-grid { grid-template-columns: 1fr; }
}

/* ================= ALARM PANEL ================= */
.alarm-card { margin: 0 0 22px; }
.alarm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.alarm-empty { font-size: 13px; color: var(--muted); padding: 8px 0; }
.alarm-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff;
}
.alarm-item.critical { border-color: #fca5a5; background: #fef2f2; }
.alarm-item.warning { border-color: #fcd34d; background: #fffbeb; }
.alarm-item .lvl {
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0;
}
.alarm-item.critical .lvl { background: #fee2e2; color: #991b1b; }
.alarm-item.warning .lvl { background: #fef3c7; color: #92400e; }
.alarm-item .ttl { font-weight: 700; font-size: 13px; }
.alarm-item .det { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alarm-settings { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.alarm-settings summary {
  cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.alarm-form {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-top: 10px;
}
.alarm-form label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.alarm-form input[type="number"] {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600;
}
.alarm-enable { flex-direction: row !important; align-items: center; gap: 8px !important; }
.alarm-hist-wrap { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.alarm-hist { max-height: 140px; overflow-y: auto; font-size: 12px; color: var(--muted); }
.alarm-hist div { padding: 3px 0; border-bottom: 1px solid var(--line); }
