/* style.css — Seiva Ad Manager */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* ── Seiva brand palette ── */
  --seiva-green:       #38a832;
  --seiva-green-dark:  #1a5c2e;
  --seiva-green-deep:  #0d2b1a;
  --seiva-orange:      #e8491c;
  --seiva-pink:        #f2bfce;
  --seiva-blue-sky:    #42b0e4;
  --seiva-blue:        #1e4fd4;
  --seiva-yellow:      #f5c514;
  --seiva-cream:       #f7f0e6;
  --seiva-black:       #141414;

  /* ── App tokens ── */
  --bg: var(--seiva-cream);
  --surface: #ffffff;
  --surface-hover: #f0e9de;
  --surface-raised: #ffffff;
  --border: #e2d9ce;
  --border-strong: #c8bdb0;
  --text: var(--seiva-black);
  --text-muted: #6b5f55;
  --text-light: #a89e95;
  --primary: var(--seiva-green);
  --primary-hover: var(--seiva-green-dark);
  --primary-light: #e6f5e4;
  --primary-mid: #9edb9a;
  --aurora: #c0306a;
  --aurora-light: #fce8f0;
  --aurora-mid: #e898c0;
  --indice: #9a7000;
  --indice-light: #fdf5c0;
  --indice-mid: #e8d060;
  --green: var(--seiva-green);
  --green-dark: var(--seiva-green-dark);
  --green-light: #e6f5e4;
  --amber: #c97c0a;
  --amber-light: #fdf0d0;
  --red: #cc2a10;
  --red-light: #fde0d8;
  --gray: #6b5f55;
  --gray-light: #f0e9de;
  --shadow-xs: 0 1px 2px rgba(13,43,26,.06);
  --shadow-sm: 0 1px 3px rgba(13,43,26,.08), 0 1px 2px rgba(13,43,26,.05);
  --shadow: 0 4px 12px rgba(13,43,26,.09), 0 2px 4px rgba(13,43,26,.05);
  --shadow-lg: 0 16px 40px rgba(13,43,26,.13), 0 4px 12px rgba(13,43,26,.07);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

/* ─── Typography ─────────────────────────────────────────────────────── */
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: 1rem; font-weight: 600; }
p { color: var(--text-muted); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-bg {
  background: linear-gradient(145deg, var(--seiva-green-deep) 0%, #1a3d22 45%, #0a2015 100%);
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── Login Card ─────────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  padding: 2.5rem 2rem;
  border: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 2rem;
}

.login-logo-mark {
  flex-shrink: 0;
  display: flex;
}

.login-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.login-brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
}

.login-brand-sub {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: .1rem;
}

/* ─── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  background: var(--seiva-green-deep);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: .65rem 1.75rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand-icon {
  width: 26px;
  height: 26px;
  background: var(--primary);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar-brand-icon svg { display: block; }

.navbar-brand .brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.02em;
}

.navbar-brand .brand-sub {
  font-size: .65rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .05rem;
  display: block;
}

.navbar-controls {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  flex-wrap: wrap;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { line-height: 1.2; }
.user-name { font-size: .82rem; font-weight: 600; color: #ffffff; }
.user-role { font-size: .7rem; color: rgba(255,255,255,.55); }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .48rem .95rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .13s, border-color .13s, color .13s, box-shadow .13s, transform .1s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary-hover); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(22,163,74,.25); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); box-shadow: var(--shadow-xs); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.navbar .btn-ghost { color: rgba(255,255,255,.65); }
.navbar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #ffffff; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-sm { padding: .28rem .65rem; font-size: .77rem; }
.btn-lg { padding: .72rem 1.4rem; font-size: .95rem; font-weight: 600; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .01em;
}

.form-hint { font-size: .75rem; color: var(--text-light); }

.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

.form-control::placeholder { color: var(--text-light); }
.form-control:read-only { background: var(--bg); color: var(--text-muted); cursor: default; }

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.2rem;
}

.form-error { font-size: .78rem; color: var(--red); }

.char-counter { font-size: .75rem; color: var(--text-muted); text-align: right; }
.char-counter.ok { color: var(--green); }
.char-counter.warn { color: var(--amber); }
.char-counter.error { color: var(--red); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-body { padding: 1.25rem; }
.card-footer {
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Badges / Pills ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .71rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-aurora { background: var(--aurora-light); color: var(--aurora); }
.badge-indice { background: var(--indice-light); color: var(--indice); }
.badge-destaque { background: var(--seiva-yellow); color: #5a3c00; opacity: .85; }
.badge-corpo { background: var(--primary-light); color: var(--seiva-green-dark); }
.badge-rascunho  { background: var(--gray-light);    color: var(--gray); }
.badge-pendente  { background: var(--amber-light);   color: var(--amber); }
.badge-aprovado  { background: var(--green-light);   color: var(--green); }
.badge-veiculado { background: var(--indice-light);  color: var(--indice); }
.badge-rejeitado { background: var(--red-light);     color: var(--red); }
.badge-admin { background: #ede9fe; color: #5b21b6; }
.badge-redator { background: #e0f2fe; color: #0369a1; }
.badge-anunciante { background: #fdf4ff; color: #86198f; }

/* ─── Calendar Page ──────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: calc(100vh - 55px);
  overflow: hidden;
}

.app-main {
  flex: 1;
  overflow: auto;
  padding: 1.75rem 2.5rem;
  background: var(--bg);
}

.app-sidebar {
  width: 290px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.sidebar-body { padding: 1rem 1.25rem; flex: 1; }

/* ─── Slot Indicators ────────────────────────────────────────────────── */
.slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}

