/* ══════════════════════════════════════════════════
   ANDREIAPP — Minimal Premium Dark
   (inspirado no visual da Intranet: glass, emerald, Inter)
══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg:       #070707;
  --surface:  #0d0d0d;
  --card:     #111111;
  --card2:    #1a1a1a;
  --border:   rgba(255,255,255,.06);
  --border2:  rgba(255,255,255,.10);

  --accent:      #10b981;
  --accent-lt:   #34d399;
  --accent-dk:   #059669;
  --accent-d:    rgba(16,185,129,.12);
  --accent-glow: rgba(16,185,129,.28);

  --gold:   #f59e0b;
  --red:    #ef4444;
  --blue:   #3b82f6;
  --indigo: #818cf8;
  --pink:   #f472b6;

  --text:  #e5e7eb;
  --text2: #9ca3af;
  --text3: #6b7280;
  --text4: #3f3f46;

  --r-sm: 7px;
  --r:    11px;
  --r-lg: 16px;
  --r-xl: 22px;

  --ease:   cubic-bezier(.4,0,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* ambient glow, sutil */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 620px; height: 620px;
  top: -220px; right: -140px;
  background: radial-gradient(circle, rgba(16,185,129,.05) 0%, transparent 70%);
}
body::after {
  width: 460px; height: 460px;
  bottom: -140px; left: 220px;
  background: radial-gradient(circle, rgba(16,185,129,.03) 0%, transparent 70%);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 99px; }

/* ── App shell (sidebar + main) ─────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 228px;
  flex-shrink: 0;
  background: rgba(13,13,13,.86);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  margin-bottom: 30px;
  text-decoration: none;
}
.sidebar-brand-icon {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--accent-dk), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #04140d;
  box-shadow: 0 0 14px var(--accent-glow);
  flex-shrink: 0;
}
.sidebar-brand-text { font-size: .92rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }

.channel-list { display: flex; flex-direction: column; gap: 2px; }
.channel-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r);
  font-size: .84rem;
  font-weight: 500;
  color: var(--text3);
  text-decoration: none;
  position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.channel-icon { font-size: .78rem; width: 15px; text-align: center; flex-shrink: 0; }
.channel-link:hover { background: rgba(255,255,255,.04); color: var(--text); }
.channel-link.active { background: var(--accent-d); color: var(--accent-lt); }
.channel-link.active::before {
  content: '';
  position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.sidebar-logout { margin-top: auto; padding-top: 14px; }
.sidebar-logout-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
.sidebar-logout-btn:hover { color: var(--red); background: rgba(239,68,68,.08); }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  position: relative;
}
.page-scroll { flex: 1; overflow-y: auto; padding: 34px 40px; }

@media (max-width: 767px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    gap: 16px;
  }
  .sidebar-brand { margin-bottom: 0; }
  .sidebar-brand-text { white-space: nowrap; }
  .channel-list { flex-direction: row; gap: 4px; }
  .channel-link span { white-space: nowrap; }
  .channel-link.active::before { display: none; }
  .sidebar-logout { display: flex; align-items: center; gap: 4px; margin-top: 0; margin-left: auto; padding-top: 0; flex-shrink: 0; }
  .app-main { min-height: auto; max-height: none; }
  .page-scroll { padding: 22px; }
}

/* ── Page header (slim, compartilhado) ──────────────── */
.page-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 20px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}
.page-hdr h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  margin: 0;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 13px;
  font-size: .74rem;
  color: var(--text3);
  font-weight: 500;
}
.stat-pill strong { color: var(--text); font-weight: 700; }

/* ── Card box (painel genérico) ─────────────────────── */
.card-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
}
.box-title {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -.01em;
}

/* Seção retrátil ("Nova refeição" / "Novo treino") */
.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
  user-select: none;
}
.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-summary::marker { content: ''; }
.collapsible-chevron { color: var(--text3); font-size: .72rem; transition: transform .15s var(--ease); }
details[open] > .collapsible-summary { margin-bottom: 16px; }
details[open] > .collapsible-summary .collapsible-chevron { transform: rotate(90deg); }

