/* eu.caprara.network — dark, azul tech */

:root {
  --bg: #0C111B;
  --surface: #141B28;
  --surface-soft: #1A2333;
  --line: #273349;
  --line-strong: #34425E;
  --ink: #E8EDF7;
  --muted: #8C97AC;
  --blue: #4D8DFF;
  --blue-soft: rgba(77, 141, 255, 0.14);
  --sky: #38BDF8;
  --cyan: #22D3EE;
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --violet: #A78BFA;
  --violet-soft: rgba(167, 139, 250, 0.14);
  --green: #4ADE80;
  --amber: #FBBF24;
  --red: #F87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue-soft); }

.hidden { display: none !important; }

button { font-family: inherit; }

/* ---------- LOGIN ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(77, 141, 255, 0.08), transparent),
    var(--bg);
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.login-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-title::before {
  content: '';
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 4px 20px rgba(77, 141, 255, 0.35);
}

.login-sub {
  margin: -8px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.login-box input {
  font-family: inherit;
  font-size: 15px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}

.login-box input:focus { border-color: var(--blue); }

.login-box button {
  font-size: 15px;
  font-weight: 600;
  padding: 13px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s;
}

.login-box button:hover { filter: brightness(1.12); }

.login-error {
  margin: 0;
  min-height: 1.4em;
  font-size: 13px;
  color: var(--red);
}

/* ---------- TOPO / ABAS ---------- */
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 22px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.tab::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.4;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.tab-orange::before { background: var(--blue); }
.tab-yellow::before { background: var(--cyan); }

.tab:hover { color: var(--ink); }

.tab.active {
  background: var(--surface-soft);
  color: var(--ink);
}

.tab.active::before { opacity: 1; }

.tab-violet::before { background: var(--violet); }

.tab-orange.active::before { box-shadow: 0 0 10px var(--blue); }
.tab-yellow.active::before { box-shadow: 0 0 10px var(--cyan); }
.tab-violet.active::before { box-shadow: 0 0 10px var(--violet); }

.save-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.save-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
  transition: background 0.2s, box-shadow 0.2s;
}

.save-status.saving::before {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

.save-status.error { color: var(--red); }
.save-status.error::before {
  background: var(--red);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

/* ---------- KANBAN ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

.column {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px 16px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.column[data-col="medio"] { border-top-color: var(--sky); }
.column[data-col="longo"] { border-top-color: var(--cyan); }

.column-title {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 2px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 30px;
  flex: 1;
}

.card {
  position: relative;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 32px 12px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: grab;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover { border-color: var(--line-strong); }

.card:active { cursor: grabbing; }

.card.editing {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
  cursor: text;
}

.card .txt { outline: none; display: block; min-height: 1.4em; }

.card.sortable-ghost {
  opacity: 0.5;
  border-style: dashed;
  border-color: var(--blue);
  background: var(--blue-soft);
}

.card.sortable-drag {
  opacity: 0.97;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
  transform: rotate(1.5deg);
}

.card .del {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}

.card:hover .del, .card.editing .del { opacity: 0.7; }

.card .del:hover {
  opacity: 1;
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
}

.add-card {
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.add-card:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

/* ---------- BLOCO DE NOTAS ---------- */
.notes-wrap { display: flex; }

.notes {
  width: 100%;
  min-height: calc(100vh - 230px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 34px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: box-shadow 0.15s;
}

.notes:focus {
  box-shadow: var(--shadow), 0 0 0 3px var(--cyan-soft);
}

.notes::placeholder { color: #475369; }

/* ---------- AGENDA ---------- */
.agenda-setup {
  max-width: 660px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--violet);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
}

.agenda-setup h2 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
}

.agenda-setup ol {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.agenda-setup ol strong { color: var(--ink); font-weight: 600; }

.agenda-setup-row { display: flex; gap: 10px; }

.agenda-setup-row input {
  flex: 1;
  font-family: inherit;
  font-size: 13.5px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.agenda-setup-row input:focus { border-color: var(--violet); }

.agenda-setup-row button {
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--violet);
  color: #14101F;
  cursor: pointer;
  transition: filter 0.15s;
}

.agenda-setup-row button:hover { filter: brightness(1.12); }

.agenda-error {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-size: 13px;
  color: var(--red);
}

.agenda-warn {
  margin: 0;
  font-size: 13px;
  color: var(--amber);
}

.agenda-empty, .agenda-loading {
  color: var(--muted);
  font-size: 14.5px;
}

.agenda-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.agenda-arrow {
  width: 38px;
  height: 38px;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}

.agenda-arrow:hover:not(:disabled) {
  border-color: var(--violet);
  color: var(--violet);
}

.agenda-arrow:disabled { opacity: 0.3; cursor: default; }

.agenda-today {
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--violet);
  background: var(--violet-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.12s;
}

.agenda-today:hover { filter: brightness(1.15); }

.agenda-range {
  margin-left: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}

.agenda-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: stretch;
}

.agenda-day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 12px;
  min-height: 180px;
}

.agenda-day.is-today { border-color: var(--violet); }

.agenda-day.is-past { opacity: 0.6; }

.agenda-day h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
}

.agenda-day-date {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 12px;
}

.agenda-ev {
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}

.agenda-time {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: #0C111B;
  background: #F4F6FA;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.agenda-ev-title { font-size: 14px; line-height: 1.4; }

.agenda-empty { margin: 4px 0 0; font-size: 13px; }

.agenda-foot {
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

.agenda-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.agenda-link:hover {
  color: var(--violet);
  background: var(--violet-soft);
}

/* ---------- MOBILE ---------- */
@media (max-width: 760px) {
  .app { padding: 18px 14px 48px; }

  .topbar { margin-bottom: 20px; }

  .tabs { width: 100%; }

  .tab {
    flex: 1;
    justify-content: center;
    padding: 10px 8px;
    font-size: 13.5px;
  }

  .save-status { width: 100%; justify-content: flex-end; margin-top: -4px; }

  .board { grid-template-columns: 1fr; gap: 14px; }

  .column { min-height: 0; padding: 18px 14px 12px; }

  .notes {
    min-height: calc(100vh - 210px);
    padding: 22px 18px;
    font-size: 15.5px;
  }

  .agenda-setup { padding: 20px 18px; }

  .agenda-setup-row { flex-direction: column; }

  .agenda-grid { grid-template-columns: 1fr; gap: 12px; }

  .agenda-day { min-height: 0; }

  .agenda-range { margin-left: auto; }
}