.slot-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .55rem;
  border-radius: var(--radius-sm);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid;
  transition: opacity .15s, transform .1s;
}

.slot-item:hover:not(.blocked) { transform: translateY(-1px); }

.slot-item.free { background: var(--surface); opacity: .9; }
.slot-item.booked { opacity: 1; }
.slot-item.blocked { opacity: .3; cursor: not-allowed; }

.slot-aurora-d { border-color: var(--aurora); color: var(--aurora); }
.slot-aurora-d.booked { background: var(--aurora); color: #fff; }
.slot-aurora-c { border-color: var(--aurora-mid); color: var(--aurora); }
.slot-aurora-c.booked { background: var(--aurora-light); color: var(--aurora); border-color: var(--aurora); }
.slot-indice-d { border-color: var(--indice); color: var(--indice); }
.slot-indice-d.booked { background: var(--indice); color: #fff; }
.slot-indice-c { border-color: var(--indice-mid); color: var(--indice); }
.slot-indice-c.booked { background: var(--indice-light); color: var(--indice); border-color: var(--indice); }

/* ─── FullCalendar Overrides ─────────────────────────────────────────── */
.fc {
  font-family: var(--font) !important;
  font-size: .82rem;
}

.fc .fc-toolbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.fc .fc-button {
  background: var(--surface) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text-muted) !important;
  font-family: var(--font) !important;
  font-size: .8rem !important;
  font-weight: 500 !important;
  padding: .32rem .7rem !important;
  box-shadow: none !important;
  border-radius: var(--radius-sm) !important;
  text-transform: none !important;
  transition: background .13s, color .13s !important;
}

.fc .fc-button:hover { background: var(--surface-hover) !important; color: var(--text) !important; }
.fc .fc-button-active, .fc .fc-button:active {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-color: var(--primary-mid) !important;
}

.fc .fc-col-header-cell-cushion {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: .5rem .4rem .3rem;
  text-decoration: none;
}

.fc .fc-daygrid-day-number {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: .4rem .5rem;
  text-decoration: none;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: .25rem .25rem 0;
}

.fc .fc-daygrid-day.fc-day-today { background: #f0fdf4; }
.fc .fc-daygrid-day:not(.day-blocked):not(.fc-day-other):hover { background: rgba(56,168,50,.06); transition: background .15s; }
.fc .fc-daygrid-day { transition: background .15s; }

.fc .fc-daygrid-day.day-blocked {
  background: var(--bg) !important;
  cursor: not-allowed;
}
.fc .fc-daygrid-day.day-blocked .fc-daygrid-day-number { color: var(--text-light); }

.fc .fc-daygrid-day.fc-day-sat,
.fc .fc-daygrid-day.fc-day-sun {
  background: var(--bg);
}

.fc .fc-daygrid-day.fc-day-sat .fc-daygrid-day-number,
.fc .fc-daygrid-day.fc-day-sun .fc-daygrid-day-number {
  color: var(--text-light);
}

/* Hide FullCalendar scroll sync artifacts */
.fc .fc-scroller-harness-liquid { overflow: hidden; }
.fc .fc-scroller::-webkit-scrollbar { display: none; }
.fc .fc-scroller { scrollbar-width: none; }

/* Slot dots inside calendar cells */
.day-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px 4px 4px;
  min-height: 22px;
}

.day-slot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  border: 1.5px solid currentColor;
}

