:root {
      --bg: #f4f7fb;
      --surface: #ffffff;
      --surface-2: #f8fafc;
      --text: #16233a;
      --muted: #68758a;
      --line: #e2e8f0;
      --primary: #184a8b;
      --primary-2: #2563a8;
      --primary-soft: #eaf2fb;
      --success: #138a5b;
      --success-soft: #e7f7f0;
      --warning: #b66b09;
      --warning-soft: #fff4df;
      --danger: #c23b3b;
      --danger-soft: #fdecec;
      --running: #7c3aed;
      --running-soft: #f1eafe;
      --shadow: 0 12px 30px rgba(27, 46, 76, .08);
      --radius: 14px;
      --sidebar: 252px;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    a { color: inherit; text-decoration: none; }

    .hidden { display: none !important; }

    /* Login */
    .login-screen {
      min-height: 100vh;
      display: grid;
      grid-template-columns: minmax(420px, 1.05fr) minmax(460px, .95fr);
      background:
        radial-gradient(circle at 12% 18%, rgba(82, 141, 205, .26), transparent 34%),
        linear-gradient(135deg, #0d2e57 0%, #174b86 52%, #0b2445 100%);
    }

    .login-brand {
      padding: 64px 8vw;
      color: #fff;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-height: 100vh;
    }

    .brand-lockup { display: flex; align-items: center; gap: 12px; }
    .brand-mark {
      width: 44px; height: 44px; border-radius: 12px;
      display: grid; place-items: center;
      background: linear-gradient(145deg, #4fb4d5, #2d7cc0);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
      font-weight: 900; letter-spacing: -1px;
    }
    .brand-title { font-weight: 800; font-size: 22px; letter-spacing: -.5px; }
    .brand-subtitle { font-size: 12px; color: rgba(255,255,255,.64); margin-top: 2px; }

    .login-hero { max-width: 630px; margin: auto 0; }
    .eyebrow {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 7px 11px; border-radius: 999px;
      background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
      font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    }
    .login-hero h1 { font-size: clamp(42px, 5vw, 68px); line-height: .98; margin: 22px 0; letter-spacing: -3px; }
    .login-hero p { font-size: 18px; line-height: 1.65; max-width: 570px; color: rgba(255,255,255,.78); }
    .feature-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 34px; }
    .feature-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.84); }
    .feature-chip i { width: 8px; height: 8px; border-radius: 50%; background: #6bd4c0; box-shadow: 0 0 0 5px rgba(107,212,192,.13); }

    .login-panel-wrap { display: grid; place-items: center; padding: 36px; }
    .login-panel {
      width: min(460px, 100%);
      background: rgba(255,255,255,.98);
      border-radius: 24px;
      padding: 42px;
      box-shadow: 0 36px 80px rgba(0,0,0,.24);
    }
    .login-panel h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.7px; }
    .login-panel .desc { color: var(--muted); line-height: 1.6; margin-bottom: 30px; }
    .entra-button {
      width: 100%;
      border: 1px solid #cfd8e5;
      border-radius: 10px;
      background: #fff;
      color: #243247;
      padding: 14px 18px;
      display: flex; justify-content: center; align-items: center; gap: 13px;
      font-weight: 700;
      transition: .2s ease;
    }
    .entra-button:hover { border-color: #91a7c4; box-shadow: 0 8px 22px rgba(34,71,113,.12); transform: translateY(-1px); }
    .ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
    .ms-logo span:nth-child(1) { background:#f25022; }
    .ms-logo span:nth-child(2) { background:#7fba00; }
    .ms-logo span:nth-child(3) { background:#00a4ef; }
    .ms-logo span:nth-child(4) { background:#ffb900; }
    .login-note {
      margin-top: 22px; padding: 14px; border-radius: 10px;
      background: var(--primary-soft); color: #44617f; font-size: 12px; line-height: 1.55;
    }
    .login-footer { color: rgba(255,255,255,.55); font-size: 12px; }

    /* App layout */
    .app { min-height: 100vh; }
    .sidebar {
      width: var(--sidebar);
      position: fixed; inset: 0 auto 0 0;
      background: #102a4a;
      color: #dbe7f5;
      padding: 20px 14px;
      display: flex; flex-direction: column;
      z-index: 20;
    }
    .sidebar .brand-lockup { padding: 4px 10px 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
    .sidebar .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
    .sidebar .brand-title { font-size: 18px; }
    .sidebar .brand-subtitle { font-size: 10px; }

    .nav-section-label {
      color: rgba(219,231,245,.45);
      font-size: 10px; text-transform: uppercase; font-weight: 800;
      letter-spacing: .1em; padding: 20px 12px 8px;
    }
    .nav-item {
      width: 100%;
      display: flex; align-items: center; gap: 11px;
      border: 0; background: transparent; color: #cbd8e8;
      padding: 11px 12px; border-radius: 9px; text-align: left;
      font-size: 13px; font-weight: 650; margin: 2px 0;
    }
    .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
    .nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(65,142,210,.32), rgba(65,142,210,.14)); box-shadow: inset 3px 0 #62b5ed; }
    .nav-icon { width: 19px; height: 19px; display: grid; place-items: center; font-size: 15px; }
    .nav-badge {
      margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px;
      display: grid; place-items: center; padding: 0 6px;
      background: rgba(255,255,255,.1); color: #fff; font-size: 10px;
    }

    .sidebar-bottom { margin-top: auto; }
    .worker-status {
      margin: 14px 7px;
      padding: 12px;
      border-radius: 11px;
      background: rgba(255,255,255,.055);
      border: 1px solid rgba(255,255,255,.08);
      font-size: 11px;
    }
    .worker-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
    .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #46d49b; box-shadow: 0 0 0 4px rgba(70,212,155,.12); }
    .worker-meta { color: rgba(219,231,245,.55); }

    .main { margin-left: var(--sidebar); min-height: 100vh; }
    .topbar {
      height: 68px; position: sticky; top: 0; z-index: 15;
      background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--line);
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 28px;
    }
    .topbar-left { display: flex; align-items: center; gap: 12px; }
    .topbar-title { font-size: 18px; font-weight: 800; letter-spacing: -.35px; }
    .environment {
      padding: 5px 8px; border-radius: 6px; background: var(--success-soft);
      color: var(--success); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    }
    .topbar-actions { display: flex; align-items: center; gap: 10px; }
    .icon-button {
      width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px;
      background: #fff; display: grid; place-items: center; color: #55657b;
    }
    .user-chip { display: flex; align-items: center; gap: 10px; padding-left: 8px; }
    .avatar { width: 36px; height: 36px; border-radius: 10px; background: #d9e9f8; color: var(--primary); display: grid; place-items: center; font-weight: 800; }
    .user-name { font-size: 12px; font-weight: 800; }
    .user-role { font-size: 10px; color: var(--muted); margin-top: 2px; }

    .content { padding: 28px; }
    .page { display: none; }
    .page.active { display: block; }

    .page-heading {
      display: flex; justify-content: space-between; align-items: flex-start;
      margin-bottom: 22px; gap: 20px;
    }
    .page-heading h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.7px; }
    .page-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
    .heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }

    .btn {
      border: 1px solid transparent; border-radius: 9px;
      padding: 10px 14px; font-size: 12px; font-weight: 800;
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      transition: .18s ease;
    }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(24,74,139,.18); }
    .btn-primary:hover { background: var(--primary-2); }
    .btn-secondary { background: #fff; border-color: var(--line); color: #46556a; }
    .btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f4cccc; }
    .btn-sm { padding: 7px 10px; font-size: 11px; }
    .btn-icon-only { width: 34px; height: 34px; padding: 0; }

    .grid { display: grid; gap: 18px; }
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
    .card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: 0 4px 18px rgba(31, 47, 70, .035);
    }
    .card-body { padding: 18px; }
    .card-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 18px; border-bottom: 1px solid var(--line);
    }
    .card-title { font-weight: 800; font-size: 13px; }
    .card-subtitle { font-size: 11px; color: var(--muted); margin-top: 4px; }

    .kpi {
      padding: 18px; display: flex; justify-content: space-between; gap: 14px;
      position: relative; overflow: hidden;
    }
    .kpi:after { content: ""; position: absolute; right: -22px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--primary-soft); opacity: .55; }
    .kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; }
    .kpi-value { font-size: 28px; font-weight: 850; letter-spacing: -1px; margin: 7px 0 4px; }
    .kpi-detail { font-size: 10px; color: var(--muted); }
    .kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; z-index: 1; }
    .kpi-blue { background: var(--primary-soft); color: var(--primary); }
    .kpi-green { background: var(--success-soft); color: var(--success); }
    .kpi-purple { background: var(--running-soft); color: var(--running); }
    .kpi-red { background: var(--danger-soft); color: var(--danger); }

    .dashboard-layout { grid-template-columns: minmax(0, 1.65fr) minmax(320px, .75fr); }
    .toolbar {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
    }
    .segmented { display: inline-flex; padding: 3px; background: #eef2f7; border-radius: 9px; }
    .segmented button { border: 0; background: transparent; padding: 7px 11px; border-radius: 7px; font-size: 10px; font-weight: 800; color: var(--muted); }
    .segmented button.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(28,44,67,.08); }
    .date-nav { display: flex; align-items: center; gap: 8px; }
    .date-label { min-width: 145px; text-align: center; font-size: 12px; font-weight: 800; }

    .agenda { padding: 12px 16px 18px; overflow-x: auto; }
    .agenda-grid { min-width: 760px; display: grid; grid-template-columns: 68px repeat(5, minmax(130px, 1fr)); position: relative; }
    .agenda-day-head { padding: 9px 7px 12px; text-align: center; border-bottom: 1px solid var(--line); }
    .agenda-day-head .weekday { font-size: 9px; color: var(--muted); text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
    .agenda-day-head .day-number { font-size: 18px; font-weight: 850; margin-top: 4px; }
    .agenda-day-head.today .day-number { width: 30px; height: 30px; margin: 2px auto 0; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; }
    .time-cell, .day-cell { min-height: 56px; border-bottom: 1px solid #edf1f5; }
    .time-cell { font-size: 9px; color: var(--muted); padding: 5px 8px 0 0; text-align: right; }
    .day-cell { border-left: 1px solid #edf1f5; position: relative; }
    .event {
      position: absolute; left: 5px; right: 5px; top: 5px;
      min-height: 45px; border-radius: 7px; padding: 7px 8px;
      font-size: 9px; line-height: 1.3; overflow: hidden;
      border-left: 3px solid currentColor; z-index: 2;
    }
    .event strong { display: block; font-size: 9px; margin-bottom: 3px; }
    .event.success { color: var(--success); background: var(--success-soft); }
    .event.running { color: var(--running); background: var(--running-soft); }
    .event.warning { color: var(--warning); background: var(--warning-soft); }
    .event.failed { color: var(--danger); background: var(--danger-soft); }
    .event.scheduled { color: var(--primary); background: var(--primary-soft); }

    .timeline-list { padding: 4px 18px 18px; }
    .timeline-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 11px; padding: 13px 0; border-bottom: 1px solid #edf1f5; align-items: start; }
    .timeline-item:last-child { border-bottom: 0; }
    .timeline-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; }
    .timeline-name { font-size: 11px; font-weight: 800; }
    .timeline-meta { font-size: 9px; color: var(--muted); margin-top: 4px; }
    .timeline-time { font-size: 10px; font-weight: 800; color: #4b5a6d; }

    .alert-card { margin-top: 18px; border-color: #f4d0d0; }
    .alert-row { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #f5e3e3; }
    .alert-row:last-child { border-bottom: 0; }
    .alert-icon { color: var(--danger); }
    .alert-title { font-size: 11px; font-weight: 800; }
    .alert-meta { font-size: 9px; color: var(--muted); margin-top: 3px; }

    /* Table & filters */
    .filters {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      padding: 14px 16px; border-bottom: 1px solid var(--line);
    }
    .search-wrap { flex: 1; min-width: 220px; position: relative; }
    .search-wrap input { width: 100%; padding-left: 34px; }
    .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a1b2; font-size: 12px; }
    .form-control {
      border: 1px solid #d6dee9; border-radius: 8px; background: #fff;
      padding: 9px 10px; color: #304057; outline: 0; font-size: 11px;
    }
    .form-control:focus { border-color: #6f9dca; box-shadow: 0 0 0 3px rgba(48,113,175,.1); }

    .table-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; min-width: 840px; }
    th {
      padding: 11px 16px; background: #fafbfd; border-bottom: 1px solid var(--line);
      text-align: left; font-size: 9px; color: #6f7c8d; text-transform: uppercase; letter-spacing: .08em;
    }
    td { padding: 13px 16px; border-bottom: 1px solid #edf1f5; font-size: 11px; vertical-align: middle; }
    tr:hover td { background: #fbfcfe; }
    .script-name { font-weight: 800; color: #26384f; }
    .script-desc { color: var(--muted); font-size: 9px; margin-top: 3px; }
    .type-pill {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 5px 8px; border-radius: 6px; background: #f1f4f8;
      color: #4c5d72; font-size: 9px; font-weight: 800;
    }
    .status {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800;
    }
    .status:before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
    .status.active, .status.success { color: var(--success); background: var(--success-soft); }
    .status.inactive { color: #788699; background: #eef1f4; }
    .status.running { color: var(--running); background: var(--running-soft); }
    .status.failed { color: var(--danger); background: var(--danger-soft); }
    .status.scheduled { color: var(--primary); background: var(--primary-soft); }
    .status.warning { color: var(--warning); background: var(--warning-soft); }
    .actions-cell { display: flex; align-items: center; gap: 6px; }
    .pagination { padding: 13px 16px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; }
    .pagination-buttons { display: flex; gap: 5px; }
    .pagination-buttons button { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 10px; }
    .pagination-buttons button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

    /* Script editor */
    .editor-layout { grid-template-columns: 250px minmax(0, 1fr); }
    .stepper { padding: 10px; }
    .step-item {
      padding: 13px 12px; border-radius: 9px; margin: 3px 0;
      display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
    }
    .step-item.active { background: var(--primary-soft); }
    .step-item.done .step-number { background: var(--success); color: #fff; }
    .step-number {
      width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
      background: #e8edf3; color: #607087; font-size: 10px; font-weight: 900;
    }
    .step-item.active .step-number { background: var(--primary); color: #fff; }
    .step-title { font-size: 11px; font-weight: 800; margin-top: 2px; }
    .step-desc { font-size: 9px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

    .form-section { padding: 20px; border-bottom: 1px solid var(--line); }
    .form-section:last-child { border-bottom: 0; }
    .form-section-title { font-size: 13px; font-weight: 850; margin-bottom: 4px; }
    .form-section-desc { color: var(--muted); font-size: 10px; margin-bottom: 18px; }
    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
    .form-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .field { display: flex; flex-direction: column; gap: 7px; }
    .field.full { grid-column: 1 / -1; }
    .field label { font-size: 10px; font-weight: 800; color: #4a5a70; }
    .field .hint { font-size: 9px; color: var(--muted); margin-top: -2px; }
    textarea.form-control { min-height: 78px; resize: vertical; }
    .source-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .source-option {
      border: 1px solid var(--line); border-radius: 10px; padding: 14px;
      display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
    }
    .source-option.active { border-color: #6f9dca; background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(58,123,184,.08); }
    .source-option input { margin-top: 3px; }
    .source-title { font-size: 11px; font-weight: 850; }
    .source-desc { font-size: 9px; color: var(--muted); line-height: 1.45; margin-top: 4px; }

    .editor-tabs { display: flex; border: 1px solid var(--line); border-radius: 9px 9px 0 0; overflow: hidden; }
    .editor-tab { padding: 9px 13px; border: 0; border-right: 1px solid var(--line); background: #f6f8fb; font-size: 10px; font-weight: 800; color: var(--muted); }
    .editor-tab.active { background: #fff; color: var(--primary); }
    .code-editor {
      background: #102036; color: #d7e5f4; padding: 16px; min-height: 260px;
      border-radius: 0 0 9px 9px; width: 100%; border: 0; resize: vertical;
      font: 12px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      tab-size: 2;
    }
    .upload-zone {
      border: 1.5px dashed #b9c6d5; border-radius: 10px;
      padding: 26px; text-align: center; background: #fbfcfe;
    }
    .upload-zone strong { display: block; font-size: 12px; margin-bottom: 6px; }
    .upload-zone span { font-size: 9px; color: var(--muted); }

    .cron-preview {
      background: #102036; color: #d6e7f7; border-radius: 8px;
      padding: 12px 14px; font: 11px "SFMono-Regular", Consolas, monospace;
      display: flex; justify-content: space-between; align-items: center;
    }
    .schedule-days { display: flex; gap: 6px; flex-wrap: wrap; }
    .day-check {
      width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
      background: #fff; display: grid; place-items: center; font-size: 9px; font-weight: 850;
    }
    .day-check.active { background: var(--primary); color: #fff; border-color: var(--primary); }

    .form-footer {
      position: sticky; bottom: 0; z-index: 8;
      padding: 14px 20px; background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
      border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px;
    }

    /* Connections */
    .connection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .connection-card { padding: 18px; }
    .connection-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
    .connection-icon {
      width: 42px; height: 42px; border-radius: 11px; background: var(--primary-soft);
      color: var(--primary); display: grid; place-items: center; font-weight: 900; font-size: 12px;
    }
    .connection-name { margin-top: 16px; font-size: 13px; font-weight: 850; }
    .connection-type { color: var(--muted); font-size: 9px; margin-top: 3px; }
    .connection-meta { margin-top: 14px; display: grid; gap: 7px; }
    .meta-row { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); }
    .meta-row strong { color: #435268; font-weight: 800; }

    .connector-library { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .connector-type {
      border: 1px dashed #bdc9d7; border-radius: 10px; padding: 16px; text-align: center;
      background: #fbfcfe; min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    }
    .connector-type .connection-icon { width: 36px; height: 36px; font-size: 10px; }
    .connector-type strong { font-size: 10px; margin-top: 10px; }
    .connector-type span { font-size: 8px; color: var(--muted); margin-top: 3px; }

    /* Workers */
    .workers-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .worker-card { padding: 18px; }
    .worker-head { display: flex; align-items: center; justify-content: space-between; }
    .worker-name { font-size: 13px; font-weight: 850; }
    .worker-host { font-size: 9px; color: var(--muted); margin-top: 3px; }
    .resource { margin-top: 14px; }
    .resource-line { display: flex; justify-content: space-between; font-size: 9px; margin-bottom: 6px; }
    .progress { height: 6px; background: #e9edf2; border-radius: 99px; overflow: hidden; }
    .progress > span { height: 100%; display: block; border-radius: inherit; background: var(--primary); }

    /* Settings */
    .settings-layout { grid-template-columns: 220px minmax(0,1fr); }
    .settings-menu { padding: 8px; }
    .settings-menu button {
      width: 100%; border: 0; background: transparent; padding: 11px 12px;
      text-align: left; border-radius: 8px; font-size: 10px; font-weight: 800; color: #58677b;
    }
    .settings-menu button.active { background: var(--primary-soft); color: var(--primary); }

    /* Modal */
    .modal-backdrop {
      position: fixed; inset: 0; background: rgba(11, 26, 47, .58);
      z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px;
    }
    .modal-backdrop.open { display: flex; }
    .modal {
      width: min(920px, 100%); max-height: calc(100vh - 48px);
      background: #fff; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.3); overflow: hidden;
    }
    .modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
    .modal-title { font-size: 14px; font-weight: 850; }
    .modal-body { overflow: auto; max-height: calc(100vh - 150px); }
    .execution-summary { padding: 16px 20px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; background: #fafbfd; border-bottom: 1px solid var(--line); }
    .summary-label { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
    .summary-value { font-size: 10px; font-weight: 850; margin-top: 5px; }
    .log-toolbar { padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
    .log-view {
      background: #0d1b2d; color: #c9d7e7; margin: 0; padding: 18px;
      min-height: 380px; white-space: pre-wrap; overflow: auto;
      font: 11px/1.65 "SFMono-Regular", Consolas, monospace;
    }
    .log-time { color: #7088a4; }
    .log-info { color: #72b7f0; }
    .log-ok { color: #57d39c; }
    .log-warn { color: #e8bd65; }
    .log-error { color: #ff7b7b; }

    .toast {
      position: fixed; right: 24px; bottom: 24px; z-index: 80;
      background: #142b49; color: #fff; border-radius: 10px;
      padding: 13px 16px; box-shadow: 0 18px 45px rgba(18,42,72,.27);
      font-size: 11px; font-weight: 700; transform: translateY(30px); opacity: 0; pointer-events: none;
      transition: .25s ease;
    }
    .toast.show { transform: translateY(0); opacity: 1; }

    .mobile-menu { display: none; }

    @media (max-width: 1120px) {
      .kpi-grid { grid-template-columns: repeat(2, 1fr); }
      .dashboard-layout { grid-template-columns: 1fr; }
      .connection-grid, .workers-grid { grid-template-columns: repeat(2,1fr); }
      .connector-library { grid-template-columns: repeat(2,1fr); }
    }

    @media (max-width: 800px) {
      .login-screen { grid-template-columns: 1fr; }
      .login-brand { display: none; }
      .login-panel-wrap { min-height: 100vh; padding: 22px; }
      .sidebar { transform: translateX(-100%); transition: .2s ease; }
      .sidebar.open { transform: translateX(0); }
      .main { margin-left: 0; }
      .mobile-menu { display: grid; }
      .content { padding: 18px; }
      .topbar { padding: 0 16px; }
      .kpi-grid, .connection-grid, .workers-grid, .editor-layout, .settings-layout, .form-grid, .source-options { grid-template-columns: 1fr; }
      .execution-summary { grid-template-columns: repeat(2, 1fr); }
      .page-heading { flex-direction: column; }
      .heading-actions { width: 100%; }
    }

/* Ajustes do projeto PHP */
.flash-stack{display:grid;gap:8px;margin-bottom:16px}.flash{padding:12px 14px;border-radius:9px;font-size:11px;font-weight:750;border:1px solid}.flash-success{background:var(--success-soft);color:var(--success);border-color:#bce7d2}.flash-error{background:var(--danger-soft);color:var(--danger);border-color:#f2caca}.inline-form{display:inline}.empty-state{padding:42px 20px;text-align:center;color:var(--muted)}.empty-state strong{display:block;color:var(--text);font-size:14px;margin-bottom:6px}.code-box{background:#102036;color:#d7e5f4;padding:16px;border-radius:9px;overflow:auto;font:11px/1.6 "SFMono-Regular",Consolas,monospace}.log-line{display:grid;grid-template-columns:155px 70px 1fr;gap:10px;padding:4px 0;border-bottom:1px solid rgba(255,255,255,.05)}.log-system{color:#72b7f0}.log-stdout{color:#c9d7e7}.log-stderr{color:#ff8c8c}.calendar-board{display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));min-width:1050px}.calendar-column{border-right:1px solid var(--line);min-height:580px}.calendar-column:last-child{border-right:0}.calendar-column-head{padding:14px;text-align:center;border-bottom:1px solid var(--line);position:sticky;top:68px;background:#fff;z-index:3}.calendar-events{padding:10px;display:grid;gap:8px}.calendar-event{padding:10px;border-radius:8px;font-size:9px;border-left:3px solid}.calendar-event strong{display:block;font-size:10px;margin-bottom:4px}.calendar-event.success{background:var(--success-soft);color:var(--success)}.calendar-event.running{background:var(--running-soft);color:var(--running)}.calendar-event.failed,.calendar-event.timeout{background:var(--danger-soft);color:var(--danger)}.calendar-event.queued{background:var(--primary-soft);color:var(--primary)}.calendar-event.cancelled,.calendar-event.skipped{background:#eef1f4;color:#788699}.section-divider{height:1px;background:var(--line);margin:4px 0 18px}.checkbox-row{display:flex;align-items:center;gap:8px;font-size:10px;font-weight:750;color:#4a5a70}.checkbox-row input{width:16px;height:16px}.detail-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.detail-box{background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:12px}.detail-label{font-size:8px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;font-weight:850}.detail-value{font-size:11px;font-weight:850;margin-top:6px;overflow-wrap:anywhere}.connection-config{font:9px/1.5 "SFMono-Regular",Consolas,monospace;color:#56657a;background:#f6f8fb;border-radius:7px;padding:8px;margin-top:10px;overflow:auto}.form-error{font-size:9px;color:var(--danger)}.live-indicator{display:inline-flex;align-items:center;gap:6px;font-size:9px;color:var(--running);font-weight:800}.live-indicator:before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;animation:pulse 1.4s infinite}@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}@media(max-width:900px){.detail-grid{grid-template-columns:repeat(2,1fr)}}

/* v1.0.8 - filtros e auditoria */
.filter-date{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:10px;font-weight:800;white-space:nowrap}.filter-date .form-control{width:auto;min-width:135px}.settings-menu .settings-link{display:block;width:100%;padding:11px 12px;text-align:left;border-radius:8px;font-size:10px;font-weight:800;color:#58677b}.settings-menu .settings-link:hover{background:var(--primary-soft);color:var(--primary)}.calendar-event.scheduled{background:var(--primary-soft);color:var(--primary)}.audit-details summary{cursor:pointer;color:var(--primary);font-weight:800;font-size:10px}.audit-block{margin-top:8px}.audit-block>strong{display:block;font-size:9px;color:var(--muted);margin-bottom:4px;text-transform:uppercase;letter-spacing:.06em}.audit-block pre{max-width:460px;max-height:260px;overflow:auto;margin:0;background:#102036;color:#d7e5f4;border-radius:8px;padding:10px;font:9px/1.5 "SFMono-Regular",Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.audit-user-agent{max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media(max-width:800px){.filter-date{width:100%;justify-content:space-between}.filter-date .form-control{flex:1;max-width:none}.audit-block pre{max-width:100%}}

/* v1.0.10 - workspace / editor de arquivos */
.editor-layout > * {
  min-width: 0;
}

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 560px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.workspace-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.workspace-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.workspace-sidebar-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workspace-sidebar-head strong {
  font-size: 11px;
}

.workspace-sidebar-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-sidebar-head .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.workspace-search-wrap {
  padding: 10px 10px 6px;
}

.workspace-search-wrap .form-control {
  width: 100%;
  min-width: 0;
}

.workspace-tree {
  flex: 1 1 auto;
  min-height: 260px;
  max-height: 480px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 6px 10px;
  scrollbar-gutter: stable;
}

.workspace-folder-row,
.workspace-file-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 30px;
  padding-top: 5px;
  padding-right: 8px;
  padding-bottom: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4b5c70;
  font: inherit;
  text-align: left;
}

.workspace-folder-row {
  color: #748397;
  font-size: 9px;
  font-weight: 850;
}

.workspace-file-row {
  cursor: pointer;
  font-size: 10px;
}

.workspace-file-row:hover {
  background: #eef3f8;
}

.workspace-file-row.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 850;
}

.workspace-tree-icon {
  width: 15px;
  flex: 0 0 15px;
  text-align: center;
  opacity: .8;
}

.workspace-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-entry-mark {
  margin-left: auto;
  flex: 0 0 auto;
  color: #d79b19;
  font-size: 10px;
}

.workspace-tree-empty {
  padding: 20px 10px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.workspace-import {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.workspace-import-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.workspace-import-actions .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
  justify-content: center;
  white-space: nowrap;
}

.workspace-import small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.workspace-native-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.workspace-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: #fff;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.workspace-current {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 3px;
}

.workspace-current strong {
  overflow: hidden;
  font: 10px/1.3 "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-current span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workspace-actions .btn {
  white-space: nowrap;
}

.workspace-editor-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  height: clamp(420px, 55vh, 680px);
  min-height: 420px;
  overflow: hidden;
  background: #0d1b2d;
}

.workspace-line-numbers {
  height: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 14px 10px 14px 0;
  border-right: 1px solid rgba(255,255,255,.08);
  background: #0a1727;
  color: #657d99;
  font: 11px/1.6 "SFMono-Regular", Consolas, monospace;
  text-align: right;
  white-space: pre;
  user-select: none;
}

.workspace-code-editor {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: auto;
  resize: none;
  border: 0;
  border-radius: 0;
  outline: 0;
  padding: 14px 16px;
  background: #0d1b2d;
  color: #d8e6f5;
  caret-color: #fff;
  font: 11px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 4;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.workspace-code-editor:focus {
  box-shadow: inset 0 0 0 1px rgba(98,181,237,.28);
}

.workspace-code-editor:disabled {
  cursor: default;
  opacity: .15;
}

.workspace-binary-state {
  position: absolute;
  inset: 0 0 0 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 30px;
  background: #0d1b2d;
  color: #b8c8da;
  text-align: center;
}

.workspace-binary-state.hidden {
  display: none;
}

.workspace-binary-state strong {
  margin-bottom: 7px;
  color: #fff;
  font-size: 13px;
}

.workspace-binary-state span {
  max-width: 480px;
  color: #8fa5bd;
  font-size: 9px;
  line-height: 1.55;
}

.workspace-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 7px 11px;
  border-top: 1px solid var(--line);
  background: #f7f9fc;
  color: var(--muted);
  font-size: 9px;
}

.workspace-statusbar > span {
  min-width: 0;
}

.workspace-statusbar code {
  display: inline-block;
  max-width: min(46vw, 520px);
  overflow: hidden;
  color: #33465d;
  font: 9px "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .workspace-shell {
    grid-template-columns: minmax(200px, 235px) minmax(0, 1fr);
  }

  .workspace-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .workspace-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace-tree {
    min-height: 150px;
    max-height: 240px;
  }

  .workspace-editor-wrap {
    height: 430px;
    min-height: 360px;
  }

  .workspace-statusbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-statusbar code {
    max-width: 72vw;
  }
}

@media (max-width: 560px) {
  .workspace-sidebar-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-import-actions {
    grid-template-columns: 1fr;
  }

  .workspace-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-actions .btn {
    width: 100%;
  }

  .workspace-editor-wrap {
    grid-template-columns: 42px minmax(0, 1fr);
    height: 380px;
  }

  .workspace-binary-state {
    left: 42px;
  }

  .workspace-line-numbers {
    padding-right: 7px;
    font-size: 10px;
  }

  .workspace-code-editor {
    padding-inline: 12px;
    font-size: 10px;
  }
}
