:root {
  --bg-main: #f2f5f9;
  --bg-panel: #ffffff;
  --bg-soft: #f7f9fc;
  --text-main: #1f2937;
  --text-muted: #5b677a;
  --line: #dbe3ef;
  --brand: #0f4fa8;
  --brand-strong: #0a3a7d;
  --danger: #b42318;
  --ok: #0f8a43;
  --warning: #b76e00;
  --shadow: 0 10px 28px rgba(15, 39, 75, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: "Trebuchet MS", "Segoe UI", "Verdana", sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(15, 79, 168, 0.13), transparent 28%),
    radial-gradient(circle at 92% 78%, rgba(16, 185, 129, 0.1), transparent 24%),
    linear-gradient(135deg, #eff4fb 0%, #f8fbff 100%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Cambria", "Georgia", serif;
  letter-spacing: 0.01em;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #0b1f44 0%, #102a59 100%);
  color: #e9f0ff;
}

.brand {
  display: grid;
  gap: 10px;
}

.brand-eyebrow {
  color: #9ec5ff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brand p {
  margin: 0;
  color: #c8d9ff;
  font-size: 0.95rem;
  line-height: 1.45;
}

.nav {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.nav-link {
  display: block;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(210, 226, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: #edf4ff;
  text-decoration: none;
  font-weight: 600;
  transition: all 160ms ease;
}

.nav-link:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.12);
}

.nav-link.is-active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
}

.content {
  padding: 28px;
}

.hero,
.panel,
.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px;
  margin-bottom: 18px;
}

.hero.compact {
  align-items: flex-start;
}

.hero p {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.section-eyebrow {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

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

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stat-card strong {
  font-size: 1.5rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.execution-card p {
  margin: 8px 0;
}

.client-shortcuts {
  display: grid;
  gap: 10px;
}

.shortcut-item {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  background: var(--bg-soft);
}

.shortcut-item:hover {
  border-color: #b9c8de;
}

.shortcut-title {
  font-weight: 700;
}

.shortcut-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.cell-title {
  font-weight: 700;
}

.cell-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.filter-form {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 6px;
}

label > span {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text-main);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 79, 168, 0.22);
  border-color: #9eb9e0;
}

.field-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text-main);
  text-decoration: none;
  padding: 10px 13px;
  font: inherit;
  cursor: pointer;
  font-weight: 700;
  transition: all 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
}

.button-danger {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #d92d20 0%, #a1221a 100%);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-ok,
.status-completed {
  background: rgba(15, 138, 67, 0.12);
  color: #0f7a3b;
}

.status-inactive,
.status-failed {
  background: rgba(180, 35, 24, 0.11);
  color: #9f1e14;
}

.status-running {
  background: rgba(183, 110, 0, 0.16);
  color: #9f6400;
}

.status-info {
  background: rgba(15, 79, 168, 0.12);
  color: #0f4fa8;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.tag-on {
  background: rgba(15, 138, 67, 0.12);
  color: #0f7a3b;
}

.tag-off {
  background: rgba(91, 103, 122, 0.14);
  color: #4d596e;
}

.accordion-stack {
  display: grid;
  gap: 10px;
}

.accordion {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}

.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.report-form {
  padding: 0 14px 14px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.switch-row input[type="checkbox"] {
  display: none;
}

.switch-ui {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #c8d2e3;
  transition: background 160ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.switch-row input[type="checkbox"]:checked + .switch-ui {
  background: var(--brand);
}

.switch-row input[type="checkbox"]:checked + .switch-ui::after {
  transform: translateX(20px);
}

.switch-text {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-main);
  font-weight: 600;
}

.hint-line {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.email-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9d8ef;
  border-radius: 999px;
  background: #edf4ff;
  color: #1f4f93;
  font-size: 0.8rem;
  padding: 3px 9px;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
}

.flash-success {
  border-color: rgba(15, 138, 67, 0.24);
  background: rgba(15, 138, 67, 0.08);
  color: #0e7138;
}

.flash-error {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.08);
  color: #9f1e14;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .panel-grid,
  .form-grid,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

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

  .summary-main {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ======================================================
   Sidebar - bloco do usuario logado e link de sair
   ====================================================== */
.sidebar-user {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 4px;
}

.sidebar-user-name {
  color: #e9f0ff;
  font-weight: 600;
  font-size: 0.95rem;
}

.sidebar-user-email {
  color: #9ec5ff;
  font-size: 0.8rem;
  margin-bottom: 8px;
  word-break: break-all;
}

.sidebar-user-logout {
  display: inline-block;
  color: #ffd3d3;
  font-size: 0.82rem;
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid rgba(255, 211, 211, 0.35);
  border-radius: 6px;
  width: fit-content;
}

.sidebar-user-logout:hover {
  background: rgba(255, 211, 211, 0.12);
}
