/* ============================================================================
 * claudehub — overlay 4b: "Execuções Programadas"
 * Versão: 1.0.0 · usa /api/schedules (GET/POST/PATCH/DELETE + /run) e /api/settings
 * Botão de nav acima de "Agentes & Comandos". Reusa a linguagem visual do overlay 3.
 * ==========================================================================*/

.rail__navbtn.sc-navbtn[aria-selected="true"] { color: var(--brand, #6ea8fe); }

/* ---- modal ---- */
.sc-modal {
  position: fixed; inset: 0; z-index: 10002;
  display: grid; place-items: center; padding: 4vh 3vw;
  background: color-mix(in srgb, #000 70%, transparent);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.sc-modal[data-show="1"] { opacity: 1; pointer-events: auto; }
.sc-panel {
  display: flex; flex-direction: column;
  inline-size: min(64rem, 96vw); block-size: min(84vh, 62rem);
  background: var(--surface-raised, #1a1f26);
  border: 1px solid var(--line-strong, #2a323c);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px -12px rgba(0,0,0,.6);
}
.sc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-block-end: 1px solid var(--line, #232a32);
}
.sc-head h2 { margin: 0; font-size: var(--text-md, 1rem); font-family: var(--font-display, inherit); color: var(--ink, #e8eef5); display: flex; align-items: center; gap: 8px; }
.sc-head .sc-tz { margin-inline-start: 10px; font-size: var(--text-2xs, .68rem); color: var(--ink-faint, #6b7a89); }
.sc-close { margin-inline-start: auto; background: transparent; border: 0; color: var(--ink-dim,#9fb0c0); font-size: 20px; cursor: pointer; line-height: 1; }
.sc-close:hover { color: var(--ink, #e8eef5); }

.sc-body { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-block-size: 0; }
.sc-list { border-inline-end: 1px solid var(--line, #232a32); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.sc-list__new {
  inline-size: 100%; text-align: start; padding: 9px 11px;
  border: 1px dashed var(--line-strong, #2a323c); border-radius: 9px;
  background: transparent; color: var(--brand-soft, #ffb454); cursor: pointer; font-size: var(--text-sm, .84rem);
}
.sc-item {
  border: 1px solid var(--line, #232a32); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; background: var(--surface, #14181d);
  display: flex; flex-direction: column; gap: 4px;
}
.sc-item[aria-selected="true"] { border-color: color-mix(in srgb, var(--brand,#6ea8fe) 60%, transparent); background: color-mix(in srgb, var(--brand,#6ea8fe) 8%, var(--surface,#14181d)); }
.sc-item__top { display: flex; align-items: center; gap: 8px; }
.sc-item__name { font-size: var(--text-sm, .9rem); color: var(--ink, #e8eef5); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-item__dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--ink-faint, #6b7a89); flex: 0 0 auto; }
.sc-item__dot[data-s="ok"] { background: var(--u-ok, #35c26b); }
.sc-item__dot[data-s="error"] { background: var(--u-danger, #ff6b6b); }
.sc-item__dot[data-s="running"] { background: var(--brand, #6ea8fe); animation: sc-pulse 1.3s ease-out infinite; }
.sc-item[data-off="1"] { opacity: .55; }
.sc-item__when { font-size: var(--text-xs, .76rem); color: var(--ink-dim, #9fb0c0); }
.sc-item__next { font-size: var(--text-2xs, .68rem); color: var(--ink-faint, #6b7a89); }
.sc-item__acts { display: flex; gap: 4px; margin-inline-start: auto; }
.sc-item__acts button { border: 0; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-dim, #9fb0c0); border-radius: 6px; padding: 2px 5px; }
.sc-item__acts button:hover { background: color-mix(in srgb, var(--brand,#6ea8fe) 16%, transparent); color: var(--ink, #e8eef5); }
.sc-item__acts .sc-del:hover { background: color-mix(in srgb, var(--u-danger,#ff6b6b) 18%, transparent); color: var(--u-danger, #ff6b6b); }
@keyframes sc-pulse { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--brand,#6ea8fe) 65%,transparent);} 70%{box-shadow:0 0 0 6px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }
@media (prefers-reduced-motion: reduce){ .sc-item__dot[data-s="running"]{ animation:none; } }

/* ---- formulário ---- */
.sc-form { overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-inline-size: 0; }
.sc-field { display: flex; flex-direction: column; gap: 5px; }
.sc-field > label { font-size: var(--text-xs, .74rem); color: var(--ink-dim, #9fb0c0); text-transform: uppercase; letter-spacing: .04em; }
.sc-input, .sc-ta, .sc-form input[type="time"], .sc-form input[type="datetime-local"] {
  background: var(--surface, #14181d); color: var(--ink, #e8eef5);
  border: 1px solid var(--line, #232a32); border-radius: 8px; padding: 8px 10px; font-size: var(--text-sm, .86rem);
  font-family: inherit;
}
.sc-ta { resize: vertical; min-block-size: 4.5rem; font-family: var(--font-mono, ui-monospace, monospace); line-height: 1.5; }
.sc-input:focus, .sc-ta:focus, .sc-form input:focus { outline: 0; border-color: color-mix(in srgb, var(--brand,#6ea8fe) 60%, transparent); }

.sc-seg { display: flex; gap: 4px; background: var(--surface, #14181d); border: 1px solid var(--line, #232a32); border-radius: 999px; padding: 3px; inline-size: fit-content; }
.sc-seg button { border: 0; background: transparent; color: var(--ink-dim, #9fb0c0); padding: 5px 14px; border-radius: 999px; cursor: pointer; font-size: var(--text-sm, .82rem); }
.sc-seg button[aria-pressed="true"] { background: var(--brand, #6ea8fe); color: #071018; font-weight: 600; }

.sc-days { display: flex; gap: 5px; flex-wrap: wrap; }
.sc-day { inline-size: 2.4rem; text-align: center; padding: 6px 0; border-radius: 8px; border: 1px solid var(--line, #232a32); background: var(--surface, #14181d); color: var(--ink-dim, #9fb0c0); cursor: pointer; font-size: var(--text-xs, .76rem); }
.sc-day[aria-pressed="true"] { background: color-mix(in srgb, var(--brand,#6ea8fe) 22%, transparent); border-color: color-mix(in srgb, var(--brand,#6ea8fe) 55%, transparent); color: var(--ink, #e8eef5); }

.sc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-check { display: flex; align-items: center; gap: 7px; font-size: var(--text-sm, .84rem); color: var(--ink-dim, #9fb0c0); cursor: pointer; }
.sc-actions { display: flex; gap: 8px; margin-block-start: 4px; flex-wrap: wrap; }
.sc-btn { padding: 8px 16px; border-radius: 8px; border: 0; cursor: pointer; font-size: var(--text-sm, .85rem); font-weight: 600; }
.sc-btn--primary { background: var(--brand, #6ea8fe); color: #071018; }
.sc-btn--ghost { background: transparent; color: var(--ink-dim, #9fb0c0); border: 1px solid var(--line-strong, #2a323c); }
.sc-btn--ghost:hover { color: var(--ink, #e8eef5); }
.sc-btn--danger { background: transparent; color: var(--u-danger, #ff6b6b); border: 1px solid color-mix(in srgb, var(--u-danger,#ff6b6b) 40%, transparent); }
.sc-btn:disabled { opacity: .5; cursor: not-allowed; }
.sc-hidden { display: none !important; }
.sc-empty { grid-column: 1 / -1; display: grid; place-items: center; color: var(--ink-faint, #6b7a89); font-size: var(--text-sm, .84rem); padding: 24px; text-align: center; }

@media (max-width: 760px) {
  .sc-body { grid-template-columns: 1fr; grid-template-rows: 42% 58%; }
  .sc-list { border-inline-end: 0; border-block-end: 1px solid var(--line,#232a32); }
}
