/* Cronograma mensal */
.crg-page { display: flex; flex-direction: column; gap: 16px; }

.crg-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.9));
  border-color: rgba(59, 130, 246, 0.25);
}
.crg-title { margin: 0 0 6px; font-size: 1.35rem; }
.crg-lead { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.45; max-width: 52ch; }
.crg-muted { color: var(--text-dim); font-size: 0.85rem; }

.crg-import {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 18px;
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(51, 65, 85, 0.12));
}
.crg-import--maintenance { opacity: 0.94; }
.crg-import-main { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 220px; }
.crg-import-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.crg-import-main code {
  font-size: 0.8125rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.crg-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.crg-maint-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.28);
  white-space: nowrap;
}
.crg-import-btn[aria-disabled="true"] {
  opacity: 0.72;
  cursor: not-allowed;
}
.crg-import-btn[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
}

.crg-settings {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px;
  border-color: rgba(251, 191, 36, 0.2);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.85), rgba(120, 53, 15, 0.08));
}
.crg-settings-main { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 220px; }
.crg-settings-icon { font-size: 1.4rem; line-height: 1; }
.crg-settings-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.crg-toggle { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; }
.crg-field-inline { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; }
.crg-select {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  color: var(--text-primary); border-radius: 8px; padding: 6px 10px; font-size: 0.875rem;
}
.crg-select-full { width: 100%; }

.crg-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
}
.crg-month-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crg-period-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 160px; max-width: min(360px, 55vw);
}
.crg-period-label {
  margin: 0; padding: 4px 10px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-primary);
  font-size: 1.05rem; font-weight: 700; text-align: center; cursor: pointer;
  line-height: 1.25; transition: background 0.15s, color 0.15s;
}
.crg-period-label:hover {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-bright, #60a5fa);
}
.crg-scope-hint {
  font-size: 0.68rem; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 600;
}
.crg-scope-hint.hidden { display: none; }

.crg-picker-modal { max-width: 420px; width: 100%; }
.crg-picker-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.crg-picker-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: rgba(15, 23, 42, 0.6); border-radius: 10px;
  border: 1px solid var(--border-subtle);
}
.crg-picker-tab {
  flex: 1; border: none; border-radius: 8px; padding: 8px 10px;
  background: transparent; color: var(--text-dim); font-size: 0.8125rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.crg-picker-tab:hover { color: var(--text-primary); }
.crg-picker-tab.active {
  background: rgba(59, 130, 246, 0.25); color: #93c5fd;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}
.crg-picker-panel.hidden { display: none; }
.crg-picker-hint { margin: 0 0 10px; font-size: 0.8125rem; line-height: 1.35; }
.crg-picker-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.crg-input-date {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  color: var(--text-primary); border-radius: 8px; padding: 8px 10px; font-size: 0.875rem;
}

.crg-body { padding: 14px; overflow: hidden; }

.crg-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 8px; padding: 0 2px;
}
.crg-weekdays span {
  text-align: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  color: var(--text-dim); letter-spacing: 0.04em;
}

.crg-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
}

.crg-day {
  min-height: 148px; border-radius: 12px; border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.55); padding: 8px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column;
}
.crg-day:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.crg-day--other { opacity: 0.4; }
.crg-day--weekend { background: rgba(251, 191, 36, 0.07); border-color: rgba(251, 191, 36, 0.2); }
.crg-day--has { border-color: rgba(59, 130, 246, 0.4); min-height: 168px; }