.list-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.list-item:hover { border-color: var(--border2); background: var(--card2); }
.list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.list-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.list-item-time { font-size: .74rem; color: var(--text3); font-weight: 500; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ── Arrastar para reordenar (refeições/treinos) ────── */
.drag-handle {
  color: var(--text4);
  font-size: .8rem;
  cursor: grab;
  flex-shrink: 0;
  padding: 2px 2px;
  touch-action: none;
}
.drag-handle:hover { color: var(--text3); }
.drag-ghost { opacity: .35; }
.sortable-chosen { border-color: rgba(16,185,129,.35) !important; }
.list-item-desc { font-size: .86rem; color: var(--text); overflow-wrap: break-word; padding-left: 27px; }

.badge-type {
  background: var(--accent-d);
  color: var(--accent-lt);
  font-size: .66rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Workouts ────────────────────────────────────── */
.exercise-row { align-items: center; }
.workout-info { flex: 1 1 auto; min-width: 0; }
.workout-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.015em;
  line-height: 1.3;
  overflow-wrap: break-word;
}
.workout-time {
  font-size: .72rem;
  color: var(--text3);
  font-weight: 500;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.exercise-row-view {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.025);
}
.ex-name { color: var(--text); font-weight: 500; }
.ex-detail { color: var(--text3); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* ── Calendar (intestino) ────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-weekday {
  text-align: center;
  font-size: .64rem;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .05em;
  padding-bottom: 6px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  border-radius: var(--r);
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s var(--spring);
  position: relative;
}
.cal-cell:hover { border-color: var(--border2); background: rgba(255,255,255,.045); }
.cal-cell-empty { background: transparent; border: none; cursor: default; }
.cal-day-num { font-size: .8rem; font-weight: 500; color: var(--text2); }
.cal-cell-today { border-color: var(--accent); }
.cal-cell-today .cal-day-num { color: var(--accent-lt); font-weight: 700; }
.cal-cell-marked { background: var(--accent-d); border-color: rgba(16,185,129,.25); }
.cal-cell-marked .cal-day-num { color: var(--text); }

/* Dia selecionado (data ativa no formulário abaixo) — bem mais vibrante */
.cal-cell-selected {
  background: linear-gradient(135deg, var(--accent-dk), var(--accent)) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow), 0 6px 18px rgba(16,185,129,.35);
  transform: scale(1.06);
  z-index: 1;
}
.cal-cell-selected .cal-day-num { color: #04140d; font-weight: 800; }
.cal-cell-selected .cal-count-badge { background: rgba(4,20,13,.28); color: #04140d; }
.cal-count-badge {
  font-size: .62rem;
  font-weight: 700;
  color: var(--accent-lt);
  background: rgba(16,185,129,.16);
  border-radius: 99px;
  padding: 0 7px;
  line-height: 1.5;
}

/* ── Empty state ──────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text3); }
.empty-state .icon { font-size: 2.2rem; margin-bottom: 14px; opacity: .35; }

/* ══ Bootstrap overrides ═══════════════════════════ */
.btn-success {
  background: linear-gradient(135deg, var(--accent-dk), var(--accent)) !important;
  border: none !important;
  color: #04140d !important;
  font-weight: 700 !important;
  border-radius: var(--r-sm) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12) !important;
  transition: all .2s var(--spring) !important;
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow) !important; }
.btn-success:active { transform: scale(.97); }

.btn-outline-secondary {
  border-color: var(--border2) !important;
  color: var(--text3) !important;
  background: rgba(255,255,255,.02) !important;
  border-radius: var(--r-sm) !important;
}
.btn-outline-secondary:hover { background: rgba(255,255,255,.06) !important; color: var(--text) !important; }

.btn-outline-danger {
  border-color: rgba(239,68,68,.25) !important;
  color: var(--red) !important;
  background: transparent !important;
  border-radius: var(--r-sm) !important;
}
.btn-outline-danger:hover { background: rgba(239,68,68,.08) !important; }

.form-control, .form-select {
  background: rgba(255,255,255,.03) !important;
  border-color: var(--border2) !important;
  color: var(--text) !important;
  border-radius: var(--r-sm) !important;
}
.form-control::placeholder { color: var(--text4) !important; }
.form-control:focus, .form-select:focus {
  border-color: rgba(16,185,129,.4) !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,.08) !important;
  background: rgba(255,255,255,.045) !important;
  color: var(--text) !important;
}
.form-label {
  color: var(--text3) !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── Row card (compartilhado: pastas e notas) ───────── */
.row-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 15px;
  transition: border-color .15s, background .15s;
}
.row-card:hover { border-color: var(--border2); background: var(--card2); }
.row-link { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: block; }
.row-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity .12s; }
.row-card:hover .row-actions { opacity: 1; }
/* Telas sem hover (touch) precisam ver as ações sempre */
@media (hover: none) {
  .row-actions { opacity: 1; }
}
.icon-action-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: none; border: none;
  color: var(--text3); font-size: .74rem;
  transition: all .12s;
}
.icon-action-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.icon-action-danger:hover { background: rgba(239,68,68,.1); color: var(--red); }

