/* ============================================================
   Veloci Auto — Design System "Kinetic Architect"
   ============================================================ */

/* ----- Reset & Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:             #f6faff;
  --surface:        #ffffff;
  --surface-tonal:  #eef4fc;

  --primary:        #002555;
  --primary-hv:     #001d44;
  --accent:         #4A90E2;
  --accent-hv:      #3a7cd5;
  --danger:         #dc2626;
  --success:        #16a34a;

  --text:           #0d1b2e;
  --text-muted:     #6b7fa3;

  --nav-h:          62px;
  --sidebar-w:      230px;

  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      24px;
  --radius-pill:    999px;

  --shadow-ambient: 0px 8px 24px rgba(27, 59, 111, 0.07);
  --shadow-hover:   0px 16px 40px rgba(27, 59, 111, 0.13);
  --shadow-card:    0px 2px 8px rgba(27, 59, 111, 0.05);

  --glass-bg:       rgba(0, 37, 85, 0.88);
  --glass-blur:     12px;

  --term-bg:        #001400;
  --term-fg:        #00e676;
  --term-dim:       #00994d;
}

html, body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- Typography ------------------------------------------ */
h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: .25rem;
  color: var(--primary);
}
h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: .75rem;
}
h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: .75rem;
}

/* ----- Navbar ---------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
  gap: 1rem;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 20px rgba(0,0,0,.25);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
}
.navbar__logo img {
  height: 34px;
  width: auto;
  object-fit: contain;
}
.navbar__title {
  color: rgba(255,255,255,.9);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.navbar__spacer { flex: 1; }
.navbar__user {
  color: rgba(255,255,255,.55);
  font-size: .825rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.navbar__logout-btn {
  color: rgba(255,255,255,.65);
  font-size: .8rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-pill);
  padding: .25rem .85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, color .2s;
}
.navbar__logout-btn:hover {
  background: rgba(255,255,255,.16);
  color: #fff;
}

/* ----- Sidebar admin --------------------------------------- */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--nav-h);
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  background: var(--primary);
  overflow-y: auto;
  z-index: 90;
  padding: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 20px rgba(0,37,85,.18);
}

.sidebar__title {
  font-size: .68rem;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  padding: 0 1.25rem 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .1rem;
  padding: 0 .75rem;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .9rem;
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background .15s, color .15s;
}
.sidebar__item:hover {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.95);
  text-decoration: none;
}
.sidebar__item--active {
  background: rgba(74,144,226,.18);
  color: #fff;
}
.sidebar__item--active .sidebar__icon { opacity: 1; color: var(--accent); }
.sidebar__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .6;
  transition: opacity .15s;
}
.sidebar__item:hover .sidebar__icon { opacity: 1; }
.sidebar__footer {
  padding: .85rem 1.25rem;
  font-size: .68rem;
  color: rgba(255,255,255,.22);
  border-top: 1px solid rgba(255,255,255,.07);
  text-align: center;
  letter-spacing: .03em;
}

/* ----- Navbar — botão Ajuda -------------------------------- */
.navbar__help-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: rgba(255,255,255,.65);
  font-size: .8rem;
  font-family: inherit;
  font-weight: 500;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-pill);
  padding: .28rem .9rem;
  cursor: pointer;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.navbar__help-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ----- Help Drawer ----------------------------------------- */
.help-drawer {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}
.help-drawer--open { pointer-events: all; }

.help-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,13,31,.55);
  opacity: 0;
  transition: opacity .3s;
}
.help-drawer--open .help-drawer__overlay { opacity: 1; }

.help-drawer__panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(520px, 95vw);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,37,85,.18);
  overflow: hidden;
}
.help-drawer--open .help-drawer__panel { transform: translateX(0); }