.crg-day-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-shrink: 0;
}
.crg-day-num { font-weight: 800; font-size: 0.9rem; }
.crg-day-count {
  font-size: 0.65rem; font-weight: 700; background: rgba(59, 130, 246, 0.3);
  color: #bfdbfe; border-radius: 999px; padding: 2px 7px;
}
.crg-day-add {
  margin-left: auto; width: 24px; height: 24px; border: none; border-radius: 7px;
  background: rgba(59, 130, 246, 0.25); color: #93c5fd; cursor: pointer;
  font-size: 1.1rem; line-height: 1; font-weight: 600;
}
.crg-day-add:hover { background: rgba(59, 130, 246, 0.45); color: #fff; }

.crg-day-body {
  display: flex; flex-direction: column; gap: 5px; flex: 1; overflow: hidden; min-height: 0;
}

/* —— Chip no calendário —— */
.crg-chip {
  display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%;
  border: none; border-radius: 8px; padding: 6px 8px; cursor: pointer;
  background: rgba(59, 130, 246, 0.18); border-left: 3px solid #3b82f6;
  font-size: 0.72rem; line-height: 1.25;
  transition: transform 0.12s, background 0.12s;
}
.crg-chip:hover { transform: translateY(-1px); background: rgba(59, 130, 246, 0.28); }
.crg-chip--done { background: rgba(34, 197, 94, 0.14); border-left-color: #22c55e; }
.crg-chip--has-comment { box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.25); }
.crg-chip--preview { pointer-events: none; max-width: 280px; }

.crg-chip-head {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.crg-chip-client {
  font-weight: 800; font-size: 0.74rem; letter-spacing: 0.03em;
  color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crg-chip-status {
  flex-shrink: 0; font-size: 0.65rem; font-weight: 700;
  color: #86efac; background: rgba(34, 197, 94, 0.2);
  border-radius: 999px; width: 16px; height: 16px; display: grid; place-items: center;
}
.crg-chip-line {
  display: flex; align-items: flex-start; gap: 4px;
  color: #94a3b8; font-size: 0.68rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crg-chip-line--act { color: #a5b4fc; }
.crg-chip-ico { flex-shrink: 0; font-size: 0.72rem; line-height: 1.3; }

.crg-chip-comment {
  display: flex; align-items: flex-start; gap: 4px;
  margin-top: 2px; padding: 4px 6px; border-radius: 6px;
  background: rgba(251, 191, 36, 0.15); border-left: 2px solid #fbbf24;
  color: #fde68a; font-size: 0.67rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.crg-more {
  border: none; background: transparent; color: #93c5fd;
  font-size: 0.68rem; font-weight: 600; cursor: pointer; text-align: left; padding: 2px 4px;
}
.crg-more:hover { text-decoration: underline; }

/* —— Cards lista / painel do dia —— */
.crg-list { display: flex; flex-direction: column; gap: 24px; }
.crg-list-day-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle);
}
.crg-list-day-head h4 { margin: 0; font-size: 1rem; text-transform: capitalize; }

.crg-entry {
  border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; background: rgba(15, 23, 42, 0.6);
  transition: border-color 0.15s;
}
.crg-entry:hover { border-color: rgba(59, 130, 246, 0.35); }
.crg-entry--done { border-color: rgba(34, 197, 94, 0.35); }

.crg-entry-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.9fr 1fr;
  gap: 12px 16px;
  margin-bottom: 10px;
}
.crg-entry-lbl {
  display: block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 4px;
}
.crg-entry-col strong {
  font-size: 0.92rem; letter-spacing: 0.02em; color: #f1f5f9;
}
.crg-entry-col span { font-size: 0.85rem; color: #cbd5e1; line-height: 1.35; }

.crg-entry-comment {
  margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.04));
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-left: 4px solid #fbbf24;
}
.crg-entry-comment-lbl {
  display: block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  color: #fcd34d; margin-bottom: 4px; letter-spacing: 0.04em;
}
.crg-entry-comment p { margin: 0; font-size: 0.88rem; line-height: 1.45; color: #fef3c7; }

.crg-entry-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.crg-badge {
  font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.crg-badge--ok { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.crg-badge--pending { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
.crg-badge--note { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }

.crg-team-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.22);
  margin-bottom: 10px;
}
.crg-team-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  font-size: 0.8125rem;
  font-weight: 700;
}
.crg-team-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-size: 0.6875rem;
  font-weight: 700;
  vertical-align: middle;
}
.crg-day-panel .crg-modal-foot .btn { width: auto; min-width: 0; flex: 0 1 auto; }
.crg-day-panel .crg-modal-foot .btn-primary { min-width: 160px; }

