:root {
  --bg-1: #04131d;
  --bg-2: #062735;
  --bg-3: #083847;
  --sidebar: #03111a;
  --panel: rgba(8, 37, 53, 0.84);
  --panel-2: rgba(4, 24, 37, 0.92);
  --panel-soft: rgba(7, 31, 44, 0.78);
  --line: rgba(70, 162, 187, 0.22);
  --line-strong: rgba(95, 214, 236, 0.32);
  --line-soft: rgba(70, 162, 187, 0.10);
  --text: #effaff;
  --muted: #9cc9d5;
  --muted-2: #7eaebb;
  --primary: #3bc4dc;
  --primary-2: #228da3;
  --primary-deep: #0d5d70;
  --danger: #cf6161;
  --success: #35c585;
  --success-deep: #118a54;
  --success-soft: rgba(53, 197, 133, 0.16);
  --shadow-lg: 0 18px 38px rgba(0, 0, 0, 0.26);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.18);
  --glow: 0 0 0 1px rgba(90, 204, 226, 0.06), inset 0 1px 0 rgba(255,255,255,0.025);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --btn-h: 38px;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; min-width: 0; }
html, body { min-height: 100%; }
html { color-scheme: dark; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background-color: #03111a;
  background-image:
    radial-gradient(circle at 18% 6%, rgba(54, 198, 226, 0.11), transparent 0 22%),
    radial-gradient(circle at 75% 14%, rgba(12, 108, 129, 0.15), transparent 0 24%),
    linear-gradient(90deg, #03111a 0%, #031824 18%, #052436 54%, #031420 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(1, 13, 20, 0.55); }
::-webkit-scrollbar-thumb {
  background: rgba(79, 189, 214, 0.28);
  border-radius: 999px;
  border: 2px solid rgba(1, 13, 20, 0.18);
}
::-webkit-scrollbar-thumb:hover { background: rgba(93, 209, 236, 0.38); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 12px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #03111a;
  border-right: none;
  box-shadow: none;
}

.brand-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.logo-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(19, 92, 121, 0.92), rgba(9, 46, 65, 0.98));
  border: 1px solid rgba(85, 201, 224, 0.14);
  box-shadow: var(--shadow-sm);
  font-weight: 900;
}
.logo-box.lg {
  width: 72px;
  height: 72px;
  border-radius: 20px;
}
.brand-kicker {
  font-size: 11px;
  letter-spacing: 4px;
  color: #86dff2;
  font-weight: 800;
  margin: 0;
}
.sidebar-title {
  margin: 0;
  font-size: 24px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.sidebar-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}
.sidebar-group {
  margin-top: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(6, 31, 45, 0.72), rgba(4, 22, 34, 0.82));
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-sm), var(--glow);
  overflow: hidden;
}
.sidebar-group h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #dff8ff;
}
.nav-list, .side-stack { display: grid; gap: 8px; }
.nav-link,
.meta-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-h);
  border-radius: 14px;
  border: 1px solid rgba(78, 187, 211, 0.18);
  background: linear-gradient(180deg, rgba(13, 54, 74, 0.52), rgba(8, 38, 56, 0.82));
  color: var(--text);
  font-weight: 700;
  padding: 9px 12px;
  transition: 0.18s ease;
}
.nav-link:hover, .btn:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 213, 237, 0.38);
}
.nav-link.active {
  background: linear-gradient(135deg, #35c4dd, #1e8ea5);
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(53,196,221,0.16);
}
.meta-item {
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  text-align: left;
}
.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 1px;
}
.meta-item strong {
  display: block;
  max-width: 96px;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: right;
  line-height: 1.25;
  font-size: 12px;
}

.main {
  padding: 26px 20px 30px 24px;
  overflow-x: hidden;
  border-left: none;
  box-shadow: none;
}

.flash {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 13px;
}
.flash-success { background: rgba(53, 197, 133, 0.16); }
.flash-error { background: rgba(198, 87, 87, 0.16); }

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 33%);
  gap: 18px;
  align-items: start;
}
.hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.hero p {
  margin: 10px 0 0;
  color: #b1dbe5;
  font-size: 16px;
  max-width: 880px;
}
.page-kicker {
  color: #83def0;
  font-size: 12px;
  letter-spacing: 4px;
  font-weight: 800;
  margin: 0 0 8px;
}

.filter-card,
.panel,
.metric-card,
.client-card,
.summary-card,
.summary-mini,
.login-card,
.calendar-box,
.day-column,
.task-list-item,
.week-card,
.day-block,
.task-card,
.box-list {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 44, 61, 0.82), rgba(5, 23, 35, 0.92));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--glow);
}
.filter-card,
.panel,
.summary-card,
.login-card,
.calendar-box,
.week-card,
.box-list {
  padding: 16px;
}