.help-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  background: var(--primary);
  flex-shrink: 0;
}
.help-drawer__head-left {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.help-drawer__head-left svg { color: var(--accent); opacity: .9; }
.help-drawer__head h2 {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -.01em;
}
.help-drawer__close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.65);
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.help-drawer__close:hover { background: rgba(255,255,255,.18); color: #fff; }

.help-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.help-section__label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #e8eef7;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.help-section__label--admin { color: var(--accent); }
.help-section__label--admin::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.help-item {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  background: #f4f8fe;
  border: 1px solid #e5edf8;
  margin-bottom: .55rem;
}
.help-item:last-child { margin-bottom: 0; }
.help-item__title {
  font-size: .86rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: .3rem;
}
.help-item__desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.help-item__badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: var(--radius-pill);
  margin-bottom: .35rem;
}
.help-item__badge--blue  { background: #dbeafe; color: #1d4ed8; }
.help-item__badge--green { background: #dcfce7; color: #15803d; }
.help-item__badge--gray  { background: #f1f5f9; color: #475569; }

.help-steps { display: flex; flex-direction: column; gap: .6rem; }
.help-step  { display: flex; gap: .75rem; align-items: flex-start; }
.help-step__num {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: .15rem;
}
.help-step__text { font-size: .81rem; color: var(--text); line-height: 1.5; }
.help-step__text strong { color: var(--primary); }

/* sidebar — link de ajuda antes do footer */
.sidebar__help-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .5rem .75rem .75rem;
  padding: .65rem .9rem;
  color: rgba(255,255,255,.45);
  font-size: .82rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: background .15s, color .15s;
  width: calc(100% - 1.5rem);
  text-align: left;
}
.sidebar__help-link:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.sidebar__help-link svg  { opacity: .6; flex-shrink: 0; }
.sidebar__help-link:hover svg { opacity: 1; }

/* ----- Page shell ------------------------------------------ */
.page {
  margin-top: var(--nav-h);
  margin-left: auto;
  margin-right: auto;
  padding: 2.25rem 2.5rem;
  max-width: 980px;
}
.page--wide { max-width: 1260px; }
body.has-sidebar { padding-left: var(--sidebar-w); }

/* ----- Page header ----------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.page-header__subtitle {
  color: var(--text-muted);
  font-size: .875rem;
  margin-top: .2rem;
}
.page-header__actions {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-shrink: 0;
  padding-top: .15rem;
}

/* ----- Card ------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-ambient);
}

/* ----- Admin panel ----------------------------------------- */
.admin-panel {
  padding: 1.5rem;
  overflow: hidden;
}
.admin-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0,37,85,.06);
}
.admin-panel__header h2 { margin: 0; }

/* ----- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  border: 1.5px solid rgba(0,37,85,.18);
  background: rgba(0,37,85,.05);
  color: var(--primary);
  transition: all .2s ease;
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover {
  background: rgba(0,37,85,.09);
  border-color: rgba(0,37,85,.3);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0,37,85,.25);
}
.btn-primary:hover {
  background: var(--primary-hv);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,37,85,.35);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(74,144,226,.3);
}
.btn-accent:hover {
  background: var(--accent-hv);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(0,37,85,.2);
}
.btn-ghost:hover {
  background: rgba(0,37,85,.04);
  border-color: var(--primary);
  text-decoration: none;
}
.btn-ghost.btn--active {
  background: rgba(0,37,85,.08);
  border-color: var(--primary);
  font-weight: 600;
}
.btn-download {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .5rem 1.1rem;
  font-size: .875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  box-shadow: var(--shadow-card);
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}
.btn-download:hover { background: var(--primary-hv); text-decoration: none; }

/* ----- Back link ------------------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-muted);
  font-size: .825rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
  transition: color .15s;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ----- Status badge ---------------------------------------- */
