:root {
  --em-ink: #1c3038;
  --em-navy: #1e3a4c;
  --em-navy-deep: #142b3a;
  --em-teal: #11786d;
  --em-teal-deep: #0c6258;
  --em-mint: #e7f3ee;
  --em-sage: #d4e8df;
  --em-amber: #e5b568;
  --em-coral: #d97b61;
  --em-paper: #fffefa;
  --em-canvas: #f1f4f2;
  --em-muted: #718087;
  --em-line: #e0e8e3;
  --em-shadow: 0 14px 38px rgba(30, 56, 64, .075);
}

* { -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100vh;
  color: var(--em-ink);
  background:
    radial-gradient(ellipse at 95% 0%, rgba(198, 225, 211, .66), transparent 34rem),
    radial-gradient(ellipse at 0% 25%, rgba(239, 218, 185, .32), transparent 28rem),
    var(--em-canvas);
  font-size: .96rem;
}

.app-nav {
  position: relative;
  z-index: 2;
  min-height: 4.35rem;
  background: linear-gradient(112deg, #142b3a 0%, #1e4c55 62%, #16756b 100%);
  border-bottom: 3px solid var(--em-amber);
  box-shadow: 0 7px 25px rgba(25, 48, 59, .17);
}
.navbar-brand { gap: .75rem; font-size: 1rem; letter-spacing: .015em; }
.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: .75rem;
  color: #f3d295;
  background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.035));
  box-shadow: inset 0 1px rgba(255,255,255,.15);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .07em;
}

