:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;

  --topbar: #1f2433;
  --sidebar: #252c3d;
  --sidebar-muted: #aeb5c3;
  --sidebar-active: #2f3a52;

  --primary: #1e97f7;
  --primary-hover: #177ed0;

  --shadow: 0 10px 25px rgba(0,0,0,.10);

  --mock-tint: #f2f6ff;
  --mock-border: #dfe7ff;

  /* highlight melhor */
  --hi-outline: #ffffff;
  --hi-glow: rgba(255,255,255,.18);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* tom discreto do mock */
body.mock-tone .main{
  background: linear-gradient(180deg, var(--mock-tint), transparent 320px);
}
body.mock-tone .card{
  border-color: var(--mock-border);
}

/* ===== Topbar ===== */
.topbar{
  height: 56px;
  background: var(--topbar);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.topbar-left{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand{
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
}
.brand-mark{ font-size: 16px; opacity: .95; }

.topbar-right{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Layout ===== */
.app-shell{
  height: calc(100vh - 56px);
  display: flex;
}

.sidebar{
  width: 240px;
  background: var(--sidebar);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow: auto;
}

.main{
  flex: 1;
  overflow: auto;
  padding: 18px 18px 32px;
}

/* ===== Sidebar nav ===== */
.nav{ padding: 10px 10px 20px; }
.nav-item{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
}
.nav-item:hover{ background: rgba(255,255,255,.06); color: #fff; }
.nav-item-active{ background: var(--sidebar-active); color: #fff; }
.nav-ic{ width: 24px; display: grid; place-items: center; opacity: .95; }
.nav-tx{ font-size: 14px; font-weight: 500; }
.nav-caret{ margin-left: auto; opacity: .7; font-size: 12px; }
.nav-sep{ height: 1px; background: rgba(255,255,255,.07); margin: 10px 6px; }
.nav-section-title{
  color: rgba(255,255,255,.55);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 10px 6px;
}

/* ===== Page header ===== */
.page-header{ margin-bottom: 12px; }
.page-title-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-title h1{ margin: 0; font-size: 26px; font-weight: 900; color: #111827; }
.tabs{ display: flex; gap: 18px; margin-top: 10px; }
.tab{
  border: 0; background: transparent;
  color: #6b7280; font-weight: 700;
  padding: 8px 0; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab:hover{ color: #111827; }
.tab-active{ color: #111827; border-bottom-color: #111827; }
.page-actions{ display: flex; align-items: center; gap: 10px; }

/* ===== Card ===== */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  padding: 14px;
}

/* ===== Toolbar ===== */
.toolbar{ display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.search{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
}
.search i{ color: #9ca3af; }
.search input{ border: 0; outline: none; width: 100%; font-size: 14px; }
.filters{ display: flex; gap: 8px; }
.toolbar-right{ margin-left: auto; }

/* ===== Table ===== */
.table-wrap{
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.table-soft{ margin-top: 10px; }
.table{ width: 100%; border-collapse: collapse; }
.table thead th{
  text-align: left;
  font-size: 12px;
  letter-spacing: .02em;
  color: #6b7280;
  background: #fafafa;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
}
.table tbody td{
  padding: 14px 12px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 14px;
}
.table tbody tr:hover{ background: #fbfdff; }
.th-status, .td-status{ text-align: right; width: 140px; }

/* ===== Pagination ===== */
.pagination{ display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 12px; }
.pager{ display: flex; align-items: center; gap: 8px; }
.pager-btn, .pager-page{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
}
.pager-btn:hover, .pager-page:hover{ background: #f9fafb; }
.pager-active{ background: #1e97f7; color: #fff; border-color: #1e97f7; }
.pager-ellipsis{ color: #9ca3af; padding: 0 6px; }
.pager-last{ color: #6b7280; font-size: 14px; }

/* ===== Buttons ===== */
.btn{
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.btn-primary{ background: var(--primary); color: #fff; }
.btn-primary:hover{ background: var(--primary-hover); }
.btn-secondary{ background: #fff; color: #111827; border-color: var(--border); }
.btn-secondary:hover{ background: #f9fafb; }
.btn-ghost{ background: #fff; color: #111827; border-color: #eef0f4; }
.btn-ghost:hover{ background: #f9fafb; }

.btn-link{
  border: 0;
  background: transparent;
  color: #111827;
  padding: 8px 10px;
  font-weight: 900;
}
.btn-link:hover{ background: #f3f4f6; border-radius: 10px; }

.btn-link-inline{
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;
}
.btn-link-inline:hover{ text-decoration: underline; }

.btn-pill{ border: 0; border-radius: 999px; padding: 10px 14px; font-weight: 900; }
.btn-pill-dark{ background: rgba(255,255,255,.08); color: #fff; }
.btn-pill-dark:hover{ background: rgba(255,255,255,.12); }

.icon-btn{
  border: 0;
  background: rgba(255,255,255,.08);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:hover{ background: rgba(255,255,255,.12); }
.icon-btn.ghost{ background: #fff; color: #111827; border: 1px solid var(--border); }
.icon-btn.ghost:hover{ background: #f9fafb; }
.icon-btn.dark{ background: #111827; color: #fff; }
.icon-btn.dark:hover{ background: #0b1220; }

.select{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ===== Badges ===== */
.badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}
.badge-green{ background: #e9f9ef; color: #0b7a33; border: 1px solid #c9f0d6; }
.badge-lite{
  background: #eef2ff;
  border: 1px solid #dde4ff;
  color: #334155;
  border-radius: 999px;
  font-weight: 900;
  padding: 2px 8px;
  font-size: 12px;
}

/* ===== Views ===== */
.hidden{ display: none !important; }

/* ===== Create ===== */
.breadcrumb{ color: #6b7280; font-weight: 800; font-size: 13px; padding: 4px 2px 10px; }
.sep{ opacity: .6; margin: 0 4px; }

.create-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.create-title h2{ margin: 0; font-size: 22px; font-weight: 900; }
.create-actions{ display: flex; gap: 10px; align-items: center; }

.alert{
  background: #fff6dd;
  border: 1px solid #ffe7a6;
  color: #7a5a00;
  border-radius: 12px;
  padding: 12px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.alert i{ margin-top: 2px; }
.alert-close{
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  opacity: .7;
}
.alert-close:hover{ opacity: 1; }

/* Toggle */
.mode-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.8);
  margin-bottom: 10px;
}
.mode-title{ font-weight: 900; color: #0f172a; }
.mode-sub{ display:block; font-size: 12px; color: #6b7280; font-weight: 700; margin-top: 2px; }

.segmented{
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.seg-btn{
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
  color: #334155;
}
.seg-btn:hover{ background: #f8fafc; }
.seg-active{
  background: #1e97f7;
  color: #fff;
}

/* Empilhados */
.form-stack{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
  max-width: 980px;
}

.field label{
  display: block;
  font-size: 12px;
  color: #6b7280;
  font-weight: 900;
  margin-bottom: 6px;
}
.field input{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}
.field input:focus{
  border-color: #cfe8ff;
  box-shadow: 0 0 0 3px rgba(30,151,247,.15);
}

.inline{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day{ max-width: 160px; }

.input-icon{
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}
.input-icon i{ color: #9ca3af; }
.input-icon input{ border: 0; padding: 10px 0; }
.input-icon input:focus{ box-shadow: none; }

.link{
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.link:hover{ text-decoration: underline; }

.two-inputs{ display: flex; align-items: center; gap: 10px; }
.mini{ display: flex; align-items: center; gap: 8px; }
.mini-label{ font-size: 12px; font-weight: 900; color: #6b7280; }
.mini input{ width: 110px; }

.interval-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip-lite{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #111827;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 13px;
}
.chip-lite .x{
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: .6;
  font-size: 14px;
}
.chip-lite .x:hover{ opacity: 1; }

.select-native{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 900;
  color: #111827;
  background: #fff;
  outline: none;
  cursor: pointer;
}
.select-native:focus{
  border-color: #cfe8ff;
  box-shadow: 0 0 0 3px rgba(30,151,247,.15);
}

/* ===== Sections ===== */
.section{ margin-top: 14px; padding-top: 6px; }
.section-title{ display: flex; align-items: center; justify-content: space-between; }
.section-title h3{ margin: 6px 0 10px; font-size: 14px; font-weight: 900; color: #374151; }
.hint{ color: #9ca3af; margin-left: 6px; }

.two-cols{ display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.one-col{ display: grid; grid-template-columns: 1fr; }
.kv label{ font-size: 12px; font-weight: 900; color: #6b7280; display: block; margin-bottom: 8px; }
.kv-row{ display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.kv-help{ color: #6b7280; font-size: 13px; font-weight: 700; }
.select-like{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  color: #111827;
  font-weight: 900;
}
.w120{ width: 120px; }
.w260{ width: 260px; }

.footer-actions{ margin-top: 18px; padding-top: 12px; display: flex; justify-content: flex-start; }

/* ===== Modal ===== */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
}
.modal{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 24px));
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  z-index: 1001;
  overflow: hidden;
}
.modal-xl{ width: min(560px, calc(100vw - 24px)); }
.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h4{ margin: 0; font-size: 15px; font-weight: 900; }
.modal-body{ padding: 14px; }
.modal-footer{
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal .icon-btn{
  background: #fff;
  border: 1px solid var(--border);
  color: #111827;
}
.modal .icon-btn:hover{ background: #f9fafb; }

.modal-subtitle{
  margin: 14px 0 8px;
  font-weight: 900;
  color: #334155;
}
.radio-row{ display: flex; gap: 16px; margin-bottom: 10px; }
.radio{ display: inline-flex; gap: 8px; align-items: center; font-weight: 900; color: #334155; }
.modal-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.info-ic{
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  margin-left: 6px;
}

.toggle-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #334155;
  font-weight: 900;
}

/* Switch */
.switch{ position: relative; display: inline-block; width: 42px; height: 22px; }
.switch input{ opacity: 0; width: 0; height: 0; }
.slider{
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #e5e7eb;
  transition: .2s;
  border-radius: 999px;
}
.slider:before{
  position: absolute; content: "";
  height: 18px; width: 18px; left: 2px; top: 2px;
  background: white;
  transition: .2s;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}
.switch input:checked + .slider{ background: #93c5fd; }
.switch input:checked + .slider:before{ transform: translateX(20px); }

/* ===== Tutorial ===== */
.tutorial-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  z-index: 2000;
}
.guide-balloon{
  position: absolute;
  width: min(460px, calc(100vw - 24px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0,0,0,.50);
  border: 1px solid rgba(0,0,0,.08);
  padding: 14px;
  z-index: 2002;
}
.balloon-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.balloon-title{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.balloon-sub{
  font-size: 12px;
  color: #64748b;
  font-weight: 900;
}

/* pill do passo */
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #0b5fb5;
  background: #e9f4ff;
  border: 1px solid #cfe8ff;
  border-radius: 999px;
  padding: 4px 10px;
  width: fit-content;
}

/* box interno mais premium */
.guide-box{
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
  border-radius: 14px;
  padding: 12px;
}
.guide-h{
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 6px;
  font-size: 16px;
}
.guide-p{
  color: #111827;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px;
}
.guide-meta{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.meta-row{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 800;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
}
.meta-ic{
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  border: 1px solid #dde4ff;
  color: #334155;
  flex: 0 0 auto;
}
.meta-row strong{ color: #0f172a; }

.balloon-footer{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.balloon-tip{
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  transform: rotate(45deg);
  border-left: 1px solid rgba(0,0,0,.08);
  border-top: 1px solid rgba(0,0,0,.08);
  left: 26px;
  top: -7px;
}

/* ===== Highlight (MELHOR PARA A ABA EXCEÇÕES) ===== */
.active-step{
  position: relative;
  z-index: 2003 !important;
  outline: 5px solid var(--hi-outline) !important;
  outline-offset: 5px;
  border-radius: 12px;
  box-shadow: 0 0 0 10px var(--hi-glow), 0 22px 55px rgba(0,0,0,.35);
}

/* quando o target é TAB, deixa mais “aceso” */
.tab.active-step{
  background: rgba(255,255,255,.95) !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  border-bottom-color: transparent !important;
  color: #0f172a !important;
}

/* ===== Picker do modo ===== */
.mode-picker-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2100;
}
.mode-picker{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 24px));
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  z-index: 2101;
  overflow: hidden;
}
.mp-head{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.mp-title{ font-weight: 900; font-size: 16px; color: #0f172a; }
.mp-sub{ font-weight: 700; font-size: 12px; color: #64748b; margin-top: 2px; }
.mp-x{
  background: #0f172a;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 12px;
}
.mp-x:hover{ background: #0b1220; }

.mp-body{ padding: 14px; }
.mp-cards{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mp-card{
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}
.mp-card:hover{ background: #f8fafc; }
.mp-card-active{
  border-color: #cfe8ff;
  box-shadow: 0 0 0 3px rgba(30,151,247,.18);
}
.mp-card-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.mp-pill{
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 900;
  background: #e9f4ff;
  border: 1px solid #cfe8ff;
  color: #0b5fb5;
}
.mp-mini{
  font-weight: 900;
  font-size: 12px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
}
.mp-big{ font-weight: 900; font-size: 16px; color: #0f172a; }
.mp-desc{ font-weight: 700; font-size: 12px; color: #64748b; margin-top: 6px; }

.mp-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* ===== Responsivo ===== */
@media (max-width: 1100px){
  .two-cols{ grid-template-columns: 1fr; }
  .modal-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 560px){
  .mp-cards{ grid-template-columns: 1fr; }
}