.form-stack, .form-field { display: grid; gap: 7px; }
.form-stack { gap: 12px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-full { grid-column: 1 / -1; }
label {
  font-size: 12px;
  font-weight: 700;
  color: #dff8ff;
}
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(88, 198, 222, 0.18);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(2, 21, 33, 0.94), rgba(3, 25, 38, 0.98));
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.015);
}
select { padding-right: 34px; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(88, 198, 222, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 196, 220, 0.08);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }

.btn {
  border: 1px solid rgba(78, 187, 211, 0.18);
  background: linear-gradient(180deg, rgba(13, 54, 74, 0.78), rgba(8, 38, 56, 0.92));
  color: var(--text);
  border-radius: 14px;
  padding: 9px 14px;
  font-weight: 700;
  min-height: var(--btn-h);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.015);
  transition: 0.18s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #35c4dd, #1e8ea5);
  border-color: transparent;
}
.btn-danger {
  background: linear-gradient(135deg, #cf6161, #b04a4a);
  border-color: transparent;
}
.btn-block { width: 100%; }
.btn-row, .card-actions, .action-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.metric-card {
  padding: 16px 18px;
  min-height: 82px;
}
.metric-card.highlight {
  background: linear-gradient(135deg, rgba(56,197,222,0.92), rgba(30,142,165,0.96));
  border-color: transparent;
}
.metric-label {
  color: #8cc9d6;
  font-size: 13px;
  margin-bottom: 8px;
}
.metric-value {
  font-size: 18px;
  font-weight: 900;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 60%) minmax(320px, 40%);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}
.content-grid-client { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.92fr); }
.panel h2, .summary-card h2 { margin: 0; font-size: 18px; }
.panel-sub, .summary-sub, .login-subtitle, .muted {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.section-space { margin-top: 16px; }

.client-grid, .summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.client-card, .summary-mini { padding: 15px; }
.client-card h3 { margin: 0; font-size: 18px; }
.client-meta, .help-list { color: var(--muted); font-size: 13px; line-height: 1.45; }
.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(2, 10, 16, 0.88);
  overflow: hidden;
  margin: 12px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38c5de, #15738a);
}
.pill, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: linear-gradient(180deg, rgba(18, 82, 109, 0.96), rgba(11, 59, 81, 0.96));
  font-size: 11px;
  font-weight: 800;
}
.badge.top { background: rgba(59,196,220,.22); }
.badge.active { background: rgba(53,197,133,.18); }
.badge.inactive { background: rgba(207,97,97,.16); }
.summary-mini .n {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.help-list { padding-left: 18px; margin-top: 10px; }
.table-wrap { overflow: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
  font-size: 13px;
}

.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.client-inactive { opacity: .72; }

.weeks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.week-card { padding: 15px; }
.week-top, .day-head, .task-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.week-top h3, .day-head h4 { margin: 0; }
.week-top h3 { font-size: 16px; }
.day-head h4 { font-size: 15px; }
.day-block {
  margin-top: 12px;
  padding: 13px;
  background: linear-gradient(180deg, rgba(7, 31, 46, 0.48), rgba(5, 24, 37, 0.68));
  border-radius: 18px;
}
.day-block + .day-block { margin-top: 12px; }
.task-card {
  padding: 13px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(3, 22, 35, 0.92), rgba(3, 18, 29, 0.98));
}
.task-card + .task-card { margin-top: 10px; }
.task-card.border-accent { border-left: 2px solid rgba(59,196,220,.7); }
.task-card h5 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.3;
}
.task-card hr {
  border: 0;
  border-top: 1px solid rgba(72, 136, 174, 0.18);
  margin: 12px 0;
}
.task-link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.day-task-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}
.day-task-actions .btn { width: 100%; min-height: 36px; }
.checkbox-field {
  align-items: center;
  align-content: center;
}
.checkbox-field label { display: inline-flex; gap: 8px; align-items: center; margin-top: 22px; }

.week-note-wrap {
  margin-top: 14px;
  padding: 13px;
  border: 1px dashed rgba(86, 195, 219, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(6, 29, 43, 0.48), rgba(5, 24, 37, 0.68));
}
.week-note-wrap label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #dff8ff;
}
.week-note {
  min-height: 92px;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(2, 20, 31, 0.95), rgba(3, 24, 37, 0.98));
}
.week-note::placeholder { color: #6ea3af; }
.focus-task {
  animation: pulseFocus 1.6s ease;
  border-color: rgba(103, 227, 252, 0.56) !important;
  box-shadow: 0 0 0 3px rgba(72, 212, 237, 0.16), var(--shadow-sm);
}
@keyframes pulseFocus {
  0% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(72, 212, 237, 0.34), var(--shadow-sm); }
  50% { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(72, 212, 237, 0.10), var(--shadow-sm); }
  100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(72, 212, 237, 0.00), var(--shadow-sm); }
}