.day-slot-dot.filled { background: currentColor; }

/* Event styles */
.fc-event {
  cursor: pointer;
  border-radius: 5px !important;
  border: none !important;
  padding: 1px 5px !important;
  font-size: .71rem !important;
  font-weight: 500 !important;
  transition: filter .1s !important;
}

.fc-event:hover { filter: brightness(.92); }
.fc-event.fc-event-dragging { opacity: .75; box-shadow: var(--shadow-lg); }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(.98);
  transition: transform .22s cubic-bezier(.16,1,.3,1);
  border: 1px solid var(--border);
}

.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.1rem;
  padding: .3rem;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: background .13s, color .13s;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }

.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: .855rem; }

th {
  text-align: left;
  padding: .65rem .9rem;
  font-size: .71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaf8; }

.td-actions { display: flex; gap: .4rem; }

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); gap: 0; }

.tab {
  padding: .75rem 1.25rem;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

.tab-panel { display: none; padding: 1.5rem; }
.tab-panel.active { display: block; }

/* ─── Admin page ─────────────────────────────────────────────────────── */
.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.quota-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.quota-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: box-shadow .15s;
}

.quota-card:hover { box-shadow: var(--shadow-sm); }

.quota-label { font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.quota-numbers { font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.quota-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: .35rem; overflow: hidden; }
.quota-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .4s ease; }

/* ─── Alerts ─────────────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  line-height: 1.45;
}

.alert-error { background: var(--red-light); border-color: #fca5a5; color: #991b1b; }
.alert-success { background: var(--green-light); border-color: #86efac; color: #15803d; }
.alert-info { background: var(--indice-light); border-color: var(--indice-mid); color: #1e40af; }
.alert-warn { background: var(--amber-light); border-color: #fcd34d; color: #92400e; }

/* ─── Empty State ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 2rem; margin-bottom: .65rem; opacity: .6; }
.empty-state-title { font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.empty-state-desc { font-size: .83rem; }

/* ─── Loading ────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(1px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  font-size: .88rem;
  color: var(--text-muted);
}

/* ─── Misc ───────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .8rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-sm { gap: .5rem; }
.gap { gap: 1rem; }
.mt { margin-top: 1rem; }
.mt-sm { margin-top: .5rem; }
.mb { margin-bottom: 1rem; }
.mb-sm { margin-bottom: .5rem; }

/* Newsletter filter pills */
.nl-filter {
  display: flex;
  gap: .4rem;
}

.nl-pill {
  padding: .28rem .8rem;
  border-radius: 999px;
  font-size: .77rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .15s;
}

.nl-pill-all { border-color: var(--border-strong); color: var(--text-muted); background: var(--surface); }
.nl-pill-all.active { background: var(--text); color: #fff; border-color: var(--text); }
.nl-pill-aurora { border-color: var(--aurora); color: var(--aurora); background: var(--surface); }
.nl-pill-aurora.active { background: var(--aurora); color: #fff; }
.nl-pill-indice { border-color: var(--indice); color: var(--indice); background: var(--surface); }
.nl-pill-indice.active { background: var(--indice); color: #fff; }

/* Booking detail panel */
.booking-detail-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}

.booking-detail-item:last-child { border-bottom: none; }
.booking-detail-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); }
.booking-detail-value { font-size: .875rem; color: var(--text); word-break: break-word; }

/* ─── View Toggle ────────────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-btn {
  padding: .26rem .75rem;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .13s, color .13s;
  white-space: nowrap;
  font-family: var(--font);
}

.view-btn:hover { color: #ffffff; }
.view-btn.active { background: rgba(255,255,255,.18); color: #ffffff; box-shadow: none; }

/* ─── Dashboard ──────────────────────────────────────────────────────── */
#dashboard-view {
  height: calc(100vh - 55px);
  overflow-y: auto;
  background: var(--bg);
}