/* —— Modal —— */
.crg-modal {
  max-width: 580px; width: 100%; margin: auto; max-height: 92vh; overflow: auto;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1px solid rgba(59, 130, 246, 0.22);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.crg-modal .card-header,
.crg-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), transparent);
}
.crg-modal .card-title { color: #f1f5f9; font-size: 1.05rem; }
.crg-modal-sub { margin: 4px 0 0; font-size: 0.85rem; color: #94a3b8; }
.crg-day-panel {
  max-width: 720px; width: 100%; margin: auto; max-height: 90vh; overflow: auto;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.crg-modal-body, .crg-day-panel-body {
  padding: 18px 20px; display: flex; flex-direction: column; gap: 16px;
}

.crg-modal-section {
  padding: 14px; border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.crg-modal-section--2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 14px; border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.crg-field { display: flex; flex-direction: column; gap: 8px; }
.crg-field > span {
  font-size: 0.76rem; font-weight: 600; color: #94a3b8;
  letter-spacing: 0.03em; text-transform: uppercase;
}

/* Inputs escuros — combina com o tema */
.crg-modal input[type="text"],
.crg-modal input[type="date"],
.crg-modal input[type="search"],
.crg-modal select,
.crg-modal textarea,
.crg-modal .crg-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.72);
  color: #f1f5f9;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  color-scheme: dark;
}
.crg-modal input::placeholder,
.crg-modal textarea::placeholder { color: rgba(148, 163, 184, 0.5); }
.crg-modal input:hover,
.crg-modal select:hover,
.crg-modal textarea:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.85);
}
.crg-modal input:focus,
.crg-modal select:focus,
.crg-modal textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
  background: rgba(15, 23, 42, 0.92);
}
.crg-modal select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.crg-modal input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75); opacity: 0.85; cursor: pointer;
}

.crg-field--comment textarea {
  min-height: 92px; resize: vertical;
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.06);
  color: #fef3c7;
}
.crg-field--comment textarea::placeholder { color: rgba(253, 230, 138, 0.45); }
.crg-field--comment textarea:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}
.crg-field--comment textarea:focus {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
  background: rgba(251, 191, 36, 0.09);
}

.crg-field-hint { font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.crg-input-mt { margin-top: 4px; }

/* Pickers dentro do modal */
.crg-modal .wo-picker { position: relative; }
.crg-modal .wo-picker-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.72);
  color: #f1f5f9;
  font-size: 0.875rem;
}
.crg-modal .wo-picker-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
.crg-modal .wo-picker-input::placeholder { color: rgba(148, 163, 184, 0.5); }
.crg-modal .wo-picker-chip {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
  border-radius: 999px;
  padding: 3px 8px 3px 10px;
  font-size: 0.78rem;
}
.crg-modal .wo-picker-dropdown {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.crg-modal .wo-picker-opt:hover { background: rgba(59, 130, 246, 0.15); }

.crg-preview {
  padding: 14px; border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px dashed rgba(59, 130, 246, 0.3);
}
.crg-preview-lbl {
  display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  color: #64748b; margin-bottom: 10px; letter-spacing: 0.05em;
}
.crg-task-linked {
  margin: 0; padding: 10px 14px; border-radius: 10px;
  background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac; font-size: 0.85rem;
}

.crg-modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky; bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
}
.crg-modal-foot-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.crg-modal-foot .btn {
  width: auto;
  min-width: 108px;
  flex: 0 0 auto;
}
.crg-modal-foot .btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  font-weight: 600;
}
.crg-modal-foot .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #f8fafc;
}
.crg-modal-foot .btn-primary {
  min-width: 120px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
.crg-modal-foot .btn-ghost {
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
  width: auto;
}
.crg-modal-foot .btn-ghost:hover {
  background: rgba(248, 113, 113, 0.1);
}
.co-modal-close.crg-modal-close {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 32px; height: 32px;
  min-width: 32px;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.co-modal-close.crg-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}
.crg-empty { padding: 24px; text-align: center; }

@media (max-width: 900px) {
  .crg-entry-grid { grid-template-columns: 1fr 1fr; }
  .crg-modal-section--2col { grid-template-columns: 1fr; }
  .crg-day { min-height: 130px; }
  .crg-day--has { min-height: 150px; }
}

@media (max-width: 560px) {
  .crg-grid { gap: 4px; }
  .crg-day { min-height: 110px; padding: 5px; }
  .crg-chip { padding: 4px 6px; font-size: 0.64rem; }
  .crg-entry-grid { grid-template-columns: 1fr; }
  .crg-settings { flex-direction: column; align-items: stretch; }
}
