:root {
  --navy-950: #07142f;
  --navy-900: #0b1e43;
  --navy-800: #123365;
  --navy-700: #1d4d84;
  --coral: #fe4c57;
  --orange: #ff862f;
  --green: #2c9a69;
  --blue: #2d7ff9;
  --amber: #d98b1f;
  --red: #cf4650;
  --ink: #172238;
  --muted: #66738a;
  --line: #dfe5ee;
  --surface: #fff;
  --canvas: #f3f6fa;
  --header-height: 64px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
[hidden], .hidden { display: none !important; }
a { color: var(--navy-700); }
a:hover, a:focus { color: var(--coral); }
button, input, select, textarea { max-width: 100%; }
.text-muted { color: var(--muted); }
.form-control { border-color: #cbd4df; border-radius: 6px; box-shadow: none; }
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45,127,249,.1); }
.help-block { color: var(--muted); font-size: 12px; }

/* Navbar — mesmo padrão do sistema de afiliados. */
.navbar.navbar-inverse {
  min-height: var(--header-height);
  margin: 0;
  border: 0;
  background: var(--navy-950);
  box-shadow: 0 3px 16px rgba(7,20,47,.18);
}
.navbar-inner { min-height: var(--header-height); }
.navbar .container-fluid {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  padding: 0 18px;
}
.navbar .framevoz-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  order: 1;
  min-height: var(--header-height);
  height: auto;
  margin: 0;
  padding: 10px 18px 10px 0;
  color: #fff;
}
.framevoz-brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-right: 9px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--orange));
  font-size: 18px;
}
.brand-word { font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.brand-word > span, .login-brand strong > span { color: var(--coral); }
.framevoz-brand small {
  margin-left: 9px;
  padding-left: 9px;
  color: #95a5bf;
  border-left: 1px solid rgba(255,255,255,.2);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.main-navigation {
  position: static;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  order: 2;
  width: auto;
  margin: 0 !important;
  padding: 0 !important;
}
.navbar .main-navigation > li { float: none; margin: 0 1px; }
.navbar-inverse .main-navigation > li > a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: var(--header-height);
  padding: 21px 12px 18px;
  color: #aebbd0;
  border-bottom: 3px solid transparent;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.navbar-inverse .main-navigation > li > a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.07);
}
.navbar-inverse .main-navigation > .active > a,
.navbar-inverse .main-navigation > .active > a:hover {
  color: #fff;
  border-bottom-color: var(--coral);
  background: linear-gradient(180deg, rgba(254,76,87,.14), rgba(254,76,87,.04));
  box-shadow: inset 0 -1px rgba(254,76,87,.12);
}
.user-navigation {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  order: 3;
  min-height: var(--header-height);
  margin: 0 0 0 auto;
}
.navbar-inverse .user-navigation > li > a { padding: 22px 12px; color: #cbd5e5; font-size: 12px; }
.navbar-inverse .user-navigation > li > a:hover { color: #fff; background: rgba(255,255,255,.06); }
.mobile-menu { display: none; order: 4; margin-left: auto; }
.mobile-navigation-item { display: none !important; }

/* Workspace e componentes Bootstrap. */
.app-container { width: auto; min-height: 100vh; padding: calc(var(--header-height) + 24px) 28px 30px; }
.main-panel { min-height: calc(100vh - 110px); padding-bottom: 30px; }
.page-header { margin: 0 0 22px; padding: 0 0 14px; border-color: var(--line); }
.page-header h2 { margin: 0; color: var(--navy-950); font-size: 27px; font-weight: 700; letter-spacing: -.03em; }
.page-header h2 small { color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.has-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.has-actions > h2, .has-actions > .section-title { min-width: 0; order: 1; }
.page-actions { flex: 0 0 auto; order: 2; }
.well {
  min-height: 0;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid rgba(215,223,234,.9);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(21,40,73,.055);
}
.well-title { min-height: 30px; margin: -2px 0 16px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.section-title { margin: 0 0 12px; color: var(--navy-950); font-size: 17px; font-weight: 700; line-height: 1.4; }
.section-title .glyphicon { margin-right: 5px; color: var(--coral); }
.btn { overflow: hidden; border-radius: 7px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; box-shadow: none; }
.btn-primary { border-color: #226fe3; background: var(--blue); }
.btn-primary:hover, .btn-primary:focus { border-color: #185fc7; background: #216ddd; }
.btn-success { border-color: #25865b; background: var(--green); }
.btn-danger { border-color: #bd3943; background: var(--red); }
.alert { border-radius: 9px; }
.label { display: inline-block; padding: .4em .65em; border-radius: 4px; }
.count-label { margin-right: 7px; vertical-align: 1px; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.table-responsive { width: 100%; margin-bottom: 0; overflow-x: auto; border: 0; border-radius: 10px; }
.table { margin-bottom: 0; background: #fff; }
.table > thead > tr > th { color: #5c687a; border-bottom: 1px solid #cfd7e2; background: #edf2f7; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.table > tbody > tr > td { border-color: #e7ebf1; vertical-align: middle; }
.progress { height: 9px; margin-bottom: 0; border-radius: 10px; box-shadow: none; }
.progress-bar { border-radius: 10px; background: var(--blue); }

/* Métricas. */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}
.metrics-row::before, .metrics-row::after { display: none; }
.metrics-row > [class*="col-"] { float: none; width: auto; min-width: 0; padding: 0; }
.metrics-row > .col-md-4 { grid-column: span 4; }
.metric-box {
  position: relative;
  min-height: 126px;
  margin: 0;
  padding: 19px;
  overflow: hidden;
  border: 0;
  border-left: 4px solid var(--coral);
}
.metric-box::after {
  position: absolute;
  right: -42px;
  bottom: -44px;
  width: 90px;
  height: 90px;
  content: "";
  border-radius: 50%;
  background: rgba(254,76,87,.06);
}
.metric-box > .glyphicon { position: absolute; top: 18px; right: 18px; color: var(--coral); font-size: 27px; opacity: .18; }
.metric-box span:not(.glyphicon), .metric-box strong, .metric-box small { display: block; }
.metric-box span:not(.glyphicon) { padding-right: 28px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric-box strong { margin: 11px 0 4px; color: var(--navy-900); font-size: 27px; line-height: 1.1; }
.metric-box small { color: #8894a6; line-height: 1.35; }
.metric-next { border-left-color: var(--blue); }
.metric-next > .glyphicon { color: var(--blue); }
.metric-estimate { border-left-color: var(--green); }
.metric-estimate > .glyphicon { color: var(--green); }

/* Fluxo e upload. */
.workflow-panel { padding-bottom: 17px; }
.workflow { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 14px; }
.flow-step { display: flex; align-items: center; gap: 9px; min-width: 115px; color: var(--muted); }
.step-number { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border: 1px solid #bcc6d3; border-radius: 50%; font-size: 11px; }
.flow-step.active { color: var(--ink); }
.flow-step.active .step-number { color: #fff; border-color: var(--coral); background: var(--coral); }
.flow-step strong, .flow-step small { display: block; }
.flow-step strong { font-size: 11px; text-transform: uppercase; }
.flow-step small { margin-top: 2px; font-size: 10px; }
.flow-line { height: 1px; min-width: 20px; background: var(--line); }
.upload-panel { padding-bottom: 0; }
.dropzone {
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px;
  border: 2px dashed #c5cfdb;
  border-radius: 11px;
  text-align: center;
  cursor: pointer;
  background: #f9fbfd;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: #f2f7ff; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 14px; border-radius: 50%; color: var(--blue); background: #e8f1ff; font-size: 25px; }
.dropzone strong { color: var(--navy-950); font-size: 20px; }
.dropzone > span:not(.dropzone-icon) { margin-top: 5px; color: var(--muted); }
.dropzone small { margin-top: 18px; color: #8a96a7; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.upload-progress { padding: 17px 2px 2px; }
.upload-progress p { margin-bottom: 7px; font-size: 12px; }
.form-actions { margin: 20px -20px 0; padding: 16px 20px; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; background: #f8fafc; }
.upload-actions { display: flex; align-items: center; gap: 13px; }
.upload-actions .help-block { margin: 0; }
.readiness-list { margin-bottom: 16px; }
.readiness-list .list-group-item { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 11px; padding: 15px 4px; border-width: 1px 0 0; }
.readiness-list .list-group-item:first-child { border-top: 0; }
.readiness-list .badge { width: 27px; height: 27px; display: grid; place-items: center; padding: 0; color: var(--muted); background: #e9edf3; }
.readiness-list p { margin: 0; }
.readiness-list strong, .readiness-list small { display: block; }
.readiness-list small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.readiness-list i { color: #8894a6; font-style: normal; }
.readiness-list i.ok { color: var(--green); }
.readiness-list i.error { color: var(--red); }

/* Biblioteca. */
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.video-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(21,40,73,.055); }
.video-thumb { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); }
.video-thumb::before { position: absolute; inset: 0; content: ""; background: radial-gradient(circle at 75% 20%, rgba(45,127,249,.24), transparent 36%); }
.video-thumb .play { position: relative; width: 46px; height: 46px; padding-left: 4px; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; color: #fff; background: rgba(7,20,47,.42); }
.status-badge { position: absolute; top: 11px; left: 11px; padding: 5px 8px; border-radius: 15px; background: rgba(7,20,47,.74); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.status-badge.completed { background: var(--green); }
.status-badge.failed { background: var(--red); }
.card-delete { position: absolute; z-index: 2; top: 9px; right: 9px; width: 29px; height: 29px; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: #fff; background: rgba(7,20,47,.62); }
.card-delete:hover { background: var(--red); }
.video-duration { position: absolute; right: 11px; bottom: 9px; font-size: 10px; font-weight: 700; }
.video-body { padding: 16px; }
.video-body h3 { overflow: hidden; margin: 0 0 6px; color: var(--navy-950); font-size: 14px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.video-body > p { margin: 0; color: var(--muted); font-size: 11px; }
.job-progress { margin-top: 13px; }
.job-progress p { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 10px; }
.job-progress i { display: block; height: 7px; border-radius: 8px; background: #e6ebf1; }
.job-progress b { display: block; height: 100%; border-radius: 8px; background: var(--blue); }
.video-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; }
.video-actions button { flex: 1 1 90px; min-height: 34px; padding: 6px 9px; border: 1px solid #cbd4df; border-radius: 6px; background: #fff; font-size: 10px; font-weight: 700; }
.video-actions button:hover { border-color: var(--blue); color: var(--blue); }
.video-actions button.primary-action { color: #fff; border-color: var(--blue); background: var(--blue); }
.error-copy { overflow: hidden; margin-top: 10px !important; color: var(--red) !important; white-space: nowrap; text-overflow: ellipsis; }
.empty-state { grid-column: 1 / -1; display: grid; place-items: center; min-height: 300px; text-align: center; }
.empty-state > .glyphicon { color: #aab5c4; font-size: 38px; }
.empty-state h3 { margin: 13px 0 4px; color: var(--navy-950); }

/* Custos. */
.cost-highlight { margin: 21px 0; padding: 20px; border-left: 4px solid var(--coral); border-radius: 8px; background: #f8fafc; }
.cost-highlight span, .cost-highlight strong, .cost-highlight small { display: block; }
.cost-highlight span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.cost-highlight strong { margin: 5px 0; color: var(--navy-900); font-size: 32px; }
.cost-highlight small { color: var(--muted); }
.resource-panel > h3 { margin: 0 0 24px; color: var(--navy-900); font-size: 25px; font-weight: 700; }
.resource-item { margin-bottom: 23px; }
.resource-item p { margin-bottom: 8px; font-size: 12px; }
.resource-note { margin: 26px 0 0; font-size: 12px; line-height: 1.55; }

/* Modais Bootstrap controlados pelo app.js. */
.overlay.modal-shell { position: fixed; z-index: 1050; inset: 0; display: none; overflow-x: hidden; overflow-y: auto; padding: 25px 15px; background: rgba(7,20,47,.68); }
.overlay.modal-shell.open { display: block; }
.modal-shell .modal-dialog { margin: 0 auto; }
.modal-content { overflow: hidden; border: 0; border-radius: 14px; box-shadow: 0 28px 80px rgba(7,20,47,.38); }
.modal-header { padding: 17px 20px; border-color: var(--line); }
.modal-title { padding-right: 32px; color: var(--navy-950); font-size: 20px; font-weight: 700; }
.modal-title small { color: var(--muted); font-size: 12px; font-weight: 400; }
.modal-body { max-height: calc(100vh - 230px); padding: 22px; overflow-y: auto; }
.modal-footer { padding: 13px 20px; border-color: var(--line); background: #f8fafc; }
.config-tabs { margin: 0; padding: 0 15px; border-bottom-color: var(--line); background: #f8fafc; }
.config-tabs > li > a { margin-right: 4px; padding: 12px 16px; color: var(--muted); border-radius: 8px 8px 0 0; font-size: 12px; font-weight: 700; }
.config-tabs > li.active > a, .config-tabs > li.active > a:hover { color: var(--coral); border-color: var(--line) var(--line) transparent; background: #fff; }
.settings-pane { min-height: 360px; }
.settings-pane .form-group { margin-bottom: 19px; }
.settings-pane label { color: var(--navy-900); font-size: 12px; }
.secret-field { font-family: Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.settings-pane input[type="range"] { width: 100%; accent-color: var(--blue); }
.player-stage { background: #05090f; }
.player-stage video { display: block; width: 100%; max-height: 62vh; }
.player-copy { min-height: 74px; }
.player-copy p { margin: 0; white-space: pre-wrap; line-height: 1.55; }

/* Login no mesmo padrão do afiliados. */
.overlay.login-page {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: none;
  align-items: center;
  min-height: 100vh;
  padding: 24px 15px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 15%, rgba(45,127,249,.22), transparent 30%),
    radial-gradient(circle at 88% 78%, rgba(254,76,87,.18), transparent 32%),
    linear-gradient(135deg, var(--navy-950), #102956 65%, #17396c);
}
.overlay.login-page.open { display: flex; }
.login-page::before, .login-page::after { position: absolute; content: ""; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.login-page::before { width: 420px; height: 420px; top: -220px; right: -120px; }
.login-page::after { width: 300px; height: 300px; bottom: -180px; left: -80px; }
.login-page .container { position: relative; z-index: 1; width: 100%; max-width: 470px; }
.login-column { float: none; width: 100%; max-width: 440px; margin: 0 auto; }
.login-box { margin: 0; padding: 28px 32px 24px; border: 0; border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 20px; }
.framevoz-login-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--coral), var(--orange)); font-size: 22px; }
.login-brand strong { color: var(--navy-950); font-size: 26px; letter-spacing: -.04em; }
.login-intro { margin-bottom: 20px; text-align: center; }
.login-eyebrow { display: inline-block; margin-bottom: 6px; color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.login-title { margin: 0 0 6px; color: var(--navy-950); font-size: 26px; font-weight: 700; }
.login-box label { margin-bottom: 7px; }
.login-box .form-control { height: 44px; border-radius: 8px; }
.login-error { min-height: 19px; margin: -3px 0 7px; font-size: 11px; }
.login-box hr { margin: 17px 0 13px; }
.login-help { margin: 0; font-size: 12px; }

.toast-region { position: fixed; z-index: 1200; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(370px, calc(100vw - 30px)); }
.toast { padding: 14px 17px; border-radius: 8px; color: #fff; background: var(--navy-900); box-shadow: 0 12px 30px rgba(16,31,58,.22); font-size: 12px; }
.toast.error { background: var(--red); }

@media (max-width: 1199px) {
  .framevoz-brand small { display: none; }
}

@media (max-width: 991px) {
  .navbar .container-fluid { position: relative; flex-wrap: nowrap; }
  .mobile-menu { display: block; width: 42px; height: 38px; margin: 0 0 0 auto; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
  .main-navigation {
    position: absolute;
    z-index: 1030;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - var(--header-height));
    padding: 9px 12px 12px !important;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,.08);
    background: var(--navy-900);
    box-shadow: 0 16px 30px rgba(7,20,47,.3);
  }
  .main-navigation.open { display: flex; }
  .navbar .main-navigation > li { width: 100%; margin: 1px 0; }
  .navbar-inverse .main-navigation > li > a,
  .navbar-inverse .main-navigation > .active > a,
  .navbar-inverse .main-navigation > .active > a:hover { min-height: 0; padding: 12px 13px; border: 0; border-radius: 7px; }
  .navbar-inverse .main-navigation > .active > a,
  .navbar-inverse .main-navigation > .active > a:hover { background: linear-gradient(110deg, var(--coral), var(--orange)); }
  .mobile-navigation-item { display: block !important; }
  .user-navigation { display: none; }
  .metrics-row > .col-md-4 { grid-column: span 6; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  :root { --header-height: 58px; }
  body { font-size: 13px; }
  .navbar .container-fluid { padding: 0 10px; }
  .navbar .framevoz-brand { min-height: 58px; padding-right: 5px; }
  .framevoz-brand-icon { width: 34px; height: 34px; margin-right: 6px; font-size: 16px; }
  .brand-word { font-size: 18px; }
  .mobile-menu { width: 38px; height: 36px; padding: 8px; }
  .app-container { padding: 74px 12px 22px; }
  .main-panel { padding-right: 0; padding-left: 0; }
  .page-header { margin-bottom: 16px; }
  .page-header h2 { font-size: 22px; }
  .page-header h2 small { display: block; margin-top: 5px; line-height: 1.35; }
  .has-actions { align-items: stretch; flex-direction: column; }
  .page-actions { width: 100%; order: 2; }
  .page-actions .btn { width: 100%; }
  .well { margin-bottom: 15px; padding: 15px; border-radius: 11px; }
  .metrics-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 15px; }
  .metrics-row > .col-md-4 { grid-column: span 1; }
  .metric-box { min-height: 104px; padding: 15px; }
  .metric-box strong { font-size: 24px; }
  .workflow { min-width: 650px; }
  .workflow-panel { overflow-x: auto; }
  .dropzone { min-height: 240px; padding: 24px 15px; }
  .dropzone strong { font-size: 17px; }
  .form-actions { margin-right: -15px; margin-left: -15px; border-radius: 0 0 11px 11px; }
  .upload-actions { align-items: stretch; flex-direction: column; }
  .upload-actions .btn { width: 100%; }
  .video-grid { grid-template-columns: 1fr; gap: 12px; }
  .config-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px; border: 0; }
  .config-tabs > li { float: none; margin: 0; }
  .config-tabs > li > a { height: 100%; margin: 0; padding: 9px 6px; border: 1px solid var(--line); border-radius: 7px; text-align: center; }
  .config-tabs > li.active > a, .config-tabs > li.active > a:hover { color: #fff; border-color: var(--navy-800); background: var(--navy-800); }
  .overlay.modal-shell { padding: 8px; }
  .modal-shell .modal-dialog { width: auto; margin: 0; }
  .modal-content { border-radius: 10px; }
  .modal-body { max-height: calc(100vh - 205px); padding: 15px; }
  .modal-title small { display: block; margin-top: 3px; }
  .modal-footer { display: flex; flex-wrap: wrap; gap: 6px; }
  .modal-footer .btn { flex: 1 1 120px; margin: 0 !important; }
  .login-page { padding: 14px 10px; }
  .login-box { padding: 22px 18px; border-radius: 13px; }
  .login-title { font-size: 23px; }
}

@media (max-width: 390px) {
  .brand-word { font-size: 16px; }
  .config-tabs { grid-template-columns: 1fr; }
}