.calendar-box { padding: 14px; overflow-x: auto; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  min-width: 980px;
}
.weekday-head {
  text-align: center;
  padding: 11px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(25, 92, 122, 0.82), rgba(18, 69, 93, 0.90));
  font-weight: 800;
  font-size: 13px;
}
.day-column {
  min-height: 250px;
  max-height: 250px;
  padding: 11px;
  border-radius: 18px;
  overflow-y: auto;
  overflow-x: hidden;
}
.day-number {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 10px;
  padding-bottom: 6px;
  background: linear-gradient(180deg, rgba(8, 37, 53, 0.94), rgba(8, 37, 53, 0.72));
}
.task-list-item {
  display: block;
  padding: 10px 10px 9px;
  border-radius: 14px;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.35;
  transition: 0.16s ease;
}
.task-list-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}
.task-list-item strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.task-list-item.midia { border-left: 3px solid #38c5de; }
.task-list-item.video { border-left: 3px solid #8f67ff; }

/* PUBLICADO EM VERDE */
.task-list-item.publicado,
.task-list-item.stage-publicado,
.task-list-item.done,
.task-list-item.is-publicado,
.task-list-item[data-stage="publicado"] {
  border-color: rgba(72, 214, 138, 0.24);
  border-left: 3px solid #35c585 !important;
  background: linear-gradient(180deg, rgba(14, 58, 40, 0.96), rgba(8, 34, 24, 0.98)) !important;
  box-shadow: 0 0 0 1px rgba(53, 197, 133, 0.10), inset 0 1px 0 rgba(255,255,255,0.02);
}

.task-list-item.publicado strong,
.task-list-item.stage-publicado strong,
.task-list-item.done strong,
.task-list-item.is-publicado strong,
.task-list-item[data-stage="publicado"] strong {
  color: #f1fff6;
}

.task-list-item.publicado,
.task-list-item.stage-publicado,
.task-list-item.done,
.task-list-item.is-publicado,
.task-list-item[data-stage="publicado"] {
  color: #c9f5db;
}

/* reforço caso a classe publicado venha junto com tipo */
.task-list-item.midia.publicado,
.task-list-item.midia.stage-publicado,
.task-list-item.video.publicado,
.task-list-item.video.stage-publicado,
.task-list-item.midia.done,
.task-list-item.video.done {
  border-left: 3px solid #35c585 !important;
}

.empty-state { color: var(--muted); margin: 0; min-height: 16px; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card { width: min(480px, 100%); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

@media (max-width: 1440px) {
  .metrics-row, .stats-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .hero-row,
  .content-grid,
  .content-grid-client,
  .client-grid,
  .summary-grid,
  .form-grid-2,
  .weeks-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }
  .calendar-grid { min-width: 840px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .metrics-row, .stats-six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-task-actions { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .metrics-row, .stats-six { grid-template-columns: 1fr; }
  .main { padding: 18px 12px 24px; }
  .hero h1 { font-size: 34px; }
  .calendar-grid { min-width: 760px; }
}

.task-actions,
.day-task-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 118px;
  min-width: 118px;
  align-items: stretch;
}

.task-actions .btn,
.day-task-actions .btn {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.15;
  border-radius: 12px;
}

.task-actions .btn-primary,
.day-task-actions .btn-primary {
  background: linear-gradient(135deg, #35c4dd, #1e8ea5);
}

.task-actions .btn-danger,
.day-task-actions .btn-danger {
  background: linear-gradient(135deg, #cf6161, #b04a4a);
}

.task-link-row,
.whatsapp-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.task-link-row .btn,
.whatsapp-row .btn,
.btn-whatsapp,
.whatsapp-btn {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 12px;
  width: auto;
}

.task-title-row {
  align-items: flex-start;
  gap: 14px;
}

.task-card,
.day-block .task-card {
  display: flex;
  flex-direction: column;
}

.task-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

/* SELECT DARK CORRIGIDO */
select,
input[type="month"],
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #041926 !important;
  background-image:
    linear-gradient(180deg, rgba(2, 21, 33, 0.94), rgba(3, 25, 38, 0.98)),
    linear-gradient(45deg, transparent 50%, #effaff 50%),
    linear-gradient(135deg, #effaff 50%, transparent 50%);
  background-position:
    0 0,
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size:
    100% 100%,
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  color: #effaff !important;
  color-scheme: dark;
}

select option,
select optgroup {
  background: #062735 !important;
  color: #effaff !important;
}

select option:checked,
select option:hover,
select option:focus,
select option:active {
  background: #0d5d70 !important;
  color: #ffffff !important;
}

select::-ms-expand {
  display: none;
}