.status-badge {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.status-PENDING  { background: #fef9c3; color: #854d0e; }
.status-RUNNING  { background: #dbeafe; color: #1d4ed8; }
.status-SUCCESS  { background: #dcfce7; color: #15803d; }
.status-ERROR    { background: #fee2e2; color: #991b1b; }

/* ----- Meta row -------------------------------------------- */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.meta-row strong { color: var(--text); }

/* ----- Error box ------------------------------------------- */
.error-box {
  background: #fef2f2;
  border-radius: var(--radius-md);
  color: #991b1b;
  padding: .75rem 1.1rem;
  margin-bottom: 1rem;
  font-size: .875rem;
}

/* ----- Download section ------------------------------------ */
.download-section { margin: 1.25rem 0; display: none; }
.download-section.visible { display: block; }
.download-links { display: flex; flex-wrap: wrap; gap: .75rem; }
.download-card {
  background: #f0fdf4;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(22,163,74,.1);
}
.download-card__header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}
.download-card__icon { font-size: 1.3rem; }
.download-card__header h3 { margin: 0; color: #15803d; }
.btn-download--lg {
  padding: .65rem 1.4rem;
  font-size: .95rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(37,99,235,.25);
  transition: transform .1s, box-shadow .1s;
}
.btn-download--lg:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37,99,235,.35);
}

/* ----- Terminal section ------------------------------------ */
.terminal-section { margin-top: 1.5rem; }
.terminal-section h3 { margin-bottom: .75rem; }
.terminal-wrap {
  background: var(--term-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
}
.terminal-bar {
  background: #0a1e0a;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .85rem;
  border-bottom: 1px solid #1a3a1a;
}
.terminal-bar__dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.terminal-bar__dot--red    { background: #ff5f56; }
.terminal-bar__dot--yellow { background: #ffbd2e; }
.terminal-bar__dot--green  { background: #27c93f; }
.terminal-bar__title {
  margin-left: .5rem;
  color: #4a7c59;
  font-size: .8rem;
  font-family: 'Courier New', monospace;
  letter-spacing: .04em;
}
.terminal-bar__spinner {
  margin-left: auto;
  color: #27c93f;
  font-size: .9rem;
  animation: spin 1.2s linear infinite;
  display: inline-block;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.terminal-body {
  padding: 1rem 1.2rem;
  max-height: 600px;
  min-height: 220px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-track { background: #001400; }
.terminal-body::-webkit-scrollbar-thumb { background: #1a4a1a; border-radius: 3px; }
#log-content {
  font-family: 'Courier New', 'Lucida Console', monospace;
  font-size: .82rem;
  line-height: 1.65;
  color: var(--term-fg);
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  border: none;
  margin: 0;
}

/* ----- Form ----------------------------------------------- */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .825rem;
  margin-bottom: .4rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group input[type="file"] {
  width: 100%;
  padding: .6rem 1rem;
  border: 1.5px solid rgba(0,37,85,.1);
  border-radius: var(--radius-md);
  font-size: .9rem;
  background: var(--surface-tonal);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(74,144,226,.15);
}
.form-group input[type="file"] { padding: .5rem .8rem; cursor: pointer; }

/* ----- Search input (page-header) ------------------------- */
.search-wrap {
  position: relative;
  max-width: 380px;
  width: 100%;
  border-radius: var(--radius-pill);
  /* gradient border: padding-box = inner fill, border-box = border gradient */
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(90deg, rgba(74,144,226,.35) 0%, rgba(0,37,85,.25) 100%) border-box;
  border: 2px solid transparent;
  box-shadow: 0 2px 14px rgba(0,37,85,.07);
  transition: box-shadow .25s, background .25s;
}
.search-wrap:focus-within {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(90deg, #4A90E2 0%, #002555 100%) border-box;
  box-shadow:
    0 0 0 4px rgba(74,144,226,.16),
    0 6px 24px rgba(0,37,85,.13);
}
.search-wrap__icon {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  pointer-events: none;
  transition: color .2s;
}
.search-wrap:focus-within .search-wrap__icon {
  color: var(--primary);
}
.search-wrap input[type="search"] {
  width: 100%;
  padding: .7rem 1.1rem .7rem 2.55rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  border-radius: var(--radius-pill);
}
.search-wrap input[type="search"]::placeholder {
  color: var(--text-muted);
  font-style: italic;
}
.search-wrap input[type="search"]::-webkit-search-cancel-button {
  opacity: .4;
  cursor: pointer;
}

/* ----- Flash messages ------------------------------------- */
.flash {
  padding: .7rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: .875rem;
  font-weight: 500;
}
.flash--error   { background: #fef2f2; color: #991b1b; }
.flash--success { background: #f0fdf4; color: #15803d; }
.flash--info    { background: #eff6ff; color: #1e40af; }

/* ----- Badges --------------------------------------------- */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge--blue   { background: #dbeafe; color: #1e40af; }
.badge--orange { background: #fef3c7; color: #b45309; }
.badge--gray   { background: #f1f5f9; color: #64748b; }
.badge--green  { background: #dcfce7; color: #15803d; }

/* ----- Dashboard — Bento Grid ----------------------------- */
.automation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(156px, auto);
  gap: 1rem;
  margin-top: .75rem;
}
.automation-card--wide { grid-column: span 2; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.automation-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
  animation: fadeInUp .4s ease both;
}
.automation-card:nth-child(1) { animation-delay: 0s; }
.automation-card:nth-child(2) { animation-delay: .07s; }
.automation-card:nth-child(3) { animation-delay: .14s; }
.automation-card:nth-child(4) { animation-delay: .21s; }
.automation-card:nth-child(5) { animation-delay: .28s; }
.automation-card:nth-child(6) { animation-delay: .35s; }
.automation-card:nth-child(n+7) { animation-delay: .42s; }

.automation-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  opacity: 0;
  transition: opacity .25s ease;
}
.automation-card:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.automation-card:hover::before { opacity: 1; }

.automation-card__icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .3rem;
  flex-shrink: 0;
}
.automation-card__icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
}
.automation-card__name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.automation-card__desc {
  font-size: .825rem;
  color: var(--text-muted);
  flex: 1;
  line-height: 1.5;
}
.automation-card__actions {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}

/* ----- Login page ----------------------------------------- */
.login-page {
  min-height: 100vh;
  background: var(--primary);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(74,144,226,.22) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(74,144,226,.09) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.5rem;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.login-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 2rem;
}
.login-card__logo img { height: 40px; width: auto; }
.login-card__title {
  color: rgba(255,255,255,.95);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.login-card__subtitle {
  text-align: center;
  color: rgba(255,255,255,.38);
  font-size: .8rem;
  margin-top: -.5rem;
  margin-bottom: 2rem;
  letter-spacing: .02em;
}
.login-card .form-group label { color: rgba(255,255,255,.72); font-size: .8rem; }
.login-card .form-group input {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  color: #f1f5f9;
}
.login-card .form-group input::placeholder { color: rgba(255,255,255,.28); }
.login-card .form-group input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 3px rgba(74,144,226,.25);
}
.login-card .btn-primary {
  width: 100%;
  padding: .7rem;
  font-size: .95rem;
  margin-top: .5rem;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(74,144,226,.4);
  border-radius: var(--radius-lg);
  justify-content: center;
}
.login-card .btn-primary:hover {
  background: var(--accent-hv);
  transform: translateY(-1px);
  box-shadow: 0 6px 26px rgba(74,144,226,.5);
}

/* ----- Tabela de quantidades mínimas ----------------------- */
.qtd-table-wrap { overflow-x: auto; }
.qtd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.qtd-table--auto { table-layout: fixed; }
.qtd-table thead tr { border-bottom: 1px solid rgba(0,37,85,.08); }
.qtd-table th {
  text-align: left;
  padding: .6rem .85rem;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.qtd-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid rgba(0,37,85,.05);
  vertical-align: middle;
}
.qtd-table tbody tr:last-child td { border-bottom: none; }
.qtd-table tbody tr { transition: background .12s; }
.qtd-table tbody tr:hover { background: rgba(74,144,226,.04); }
.qtd-table__dia { font-weight: 600; color: var(--text); }
.qtd-table__vazio { color: var(--text-muted); }
.qtd-input {
  width: 70px;
  padding: .3rem .5rem;
  border: 1.5px solid rgba(0,37,85,.12);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  text-align: center;
  background: var(--surface-tonal);
  color: var(--text);
  display: inline-block;
  vertical-align: middle;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.qtd-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74,144,226,.15);
}
.btn-danger-sm {
  background: transparent;
  border: 1.5px solid rgba(220,38,38,.22);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: .2rem .55rem;
  font-size: .78rem;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
.btn-danger-sm:hover { background: #fef2f2; border-color: var(--danger); }

/* ----- Faixas de KM ---------------------------------------- */
.km-currency-cell {
  display: flex;
  align-items: center;
  gap: .25rem;
  justify-content: center;
}
.km-currency-cell .km-prefix {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}
.km-currency-cell .qtd-input { width: 72px; }
.km-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0 .35rem;
  user-select: none;
}
.km-drag-handle:active { cursor: grabbing; }
.km-row.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}
.km-row--deleting td { opacity: .35; }
.btn-km-remove {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 1rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: var(--radius-sm);
  line-height: 1;
  font-family: inherit;
}
.btn-km-remove:hover { background: #fee2e2; }
.btn-km-add {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .75rem;
  padding: .4rem 1rem;
  background: transparent;
  border: 1.5px dashed rgba(74,144,226,.4);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-size: .875rem;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
.btn-km-add:hover { background: rgba(74,144,226,.06); border-color: var(--accent); }

/* ----- Table cell alignment -------------------------------- */
.qtd-table td.td-center { text-align: center; }
.qtd-table th.th-turno-sep,
.qtd-table td.td-turno-sep { border-left: 1px solid rgba(0,37,85,.08); }

/* ----- Filter form (logs) ---------------------------------- */
.logs-filter-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.logs-filter-form__field { min-width: 130px; }
.logs-filter-form__field--wide { flex: 1; min-width: 200px; }
.logs-filter-form__actions { display: flex; gap: .5rem; align-items: flex-end; }

/* ----- Mobile / Responsivo --------------------------------- */
.navbar__hamburger { display: none; }
.sidebar__mobile-logout { display: none; }
.sidebar__logout-btn {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  border-radius: var(--radius-md);
  padding: .4rem .9rem;
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar__logout-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-overlay--visible { display: block; }

@media (max-width: 1100px) and (min-width: 769px) {
  .automation-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-panel { padding: 1rem; }

  .navbar__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #f1f5f9;
    font-size: 1.1rem;
    cursor: pointer;
    padding: .3rem .5rem;
    border-radius: var(--radius-sm);
    margin-right: .25rem;
    flex-shrink: 0;
  }
  .navbar__hamburger:hover { background: rgba(255,255,255,.14); }
  .navbar__email {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 200;
  }
  .sidebar--open { transform: translateX(0); }
  body.has-sidebar { padding-left: 0; }
  .sidebar__item--no-mobile { display: none; }
  body.has-sidebar .navbar__user { display: none; }
  .sidebar__mobile-logout {
    display: block;
    padding: 0 .75rem .75rem;
  }
  .page { padding: 1.25rem 1rem; }
  .automation-grid { grid-template-columns: 1fr; }
  .automation-card--wide { grid-column: span 1; }
  .page-header { flex-direction: column; align-items: flex-start; }

  .logs-filter-form { flex-direction: column; }
  .logs-filter-form__field,
  .logs-filter-form__field--wide { width: 100%; min-width: unset; flex: unset; }
  .logs-filter-form__actions { width: 100%; }
  .logs-filter-form__actions .btn { flex: 1; justify-content: center; }
}

/* ----- Toast de conclusão ---------------------------------- */
.exec-toast {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 600;
  min-width: 280px;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,37,85,.18), 0 2px 8px rgba(0,0,0,.08);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.exec-toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.exec-toast--success { border-left-color: var(--success); }
.exec-toast--error   { border-left-color: var(--danger); }

.exec-toast__icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-top: .05rem;
}
.exec-toast--success .exec-toast__icon { background: #dcfce7; color: var(--success); }
.exec-toast--error   .exec-toast__icon { background: #fee2e2; color: var(--danger); }

.exec-toast__body { flex: 1; }
.exec-toast__title {
  font-size: .86rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .2rem;
}
.exec-toast__msg {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.exec-toast__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .1rem;
  flex-shrink: 0;
  line-height: 1;
  font-size: 1rem;
  margin-top: -.05rem;
  transition: color .15s;
}
.exec-toast__close:hover { color: var(--text); }

.exec-toast__bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: currentColor;
  width: 100%;
  transform-origin: left;
  animation: none;
}
.exec-toast--success .exec-toast__bar { color: var(--success); }
.exec-toast--error   .exec-toast__bar { color: var(--danger); }

@keyframes toast-bar-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ----- Page Loader ----------------------------------------- */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
#page-loader.page-loader--hidden {
  opacity: 0;
  pointer-events: none;
}
.page-loader__logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  animation: loader-spin 1.1s linear infinite;
}
@keyframes loader-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ----- Alert ---------------------------------------- */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.alert--error {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}
.alert--success {
  background: #f0fdf4;
  color: var(--success);
  border-color: #bbf7d0;
}