/* Pastas */
.folder-row { display: flex; align-items: center; gap: 12px; }
.folder-row-icon { color: var(--accent-lt); font-size: .95rem; flex-shrink: 0; width: 18px; text-align: center; }
.folder-row-name {
  flex: 1; min-width: 0;
  font-size: .88rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.folder-row-count { font-size: .72rem; color: var(--text3); flex-shrink: 0; }

/* Notas (lista) */
.note-row-title { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.note-row-preview {
  font-size: .78rem; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.note-row-date { font-size: .68rem; color: var(--text4); font-variant-numeric: tabular-nums; }

/* ── Editor de nota ──────────────────────────────────── */
.editor-header {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.editor-header-folder {
  flex: 1; min-width: 0;
  font-size: .78rem; color: var(--text3); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.editor-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.note-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 30px 44px 40px;
}
.note-editor-title {
  background: none; border: none; outline: none;
  color: #fff; font-size: 1.5rem; font-weight: 800;
  letter-spacing: -.02em; margin-bottom: 16px; width: 100%; flex-shrink: 0;
}
.note-editor-title::placeholder { color: var(--text4); }
.note-editor-body {
  flex: 1;
  background: none; border: none; outline: none; resize: none;
  color: var(--text2); font-size: .92rem; line-height: 1.75;
  width: 100%; min-height: 300px;
  font-family: inherit;
}
.note-editor-body::placeholder { color: var(--text4); }

@media (max-width: 767px) {
  .note-editor { padding: 22px 20px 30px; }
}

/* ══════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════ */
.login-body { overflow: hidden; }

.login-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Lado ilustração ─────────────────────────────── */
.login-art {
  flex: 1.1;
  position: relative;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px;
}
.login-art-glow {
  position: absolute;
  width: 640px; height: 640px;
  top: -160px; left: -160px;
  background: radial-gradient(circle, rgba(16,185,129,.10) 0%, transparent 70%);
  pointer-events: none;
}
.login-art-svg {
  width: 100%;
  max-width: 460px;
  height: auto;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,.5));
}
.login-art-svg g > rect,
.login-art-svg g > circle { transition: none; }

.float-slow { animation: floatY 7s ease-in-out infinite; }
.float-mid  { animation: floatY 5.5s ease-in-out infinite; animation-delay: .3s; }
.float-fast { animation: floatY 4.5s ease-in-out infinite; animation-delay: .6s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.login-art-copy {
  text-align: center;
  margin-top: 34px;
  max-width: 420px;
  position: relative;
}
.login-art-kicker {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-lt);
  margin-bottom: 10px;
}
.login-art-copy h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 10px;
}
.login-art-copy p {
  font-size: .88rem;
  color: var(--text3);
  line-height: 1.6;
}

/* ── Lado formulário ─────────────────────────────── */
.login-form-side {
  flex: 1;
  min-width: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  position: relative;
}
.login-form-side::before {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  bottom: -180px; right: -180px;
  background: radial-gradient(circle, rgba(16,185,129,.05) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 340px;
  position: relative;
  z-index: 1;
}
.login-logo {
  width: 44px; height: 44px;
  font-size: 1.05rem;
  margin-bottom: 22px;
}
.login-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  margin-bottom: 6px;
}
.login-sub {
  font-size: .86rem;
  color: var(--text3);
  margin-bottom: 28px;
}

.login-form .form-label { margin-bottom: 8px; }
.login-input-wrap { position: relative; margin-bottom: 6px; }
.login-input-icon {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--text4);
  font-size: .82rem;
  pointer-events: none;
}
.login-input {
  padding: 12px 16px 12px 40px !important;
  font-size: .92rem !important;
}

.login-error {
  display: flex;
  align-items: center;
  font-size: .78rem;
  color: var(--red);
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--r-sm);
  padding: 9px 13px;
  margin-top: 12px;
}

.login-submit {
  width: 100%;
  padding: 12px !important;
  font-size: .92rem !important;
  margin-top: 18px;
}

.login-label-spaced { margin-top: 16px; }

.login-switch {
  text-align: center;
  font-size: .82rem;
  color: var(--text3);
  margin-top: 20px;
}
.login-switch a { color: var(--accent-lt); font-weight: 600; text-decoration: none; }
.login-switch a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .login-art { display: none; }
  .login-form-side { min-width: 0; flex: 1; }
}