.dash-scroll { display: flex; justify-content: center; padding: 3rem 1.5rem 4rem; }

.dash-inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.dash-inner > * { animation: dashIn .55s cubic-bezier(.22,.68,0,1.2) both; }

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

.dash-welcome { animation-delay: .04s; }
.dash-hello { font-size: .95rem; color: var(--text-muted); font-weight: 500; margin-bottom: .3rem; }
.dash-company { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
.dash-sub { font-size: .92rem; color: var(--text-muted); margin: 0; }

.dash-section { animation: dashIn .55s cubic-bezier(.22,.68,0,1.2) both; }

.dash-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .9rem;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.dash-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.dash-stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.dash-stat-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.dash-stat-adquiridos .dash-stat-num  { color: var(--text-muted); }
.dash-stat-disponiveis .dash-stat-num { color: var(--primary); }
.dash-stat-disponiveis { border-color: var(--primary-mid); background: var(--primary-light); }
.dash-stat-submetidos .dash-stat-num  { color: var(--amber); }
.dash-stat-veiculados .dash-stat-num  { color: var(--indice); }

/* legado */
.dash-quota-summary { display: flex; align-items: baseline; gap: .6rem; margin-bottom: 1rem; }
.dash-quota-big { font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -.02em; }
.dash-quota-label { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

.dash-cards { display: flex; gap: .75rem; flex-wrap: wrap; }

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 140px;
  flex: 1;
  animation: dashIn .5s cubic-bezier(.22,.68,0,1.2) both;
}
.dash-card-aurora { border-left-color: var(--red); }
.dash-card-indice  { border-left-color: var(--blue); }
.dash-card-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; margin-bottom: .5rem; }
.dash-card-number { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.dash-card-sub { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }
.dash-empty { color: var(--text-muted); font-size: .9rem; font-style: italic; }

.dash-upcoming { display: flex; flex-direction: column; gap: .5rem; }

.dash-upcoming-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  flex-wrap: wrap;
  transition: background .12s, border-color .12s;
}
.dash-upcoming-row:hover { background: var(--surface-hover); border-color: var(--primary-mid); }
.dash-upcoming-date { font-weight: 700; color: var(--text); min-width: 72px; }
.dash-upcoming-fmt { color: var(--text-muted); font-size: .8rem; }
.dash-upcoming-name { color: var(--text); font-weight: 500; flex: 1; }

.dash-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.dash-action-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-family: inherit;
}
.dash-action-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(22,163,74,.12);
  transform: translateY(-2px);
}
.dash-action-icon { font-size: 1.5rem; line-height: 1; margin-bottom: .25rem; }
.dash-action-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.dash-action-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.4; }
.dash-action-wip { cursor: default; opacity: .5; }
.dash-action-wip:hover { border-color: var(--border); box-shadow: none; transform: none; }

.sh-date-picker { width: 130px; }

@media (max-width: 600px) {
  .dash-action-grid { grid-template-columns: 1fr; }
  .dash-company { font-size: 1.5rem; }
}

/* ─── Sheet View ─────────────────────────────────────────────────────── */
#list-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 55px);
  overflow: hidden;
  background: var(--bg);
}

.sheet-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem max(1.5rem, calc((100% - 1160px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
}

.sheet-month-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  min-width: 200px;
  justify-content: center;
}

.sheet-month-nav .btn { font-size: 1.1rem; padding: .15rem .55rem; }

.sheet-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

#sheet-save-count {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sheet-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 max(1.5rem, calc((100% - 1160px) / 2)) 2rem;
}

#sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

#sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  padding: .5rem .6rem;
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.sh-th-date  { width: 90px; }
.sh-th-campaign { width: 160px; }
.sh-th-author { width: 140px; }
.sh-th-nl   { width: 100px; }
.sh-th-fmt  { width: 90px; }
.sh-th-text { min-width: 260px; }
.sh-th-link { width: 140px; }
.sh-th-status { width: 40px; }

