
      :root {
        color-scheme: light;
        font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        line-height: 1.4;
        --gaia-bg: #faf9f3;
        --gaia-ink: #1b1c19;
        --gaia-muted: #6b7280;
        --gaia-panel: #ffffff;
        --gaia-line: #ece7dc;
        --gaia-soft: #f6f4ec;
        --gaia-green: #1d4e35;
        --gaia-green-dark: #163d29;
        --gaia-green-soft: #eaf3e8;
        --gaia-teal: #1d9e75;
        --gaia-danger: #b42318;
        --gaia-warning: #b7791f;
        --gaia-shadow: 0 18px 40px rgba(39, 45, 38, 0.08);
      }
      * { box-sizing: border-box; }
      [hidden] { display: none !important; }
      html { min-height: 100%; }
      body {
        background: var(--gaia-bg);
        color: var(--gaia-ink);
        margin: 0;
        min-height: 100vh;
      }
      .app-shell {
        display: none;
        grid-template-columns: 244px minmax(0, 1fr);
        min-height: 100vh;
      }
      body.authenticated .app-shell { display: grid; }
      .auth-screen {
        align-items: stretch;
        background:
          linear-gradient(90deg, rgba(29, 78, 53, 0.08), rgba(250, 249, 243, 0) 42%),
          var(--gaia-bg);
        display: grid;
        min-height: 100vh;
        padding: 32px;
      }
      body.authenticated .auth-screen { display: none; }
      .auth-shell {
        align-self: center;
        display: grid;
        grid-template-columns: minmax(320px, 430px) minmax(340px, 1fr);
        margin: 0 auto;
        max-width: 980px;
        min-height: 520px;
        width: 100%;
      }
      .auth-card {
        align-content: center;
        background: var(--gaia-panel);
        border: 1px solid var(--gaia-line);
        border-radius: 8px 0 0 8px;
        box-shadow: var(--gaia-shadow);
        display: grid;
        gap: 22px;
        padding: 32px;
        width: 100%;
      }
      .auth-card .brand-mark { height: 36px; width: 72px; }
      .auth-card h1 {
        color: #111827;
        font-size: 25px;
        font-weight: 600;
        line-height: 1.18;
        margin: 0 0 8px;
      }
      .auth-card p { margin: 0; }
      .auth-form {
        display: grid;
        gap: 14px;
      }
      .login-error {
        background: #fef2f2;
        border-radius: 8px;
        color: #b91c1c;
        display: none;
        font-size: 13px;
        font-weight: 650;
        padding: 10px 12px;
      }
      .login-error.visible { display: block; }
      .auth-aside {
        background: #183325;
        border-radius: 0 8px 8px 0;
        box-shadow: var(--gaia-shadow);
        color: #eaf3e8;
        display: grid;
        grid-template-rows: 1fr auto;
        overflow: hidden;
        padding: 32px;
        position: relative;
      }
      .auth-aside::before {
        background:
          linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
          linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
        background-size: 34px 34px;
        content: "";
        inset: 0;
        opacity: 0.55;
        position: absolute;
      }
      .auth-aside > * { position: relative; }
      .auth-kicker {
        color: #9be0bf;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.16em;
        margin: 0 0 14px;
        text-transform: uppercase;
      }
      .auth-aside h2 {
        color: #ffffff;
        font-size: 30px;
        font-weight: 650;
        line-height: 1.18;
        margin: 0;
        max-width: 520px;
      }
      .auth-aside-copy {
        color: #bdd5c8;
        font-size: 14px;
        line-height: 1.7;
        margin: 18px 0 0;
        max-width: 520px;
      }
      .auth-status-grid {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 28px;
      }
      .auth-status {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        display: grid;
        gap: 4px;
        min-height: 74px;
        padding: 13px;
      }
      .auth-status span {
        color: #9fb7aa;
        font-size: 11px;
        font-weight: 650;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .auth-status strong {
        color: #ffffff;
        font-size: 15px;
        font-weight: 600;
      }
      .auth-foot {
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        color: #a8c5b5;
        display: flex;
        font-size: 12px;
        justify-content: space-between;
        padding-top: 18px;
      }
      .auth-lock {
        align-items: center;
        background: rgba(155, 224, 191, 0.12);
        border: 1px solid rgba(155, 224, 191, 0.24);
        border-radius: 999px;
        color: #b7f1d2;
        display: inline-flex;
        font-size: 12px;
        font-weight: 600;
        min-height: 30px;
        padding: 5px 11px;
      }
      .sidebar {
        background:
          linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 247, 0.98)),
          #ffffff;
        border-right: 1px solid #f0eee7;
        color: #334155;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 18px 14px;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
      }
      .brand-lockup {
        border-bottom: 1px solid #f0eee7;
        display: grid;
        gap: 12px;
        padding: 0 0 20px;
      }
      .brand-mark {
        align-items: center;
        background: var(--gaia-green);
        border-radius: 7px;
        color: #ffffff;
        display: inline-flex;
        font-size: 12px;
        font-weight: 800;
        height: 34px;
        justify-content: center;
        letter-spacing: 0.02em;
        width: 70px;
      }
      .brand-title {
        display: grid;
        gap: 2px;
      }
      .brand-title strong {
        color: #111827;
        font-size: 14px;
        font-weight: 500;
      }
      .brand-title span {
        color: #94a3b8;
        font-size: 12px;
      }
      .sidebar-main {
        display: grid;
        gap: 20px;
      }
      .sidebar-section {
        display: grid;
        gap: 8px;
      }
      .sidebar-label {
        color: #a8b1bd;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.08em;
        margin: 0;
        text-transform: uppercase;
      }
      .sidebar-link {
        align-items: center;
        background: #f8faf7;
        border: 1px solid #edf0e8;
        border-radius: 10px;
        color: #375344;
        display: flex;
        font-size: 13px;
        gap: 8px;
        min-height: 38px;
        padding: 8px 10px;
        text-decoration: none;
      }
      .sidebar-bottom {
        border-top: 1px solid #f0eee7;
        display: grid;
        gap: 10px;
        padding-top: 14px;
      }
      .user-row {
        align-items: center;
        display: grid;
        gap: 8px;
        grid-template-columns: 28px minmax(0, 1fr) 8px;
      }
      .avatar {
        align-items: center;
        background: #eaf3e8;
        border-radius: 999px;
        color: var(--gaia-green);
        display: flex;
        font-size: 12px;
        font-weight: 700;
        height: 28px;
        justify-content: center;
        width: 28px;
      }
      .online-dot {
        background: var(--gaia-teal);
        border-radius: 999px;
        height: 8px;
        width: 8px;
      }
      main {
        background: var(--gaia-bg);
        min-width: 0;
      }
      .topbar {
        align-items: center;
        background: rgba(250, 249, 243, 0.96);
        border-bottom: 1px solid var(--gaia-line);
        display: flex;
        gap: 18px;
        justify-content: space-between;
        min-height: 50px;
        padding: 10px 26px;
        position: sticky;
        top: 0;
        z-index: 10;
      }
      .breadcrumb {
        align-items: center;
        color: #9ca3af;
        display: flex;
        font-size: 12px;
        gap: 8px;
      }
      .breadcrumb strong {
        color: #111827;
        font-weight: 500;
      }
      .status-pill {
        align-items: center;
        background: #eaf3e8;
        border-radius: 999px;
        color: var(--gaia-green);
        display: inline-flex;
        font-size: 12px;
        font-weight: 500;
        gap: 7px;
        padding: 5px 12px;
      }
      .page-body {
        padding: 24px 28px 40px;
      }
      header {
        align-items: flex-start;
        display: flex;
        gap: 14px;
        justify-content: space-between;
        margin-bottom: 16px;
      }
      h1 {
        font-size: 20px;
        font-weight: 500;
        letter-spacing: 0;
        margin: 0;
      }
      h2 {
        font-size: 16px;
        font-weight: 650;
        margin: 0 0 14px;
      }
      h3 {
        font-size: 15px;
        margin: 0 0 10px;
      }
      label {
        color: #374151;
        display: grid;
        font-size: 12px;
        font-weight: 650;
        gap: 7px;
      }
      input, select, textarea {
        background: #ffffff;
        border: 1px solid #e5e1d8;
        border-radius: 8px;
        color: #1f2937;
        font: inherit;
        min-height: 44px;
        outline: none;
        padding: 9px 12px;
        transition: border-color 0.16s ease, box-shadow 0.16s ease;
        width: 100%;
      }
      textarea {
        line-height: 1.45;
        min-height: 96px;
        resize: vertical;
      }
      input:focus, select:focus, textarea:focus {
        border-color: #c8c0ae;
        box-shadow: 0 0 0 3px rgba(29, 78, 53, 0.08);
      }
      input[readonly] {
        background: #f8fafc;
        color: #64748b;
      }
      .sr-only {
        border: 0 !important;
        clip: rect(0 0 0 0) !important;
        height: 1px !important;
        margin: -1px !important;
        overflow: hidden !important;
        padding: 0 !important;
        position: absolute !important;
        white-space: nowrap !important;
        width: 1px !important;
      }
      button {
        border: 0;
        border-radius: 8px;
        cursor: pointer;
        font: inherit;
        font-size: 15px;
        font-weight: 500;
        min-height: 44px;
        padding: 9px 15px;
        transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
      }
      a.button {
        align-items: center;
        background: var(--gaia-green);
        border-radius: 8px;
        color: #ffffff;
        display: inline-flex;
        font-size: 15px;
        font-weight: 700;
        justify-content: center;
        min-height: 44px;
        padding: 9px 15px;
        text-decoration: none;
      }
      a.button:hover { background: var(--gaia-green-dark); }
      a.button.secondary {
        background: #ffffff;
        border: 1px solid #e5e1d8;
        color: #374151;
      }
      a.button.secondary:hover { background: #f8f7f1; }
      button:disabled {
        cursor: not-allowed;
        opacity: 0.55;
      }
      button:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
        outline: 3px solid rgba(29, 78, 53, 0.5);
        outline-offset: 2px;
      }
      .top-actions {
        align-items: end;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(220px, 360px) auto;
      }
      .primary { background: var(--gaia-green); color: #ffffff; }
      .primary:hover { background: var(--gaia-green-dark); }
      .secondary {
        background: #ffffff;
        border: 1px solid #e5e1d8;
        color: #374151;
      }
      .secondary:hover { background: #f8f7f1; }
      .mono {
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
        overflow-wrap: anywhere;
      }
      .danger { background: var(--gaia-danger); color: #ffffff; }
      .danger.secondary {
        background: #fff7f7;
        border: 1px solid #fecaca;
        color: var(--gaia-danger);
      }
      .danger.secondary:hover { background: #fee2e2; }
      .tabs {
        display: grid;
        gap: 14px;
        margin: 0;
      }
      .tab-group {
        display: grid;
        gap: 4px;
      }
      .tab-group + .tab-group {
        border-top: 1px solid #f0eee7;
        padding-top: 12px;
      }
      .tab-group-label {
        color: #9aa5b1;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.07em;
        margin: 0 0 2px;
        padding: 0 9px;
        text-transform: uppercase;
      }
      .tab {
        align-items: center;
        background: transparent;
        border-radius: 8px;
        color: #475569;
        display: flex;
        font-size: 14px;
        gap: 9px;
        justify-content: flex-start;
        min-height: 42px;
        padding: 8px 9px;
        text-align: left;
        text-decoration: none;
        width: 100%;
      }
      .tab:hover { background: #f7f8f4; color: #1f2937; }
      .tab.active {
        background: #eaf3e8;
        box-shadow: inset 3px 0 0 var(--gaia-green);
        color: var(--gaia-green);
      }
      .tab-icon {
        align-items: center;
        background: rgba(29, 78, 53, 0.08);
        border-radius: 8px;
        color: var(--gaia-green);
        display: inline-flex;
        flex: 0 0 26px;
        font-size: 13px;
        height: 26px;
        justify-content: center;
        width: 26px;
      }
      .tab.active .tab-icon {
        background: var(--gaia-green);
        color: #ffffff;
      }
      .view { display: none; }
      .view.active { display: block; }
      .content-stack {
        display: grid;
        gap: 18px;
      }
      .dashboard-stack {
        display: grid;
        gap: 18px;
      }
      .dashboard-grid {
        align-items: start;
        display: grid;
        gap: 18px;
        grid-template-columns: minmax(0, 0.92fr) minmax(430px, 0.58fr);
      }
      .dashboard-side {
        display: grid;
        gap: 14px;
      }
      .hero {
        background: radial-gradient(circle at top left, rgba(212, 231, 220, 0.95), rgba(248, 246, 238, 0.92) 55%, rgba(255, 255, 255, 0.98) 100%);
        border: 1px solid #d8dfd3;
        border-radius: 22px;
        box-shadow: 0 18px 45px rgba(15, 25, 19, 0.08);
        overflow: hidden;
        padding: 22px;
      }
      .hero-grid {
        display: grid;
        gap: 16px;
      }
      .hero-badge {
        align-items: center;
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid rgba(255, 255, 255, 0.85);
        border-radius: 999px;
        color: var(--gaia-green);
        display: inline-flex;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.22em;
        padding: 6px 12px;
        text-transform: uppercase;
      }
      .hero-title {
        color: #183325;
        font-size: 26px;
        font-weight: 650;
        line-height: 1.22;
        margin: 14px 0 0;
        max-width: 820px;
      }
      .hero-copy {
        color: #4b5563;
        font-size: 14px;
        line-height: 1.62;
        margin: 12px 0 0;
        max-width: 760px;
      }
      .hero-actions {
        align-self: start;
        display: grid;
        gap: 12px;
      }
      .notice-card {
        border: 1px solid #e7ece4;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.86);
        color: #4b5563;
        padding: 14px 16px;
      }
      .notice-card h2 {
        margin-bottom: 6px;
      }
      .notice-card.warning {
        background: #fff8e8;
        border-color: #f6d77a;
        color: #7a3e0a;
      }
      .notice-card.info {
        background: #eef8ff;
        border-color: #bae0ff;
        color: #075985;
      }
      .hero-kpis {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 18px;
      }
      .quick-grid {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
      }
      .quick-grid-row {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
      }
      .quick-card {
        background: #fbfcfb;
        border: 1px solid #e6ebe5;
        border-radius: 16px;
        display: grid;
        gap: 10px;
        min-width: 0;
        padding: 14px;
      }
      .quick-card h2 {
        align-items: center;
        display: flex;
        font-size: 14px;
        gap: 8px;
        margin-bottom: 0;
      }
      .quick-card h2::before {
        align-items: center;
        background: #eaf3e8;
        border-radius: 8px;
        color: var(--gaia-green);
        content: "↗";
        display: inline-flex;
        font-size: 12px;
        height: 24px;
        justify-content: center;
        width: 24px;
      }
      .quick-card p {
        color: var(--gaia-muted);
        font-size: 13px;
        line-height: 1.55;
        margin: 0;
      }
      .daily-anomaly-panel {
        background:
          linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 249, 243, 0.96)),
          #ffffff;
      }
      .daily-anomaly-grid {
        display: grid;
        gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 14px;
      }
      .daily-anomaly-card {
        background: #ffffff;
        border: 1px solid #e6ebe5;
        border-radius: 18px;
        box-shadow: 0 12px 28px rgba(31, 41, 55, 0.06);
        display: grid;
        gap: 12px;
        min-height: 210px;
        padding: 15px;
      }
      .daily-anomaly-head {
        align-items: start;
        display: flex;
        gap: 12px;
        justify-content: space-between;
      }
      .daily-anomaly-head div {
        display: grid;
        gap: 3px;
      }
      .daily-anomaly-head span {
        color: #94a3b8;
        font-size: 11px;
        font-weight: 750;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .daily-anomaly-head strong {
        color: #111827;
        font-size: 18px;
        font-weight: 700;
        text-transform: capitalize;
      }
      .daily-anomaly-kpis {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
      .daily-anomaly-kpis div {
        background: #f8faf7;
        border: 1px solid #edf2ea;
        border-radius: 12px;
        display: grid;
        gap: 2px;
        min-height: 66px;
        padding: 10px;
      }
      .daily-anomaly-kpis strong {
        color: var(--gaia-green);
        font-size: 21px;
        line-height: 1;
      }
      .daily-anomaly-kpis span {
        color: #64748b;
        font-size: 11px;
        font-weight: 650;
        line-height: 1.18;
      }
      .daily-anomaly-list {
        display: grid;
        gap: 8px;
      }
      .daily-anomaly-row {
        align-items: center;
        background: #fbfcfb;
        border: 1px solid #eef2ea;
        border-radius: 12px;
        display: flex;
        gap: 10px;
        justify-content: space-between;
        padding: 9px 10px;
      }
      .daily-anomaly-row div {
        display: grid;
        gap: 2px;
        min-width: 0;
      }
      .daily-anomaly-row strong {
        color: #1f2937;
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .daily-anomaly-row span {
        color: #64748b;
        font-size: 12px;
      }
      .summary-grid {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .summary-card {
        background: #fbfcfb;
        border: 1px solid #e6ebe5;
        border-radius: 16px;
        padding: 14px;
      }
      .summary-card > .muted {
        color: #52635a;
      }
      .summary-card strong {
        color: #10251b;
        display: block;
        font-size: 20px;
        margin-top: 6px;
      }
      .apk-card {
        align-items: center;
        background:
          linear-gradient(135deg, rgba(29, 78, 53, 0.08), rgba(255, 255, 255, 0.96) 42%),
          #fbfcfb;
        border: 1px solid #dce8dc;
        border-radius: 20px;
        display: grid;
        gap: 18px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 18px;
      }
      .apk-icon {
        align-items: center;
        background: var(--gaia-green);
        border-radius: 18px;
        box-shadow: 0 14px 30px rgba(29, 78, 53, 0.2);
        color: #ffffff;
        display: grid;
        font-size: 14px;
        font-weight: 900;
        height: 64px;
        justify-content: center;
        letter-spacing: 0.08em;
        width: 64px;
      }
      .apk-main {
        display: grid;
        gap: 12px;
        min-width: 0;
      }
      .apk-heading h3 {
        color: #10251b;
        font-size: 24px;
        line-height: 1.15;
        margin: 2px 0 0;
        overflow-wrap: anywhere;
      }
      .apk-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .apk-badges span {
        background: #eef7ef;
        border: 1px solid #d8ead9;
        border-radius: 999px;
        color: #244b34;
        font-size: 12px;
        font-weight: 800;
        padding: 6px 10px;
      }
      .apk-checksum {
        background: rgba(255, 255, 255, 0.72);
        border: 1px dashed #cbd9c9;
        border-radius: 12px;
        display: grid;
        gap: 4px;
        max-width: 760px;
        padding: 10px 12px;
      }
      .apk-checksum span {
        color: #64748b;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .apk-checksum code {
        color: #334155;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
        font-size: 12px;
        overflow-wrap: anywhere;
      }
      .apk-actions {
        align-items: stretch;
        display: grid;
        gap: 10px;
        min-width: 190px;
      }
      a.button.apk-primary {
        box-shadow: 0 12px 24px rgba(29, 78, 53, 0.18);
        font-size: 16px;
        min-height: 50px;
      }
      .apk-history {
        display: grid;
        gap: 12px;
        margin-top: 18px;
      }
      .section-heading {
        align-items: end;
        display: flex;
        gap: 12px;
        justify-content: space-between;
      }
      .section-heading h3 {
        color: #10251b;
        font-size: 18px;
        margin: 2px 0 0;
      }
      .table-scroll {
        overflow-x: auto;
      }
      .apk-history table {
        min-width: 880px;
      }
      .apk-history-actions {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .apk-history-actions .button,
      .apk-history-actions button {
        font-size: 12px;
        min-height: 34px;
        padding: 6px 10px;
      }
      .readable-list {
        display: grid;
        gap: 10px;
      }
      .readable-row {
        align-items: flex-start;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid #eee9de;
        border-radius: 14px;
        display: grid;
        gap: 12px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 12px;
      }
      .actionable-row { cursor: pointer; }
      .actionable-row:hover { border-color: #cbd9c9; box-shadow: 0 8px 22px rgba(39, 45, 38, 0.08); }
      .readable-row h3 {
        margin-bottom: 4px;
      }
      .event-card {
        background: #ffffff;
        border: 1px solid #eee9de;
        border-radius: 16px;
        display: grid;
        gap: 10px;
        padding: 14px;
      }
      .event-title {
        display: grid;
        gap: 3px;
      }
      .event-details {
        border-top: 1px solid #f0ece3;
        padding-top: 8px;
      }
      .event-details summary {
        color: var(--gaia-green);
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
      }
      .event-details pre {
        margin-top: 8px;
      }
      .activity-toolbar {
        align-items: end;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(240px, 1.4fr) repeat(2, minmax(150px, 0.7fr));
        margin-bottom: 14px;
      }
      .daily-toolbar {
        align-items: end;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(470px, 0.78fr) minmax(360px, 1fr);
        margin: 16px 0 16px;
      }
      .daily-gaia-actions {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
      }
      .daily-gaia-filter-block {
        margin: 10px 0;
      }
      .daily-gaia-filter-block > p {
        color: #94a3b8;
        font-size: 11px;
        font-weight: 850;
        letter-spacing: 0.10em;
        margin: 0 0 7px;
        text-transform: uppercase;
      }
      .daily-month-control {
        align-items: end;
        display: grid;
        gap: 8px;
        grid-template-columns: 42px minmax(150px, 1fr) 42px;
      }
      .daily-month-control button {
        min-height: 42px;
        padding-left: 0;
        padding-right: 0;
      }
      .daily-filter {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 8px;
      }
      .daily-filter-chip {
        background: #f6f7fb;
        border: 1px solid transparent;
        border-radius: 999px;
        color: #334155;
        cursor: pointer;
        font-size: 12px;
        font-weight: 650;
        min-height: 24px;
        padding: 5px 13px;
      }
      .daily-filter-chip.active {
        background: #111827;
        border-color: #111827;
        color: #ffffff;
      }
      .daily-filter-chip-muted {
        margin-left: auto;
      }
      .daily-gaia-summary {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
        margin: 0 0 12px;
      }
      .daily-gaia-summary-title {
        display: grid;
        gap: 3px;
        margin-right: 8px;
      }
      .daily-gaia-summary-title span {
        color: #94a3b8;
        font-size: 11px;
        font-weight: 850;
        letter-spacing: 0.10em;
        text-transform: uppercase;
      }
      .daily-gaia-summary-title small {
        color: #64748b;
        font-size: 11px;
      }
      .daily-gaia-summary-pill {
        background: #f6f7fb;
        border: 1px solid transparent;
        border-radius: 999px;
        box-shadow: none;
        display: inline-flex;
        min-height: 0;
        padding: 7px 12px;
      }
      .daily-gaia-summary-pill span {
        color: #94a3b8;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
      }
      .daily-gaia-summary-pill strong {
        color: #111827;
        font-size: 12px;
      }
      .daily-gaia-summary-pill.emerald { background: #ecfdf5; border-color: #a7f3d0; }
      .daily-gaia-summary-pill.emerald strong { color: #047857; }
      .daily-gaia-summary-pill.amber { background: #fffbeb; border-color: #fde68a; }
      .daily-gaia-summary-pill.amber strong { color: #b45309; }
      .daily-gaia-summary-pill.violet { background: #faf5ff; border-color: #ddd6fe; }
      .daily-gaia-summary-pill.violet strong { color: #6d28d9; }
      .daily-gaia-summary-pill.red { background: #fef2f2; border-color: #fecaca; }
      .daily-gaia-summary-pill.red strong { color: #b91c1c; }
      .daily-gaia-warning {
        background: #fff7ed;
        border: 1px solid #fed7aa;
        border-radius: 12px;
        color: #9a3412;
        display: grid;
        gap: 4px;
        flex-basis: 100%;
        padding: 12px 14px;
      }
      .daily-gaia-warning strong {
        font-size: 13px;
      }
      .daily-gaia-warning span {
        font-size: 12px;
      }
      .feed-stats {
        align-items: center;
        background: #f8faf7;
        border: 1px solid #e6ebe5;
        border-radius: 12px;
        color: #64748b;
        display: flex;
        flex-wrap: wrap;
        font-size: 13px;
        gap: 10px 16px;
        margin-bottom: 14px;
        padding: 10px 14px;
      }
      .feed-stats strong {
        color: #111827;
        font-weight: 650;
      }
      .meter-toolbar,
      .plant-toolbar {
        align-items: end;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(240px, 1fr) auto;
        margin-bottom: 14px;
      }
      .teti-plants-panel {
        background:
          radial-gradient(circle at top right, rgba(29, 158, 117, 0.10), transparent 32%),
          linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,251,247,0.96));
        border-color: #dfe9da;
      }
      .teti-plants-hero {
        align-items: center;
        background: linear-gradient(135deg, #ffffff 0%, #f3f8f1 100%);
        border: 1px solid #e1ecdc;
        border-radius: 18px;
        margin-bottom: 14px;
        padding: 16px 18px;
      }
      .teti-plants-hero h2 {
        font-size: 24px;
        margin-bottom: 4px;
      }
      .teti-plants-panel #teti-plant-summary {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
      }
      .teti-plants-panel .summary-card {
        background: rgba(255,255,255,0.86);
        border-color: #e0eadc;
        box-shadow: 0 10px 24px rgba(29, 78, 53, 0.06);
      }
      .plant-toolbar {
        background: rgba(255,255,255,0.82);
        border: 1px solid #e4eadf;
        border-radius: 16px;
        padding: 12px;
      }
      .plant-filter-bar {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 10px 14px;
        justify-content: space-between;
        margin-bottom: 14px;
      }
      .plant-filter {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .plant-filter-chip {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        color: #64748b;
        cursor: pointer;
        font-size: 13px;
        font-weight: 650;
        min-height: 34px;
        padding: 7px 13px;
      }
      .plant-filter-chip span {
        background: #eef2ef;
        border-radius: 999px;
        display: inline-block;
        font-size: 11px;
        margin-left: 4px;
        min-width: 22px;
        padding: 1px 6px;
        text-align: center;
      }
      .plant-filter-chip.active {
        background: var(--gaia-green);
        border-color: var(--gaia-green);
        color: #ffffff;
      }
      .plant-filter-chip.active span {
        background: rgba(255, 255, 255, 0.22);
        color: #ffffff;
      }
      .meter-shell,
      .plant-shell {
        display: grid;
        gap: 14px;
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
      }
      .plant-shell {
        align-items: start;
        grid-template-columns: minmax(320px, 0.38fr) minmax(0, 1.62fr);
        margin-top: 12px;
      }
      .meter-map {
        background: #eef7ed;
        border: 1px solid #d7e7d2;
        border-radius: 18px;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
        min-height: 430px;
        overflow: hidden;
        position: relative;
      }
      .meter-map .leaflet-container {
        background: #eef7ed;
        font-family: inherit;
        height: 100%;
        min-height: 430px;
        width: 100%;
      }
      .meter-map .leaflet-control-attribution {
        font-size: 10px;
      }
      .meter-map .leaflet-popup-content {
        color: #1f2937;
        font-size: 12px;
        margin: 10px 12px;
      }
      .meter-map .leaflet-popup-content strong {
        color: #183325;
        display: block;
        font-size: 13px;
        margin-bottom: 2px;
      }
      .meter-marker-wrap {
        background: transparent;
        border: 0;
      }
      .meter-map-empty {
        align-items: center;
        color: #4b5563;
        display: grid;
        inset: 0;
        justify-items: center;
        padding: 24px;
        position: absolute;
        text-align: center;
      }
      .meter-map-empty strong {
        color: #183325;
        display: block;
        font-size: 18px;
        margin-bottom: 6px;
      }
      .meter-marker-icon {
        align-items: center;
        background: var(--gaia-green);
        border: 2px solid #ffffff;
        border-radius: 999px;
        box-shadow: 0 10px 22px rgba(29, 78, 53, 0.28);
        color: #ffffff;
        display: flex;
        font-size: 11px;
        font-weight: 800;
        height: 30px;
        justify-content: center;
        min-height: 0;
        padding: 0;
        pointer-events: auto;
        width: 30px;
        z-index: 2;
      }
      .meter-marker-icon::after {
        border: 1px solid rgba(29, 78, 53, 0.22);
        border-radius: 999px;
        content: "";
        height: 42px;
        left: 50%;
        position: absolute;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 42px;
      }
      .meter-marker-icon:hover,
      .meter-marker-icon.selected {
        background: #163d29;
        box-shadow: 0 14px 28px rgba(29, 78, 53, 0.34);
      }
      .meter-cluster-icon {
        align-items: center;
        background: rgba(29, 78, 53, 0.96);
        border: 3px solid #ffffff;
        border-radius: 999px;
        box-shadow: 0 14px 34px rgba(29, 78, 53, 0.32);
        color: #ffffff;
        display: flex;
        font-size: 12px;
        font-weight: 800;
        height: 38px;
        justify-content: center;
        width: 38px;
      }
      .meter-cluster-icon::after {
        border: 10px solid rgba(29, 78, 53, 0.16);
        border-radius: 999px;
        content: "";
        height: 54px;
        left: 50%;
        position: absolute;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 54px;
      }
      .meter-side,
      .plant-side {
        display: grid;
        gap: 12px;
      }
      .meter-detail,
      .plant-detail {
        background: #fbfcfb;
        border: 1px solid #dfe9da;
        border-radius: 16px;
        display: grid;
        gap: 10px;
        padding: 14px;
      }
      .plant-detail {
        background: transparent;
        border: 0;
        gap: 16px;
        min-width: 0;
        padding: 0;
      }
      .meter-detail h3,
      .plant-detail h3 {
        color: #183325;
        margin: 0;
      }
      .meter-detail-grid,
      .plant-detail-grid {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .meter-kv,
      .plant-kv {
        background: #ffffff;
        border: 1px solid #edf0e8;
        border-radius: 10px;
        display: grid;
        gap: 3px;
        padding: 9px 10px;
      }
      .meter-kv span,
      .plant-kv span {
        color: #7a8591;
        font-size: 10px;
        font-weight: 750;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .meter-kv strong,
      .plant-kv strong {
        color: #1f2937;
        font-size: 12px;
        font-weight: 650;
        overflow-wrap: anywhere;
      }
      .meter-list,
      .plant-list {
        display: grid;
        gap: 8px;
        max-height: 360px;
        overflow: auto;
        padding-right: 4px;
      }
      .plant-shell > .plant-list {
        background: rgba(255,255,255,0.92);
        border: 1px solid #e1eadc;
        border-radius: 18px;
        box-shadow: 0 18px 34px rgba(29, 78, 53, 0.07);
        max-height: min(78vh, 820px);
        padding: 10px;
        position: sticky;
        top: 18px;
      }
      .meter-row,
      .plant-row {
        align-items: center;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
        border: 1px solid #e6efe2;
        border-left: 4px solid transparent;
        border-radius: 14px;
        color: #1f2937;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 76px;
        padding: 12px 12px;
        text-align: left;
        width: 100%;
      }
      .meter-row:hover,
      .meter-row.selected,
      .plant-row:hover,
      .plant-row.selected {
        background: #f4fbf2;
        border-color: #b7d5ae;
        border-left-color: var(--gaia-green);
        box-shadow: 0 12px 24px rgba(29, 78, 53, 0.08);
      }
      .meter-row strong,
      .plant-row strong {
        display: block;
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .meter-row span,
      .plant-row span {
        color: #6b7280;
        display: block;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .plant-row .plant-row-meta {
        color: #94a39b;
        font-size: 11px;
      }
      #teti-plant-list .plant-row strong {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-height: 1.3;
        white-space: normal;
      }
      .plant-row .plant-row-side {
        display: grid;
        gap: 4px;
        justify-items: end;
        overflow: visible;
        white-space: normal;
      }
      .plant-row .plant-row-side .badge {
        display: inline-flex;
        overflow: visible;
        white-space: nowrap;
      }
      .plant-detail-head {
        background:
          radial-gradient(circle at right top, rgba(255,255,255,0.18), transparent 32%),
          linear-gradient(135deg, #183325 0%, #1d4e35 58%, #236241 100%);
        border: 1px solid rgba(29, 78, 53, 0.18);
        border-radius: 20px;
        box-shadow: 0 18px 40px rgba(24, 51, 37, 0.16);
        color: #ffffff;
        display: grid;
        gap: 6px;
        padding: 18px;
      }
      .plant-detail-head h3 {
        color: #ffffff;
        font-size: 22px;
      }
      .plant-detail-head .muted {
        color: rgba(255,255,255,0.78);
      }
      .plant-status-row {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 2px;
      }
      .plant-detail-empty {
        align-items: center;
        background: #fbfcfb;
        border: 1px dashed #d7ddd2;
        border-radius: 12px;
        color: #6b7280;
        display: grid;
        min-height: 180px;
        padding: 18px;
        text-align: center;
      }
      .plant-detail-empty strong {
        color: #374151;
        display: block;
        margin-bottom: 4px;
      }
      .plant-detail-empty span {
        font-size: 13px;
      }
      .plant-related {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        margin-top: 4px;
      }
      .plant-section {
        background: rgba(255,255,255,0.94);
        border: 1px solid #e2ecde;
        border-radius: 16px;
        box-shadow: 0 12px 26px rgba(29, 78, 53, 0.05);
        display: grid;
        gap: 10px;
        min-width: 0;
        padding: 12px;
      }
      .plant-section h3 {
        align-items: center;
        display: flex;
        font-size: 13px;
        gap: 8px;
        margin: 0;
      }
      .plant-section-count {
        background: #eef2ef;
        border-radius: 999px;
        color: #52635a;
        font-size: 11px;
        font-weight: 700;
        min-width: 22px;
        padding: 2px 7px;
        text-align: center;
      }
      .plant-section-list {
        display: grid;
        gap: 8px;
        max-height: 280px;
        overflow: auto;
        padding-right: 2px;
      }
      .plant-section-more {
        font-size: 12px;
      }
      .plant-item {
        align-items: center;
        background: #fbfcfb;
        border: 1px solid #edf0e8;
        border-radius: 12px;
        color: #1f2937;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 9px 11px;
        text-align: left;
        text-decoration: none;
      }
      .plant-item strong {
        display: block;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .plant-item > span > span {
        color: #6b7280;
        display: block;
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .plant-item-link:hover {
        background: #f8fbf7;
        border-color: #b7cdb1;
      }
      .plant-item-empty {
        border: 1px dashed #e0e5dd;
        border-radius: 12px;
        color: #6b7280;
        font-size: 12px;
        padding: 14px 12px;
        text-align: center;
      }
      .teti-pid-block {
        background:
          linear-gradient(180deg, #f7faf6 0%, #ffffff 100%);
        border: 1px solid #dce9d6;
        border-radius: 22px;
        box-shadow: 0 18px 40px rgba(29, 78, 53, 0.08);
        display: grid;
        gap: 14px;
        margin-top: 14px;
        padding: 16px;
      }
      .teti-pid-head {
        align-items: start;
        display: flex;
        flex-wrap: wrap;
        gap: 12px 18px;
        justify-content: space-between;
      }
      .teti-pid-head h3 {
        color: #183325;
        font-size: 18px;
        margin: 0;
      }
      .teti-pid-head p {
        color: #68756d;
        font-size: 13px;
        margin: 5px 0 0;
      }
      .teti-pid-head-side {
        align-items: flex-end;
        display: grid;
        gap: 8px;
        justify-items: end;
      }
      .teti-pid-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
      }
      .teti-pid-legend span {
        align-items: center;
        background: #ffffff;
        border: 1px solid #e1eadc;
        border-radius: 999px;
        color: #52635a;
        display: inline-flex;
        font-size: 11px;
        font-weight: 700;
        gap: 6px;
        min-height: 26px;
        padding: 3px 9px;
      }
      .teti-pid-legend i {
        border-radius: 999px;
        display: inline-block;
        height: 9px;
        width: 9px;
      }
      .legend-pipe { background: #e6be65; }
      .legend-valve { background: #8cc7e7; }
      .legend-pump { background: #79c49b; }
      }
      .teti-pid-shell {
        display: grid;
        gap: 12px;
        grid-template-columns: minmax(0, 1fr) 340px;
      }
      .teti-pid-canvas-wrap,
      .teti-pid-inspector {
        background: #ffffff;
        border: 1px solid #dfead9;
        border-radius: 18px;
        padding: 12px;
      }
      .teti-pid-canvas-wrap {
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.72);
        overflow: auto;
      }
      .teti-pid-canvas {
        background:
          linear-gradient(rgba(24, 51, 37, 0.042) 1px, transparent 1px),
          linear-gradient(90deg, rgba(24, 51, 37, 0.042) 1px, transparent 1px),
          radial-gradient(circle at 15% 18%, rgba(29, 158, 117, 0.07), transparent 28%),
          linear-gradient(180deg, rgba(248, 250, 247, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
        background-size: 44px 44px, 44px 44px, auto, auto;
        border: 1px solid #c7dbc2;
        border-radius: 16px;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.75);
        min-height: 620px;
        min-width: 980px;
        overflow: hidden;
        position: relative;
        width: 100%;
      }
      .teti-pid-pipes {
        height: 100%;
        inset: 0;
        pointer-events: none;
        position: absolute;
        width: 100%;
      }
      .teti-pid-pipes line {
        stroke: rgba(22, 61, 41, 0.46);
        stroke-linecap: round;
        stroke-width: 3.4;
      }
      .teti-pid-device {
        align-items: flex-start;
        background: rgba(255,255,255,0.96);
        border: 1px solid #c7dbc2;
        border-top: 4px solid #96bd8f;
        border-radius: 16px;
        box-shadow: 0 10px 22px rgba(29, 78, 53, 0.11);
        color: #183325;
        display: grid;
        gap: 4px;
        min-height: 72px;
        padding: 11px 12px;
        position: absolute;
        text-align: left;
        transform: translate(-50%, -50%);
        width: 160px;
        z-index: 2;
      }
      .teti-pid-device:hover,
      .teti-pid-device.selected {
        background: #f1fbef;
        border-color: #1d9e75;
        box-shadow: 0 16px 34px rgba(29, 78, 53, 0.22);
        z-index: 3;
      }
      .teti-pid-device-pipe {
        background: #fff8e8;
        border-color: #e6be65;
        border-top-color: #d19a24;
      }
      .teti-pid-device-valve {
        background: #eef8ff;
        border-color: #8cc7e7;
        border-top-color: #2292c4;
      }
      .teti-pid-device-pump,
      .teti-pid-device-pompa {
        background: #f0fbf5;
        border-color: #79c49b;
        border-top-color: #23965b;
      }
      .teti-pid-device strong {
        color: #183325;
        display: block;
        font-size: 13px;
        line-height: 1.35;
        white-space: normal;
      }
      .teti-pid-device span {
        color: #6b7280;
        display: block;
        font-size: 10px;
        line-height: 1.35;
        white-space: normal;
      }
      .teti-pid-device em {
        color: var(--gaia-green);
        font-size: 10px;
        font-style: normal;
        font-weight: 800;
      }
      .teti-pid-inspector {
        align-content: start;
        display: grid;
        gap: 12px;
        max-height: min(70vh, 720px);
        overflow: auto;
        position: sticky;
        top: 18px;
      }
      .teti-pid-inspector > .row:first-child {
        background: #f4fbf2;
        border: 1px solid #dcebd7;
        border-radius: 14px;
        padding: 10px 12px;
      }
      .teti-pid-doc-list {
        display: grid;
        gap: 8px;
      }
      .teti-pid-doc-row {
        align-items: center;
        background: #fbfcfb;
        border: 1px solid #edf0e8;
        border-radius: 12px;
        color: #1f2937;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 56px;
        padding: 10px 12px;
        text-align: left;
        text-decoration: none;
        width: 100%;
      }
      .teti-pid-doc-row:hover {
        background: #f8fbf7;
        border-color: #b7cdb1;
      }
      .teti-pid-doc-row strong {
        display: block;
        font-size: 12px;
      }
      .teti-pid-doc-row span {
        color: #6b7280;
        display: block;
        font-size: 11px;
      }
      .teti-pid-empty {
        align-items: center;
        background: #fbfcfb;
        border: 1px dashed #d7ddd2;
        border-radius: 12px;
        color: #6b7280;
        display: grid;
        min-height: 180px;
        padding: 18px;
        text-align: center;
      }
      .connector-panel {
        display: grid;
        gap: 12px;
      }
      .connector-header {
        align-items: start;
        display: flex;
        flex-wrap: wrap;
        gap: 10px 14px;
        justify-content: space-between;
      }
      .connector-header h3 {
        font-size: 15px;
        margin: 0;
      }
      .connector-header p {
        margin: 4px 0 0;
      }
      .connector-domain-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .connector-domain-pill {
        align-items: center;
        background: #f2f7ef;
        border: 1px solid #d7e5d3;
        border-radius: 999px;
        color: #1d4e35;
        display: inline-flex;
        font-size: 11px;
        font-weight: 700;
        min-height: 28px;
        padding: 0 10px;
      }
      .connector-section {
        display: grid;
        gap: 8px;
      }
      .connector-section h4 {
        color: #355345;
        font-size: 12px;
        margin: 0;
        text-transform: uppercase;
      }
      .connector-kpis {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      }
      .connector-kpi {
        background: #fbfcfb;
        border: 1px solid #edf0e8;
        border-radius: 12px;
        min-height: 72px;
        padding: 10px 12px;
      }
      .connector-kpi span {
        color: #6b7280;
        display: block;
        font-size: 11px;
      }
      .connector-kpi strong {
        color: #183325;
        display: block;
        font-size: 24px;
        line-height: 1.1;
        margin-top: 6px;
      }
      .connector-status-grid {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      }
      .connector-status-card {
        background: #fbfcfb;
        border: 1px solid #edf0e8;
        border-radius: 12px;
        display: grid;
        gap: 8px;
        min-height: 88px;
        padding: 12px;
      }
      .connector-status-card.ok {
        background: #f7fbf6;
        border-color: #d7e5d3;
      }
      .connector-status-card.warn {
        background: #fffaf0;
        border-color: #f2d58a;
      }
      .connector-status-card.critical {
        background: #fff6f5;
        border-color: #f5c2bf;
      }
      .connector-status-card .muted {
        margin: 0;
      }
      .connector-status-line {
        align-items: center;
        display: flex;
        gap: 8px;
        justify-content: space-between;
      }
      .activity-feed {
        display: grid;
        gap: 12px;
      }
      .activity-card {
        background: #ffffff;
        border: 1px solid #eee9de;
        border-radius: 16px;
        display: grid;
        gap: 12px;
        padding: 16px;
        transition: border-color 0.16s ease, box-shadow 0.16s ease;
      }
      .activity-card:hover {
        border-color: #d6e4d4;
        box-shadow: 0 10px 28px rgba(29, 78, 53, 0.06);
      }
      .presenze-check-chip {
        align-items: center;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        color: #475569;
        display: inline-flex;
        font-size: 13px;
        font-weight: 700;
        gap: 8px;
        min-height: 34px;
        padding: 7px 13px;
      }
      .presenze-analysis-layout {
        display: grid;
        gap: 16px;
        grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
        margin-top: 14px;
      }
      .presenze-record-list,
      .presenze-detail-panel,
      .presenze-team-list,
      .presenze-team-detail {
        background: #ffffff;
        border: 1px solid #eee9de;
        border-radius: 22px;
        box-shadow: 0 14px 36px rgba(17, 24, 39, 0.05);
        min-width: 0;
        overflow: hidden;
      }
      .presenze-panel-head {
        align-items: center;
        border-bottom: 1px solid #f0ece3;
        display: flex;
        gap: 12px;
        justify-content: space-between;
        padding: 14px 16px;
      }
      .presenze-table-wrap {
        max-height: calc(100vh - 360px);
        overflow: auto;
      }
      .presenze-analysis-table {
        min-width: 760px;
      }
      .presenze-analysis-table td strong,
      .presenze-analysis-table td span {
        display: block;
      }
      .presenze-analysis-table td span {
        color: #94a3b8;
        font-size: 12px;
        margin-top: 2px;
      }
      .presenze-anomaly-row {
        cursor: pointer;
      }
      .presenze-anomaly-row.selected td {
        background: #ecfdf5;
      }
      .presenze-detail-panel {
        align-self: start;
        max-height: calc(100vh - 260px);
        overflow: auto;
        padding: 16px;
        position: sticky;
        top: 16px;
      }
      .presenze-detail-stack {
        display: grid;
        gap: 14px;
      }
      .presenze-detail-stack h3 {
        color: #111827;
        font-size: 20px;
        margin: 4px 0 0;
      }
      .presenze-detail-section {
        background: #fbfaf5;
        border: 1px solid #f0ece3;
        border-radius: 16px;
        display: grid;
        gap: 8px;
        padding: 12px;
      }
      .presenze-month-jump {
        align-items: center;
        background: #ffffff;
        border: 1px solid #f2dfb6;
        border-radius: 999px;
        color: #92400e;
        cursor: pointer;
        display: inline-flex;
        font-size: 12px;
        font-weight: 750;
        padding: 7px 11px;
      }
      .presenze-team-hero {
        background: linear-gradient(135deg, #ecfdf5, #ffffff 58%, #fbfaf5);
        border: 1px solid #d1fae5;
        border-radius: 28px;
        display: grid;
        gap: 18px;
        grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
        margin: 14px 0;
        padding: 18px;
      }
      .presenze-team-hero h3 {
        color: #0f172a;
        font-size: 24px;
        margin: 6px 0;
      }
      .presenze-team-kpis {
        background: rgba(255, 255, 255, 0.78);
        border: 1px solid rgba(255, 255, 255, 0.9);
        border-radius: 20px;
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 12px;
        text-align: center;
      }
      .presenze-team-kpis strong {
        color: #0f172a;
        display: block;
        font-size: 24px;
      }
      .presenze-team-kpis span {
        color: #64748b;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }
      .presenze-team-create-form {
        background: rgba(255, 255, 255, 0.86);
        border: 1px solid #d1fae5;
        border-radius: 22px;
        box-shadow: 0 14px 32px rgba(16, 185, 129, 0.08);
        display: grid;
        gap: 12px;
        grid-template-columns: 1fr;
        margin: 0 0 14px;
        padding: 14px;
      }
      .presenze-team-create-copy {
        display: grid;
        gap: 4px;
      }
      .presenze-team-create-copy strong {
        color: #0f172a;
        font-size: 16px;
      }
      .presenze-team-create-copy span {
        color: #64748b;
        font-size: 13px;
      }
      .presenze-team-create-main {
        align-items: end;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(220px, 1fr) auto;
      }
      .presenze-team-create-form label {
        color: #475569;
        display: grid;
        font-size: 12px;
        font-weight: 800;
        gap: 6px;
        letter-spacing: 0.02em;
      }
      .presenze-team-create-form input {
        background: #ffffff;
        border: 1px solid #dbe7de;
        border-radius: 14px;
        color: #111827;
        font-size: 14px;
        padding: 10px 12px;
      }
      .presenze-team-create-form p {
        margin: 0;
      }
      .presenze-team-create-options {
        border-top: 1px solid #e2efe5;
        padding-top: 10px;
      }
      .presenze-team-create-options summary {
        color: #166534;
        cursor: pointer;
        font-size: 12px;
        font-weight: 850;
      }
      .presenze-team-create-options label {
        margin-top: 10px;
        max-width: 260px;
      }
      .presenze-team-wizard-cta {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
      }
      .presenze-team-wizard-cta span {
        color: #166534;
        font-size: 12px;
        font-weight: 750;
      }
      .modal.presenze-team-wizard-modal {
        max-height: min(94vh, 1080px);
        max-width: 1360px;
        overflow: auto;
        padding: 24px;
        width: min(1360px, calc(100vw - 32px));
      }
      .presenze-team-wizard-board {
        display: grid;
        gap: 16px;
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
        min-height: 420px;
      }
      .presenze-team-wizard-dropzones {
        display: grid;
        gap: 14px;
        grid-template-rows: 1fr 1fr;
        min-height: 420px;
      }
      .presenze-team-wizard-dropzone {
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        border: 2px dashed #cbd5e1;
        border-radius: 22px;
        display: grid;
        gap: 12px;
        min-height: 180px;
        padding: 16px;
        transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
      }
      .presenze-team-wizard-dropzone.drag-over {
        background: #ecfdf5;
        border-color: #16a34a;
        box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.18);
      }
      .presenze-team-wizard-operator.draggable {
        cursor: grab;
      }
      .presenze-team-wizard-operator.dragging {
        opacity: 0.55;
      }
      .presenze-team-wizard-operator .operator-option-foot {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
      }
      .presenze-team-wizard-operator .secondary.compact {
        min-height: 32px;
        padding: 6px 10px;
      }
      .presenze-team-wizard-head {
        align-items: flex-start;
        background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 52%, #f8fafc 100%);
        border: 1px solid #d1fae5;
        border-radius: 20px;
        display: flex;
        gap: 16px;
        justify-content: space-between;
        padding: 16px;
      }
      .presenze-team-wizard-head h2 {
        color: #0f172a;
        margin-bottom: 4px;
      }
      .presenze-team-wizard-progress {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        list-style: none;
        margin: 0;
        padding: 0;
      }
      .presenze-team-wizard-progress li {
        align-items: center;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 999px;
        color: #64748b;
        display: flex;
        gap: 8px;
        padding: 8px 10px;
      }
      .presenze-team-wizard-progress li span {
        align-items: center;
        background: #e2e8f0;
        border-radius: 999px;
        color: #334155;
        display: inline-flex;
        font-size: 12px;
        font-weight: 850;
        height: 24px;
        justify-content: center;
        width: 24px;
      }
      .presenze-team-wizard-progress li strong {
        font-size: 12px;
      }
      .presenze-team-wizard-progress li.active {
        background: #ecfdf5;
        border-color: #86efac;
        color: #166534;
      }
      .presenze-team-wizard-progress li.active span,
      .presenze-team-wizard-progress li.done span {
        background: #16a34a;
        color: #ffffff;
      }
      .presenze-team-wizard-panel {
        display: grid;
        gap: 16px;
      }
      .presenze-team-wizard-grid,
      .presenze-team-wizard-assignment-grid,
      .presenze-team-wizard-summary {
        display: grid;
        gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .presenze-team-wizard-assignment {
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        border: 1px solid #dbe7df;
        border-radius: 22px;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
        display: grid;
        gap: 12px;
        padding: 16px;
      }
      .presenze-team-wizard-assignment-head {
        display: grid;
        gap: 2px;
      }
      .presenze-team-wizard-assignment-head strong {
        color: #0f172a;
        font-size: 15px;
      }
      .presenze-team-wizard-assignment-head span {
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
      }
      .presenze-team-wizard-current {
        background: #f8fbf8;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        display: grid;
        gap: 5px;
        padding: 10px;
      }
      .presenze-team-wizard-current strong {
        color: #0f172a;
      }
      .presenze-team-wizard-current span,
      .presenze-team-wizard-current em {
        color: #64748b;
        font-size: 12px;
      }
      .presenze-team-wizard-advice,
      .presenze-team-wizard-warning {
        border-radius: 14px;
        font-size: 13px;
        font-weight: 750;
        padding: 10px 12px;
      }
      .presenze-team-wizard-advice {
        background: #ecfdf5;
        border: 1px solid #bbf7d0;
        color: #166534;
      }
      .presenze-team-wizard-warning {
        background: #fffbeb;
        border: 1px solid #fde68a;
        color: #92400e;
      }
      .presenze-team-wizard-summary div,
      .presenze-team-wizard-actions-list div {
        background: #ffffff;
        border: 1px solid #edf1f5;
        border-radius: 14px;
        display: grid;
        gap: 4px;
        padding: 12px;
      }
      .presenze-team-wizard-summary span,
      .presenze-team-wizard-actions-list span {
        color: #64748b;
        font-size: 12px;
      }
      .presenze-team-wizard-summary strong,
      .presenze-team-wizard-actions-list strong {
        color: #0f172a;
      }
      .presenze-team-wizard-actions-list {
        display: grid;
        gap: 10px;
      }
      .presenze-team-wizard-picker {
        background: #ffffff;
        border: 1px solid #e2efe5;
        border-radius: 18px;
        display: grid;
        gap: 12px;
        padding: 12px;
      }
      .presenze-team-wizard-picker-summary {
        align-items: center;
        display: flex;
        gap: 10px;
        justify-content: space-between;
      }
      .presenze-team-wizard-picker-summary strong {
        color: #166534;
        font-size: 13px;
      }
      .presenze-team-wizard-picker-summary span {
        color: #64748b;
        font-size: 12px;
        font-weight: 750;
      }
      .presenze-team-wizard-selected-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .presenze-team-wizard-empty-choice {
        background: #f8fafc;
        border: 1px dashed #cbd5e1;
        border-radius: 12px;
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
        padding: 10px 12px;
        width: 100%;
      }
      .presenze-team-wizard-chip {
        align-items: center;
        background: #ecfdf5;
        border: 1px solid #bbf7d0;
        border-radius: 999px;
        color: #14532d;
        display: inline-flex;
        gap: 9px;
        padding: 7px 9px 7px 12px;
        text-align: left;
        width: auto;
      }
      .presenze-team-wizard-chip span {
        display: grid;
        gap: 1px;
      }
      .presenze-team-wizard-chip strong {
        font-size: 12px;
        line-height: 1.2;
      }
      .presenze-team-wizard-chip small {
        color: #166534;
        font-size: 11px;
        max-width: 210px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .presenze-team-wizard-chip em {
        align-items: center;
        background: #ffffff;
        border-radius: 999px;
        display: inline-flex;
        font-style: normal;
        font-weight: 900;
        height: 22px;
        justify-content: center;
        width: 22px;
      }
      .presenze-team-wizard-operator-list {
        display: grid;
        gap: 10px;
        max-height: min(48vh, 520px);
        overflow: auto;
        padding-right: 2px;
      }
      .presenze-team-wizard-operator {
        background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
        border: 1px solid #ece7dc;
        border-radius: 16px;
        color: inherit;
        display: grid;
        gap: 9px;
        min-height: 88px;
        padding: 14px;
        text-align: left;
        width: 100%;
      }
      .presenze-team-wizard-operator:hover {
        border-color: #bbf7d0;
        box-shadow: 0 10px 24px rgba(22, 101, 52, 0.08);
        transform: translateY(-1px);
      }
      .presenze-team-wizard-operator.selected {
        background: #ecfdf5;
        border-color: #86efac;
        box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.1);
      }
      .presenze-team-wizard-operator.disabled-operator {
        background: #f8fafc;
        border-color: #e2e8f0;
        cursor: not-allowed;
        opacity: 0.64;
      }
      .presenze-team-wizard-review-grid {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .presenze-team-wizard-review-block {
        background: #ffffff;
        border: 1px solid #d1fae5;
        border-radius: 16px;
        display: grid;
        gap: 8px;
        padding: 12px;
      }
      .presenze-team-wizard-review-block > strong {
        color: #166534;
      }
      .presenze-team-wizard-review-block span {
        align-items: center;
        background: #f8fafc;
        border-radius: 12px;
        color: #0f172a;
        display: flex;
        flex-wrap: wrap;
        font-size: 13px;
        font-weight: 800;
        gap: 6px;
        padding: 8px 10px;
      }
      .presenze-team-wizard-review-block small {
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
      }
      .presenze-team-wizard-actions {
        border-top: 1px solid #e2e8f0;
        padding-top: 12px;
      }
      .presenze-team-layout {
        display: grid;
        gap: 16px;
        grid-template-columns: 340px minmax(0, 1fr);
        margin-top: 14px;
      }
      .presenze-team-list {
        align-self: start;
        display: grid;
        gap: 10px;
        max-height: calc(100vh - 320px);
        overflow: auto;
        padding: 14px;
      }
      .presenze-team-card {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 18px;
        cursor: pointer;
        display: grid;
        gap: 5px;
        padding: 14px;
        text-align: left;
        transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
      }
      .presenze-team-card:hover,
      .presenze-team-card.selected {
        border-color: #34d399;
        box-shadow: 0 12px 28px rgba(16, 185, 129, 0.12);
        transform: translateY(-1px);
      }
      .presenze-team-card strong {
        color: #0f172a;
        font-size: 15px;
      }
      .presenze-team-card span,
      .presenze-team-card small {
        color: #64748b;
        font-size: 12px;
      }
      .presenze-team-detail {
        padding: 18px;
      }
      .presenze-team-columns {
        display: grid;
        gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .presenze-person-row {
        background: #ffffff;
        border: 1px solid #edf1f5;
        border-radius: 12px;
        display: grid;
        gap: 3px;
        padding: 10px;
      }
      .presenze-person-row strong {
        color: #111827;
      }
      .presenze-person-row span {
        color: #64748b;
        font-size: 12px;
      }
      .activity-card.has-problems {
        border-color: #f3d9a6;
        box-shadow: inset 3px 0 0 #b7791f;
      }
      .activity-card-head {
        align-items: flex-start;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
      }
      .activity-card-title {
        display: grid;
        gap: 4px;
      }
      .activity-card-title strong {
        color: #111827;
        font-size: 16px;
        font-weight: 650;
      }
      .activity-card-badges {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }
      .activity-card-meta {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .meta-chip {
        align-items: center;
        background: #f6f4ec;
        border: 1px solid #ece7dc;
        border-radius: 999px;
        color: #374151;
        display: inline-flex;
        font-size: 12px;
        gap: 6px;
        padding: 5px 10px;
      }
      .meta-chip strong {
        color: #111827;
        font-weight: 650;
      }
      .id-chip {
        background: #f8faf7;
        border: 1px dashed #d8d0c0;
        border-radius: 999px;
        color: #6b7280;
        cursor: help;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
        font-size: 11px;
        padding: 4px 8px;
      }
      .domain-chip {
        background: var(--gaia-green-soft);
        border: 1px solid #d6ead1;
        border-radius: 999px;
        color: var(--gaia-green);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.04em;
        padding: 4px 8px;
      }
      .user-admin-shell {
        align-items: start;
        display: grid;
        gap: 14px;
        grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr);
      }
      .operator-list-panel {
        order: 1;
      }
      .operator-editor-panel {
        max-height: calc(100vh - 118px);
        order: 2;
        overflow: auto;
        position: sticky;
        top: 86px;
      }
      .selected-operator-summary {
        align-items: center;
        background: linear-gradient(135deg, #eef8ee, #ffffff);
        border: 1px solid #d9ead7;
        border-radius: 16px;
        display: grid;
        gap: 12px;
        grid-template-columns: auto minmax(0, 1fr);
        margin: 12px 0;
        padding: 12px;
      }
      .selected-operator-summary.empty {
        background: #f8faf7;
        border-style: dashed;
      }
      .selected-operator-summary strong {
        color: #102a1e;
        display: block;
        font-size: 14px;
        margin-bottom: 2px;
      }
      .selected-operator-avatar {
        align-items: center;
        background: var(--gaia-green);
        border-radius: 14px;
        color: #ffffff;
        display: inline-flex;
        font-size: 18px;
        font-weight: 800;
        height: 44px;
        justify-content: center;
        width: 44px;
      }
      .selected-operator-avatar.small {
        border-radius: 12px;
        font-size: 14px;
        height: 34px;
        width: 34px;
      }
      .operator-status-alert {
        border-radius: 14px;
        font-size: 13px;
        line-height: 1.45;
        margin: -2px 0 12px;
        padding: 12px 14px;
      }
      .operator-status-alert strong {
        display: block;
        font-weight: 800;
        margin-bottom: 2px;
      }
      .operator-status-alert.empty {
        background: #f8faf7;
        border: 1px dashed #d8d0c0;
        color: #64748b;
      }
      .operator-status-alert.active {
        background: #ecfdf5;
        border: 1px solid #bbf7d0;
        color: #166534;
      }
      .operator-status-alert.disabled {
        background: #fff7ed;
        border: 1px solid #fed7aa;
        color: #9a3412;
      }
      .user-admin-form {
        align-content: start;
        display: grid;
        gap: 10px;
      }
      .form-section {
        background: #ffffff;
        border: 1px solid #eee9de;
        border-radius: 14px;
        display: grid;
        gap: 10px;
        padding: 0;
      }
      .form-section summary {
        align-items: center;
        color: #111827;
        cursor: pointer;
        display: flex;
        font-size: 13px;
        font-weight: 750;
        justify-content: space-between;
        list-style: none;
        padding: 12px 14px;
      }
      .form-section summary::-webkit-details-marker {
        display: none;
      }
      .form-section summary::after {
        color: #7a8a78;
        content: "Apri";
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .form-section[open] summary {
        border-bottom: 1px solid #f0eadf;
      }
      .form-section[open] summary::after {
        content: "Chiudi";
      }
      .form-section-grid,
      .form-section > label,
      .form-section > .domain-choice-row,
      .form-section > .console-page-fieldset {
        margin: 0 12px 12px;
      }
      .form-section-grid {
        display: grid;
        gap: 10px;
      }
      .sticky-form-actions {
        background: rgba(255, 255, 255, 0.92);
        border-top: 1px solid #f0eadf;
        bottom: 0;
        margin: 4px -2px 0;
        padding-top: 10px;
        position: sticky;
      }
      .domain-choice-row.compact {
        gap: 8px;
      }
      .inline-check {
        align-items: center;
        display: flex;
        flex-direction: row;
        gap: 8px;
      }
      .inline-check input {
        width: auto;
      }
      .field-hint {
        color: #64748b;
        display: block;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.35;
        margin-top: 4px;
      }
      .console-page-fieldset {
        border: 1px solid #eee9de;
        border-radius: 14px;
        display: grid;
        gap: 8px;
        margin: 0;
        padding: 12px;
      }
      .console-page-fieldset legend {
        color: #111827;
        font-size: 13px;
        font-weight: 650;
        padding: 0 6px;
      }
      .console-page-grid {
        display: grid;
        gap: 10px;
      }
      .console-page-group {
        display: grid;
        gap: 6px;
      }
      .console-page-group strong {
        color: #64748b;
        font-size: 11px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .console-page-choice {
        align-items: center;
        display: flex;
        flex-direction: row;
        font-size: 13px;
        gap: 8px;
      }
      .console-page-choice input {
        width: auto;
      }
      .user-toolbar {
        align-items: end;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.35fr);
        margin-bottom: 14px;
      }
      .user-list {
        display: grid;
        gap: 10px;
      }
      .user-domain-section {
        display: grid;
        gap: 10px;
      }
      .user-domain-header {
        align-items: center;
        display: flex;
        gap: 8px;
        justify-content: space-between;
      }
      .user-domain-header h3 {
        color: #111827;
        font-size: 15px;
        font-weight: 650;
        margin: 0;
      }
      .user-card {
        align-items: start;
        background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
        border: 1px solid #eee9de;
        border-radius: 18px;
        display: grid;
        gap: 14px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 16px;
        transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
      }
      .user-card:hover {
        border-color: #cbdcc6;
        box-shadow: 0 12px 26px rgba(35, 72, 48, 0.08);
        transform: translateY(-1px);
      }
      .user-card.selected {
        border-color: #b7cdb1;
        box-shadow: inset 4px 0 0 var(--gaia-green), 0 14px 30px rgba(35, 72, 48, 0.10);
      }
      .user-card-main {
        display: grid;
        gap: 10px;
      }
      .user-card-head {
        align-items: center;
        display: flex;
        gap: 10px;
      }
      .user-card-title {
        display: grid;
        gap: 4px;
      }
      .user-card-title strong {
        color: #111827;
        font-size: 15px;
        font-weight: 650;
      }
      .user-card-meta {
        color: #6b7280;
        display: flex;
        flex-wrap: wrap;
        font-size: 12px;
        gap: 7px 12px;
      }
      .user-card-meta.compact span {
        background: #ffffff;
        border: 1px solid #edf1ea;
        border-radius: 999px;
        padding: 5px 9px;
      }
      .user-card-meta.compact strong {
        color: #374151;
        font-weight: 750;
      }
      .user-card-actions {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
      }
      .attachment-grid {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      }
      .attachment-tile {
        background: #fbfcfb;
        border: 1px solid #e6ebe5;
        border-radius: 12px;
        display: grid;
        gap: 6px;
        padding: 12px;
      }
      .attachment-tile.has-problems {
        border-color: #f3c4c4;
        box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.08);
      }
      .attachment-icon {
        align-items: center;
        background: #eef7ed;
        border-radius: 8px;
        color: var(--gaia-green);
        display: inline-flex;
        font-size: 11px;
        font-weight: 800;
        height: 28px;
        justify-content: center;
        letter-spacing: 0.06em;
        width: 44px;
      }
      .attachment-tile.video .attachment-icon { background: #eef4ff; color: #1d4ed8; }
      .attachment-tile.pdf .attachment-icon { background: #fff5df; color: #b7791f; }
      .attachment-tile.file .attachment-icon { background: #f3f4f6; color: #4b5563; }
      .attachment-preview-trigger {
        align-items: center;
        background: #ffffff;
        border: 1px solid #dfe7dd;
        border-radius: 8px;
        color: #1f2937;
        display: grid;
        gap: 8px;
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 48px;
        padding: 6px;
        text-align: left;
        width: 100%;
      }
      .attachment-preview-trigger:hover {
        border-color: #b7cdb1;
        background: #f8fbf7;
      }
      .attachment-thumb {
        align-items: center;
        background: #eef7ed;
        border-radius: 7px;
        display: flex;
        height: 42px;
        justify-content: center;
        overflow: hidden;
        position: relative;
        width: 48px;
      }
      .attachment-thumb img {
        display: none;
        height: 100%;
        object-fit: cover;
        width: 100%;
      }
      .attachment-preview-trigger.loaded .attachment-thumb img { display: block; }
      .attachment-preview-trigger.loaded .attachment-thumb .attachment-icon { display: none; }
      .attachment-preview-trigger.preview-error { border-color: #f3c4c4; }
      .attachment-preview-name {
        display: grid;
        gap: 2px;
        min-width: 0;
      }
      .attachment-preview-name strong,
      .attachment-preview-name span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .attachment-preview-name strong {
        color: #111827;
        font-size: 12px;
        font-weight: 650;
      }
      .attachment-preview-name span {
        color: #6b7280;
        font-size: 11px;
      }
      .activity-timeline {
        color: #6b7280;
        display: flex;
        flex-wrap: wrap;
        font-size: 12px;
        gap: 8px 14px;
      }
      .activity-timeline span::before {
        color: #cbd5e1;
        content: "•";
        margin-right: 8px;
      }
      .activity-timeline span:first-child::before { content: none; margin: 0; }
      .activity-details {
        border-top: 1px solid #f0ece3;
        padding-top: 8px;
      }
      .activity-details summary {
        color: var(--gaia-green);
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
      }
      .activity-details-grid {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        margin-top: 10px;
      }
      .activity-detail-item {
        background: #f8faf7;
        border: 1px solid #ece7dc;
        border-radius: 10px;
        display: grid;
        gap: 4px;
        padding: 10px 12px;
      }
      .activity-detail-item span {
        color: #6b7280;
        font-size: 11px;
        font-weight: 650;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .activity-detail-item strong {
        color: #1f2937;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
        font-size: 12px;
        font-weight: 500;
        overflow-wrap: anywhere;
      }
      .log-summary-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .log-chip {
        background: #f3f4f6;
        border-radius: 999px;
        color: #4b5563;
        font-size: 12px;
        font-weight: 600;
        padding: 4px 10px;
      }
      .log-chip.error { background: #fef2f2; color: #b42318; }
      .log-chip.warn { background: #fff5df; color: #b7791f; }
      .log-chip.info { background: #eef7ed; color: var(--gaia-green); }
      .log-stream {
        display: grid;
        gap: 8px;
        max-height: 320px;
        overflow: auto;
        padding-right: 4px;
      }
      .log-line {
        align-items: start;
        background: #fbfcfb;
        border: 1px solid #ece7dc;
        border-left: 3px solid #cbd5e1;
        border-radius: 10px;
        display: grid;
        gap: 4px 10px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 10px 12px;
      }
      .log-line.error { border-left-color: #b42318; background: #fffafa; }
      .log-line.warn { border-left-color: #b7791f; background: #fffdf7; }
      .log-line.info { border-left-color: var(--gaia-teal); }
      .log-line.debug { border-left-color: #94a3b8; }
      .log-level {
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .log-area {
        color: #6b7280;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-transform: uppercase;
      }
      .log-message {
        color: #1f2937;
        font-size: 13px;
        grid-column: 1 / -1;
        line-height: 1.45;
      }
      .log-time {
        color: #9ca3af;
        font-size: 11px;
        white-space: nowrap;
      }
      .empty-feed {
        align-items: center;
        background: linear-gradient(180deg, #ffffff 0%, #fbfaf5 100%);
        border: 1px dashed #ddd5c5;
        border-radius: 16px;
        color: #6b7280;
        display: grid;
        gap: 6px;
        justify-items: center;
        padding: 28px 18px;
        text-align: center;
      }
      .empty-feed strong {
        color: #374151;
        font-size: 15px;
      }
      .activity-table {
        border-collapse: separate;
        border-spacing: 0 6px;
        width: 100%;
      }
      .daily-matrix-shell {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 18px;
        max-height: calc(100vh - 190px);
        min-height: 260px;
        overflow: auto;
        position: relative;
      }
      .daily-matrix {
        border-collapse: separate;
        border-spacing: 0;
        min-width: 980px;
        width: 100%;
      }
      .daily-matrix th,
      .daily-matrix td {
        background: #ffffff;
        border-bottom: 1px solid #eef2f7;
        border-right: 1px solid #eef2f7;
        padding: 10px 8px;
        text-align: center;
        vertical-align: middle;
      }
      .daily-matrix thead th {
        background: #f8fafc;
        color: #64748b;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.03em;
        position: sticky;
        text-transform: uppercase;
        top: 0;
        z-index: 5;
      }
      .daily-matrix thead th span,
      .daily-matrix thead th strong {
        display: block;
      }
      .daily-matrix thead th strong {
        color: #111827;
        font-size: 18px;
        letter-spacing: 0;
        margin-top: 2px;
      }
      .daily-day-badges {
        display: grid;
        gap: 3px;
        justify-items: center;
        margin-top: 6px;
        min-height: 38px;
      }
      .daily-day-badges em {
        border-radius: 999px;
        font-size: 10px;
        font-style: normal;
        font-weight: 800;
        line-height: 1;
        min-width: 56px;
        padding: 4px 7px;
        text-transform: none;
      }
      .daily-day-badges .anomaly {
        background: #fff1f2;
        border: 1px solid #fecdd3;
        color: #dc2626;
      }
      .daily-day-badges .requests {
        background: #eff6ff;
        border: 1px solid #bae6fd;
        color: #0284c7;
      }
      .daily-matrix .weekend {
        background: #f8fafc;
      }
      .daily-person-col {
        left: 0;
        min-width: 256px;
        position: sticky;
        text-align: left !important;
        width: 256px;
        z-index: 6;
      }
      .daily-matrix tbody .daily-person-col {
        background: #ffffff;
        z-index: 4;
      }
      .daily-section-row th {
        background: linear-gradient(90deg, #eef6ff, #f8fbff);
        border-bottom: 1px solid #bfdbfe;
        border-top: 1px solid #bfdbfe;
        color: #1e3a8a;
        font-size: 12px;
        letter-spacing: 0.06em;
        padding: 10px 14px !important;
        position: sticky;
        left: 0;
        text-align: left !important;
        text-transform: uppercase;
        z-index: 7;
      }
      .daily-section-row span {
        font-weight: 900;
      }
      .daily-section-row small {
        color: #64748b;
        font-size: 11px;
        font-weight: 750;
        letter-spacing: 0;
        margin-left: 10px;
        text-transform: none;
      }
      .daily-supervisor-row .daily-person-col,
      .daily-supervisor-row td {
        background: #fbfdff;
      }
      .daily-person {
        background: transparent;
        border: 0;
        display: grid;
        gap: 5px;
        padding: 0;
        text-align: left;
        width: 100%;
      }
      .daily-person.gaia-like {
        position: relative;
      }
      .daily-person-supervisor strong {
        color: #0f172a;
      }
      .daily-person .daily-person-role {
        background: #dbeafe;
        border: 1px solid #93c5fd;
        border-radius: 999px;
        color: #1d4ed8;
        display: inline-flex;
        font-size: 11px;
        font-weight: 850;
        justify-self: flex-start;
        padding: 3px 8px;
      }
      .daily-person strong {
        color: #111827;
        font-size: 15px;
        font-weight: 850;
      }
      .daily-person span {
        color: #64748b;
        font-size: 12px;
        font-weight: 650;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .daily-person em {
        background: #eaf2ff;
        border-radius: 999px;
        color: #2563eb;
        display: inline-flex;
        font-size: 11px;
        font-style: normal;
        font-weight: 750;
        justify-self: flex-start;
        padding: 4px 8px;
      }
      .daily-person small {
        background: #f1f5f9;
        border-radius: 6px;
        color: #475569;
        font-size: 11px;
        font-weight: 800;
        justify-self: flex-start;
        padding: 4px 8px;
      }
      .daily-person-alert {
        background: #fee2e2;
        border-radius: 6px;
        color: #dc2626;
        font-size: 11px;
        font-weight: 850;
        padding: 4px 7px;
        position: absolute;
        right: 0;
        top: 48px;
      }
      .daily-person-breakdown {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        display: grid;
        margin-top: 4px;
        overflow: hidden;
      }
      .daily-person-breakdown span {
        align-items: center;
        display: grid;
        grid-template-columns: 1fr auto;
        min-width: 0;
      }
      .daily-person-breakdown span + span {
        border-top: 1px solid #e2e8f0;
      }
      .daily-person-breakdown i,
      .daily-person-breakdown strong {
        font-size: 10px;
        padding: 5px 7px;
      }
      .daily-person-breakdown i {
        color: #0f766e;
        font-style: normal;
        font-weight: 700;
      }
      .daily-person-breakdown strong {
        color: #0f766e;
        font-weight: 850;
      }
      .daily-cell-wrap {
        min-width: 80px;
        width: 80px;
      }
      .daily-cell {
        align-items: center;
        border: 1px solid transparent;
        border-radius: 12px;
        cursor: pointer;
        display: grid;
        gap: 2px;
        height: 66px;
        justify-items: center;
        margin: 0 auto;
        padding: 6px;
        width: 68px;
      }
      .daily-cell strong {
        font-size: 16px;
        line-height: 1.05;
      }
      .daily-cell span {
        font-size: 10px;
        font-weight: 700;
        line-height: 1.05;
        min-height: 12px;
      }
      .daily-cell.sent,
      .daily-cell.worked {
        background: #ecfdf5;
        border-color: #d1fae5;
        color: #047857;
      }
      .daily-cell.pending {
        background: #f0f9ff;
        border-color: #bae6fd;
        color: #075985;
      }
      .daily-cell.analysis {
        background: #fffbeb;
        border-color: #fde68a;
        color: #92400e;
      }
      .daily-cell.problem,
      .daily-cell.anomaly {
        background: #fef2f2;
        border-color: #fecaca;
        color: #b91c1c;
      }
      .daily-cell.special {
        background: #f5f3ff;
        border-color: #ddd6fe;
        color: #6d28d9;
      }
      .daily-cell.ferie {
        background: #ecfeff;
        border-color: #67e8f9;
        color: #0f766e;
      }
      .daily-cell.permesso,
      .daily-cell.absence {
        background: #f0f9ff;
        border-color: #bae6fd;
        color: #0369a1;
      }
      .daily-cell.malattia {
        background: #f3f4f6;
        border-color: #e5e7eb;
        color: #374151;
      }
      .daily-cell.rest {
        background: #f9fafb;
        border-color: #f3f4f6;
        color: #d1d5db;
      }
      .daily-cell.empty {
        cursor: default;
        height: 38px;
        opacity: 0.72;
        width: 38px;
      }

      .daily-cell:focus,
      .daily-cell:hover {
        box-shadow: 0 0 0 3px rgba(29, 78, 53, 0.12);
        outline: none;
      }
      .daily-total-col {
        min-width: 116px;
        position: sticky;
        right: 0;
        width: 116px;
        z-index: 4;
      }
      .daily-matrix thead .daily-total-col {
        z-index: 6;
      }
      .daily-row-total {
        display: grid;
        gap: 2px;
      }
      .daily-row-total strong {
        color: #111827;
        font-size: 18px;
      }
      .daily-row-total span {
        color: #64748b;
        font-size: 11px;
      }
      .daily-detail {
        background: #ffffff;
        border: 1px solid #e6ebe5;
        border-radius: 18px;
        box-shadow: var(--gaia-shadow);
        display: grid;
        gap: 12px;
        margin-top: 14px;
        padding: 14px;
      }
      .daily-detail-head {
        align-items: center;
        border-bottom: 1px solid #f0ece3;
        display: flex;
        gap: 12px;
        justify-content: space-between;
        padding-bottom: 12px;
      }
      .daily-detail-head div {
        display: grid;
        gap: 2px;
      }
      .daily-detail-head strong {
        color: #111827;
        font-size: 16px;
      }
      .daily-detail-head span {
        color: #64748b;
        font-size: 13px;
      }
      .daily-detail-card {
        display: grid;
        gap: 10px;
      }
      .daily-gaia-anomaly-panel {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        display: block;
        margin: 8px 0 14px;
        padding: 0;
      }
      .daily-gaia-legend {
        align-items: center;
        border-top: 1px solid #eef2f7;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding-top: 14px;
      }
      .daily-gaia-legend span {
        align-items: center;
        color: #64748b;
        display: inline-flex;
        font-size: 12px;
        font-weight: 650;
        gap: 6px;
      }
      .daily-gaia-legend i {
        border-radius: 4px;
        display: inline-block;
        height: 12px;
        width: 12px;
      }
      .daily-gaia-legend .worked { background: #dcfce7; border: 1px solid #86efac; }
      .daily-gaia-legend .absence { background: #e0f2fe; border: 1px solid #bae6fd; }
      .daily-gaia-legend .special { background: #ede9fe; border: 1px solid #c4b5fd; }
      .daily-gaia-legend .anomaly { background: #fee2e2; border: 1px solid #fecaca; }
      .daily-gaia-legend .extra {
        background: transparent;
        border: 0;
        height: 0;
        width: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: 10px solid #059669;
        border-radius: 0;
      }
      .daily-gaia-legend .km { background: #fee2e2; border: 1px solid #fca5a5; }
      .daily-gaia-legend .trasferta { background: #dbeafe; border: 1px solid #93c5fd; }
      .daily-gaia-legend button {
        background: #eff6ff;
        border: 1px solid #bae6fd;
        border-radius: 999px;
        color: #0369a1;
        cursor: pointer;
        font-size: 12px;
        font-weight: 750;
        padding: 6px 12px;
      }
      .daily-gaia-anomaly-head {
        align-items: flex-start;
        display: flex;
        gap: 12px;
        justify-content: space-between;
      }
      .daily-gaia-kpis {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
      .daily-gaia-kpis div {
        background: #ffffff;
        border: 1px solid #f0ece3;
        border-radius: 16px;
        display: grid;
        gap: 3px;
        padding: 12px;
      }
      .daily-gaia-kpis span {
        color: #94a3b8;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
      }
      .daily-gaia-kpis strong {
        color: #111827;
        font-size: 26px;
      }
      .daily-gaia-kpis small {
        color: #64748b;
        font-size: 12px;
      }
      .daily-gaia-rules,
      .daily-gaia-controls {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .daily-gaia-rules span {
        align-items: center;
        background: #ffffff;
        border: 1px solid #eef0ea;
        border-radius: 999px;
        color: #475569;
        display: inline-flex;
        font-size: 12px;
        font-weight: 650;
        gap: 7px;
        padding: 7px 10px;
      }
      .daily-gaia-rules i {
        border-radius: 999px;
        display: inline-block;
        height: 9px;
        width: 9px;
      }
      .daily-gaia-rules i.ok { background: #22c55e; }
      .daily-gaia-rules i.analysis { background: #f59e0b; }
      .daily-gaia-rules i.critical { background: #ef4444; }
      .daily-gaia-controls span {
        color: #94a3b8;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
      }
      .daily-anomaly-filter,
      .daily-anomaly-group {
        background: #ffffff;
        border: 1px solid #e7e2d8;
        border-radius: 999px;
        color: #475569;
        cursor: pointer;
        font-size: 12px;
        font-weight: 750;
        padding: 7px 11px;
      }
      .daily-anomaly-filter.active,
      .daily-anomaly-group.active {
        background: #172033;
        border-color: #172033;
        color: #ffffff;
      }
      .daily-gaia-groups {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .daily-gaia-group {
        background: #ffffff;
        border: 1px solid #f0ece3;
        border-radius: 18px;
        display: grid;
        gap: 8px;
        padding: 12px;
      }
      .daily-gaia-group-head {
        display: grid;
        gap: 2px;
      }
      .daily-gaia-group-head strong {
        color: #111827;
        font-size: 14px;
      }
      .daily-gaia-group-head span {
        color: #64748b;
        font-size: 12px;
      }
      .daily-gaia-anomaly-row {
        background: #fbfaf5;
        border: 1px solid #f0ece3;
        border-radius: 14px;
        cursor: pointer;
        display: grid;
        gap: 5px;
        padding: 10px;
        text-align: left;
      }
      .daily-gaia-anomaly-row:hover,
      .daily-gaia-anomaly-row:focus {
        border-color: #d9b56d;
        box-shadow: 0 0 0 3px rgba(217, 181, 109, 0.14);
        outline: none;
      }
      .daily-gaia-anomaly-row > span {
        color: #111827;
        font-size: 13px;
        font-weight: 750;
      }
      .daily-gaia-anomaly-row small {
        color: #64748b;
        font-size: 12px;
        line-height: 1.35;
      }
      .modal.daily-report-modal {
        max-height: min(90vh, 980px);
        max-width: 1180px;
        overflow: auto;
        width: min(calc(100vw - 48px), 1180px);
      }
      .daily-report-modal #daily-report-modal-body {
        display: grid;
        gap: 12px;
      }
      .daily-modal-anomaly {
        border-radius: 14px;
        display: grid;
        gap: 4px;
        padding: 10px 12px;
      }
      .daily-modal-anomaly strong {
        font-size: 13px;
      }
      .daily-modal-anomaly span {
        font-size: 13px;
        line-height: 1.4;
      }
      .daily-modal-anomaly.anomaly {
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #991b1b;
      }
      .daily-modal-anomaly.analysis {
        background: #fffbeb;
        border: 1px solid #fde68a;
        color: #92400e;
      }
      .daily-modal-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .daily-modal-nav-row {
        display: flex;
        gap: 10px;
        justify-content: space-between;
      }
      .daily-modal-nav {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        color: #374151;
        cursor: pointer;
        font-size: 13px;
        font-weight: 700;
        padding: 9px 14px;
      }
      .daily-modal-nav:disabled {
        cursor: not-allowed;
        opacity: 0.35;
      }
      .daily-modal-grid {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
      .daily-modal-pill {
        background: #f8fafc;
        border: 1px solid #edf1f5;
        border-radius: 14px;
        display: grid;
        gap: 3px;
        padding: 10px;
      }
      .daily-modal-pill span {
        color: #94a3b8;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }
      .daily-modal-pill strong {
        color: #111827;
        font-size: 13px;
        text-transform: capitalize;
      }
      .daily-modal-pill.anomaly { background: #fef2f2; border-color: #fecaca; }
      .daily-modal-pill.anomaly strong { color: #b91c1c; }
      .daily-modal-pill.analysis { background: #fffbeb; border-color: #fde68a; }
      .daily-modal-pill.analysis strong { color: #92400e; }
      .daily-modal-pill.worked { background: #ecfdf5; border-color: #d1fae5; }
      .daily-modal-pill.worked strong { color: #047857; }
      .daily-modal-pill.absence, .daily-modal-pill.permesso { background: #f0f9ff; border-color: #bae6fd; }
      .daily-modal-pill.ferie { background: #f0fdfa; border-color: #99f6e4; }
      .daily-modal-pill.km { background: #fffbeb; border-color: #fde68a; }
      .daily-modal-pill.trasferta { background: #faf5ff; border-color: #ddd6fe; }
      .daily-modal-pill.reperibilita { background: #fff7ed; border-color: #fed7aa; }
      .daily-modal-section {
        display: grid;
        gap: 8px;
      }
      .daily-modal-punches {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .daily-modal-punches span {
        align-items: center;
        background: #fbfaf5;
        border: 1px solid #f0ece3;
        border-radius: 999px;
        color: #374151;
        display: inline-flex;
        gap: 6px;
        padding: 7px 10px;
      }
      .daily-modal-punches em {
        color: #9ca3af;
        font-style: normal;
      }
      .daily-modal-punches small {
        color: #94a3b8;
      }
      .daily-modal-note {
        background: #fbfaf5;
        border: 1px solid #f0ece3;
        border-radius: 12px;
        color: #475569;
        font-size: 13px;
        line-height: 1.45;
        margin: 0;
        padding: 10px;
      }
      .activity-table thead th {
        border-bottom: 0;
        color: #9ca3af;
        font-size: 11px;
        font-weight: 650;
        letter-spacing: 0.04em;
        padding: 0 10px 8px;
        text-transform: uppercase;
        vertical-align: bottom;
      }
      .activity-row td {
        background: #ffffff;
        border-bottom: 1px solid #eee9de;
        border-top: 1px solid #eee9de;
        cursor: pointer;
        font-size: 13px;
        padding: 12px 10px;
        vertical-align: middle;
      }
      .activity-row td:first-child {
        border-left: 1px solid #eee9de;
        border-radius: 12px 0 0 12px;
        width: 28px;
      }
      .activity-row td:last-child {
        border-radius: 0 12px 12px 0;
        border-right: 1px solid #eee9de;
      }
      .activity-row:hover td,
      .activity-row.open td {
        background: #fbfdf9;
        border-color: #d6e4d4;
      }
      .activity-row.has-problems td:first-child {
        box-shadow: inset 3px 0 0 #b7791f;
      }
      .activity-row .chevron {
        color: #94a3b8;
        display: inline-block;
        font-size: 11px;
        transition: transform 0.15s ease;
      }
      .activity-row.open .chevron {
        color: var(--gaia-green);
        transform: rotate(90deg);
      }
      .activity-row-title {
        display: grid;
        gap: 2px;
      }
      .activity-row-title strong {
        color: #111827;
        font-size: 14px;
        font-weight: 650;
      }
      .activity-row-sub {
        color: #9ca3af;
        font-size: 12px;
      }
      .activity-row-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
      }
      .activity-detail-row td {
        background: transparent;
        border: 0;
        padding: 0 0 8px 28px;
      }
      .activity-detail-panel {
        background: #fbfcfb;
        border: 1px solid #e6ebe5;
        border-radius: 14px;
        display: grid;
        gap: 14px;
        padding: 14px;
      }
      .activity-detail-section h4 {
        color: #374151;
        font-size: 12px;
        font-weight: 650;
        letter-spacing: 0.04em;
        margin: 0 0 8px;
        text-transform: uppercase;
      }
      .activity-detail-grid {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      }
      .activity-kv {
        background: #ffffff;
        border: 1px solid #ece7dc;
        border-radius: 10px;
        display: grid;
        gap: 4px;
        min-height: 58px;
        padding: 9px 10px;
      }
      .activity-kv span {
        color: #9ca3af;
        font-size: 11px;
        font-weight: 650;
        letter-spacing: 0.03em;
        text-transform: uppercase;
      }
      .activity-kv strong {
        color: #1f2937;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.4;
        overflow-wrap: anywhere;
      }
      .activity-kv.wide {
        grid-column: 1 / -1;
      }
      .gps-link {
        color: var(--gaia-green);
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
      }
      .gps-link:hover {
        text-decoration: underline;
      }
      .attachment-mini-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }
      .attachment-mini {
        align-items: center;
        background: #ffffff;
        border: 1px solid #ece7dc;
        border-radius: 999px;
        color: #374151;
        display: inline-flex;
        font-size: 12px;
        gap: 6px;
        padding: 4px 9px;
      }
      .attachment-mini.attachment-preview-trigger {
        border-radius: 999px;
        display: inline-grid;
        grid-template-columns: 30px minmax(64px, 150px);
        min-height: 36px;
        padding: 3px 8px 3px 3px;
        width: auto;
      }
      .attachment-mini .attachment-thumb {
        border-radius: 999px;
        height: 28px;
        width: 30px;
      }
      .attachment-mini .attachment-icon {
        border-radius: 999px;
        font-size: 9px;
        height: 28px;
        width: 30px;
      }
      .panel {
        background: var(--gaia-panel);
        border: 1px solid #f3f0e8;
        border-radius: 12px;
        box-shadow: 0 12px 32px rgba(15, 25, 19, 0.05);
        padding: 18px;
      }
      .grid {
        display: grid;
        gap: 14px;
      }
      .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .metric {
        background: rgba(255, 255, 255, 0.82);
        border: 1px solid rgba(255, 255, 255, 0.72);
        border-radius: 16px;
        flex: 1 1 200px;
        min-width: 180px;
        padding: 12px 15px;
      }
      .metric strong {
        display: block;
        font-size: 18px;
        font-weight: 650;
        margin-top: 6px;
      }
      .metric .payload, .metric pre {
        margin-top: 8px;
      }
      .toolbar {
        align-items: end;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(220px, 1fr) 190px;
        margin-bottom: 14px;
      }
      .muted {
        color: var(--gaia-muted);
        font-size: 13px;
        margin: 0;
      }
      .section-title {
        color: #374151;
        font-size: 14px;
        font-weight: 500;
      }
      .badge {
        border-radius: 999px;
        display: inline-flex;
        font-size: 12px;
        font-weight: 600;
        padding: 4px 9px;
      }
      .badge.ok { background: var(--gaia-green-soft); color: var(--gaia-green); }
      .badge.warn { background: #fff5df; color: var(--gaia-warning); }
      .badge.critical { background: #fef2f2; color: #b42318; }
      .badge.info { background: #eef4fb; color: #1d5b96; }
      .badge.neutral { background: #f1f3f2; color: #52635a; }
      .device-code {
        background: #eef7ed;
        border: 1px solid #d6ead1;
        border-radius: 8px;
        color: var(--gaia-green);
        display: inline-flex;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
        font-size: 18px;
        font-weight: 800;
        letter-spacing: 0.02em;
        margin: 6px 0;
        padding: 6px 9px;
      }
      .technical-id {
        overflow-wrap: anywhere;
      }
      .domain-controls {
        display: grid;
        gap: 8px;
      }
      .domain-controls label {
        align-items: center;
        background: #f8faf7;
        border: 1px solid #e6ebe5;
        border-radius: 8px;
        color: #374151;
        display: inline-flex;
        font-size: 13px;
        font-weight: 700;
        gap: 7px;
        padding: 7px 9px;
        width: fit-content;
      }
      .domain-controls input {
        margin: 0;
        min-height: auto;
        width: auto;
      }
      .device-control-actions {
        align-items: stretch;
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(2, minmax(86px, 1fr));
        max-width: 270px;
      }
      .device-action {
        align-items: center;
        background: #ffffff;
        border: 1px solid #e6ebe5;
        border-radius: 10px;
        color: #244336;
        display: inline-flex;
        font-size: 13px;
        font-weight: 750;
        justify-content: center;
        min-height: 34px;
        padding: 7px 10px;
        white-space: nowrap;
      }
      .device-action:hover:not(:disabled) {
        background: #f4faf3;
        border-color: #bfd6b8;
      }
      .device-action.primary-action {
        background: var(--gaia-green);
        border-color: var(--gaia-green);
        color: #ffffff;
        grid-column: 1 / -1;
      }
      .device-action.primary-action:hover:not(:disabled) {
        background: #163d29;
      }
      .device-action.danger-action {
        background: #fff7f7;
        border-color: #f5c2c7;
        color: #b42318;
      }
      .device-action.danger-action:hover:not(:disabled) {
        background: #fee2e2;
        border-color: #f0a3a8;
      }
      .enrollment-domain-preview {
        background: #f8faf7;
        border: 1px solid #e6ebe5;
        border-radius: 8px;
        display: grid;
        gap: 8px;
        padding: 12px;
      }
      .enrollment-domain-preview strong {
        color: #111827;
        font-size: 13px;
      }
      .domain-pill-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .domain-pill {
        background: var(--gaia-green-soft);
        border: 1px solid #d6ead1;
        border-radius: 999px;
        color: var(--gaia-green);
        display: inline-flex;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.03em;
        padding: 5px 10px;
      }
      .domain-pill.empty {
        background: #fff5df;
        border-color: #f6d9a6;
        color: var(--gaia-warning);
      }
      .domain-choice-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .domain-choice {
        align-items: center;
        background: #ffffff;
        border: 1px solid #e6ebe5;
        border-radius: 999px;
        color: #374151;
        cursor: pointer;
        display: inline-flex;
        font-size: 12px;
        font-weight: 800;
        gap: 7px;
        letter-spacing: 0.03em;
        padding: 7px 11px;
        width: auto;
      }
      .domain-choice:has(input:checked) {
        background: var(--gaia-green-soft);
        border-color: #b9dfb2;
        color: var(--gaia-green);
      }
      .domain-choice input {
        accent-color: var(--gaia-green);
        margin: 0;
        min-height: auto;
        width: auto;
      }
      .operator-picker {
        position: relative;
      }
      .operator-picker-trigger {
        align-items: center;
        background:
          linear-gradient(180deg, #ffffff 0%, #fbfaf5 100%);
        border: 1px solid #e5e1d8;
        border-radius: 12px;
        color: #1f2937;
        display: grid;
        gap: 4px;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 54px;
        padding: 10px 12px;
        text-align: left;
        width: 100%;
      }
      .operator-picker-trigger:hover {
        background: linear-gradient(180deg, #ffffff 0%, #f7f5ef 100%);
        border-color: #d8d0c0;
      }
      .operator-picker.open .operator-picker-trigger,
      .operator-picker-trigger:focus {
        border-color: #c8c0ae;
        box-shadow: 0 0 0 3px rgba(29, 78, 53, 0.08);
      }
      .operator-picker-value {
        color: #111827;
        display: block;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.3;
      }
      .operator-picker-meta {
        color: #6b7280;
        display: block;
        font-size: 12px;
        line-height: 1.35;
      }
      .operator-picker-caret {
        color: var(--gaia-green);
        font-size: 14px;
        font-weight: 800;
      }
      .operator-picker-panel {
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid #e5e1d8;
        border-radius: 16px;
        box-shadow: 0 24px 50px rgba(15, 25, 19, 0.12);
        display: none;
        left: 0;
        margin-top: 8px;
        overflow: hidden;
        position: absolute;
        right: 0;
        top: 100%;
        z-index: 20;
      }
      .operator-picker.open .operator-picker-panel {
        display: grid;
      }
      .operator-picker-search-wrap {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(251, 250, 245, 0.98) 100%);
        border-bottom: 1px solid #eee9de;
        display: grid;
        gap: 8px;
        padding: 12px 12px 14px;
        position: sticky;
        top: 0;
        z-index: 2;
      }
      .operator-picker-summary {
        align-items: center;
        color: #6b7280;
        display: flex;
        font-size: 12px;
        font-weight: 700;
        justify-content: space-between;
      }
      .operator-picker-search {
        border-radius: 10px;
        min-height: 48px;
      }
      .operator-picker-results {
        background: linear-gradient(180deg, #fffdfa 0%, #fbfaf5 100%);
        display: grid;
        gap: 10px;
        max-height: 360px;
        overflow: auto;
        padding: 12px;
      }
      .operator-picker-empty {
        background: #ffffff;
        border: 1px dashed #ddd5c5;
        border-radius: 12px;
        color: #6b7280;
        font-size: 13px;
        padding: 14px 12px;
      }
      .operator-option {
        background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
        border: 1px solid #ece7dc;
        border-radius: 14px;
        color: inherit;
        display: grid;
        gap: 10px;
        min-height: 96px;
        padding: 18px 18px 16px;
        text-align: left;
        width: 100%;
      }
      .operator-option:hover {
        background: linear-gradient(180deg, #ffffff 0%, #f6f3ec 100%);
        border-color: #d8d0c0;
        transform: translateY(-1px);
      }
      .operator-option.selected {
        background: #eef7ed;
        border-color: #b9dfb2;
        box-shadow: inset 0 0 0 1px rgba(29, 78, 53, 0.08), 0 8px 20px rgba(29, 78, 53, 0.08);
      }
      .operator-option.disabled-operator {
        background: linear-gradient(180deg, #fffdfa 0%, #fcf7f0 100%);
        border-color: #f1dcc5;
      }
      .operator-option-head {
        align-items: flex-start;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(0, 1fr) auto;
      }
      .operator-option-name {
        color: #111827;
        display: block;
        font-size: 17px;
        font-weight: 800;
        line-height: 1.35;
      }
      .operator-option-email {
        color: #6b7280;
        display: block;
        font-size: 14px;
        margin-top: 5px;
      }
      .operator-option-foot {
        align-items: end;
        display: grid;
        flex-wrap: wrap;
        gap: 8px;
        grid-template-columns: minmax(0, 1fr) auto;
      }
      .operator-option-domains {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .operator-option-note {
        color: #6b7280;
        font-size: 12px;
        font-weight: 700;
        text-align: right;
      }
      .operator-option-mark {
        background: #fff1a8;
        border-radius: 4px;
        color: #111827;
        padding: 0 2px;
      }
      .mini-pill {
        align-items: center;
        background: #f6f4ec;
        border: 1px solid #e8e1d2;
        border-radius: 999px;
        color: #4b5563;
        display: inline-flex;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.03em;
        min-height: 24px;
        padding: 4px 9px;
        text-transform: uppercase;
      }
      .mini-pill.active {
        background: #ecfdf5;
        border-color: #bbf7d0;
        color: #166534;
      }
      .mini-pill.disabled {
        background: #fff7ed;
        border-color: #fed7aa;
        color: #9a3412;
      }
      .mini-pill.domain {
        background: #ffffff;
        color: #4b5563;
      }
      .list {
        display: grid;
        gap: 10px;
      }
      .item {
        background: rgba(255, 255, 255, 0.86);
        border: 1px solid #e8eee5;
        border-radius: 16px;
        display: grid;
        gap: 8px;
        padding: 14px;
      }
      .row {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: space-between;
      }
      .fields {
        display: grid;
        gap: 12px;
      }
      .qr {
        align-items: center;
        background: #f7f6ef;
        border: 1px solid #eee9de;
        border-radius: 8px;
        display: flex;
        justify-content: center;
        min-height: 300px;
        padding: 16px;
      }
      .qr svg { height: auto; max-width: 100%; }
      .qr-card {
        align-items: center;
        display: grid;
        gap: 14px;
        justify-items: center;
        min-height: 480px;
        text-align: center;
      }
      .qr-card .qr {
        background: #ffffff;
        min-height: 340px;
        width: min(100%, 420px);
      }
      .confirm-steps {
        display: grid;
        gap: 10px;
        margin-top: 14px;
      }
      .confirm-step {
        align-items: center;
        background: #fbfcfb;
        border: 1px solid #e6ebe5;
        border-radius: 10px;
        display: grid;
        gap: 10px;
        grid-template-columns: 26px minmax(0, 1fr);
        padding: 11px 12px;
      }
      .step-index {
        align-items: center;
        background: #eaf3e8;
        border-radius: 999px;
        color: var(--gaia-green);
        display: inline-flex;
        font-size: 12px;
        font-weight: 700;
        height: 26px;
        justify-content: center;
        width: 26px;
      }
      .gateway-confirmation {
        background: #f6f4ec;
        border: 1px solid #e5e1d8;
        border-radius: 10px;
        color: #4b5563;
        display: grid;
        gap: 8px;
        margin-top: 14px;
        padding: 13px;
      }
      .gateway-confirmation.ok {
        background: #ecfdf5;
        border-color: #bbf7d0;
        color: #14532d;
      }
      .payload, pre {
        background: #17251d;
        border-radius: 8px;
        color: #e9f0e8;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
        font-size: 12px;
        margin: 0;
        overflow: auto;
        overflow-wrap: anywhere;
        padding: 12px;
        white-space: pre-wrap;
      }
      .notice {
        border-radius: 8px;
        display: none;
        font-size: 14px;
        font-weight: 650;
        margin-bottom: 16px;
        padding: 12px;
      }
      .notice.visible { display: block; }
      .notice.ok { background: #ecfdf5; color: #0f766e; }
      .notice.warn { background: #fffbeb; color: #92400e; }
      .notice.error { background: #fef2f2; color: #b91c1c; }
      .modal-backdrop {
        align-items: center;
        background: rgba(15, 23, 42, 0.5);
        display: none;
        inset: 0;
        justify-content: center;
        padding: 20px;
        position: fixed;
        z-index: 3000;
      }
      #confirm-modal,
      #input-modal {
        z-index: 4200;
      }
      .modal-backdrop.visible { display: flex; }
      .modal {
        background: #fffefa;
        border: 1px solid #eee9de;
        border-radius: 8px;
        box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
        display: grid;
        gap: 18px;
        max-width: 440px;
        padding: 22px;
        width: min(100%, 440px);
      }
      .modal-form {
        display: grid;
        gap: 18px;
        margin: 0;
      }
      .meter-modal {
        max-width: 640px;
        width: min(100%, 640px);
      }
      .meter-modal-head {
        align-items: flex-start;
        display: flex;
        gap: 14px;
        justify-content: space-between;
      }
      .meter-modal-head h2 {
        color: #183325;
        overflow-wrap: anywhere;
      }
      .modal-icon {
        align-items: center;
        background: #fef2f2;
        border-radius: 999px;
        color: var(--gaia-danger);
        display: inline-flex;
        font-size: 20px;
        font-weight: 800;
        height: 42px;
        justify-content: center;
        width: 42px;
      }
      .modal h2 {
        font-size: 20px;
        margin: 0 0 6px;
      }
      .modal p {
        color: #4b5563;
        line-height: 1.5;
        margin: 0;
      }
      .modal-field-label {
        color: #374151;
        display: grid;
        gap: 8px;
        font-size: 13px;
        font-weight: 700;
      }
      .modal-error {
        color: var(--gaia-danger);
        display: none;
        font-size: 13px;
        font-weight: 700;
      }
      .modal-error.visible { display: block; }
      .modal-device-code {
        background: #f8faf7;
        border: 1px solid #e6ebe5;
        border-radius: 8px;
        color: #1f2937;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
        font-size: 13px;
        overflow-wrap: anywhere;
        padding: 10px 12px;
      }
      .modal-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-end;
      }
      .preview-modal {
        max-width: min(920px, calc(100vw - 32px));
        width: min(920px, calc(100vw - 32px));
      }
      .preview-modal-head {
        align-items: start;
        display: flex;
        gap: 14px;
        justify-content: space-between;
      }
      .preview-modal-image-wrap {
        align-items: center;
        background: #111827;
        border-radius: 8px;
        display: flex;
        justify-content: center;
        min-height: 220px;
        overflow: hidden;
      }
      .preview-modal-image-wrap img {
        display: block;
        max-height: min(68vh, 720px);
        max-width: 100%;
        object-fit: contain;
      }
      table {
        border-collapse: collapse;
        width: 100%;
      }
      th, td {
        border-bottom: 1px solid #f0ece3;
        padding: 12px 10px;
        text-align: left;
        vertical-align: top;
      }
      th {
        color: #9ca3af;
        font-size: 11px;
        font-weight: 650;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      tbody tr:hover { background: #fbfaf5; }
      @media (max-width: 860px) {
        .auth-screen { padding: 18px; }
        .auth-shell {
          grid-template-columns: 1fr;
          max-width: 520px;
          min-height: 0;
        }
        .auth-card {
          border-radius: 8px 8px 0 0;
          padding: 26px;
        }
        .auth-aside {
          border-radius: 0 0 8px 8px;
          padding: 26px;
        }
        .auth-aside h2 { font-size: 24px; }
        .auth-status-grid { grid-template-columns: 1fr; }
        .auth-foot {
          align-items: flex-start;
          flex-direction: column;
          gap: 10px;
        }
        body.authenticated .app-shell { grid-template-columns: 1fr; }
        .sidebar {
          height: auto;
          position: static;
        }
        .topbar { align-items: stretch; flex-direction: column; padding: 18px; }
        .page-body { padding: 18px; }
        .dashboard-grid { grid-template-columns: 1fr; }
        .hero-grid { grid-template-columns: 1fr; }
        .hero-kpis { grid-template-columns: 1fr; }
        .hero-title { font-size: 25px; }
        header { align-items: stretch; flex-direction: column; }
        .top-actions { grid-template-columns: 1fr; }
        .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
        .summary-grid { grid-template-columns: 1fr; }
        .apk-card {
          align-items: stretch;
          grid-template-columns: 1fr;
        }
        .apk-icon {
          height: 52px;
          width: 52px;
        }
        .apk-actions {
          min-width: 0;
        }
        .readable-row { grid-template-columns: 1fr; }
        .quick-grid { grid-template-columns: 1fr; }
        .quick-grid-row {
          grid-auto-flow: row;
          grid-template-columns: 1fr;
          overflow-x: visible;
        }
        .daily-anomaly-grid,
        .daily-anomaly-kpis {
          grid-template-columns: 1fr;
        }
        .toolbar { grid-template-columns: 1fr; }
        .activity-toolbar { grid-template-columns: 1fr; }
        .daily-toolbar { grid-template-columns: 1fr; }
        .presenze-team-create-form {
          align-items: stretch;
          grid-template-columns: 1fr;
        }
        .presenze-team-create-main {
          grid-template-columns: 1fr;
        }
        .presenze-analysis-layout,
        .presenze-team-layout,
        .presenze-team-hero,
        .presenze-team-columns,
        .presenze-team-wizard-grid,
        .presenze-team-wizard-assignment-grid,
        .presenze-team-wizard-board,
        .presenze-team-wizard-summary,
        .presenze-team-wizard-review-grid {
          grid-template-columns: 1fr;
        }
        .presenze-team-wizard-dropzones {
          grid-template-rows: auto;
          min-height: 0;
        }
        .presenze-team-wizard-progress {
          grid-template-columns: 1fr;
        }
        .presenze-team-wizard-head {
          display: grid;
        }
        .presenze-detail-panel,
        .presenze-team-list {
          max-height: none;
          position: static;
        }
        .meter-toolbar { grid-template-columns: 1fr; }
        .plant-toolbar { grid-template-columns: 1fr; }
        .meter-shell { grid-template-columns: 1fr; }
        .plant-shell { grid-template-columns: 1fr; }
        .plant-shell > .plant-list,
        .teti-pid-inspector {
          max-height: none;
          position: static;
        }
        .teti-pid-shell { grid-template-columns: 1fr; }
        .teti-pid-canvas { min-width: 760px; }
        .meter-map { min-height: 340px; }
        .user-admin-shell { grid-template-columns: 1fr; }
        .operator-editor-panel {
          max-height: none;
          overflow: visible;
          position: static;
        }
        .user-toolbar { grid-template-columns: 1fr; }
        .user-card { grid-template-columns: 1fr; }
        .user-card-actions { justify-content: stretch; }
        .user-card-actions button { width: 100%; }
        .attachment-grid { grid-template-columns: 1fr; }
        .activity-table thead { display: none; }
        .activity-row, .activity-detail-row { display: block; width: 100%; }
        .activity-row td, .activity-detail-row td {
          border: 0;
          border-radius: 0;
          display: block;
          padding: 6px 0;
          width: 100%;
        }
        .activity-row td:first-child { box-shadow: none; }
        .activity-row {
          background: #ffffff;
          border: 1px solid #eee9de;
          border-radius: 12px;
          margin-bottom: 8px;
          padding: 12px;
        }
        .activity-detail-row td { padding: 0 0 10px; }
        .modal { padding: 18px; }
        .modal-actions {
          display: grid;
          grid-template-columns: 1fr;
        }
        table, tbody, tr, td { display: block; width: 100%; }
        thead { display: none; }
        td { border-bottom: 0; padding: 6px 0; }
        tr {
          border: 1px solid #d7e0e5;
          border-radius: 8px;
          display: block;
          margin-bottom: 10px;
          padding: 10px;
        }
      }