.dashboard-hero {
  position: relative;
  display: flex;
  min-height: 12.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  overflow: hidden;
  padding: clamp(1.4rem, 4vw, 2.35rem);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 1.35rem;
  color: #fff;
  background: linear-gradient(112deg, #183849 0%, #1b5557 57%, #148071 100%);
  box-shadow: 0 18px 42px rgba(24, 65, 68, .19);
}
.hero-copy, .hero-action { position: relative; z-index: 1; }
.hero-copy { max-width: 40rem; }
.dashboard-hero .display-6 { font-size: clamp(1.9rem, 4vw, 2.65rem); letter-spacing: -.035em; }
.hero-action { border: 0; border-radius: .8rem; color: #1c4b49; font-size: .94rem; font-weight: 700; box-shadow: 0 6px 18px rgba(6, 31, 36, .16); }
.hero-action:hover { color: #143d3c; background: #f6e7ca; }
.hero-orbit { position: absolute; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; pointer-events: none; }
.hero-orbit-one { width: 18rem; height: 18rem; top: -9rem; right: 11%; }
.hero-orbit-two { width: 25rem; height: 25rem; bottom: -19rem; right: -2rem; border-color: rgba(231,190,116,.22); }

.metric-card {
  display: flex;
  min-height: 6.2rem;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(214, 226, 219, .9);
  border-radius: 1rem;
  background: rgba(255,254,250,.93);
  box-shadow: 0 8px 24px rgba(34,54,48,.055);
  transition: transform .18s ease, box-shadow .18s ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--em-shadow); }
.metric-icon {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  flex: 0 0 2.8rem;
  place-items: center;
  border-radius: .9rem;
  font-size: 1.15rem;
}
.metric-teal { color: #0e7068; background: #e0f2ec; }
.metric-amber { color: #92611e; background: #fbefd9; }
.metric-green { color: #467a53; background: #e8f2e4; }
.metric-coral { color: #a84f3e; background: #f9e9e2; }
.metric-label { display: block; margin-bottom: .1rem; color: var(--em-muted); font-size: .76rem; font-weight: 650; }
.metric-card strong { display: block; color: var(--em-navy); font-size: 1.55rem; line-height: 1.1; letter-spacing: -.035em; }

.card {
  overflow: hidden;
  border: 1px solid var(--em-line);
  border-radius: 1.05rem;
  background: var(--em-paper);
  box-shadow: 0 10px 30px rgba(34, 54, 48, .055);
}
.card-body { padding: clamp(1.05rem, 2.5vw, 1.45rem); }
.card h1, .card h2, .card h3 { color: var(--em-navy); }
.section-heading { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.05rem; }
.section-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  flex: 0 0 2.75rem;
  place-items: center;
  border-radius: .9rem;
  color: var(--em-teal-deep);
  background: var(--em-mint);
  font-size: 1.2rem;
}

.btn { font-weight: 650; }
.btn-dark {
  --bs-btn-bg: var(--em-teal);
  --bs-btn-border-color: var(--em-teal);
  --bs-btn-hover-bg: var(--em-teal-deep);
  --bs-btn-hover-border-color: var(--em-teal-deep);
  --bs-btn-active-bg: var(--em-teal-deep);
  --bs-btn-active-border-color: var(--em-teal-deep);
  --bs-btn-disabled-bg: #8ba8a0;
  --bs-btn-disabled-border-color: #8ba8a0;
  box-shadow: 0 3px 10px rgba(17,120,109,.14);
}
.btn-outline-dark {
  --bs-btn-color: var(--em-teal-deep);
  --bs-btn-border-color: #9cbdb2;
  --bs-btn-hover-bg: var(--em-teal);
  --bs-btn-hover-border-color: var(--em-teal);
  --bs-btn-hover-color: #fff;
}
.btn-outline-light { --bs-btn-hover-bg: rgba(255,255,255,.14); }
.btn-outline-danger { --bs-btn-color: #a94e45; --bs-btn-border-color: #e3b7b0; --bs-btn-hover-bg: #a94e45; --bs-btn-hover-border-color: #a94e45; }
.btn-light { --bs-btn-bg: #f9f6ee; --bs-btn-border-color: #f9f6ee; }

.form-control, .form-select {
  min-height: 2.65rem;
  color: var(--em-ink);
  background-color: #fff;
  border-color: #cfdbd6;
  border-radius: .68rem;
}
textarea.form-control { min-height: unset; }
.form-control:focus, .form-select:focus { border-color: #49a092; box-shadow: 0 0 0 .22rem rgba(22,120,110,.14); }
.form-label { color: #344e50; font-size: .91rem; font-weight: 600; }
.form-text, .smallhint { color: var(--em-muted) !important; }

.company-table-card { border-radius: 1rem; }
.table { --bs-table-bg: var(--em-paper); --bs-table-hover-bg: #f1f7f3; --bs-table-color: var(--em-ink); margin: 0; }
.table thead th {
  padding: .95rem .85rem;
  color: #456068;
  background: #edf3ef;
  border-bottom-color: #d9e5de;
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody td { padding: .95rem .85rem; border-color: #edf0ed; }
.table a { color: var(--em-teal-deep); text-decoration-color: #a7c5b9; text-underline-offset: .18em; }
.table a:hover { color: var(--em-navy); }
.company-name { font-weight: 750; text-decoration: none; }
.company-name:hover { text-decoration: underline; }
.status-badge { padding: .43rem .62rem; border: 1px solid transparent; font-size: .72rem; font-weight: 700; text-transform: capitalize; }
.status-lead, .status-briefing { color: #3c6272; background: #e7f0f5; border-color: #d4e4eb; }
.status-producao, .status-revisao { color: #775319; background: #fbf1dc; border-color: #f0dfb9; }
.status-publicacao { color: #4d5d98; background: #eceefa; border-color: #dcdef4; }
.status-publicado { color: #2f7556; background: #e5f4e9; border-color: #d3ead9; }
.status-pausado, .status-cancelado { color: #785c5a; background: #f2ecea; border-color: #e8deda; }
.queue-cell { min-width: 5rem; }
.queue-cell > span { display: block; margin-bottom: .3rem; color: #63767a; font-size: .75rem; }
.progress { height: .34rem; overflow: hidden; border-radius: 99px; background: #e5ece8; }
.progress-bar { border-radius: 99px; background: linear-gradient(90deg, #188b76, #71b18c); }
.action-button { width: 2rem; height: 2rem; display: inline-grid; place-items: center; padding: 0; border-radius: .65rem; }
.empty-state-icon { width: 3.3rem; height: 3.3rem; display: grid; place-items: center; margin: auto; border-radius: 1rem; color: #34756c; background: #e6f2ec; font-size: 1.45rem; }

.company-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.back-link { color: var(--em-teal-deep); font-weight: 650; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.eyebrow, .niche-kicker { color: var(--em-teal-deep); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.niche-selector { padding: 1rem 1.1rem; border: 1px solid #cfe2d9; border-radius: .9rem; background: linear-gradient(110deg, #eaf5f0, #f8f4e9 92%); }
.niche-current { display: flex; min-height: 2.8rem; align-items: center; gap: .5rem; padding: .65rem .85rem; border-radius: .7rem; color: #355651; background: rgba(255,255,255,.75); font-size: .9rem; }
.niche-dot { width: .6rem; height: .6rem; flex: 0 0 .6rem; border-radius: 50%; background: var(--em-coral); box-shadow: 0 0 0 3px rgba(215,121,91,.15); }
.niche-panel { padding: 1.2rem; border: 1px solid #c9e0d7; border-left: 4px solid var(--em-teal); border-radius: .95rem; background: linear-gradient(135deg, #edf7f2 0%, #f8faf5 68%, #fff7ea 100%); }
.niche-count { padding: .35rem .65rem; border: 1px solid #efdbb6; border-radius: 99px; color: #7d5a28; background: #fff5e4; font-size: .77rem; font-weight: 700; }
.briefing-heading { padding-bottom: 1rem; border-bottom: 1px solid var(--em-line); }
.briefing-heading .eyebrow { margin-bottom: .45rem; }
.shared-briefing { padding-top: .2rem; }
.prompt { min-height: 390px; color: #263b40; background: #f7faf7; border-color: #d5e2dc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; line-height: 1.6; }
.list-group-item { color: var(--em-ink); background: rgba(255,254,250,.92); border-color: var(--em-line); }
.badge.text-bg-secondary { color: #345b54 !important; background: #dceee6 !important; }
.alert-info { color: #245e56; background: #e4f3ed; border-color: #c8e3d7; }
.alert-danger { border-radius: .8rem; }
.modal-content { border-radius: 1.1rem; }

.login-body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 10%, rgba(201,230,216,.88), transparent 40rem), radial-gradient(ellipse at 100% 100%, rgba(241,216,183,.42), transparent 32rem), var(--em-canvas);
}
.login-card { border: 1px solid var(--em-line); border-radius: 1.2rem; background: var(--em-paper); box-shadow: 0 18px 52px rgba(32,56,75,.12); }

@media (max-width: 767.98px) {
  .dashboard-hero { min-height: 0; align-items: flex-start; flex-direction: column; }
  .hero-action { width: 100%; }
  .company-heading { align-items: flex-start; flex-direction: column; }
  .company-heading > .btn { width: 100%; }
  .dashboard-stats { --bs-gutter-x: .65rem; --bs-gutter-y: .65rem; }
  .metric-card { min-height: 5.6rem; gap: .65rem; padding: .8rem; }
  .metric-icon { width: 2.35rem; height: 2.35rem; flex-basis: 2.35rem; border-radius: .75rem; }
  .metric-label { font-size: .69rem; }
  .metric-card strong { font-size: 1.32rem; }
}
@media (max-width: 575.98px) {
  .container { padding-left: 1rem; padding-right: 1rem; }
  .table { min-width: 740px; font-size: .86rem; }
  .card-body { padding: 1.05rem; }
  .niche-panel { padding: 1rem; }
}