.sh-row td {
  border-bottom: 1px solid var(--border-light, #eee);
  padding: .2rem .3rem;
  vertical-align: middle;
}

.sh-row:hover td { background: var(--bg-hover, #f0f9f4); }

.sh-has-booking td { background: #f8fffe; }
.sh-has-booking:hover td { background: #edfaf5; }

.sh-row-error td { background: #fff5f5 !important; }

.sh-date-cell {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding: .35rem .6rem !important;
  line-height: 1.3;
}

.sh-date-cell .badge-xs {
  font-size: .68rem;
  padding: .1rem .35rem;
  margin-top: .1rem;
  display: inline-block;
}

.sh-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: .82rem;
  color: var(--text);
  padding: .3rem .4rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.sh-input:focus {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.sh-input::placeholder { color: var(--text-light); }

.sh-text-col { min-width: 240px; }
.sh-link-col { min-width: 120px; }

.sh-select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: .82rem;
  color: var(--text);
  padding: .3rem .4rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .4rem center;
  padding-right: 1.4rem;
  box-sizing: border-box;
}

.sh-select:focus { box-shadow: 0 0 0 2px var(--primary-light); }

.sh-status-cell {
  padding: .3rem .5rem !important;
  white-space: nowrap;
}

.sh-ok {
  color: var(--green-dark);
  font-size: .85rem;
  font-weight: 700;
}

.sh-err {
  color: var(--red);
  font-size: .75rem;
  font-weight: 500;
  cursor: help;
  max-width: 120px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.req { color: var(--red); }

/* ─── Package View ───────────────────────────────────────────────────── */
#pkg-content {
  height: calc(100vh - 55px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#sheet-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: calc(100vh - 55px);
  overflow: hidden;
}

.pkg-months-scroll {
  flex: 1;
  overflow-y: auto;
}

.pkg-months-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.pkg-months-header { margin-bottom: 2rem; }
.pkg-months-header h2 { margin-bottom: .35rem; }
.pkg-months-header p  { font-size: .88rem; }

.pkg-months-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.pkg-month-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.1rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.pkg-month-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(22,163,74,.13);
  transform: translateY(-2px);
}

.pkg-month-past     { opacity: .5; }
.pkg-month-disabled { cursor: default; }
.pkg-month-disabled:hover { border-color: var(--border); box-shadow: none; transform: none; }

.pkg-month-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.pkg-month-year { font-size: .75rem; color: var(--text-muted); }
.pkg-month-count { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.pkg-month-action { font-size: .8rem; font-weight: 600; color: var(--primary); margin-top: .55rem; }
.pkg-month-locked { color: var(--text-light); font-weight: 400; font-size: .75rem; }

/* Package form */
.pkg-form-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.pkg-form-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem max(1.5rem, calc((100% - 1160px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.pkg-form-title { display: flex; flex-direction: column; gap: .1rem; }
.pkg-form-title h2 { margin: 0; font-size: 1rem; }
.pkg-form-title p  { margin: 0; font-size: .78rem; color: var(--text-muted); }

.pkg-form-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}

#pkg-save-count {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pkg-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 max(1.5rem, calc((100% - 1160px) / 2)) 2rem;
}

.pkg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.pkg-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  padding: .5rem .6rem;
  text-align: left;
  font-weight: 600;
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.pkg-th-num { width: 36px; text-align: center; }

.pkg-row td {
  border-bottom: 1px solid var(--border);
  padding: .22rem .3rem;
  vertical-align: middle;
}

/* Row type backgrounds */
.pkg-row.pkg-aurora-d td  { background: #fef6fa; }
.pkg-row.pkg-indice-d td  { background: #fefdf0; }
.pkg-row.pkg-aurora-c td  { background: #f8fbf6; }

.pkg-row.pkg-row-filled.pkg-aurora-d td { background: #f8e2ee; }
.pkg-row.pkg-row-filled.pkg-indice-d td { background: #faf0b0; }
.pkg-row.pkg-row-filled.pkg-aurora-c td { background: #e4f2e4; }

.pkg-row.sh-row-error td { background: #fff5f5 !important; }

/* Triplet separator: top border on row 0 of each triplet (except first) */
.pkg-row[data-triplet]:not([data-triplet="0"]) td:first-child,
.pkg-row[data-row="3"] td,
.pkg-row[data-row="6"] td,
.pkg-row[data-row="9"] td {
  /* handled via JS class instead */
}

.pkg-triplet-start td { border-top: 2px solid var(--border-strong); }

/* Slot badges */
.pkg-slot-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}

.pkg-slot-badge.pkg-aurora-d { background: var(--aurora-light); color: var(--aurora); }
.pkg-slot-badge.pkg-indice-d { background: var(--indice-light); color: var(--indice); }
.pkg-slot-badge.pkg-aurora-c {
  background: transparent;
  color: var(--aurora);
  border: 1.5px dashed var(--aurora-mid);
}

/* Cell widths */
.pkg-td-num  { text-align: center; width: 36px; font-size: .73rem; font-weight: 700; color: var(--text-light); }
.pkg-td-slot { width: 140px; }
.pkg-td-date { width: 130px; }
.pkg-td-camp { min-width: 150px; }
.pkg-td-auth { min-width: 130px; }
.pkg-td-text { min-width: 250px; }
.pkg-td-link { min-width: 120px; }
.pkg-td-act  { width: 80px; white-space: nowrap; }

.pkg-copy-btn {
  font-size: .9rem;
  padding: .18rem .45rem;
  opacity: .65;
  border-radius: var(--radius-sm);
}
.pkg-copy-btn:hover { opacity: 1; }

.pkg-date-warn {
  color: #b87800;
  font-size: .72rem;
  line-height: 1.3;
  display: inline-block;
  max-width: 200px;
  white-space: normal;
  cursor: help;
}

/* ─── Date picker popup ──────────────────────────────────────────────── */
.pkg-date-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .8rem;
  padding: .3rem .55rem;
  cursor: pointer;
  white-space: nowrap;
  min-width: 90px;
  text-align: left;
  transition: border-color .15s;
}
.pkg-date-btn:hover { border-color: var(--primary); }
.pkg-date-btn.has-date { color: var(--text); font-weight: 500; }

#pkg-datepicker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#pkg-datepicker {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  width: 340px;
  box-shadow: var(--shadow-lg);
}

.pkdp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.pkdp-title  { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.pkdp-subtitle { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.pkdp-close  { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 0; line-height: 1; }
.pkdp-close:hover { color: var(--text); }

.pkdp-legend {
  display: flex;
  gap: .75rem;
  margin-bottom: .85rem;
  font-size: .7rem;
  color: var(--text-muted);
}
.pkdp-leg { display: flex; align-items: center; gap: .3rem; }
.pkdp-leg::before { content: '●'; font-size: .8rem; }
.pkdp-leg-available::before { color: var(--primary); }
.pkdp-leg-occupied::before  { color: var(--red); }
.pkdp-leg-blocked::before   { color: var(--text-light); }

.pkdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.pkdp-dow {
  text-align: center;
  font-size: .65rem;
  color: var(--text-muted);
  padding: .2rem 0 .4rem;
  font-weight: 600;
  text-transform: uppercase;
}
.pkdp-day {
  text-align: center;
  padding: .45rem .2rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  line-height: 1;
  transition: background .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.pkdp-empty   { background: none; }
.pkdp-available {
  cursor: pointer;
  background: var(--surface-hover);
  color: var(--text);
}
.pkdp-available:hover {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(56,168,50,.35);
  z-index: 1;
  position: relative;
}
.pkdp-selected {
  background: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(56,168,50,.4);
}
.pkdp-occupied {
  background: var(--red-light);
  color: var(--red);
  cursor: not-allowed;
  position: relative;
  font-weight: 500;
}
.pkdp-occupied::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 3px,
    rgba(220,38,38,.2) 3px, rgba(220,38,38,.2) 4px
  );
  border-radius: inherit;
}
.pkdp-blocked {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: .4;
}

/* ─── Staff upcoming table ───────────────────────────────────────────── */
.staff-upcoming-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.staff-upcoming-table thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: .5rem .85rem;
  border-bottom: 2px solid var(--border);
}
.staff-upcoming-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.staff-upcoming-table tbody tr:hover { background: var(--surface-hover); }
.staff-upcoming-table td {
  padding: .65rem .85rem;
  vertical-align: middle;
}
.staff-upcoming-table td:first-child { font-weight: 600; white-space: nowrap; }
.staff-upcoming-table td:nth-child(4) { color: var(--text-muted); font-size: .8rem; }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-sidebar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .navbar-controls { display: none; }
  .pkg-months-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-action-grid { grid-template-columns: 1fr; }
}
