/* ═══════════════════════════════════════════════════════════
   DomusFlow — Custom CSS
   ═══════════════════════════════════════════════════════════ */

:root {
  --primary:   #27ae60;
  --primary-dark: #219150;
  --secondary: #2980b9;
  --bg:        #f4f6f9;
  --sidebar-w: 240px;
  --topbar-h:  56px;
  --bottom-h:  64px;
  --card-radius: 14px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── Reset ── */
body {
  background: var(--bg);
  color: #2c3e50;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #fff;
  border-right: 1px solid #e9ecef;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 2rem;
  padding: 0 .5rem;
}

.sidebar-brand i { font-size: 1.5rem; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: .25rem; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: 10px;
  text-decoration: none;
  color: #5a6a7a;
  font-size: .93rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(39,174,96,.1);
  color: var(--primary);
}
.sidebar-link i { font-size: 1.1rem; }

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

/* ── Main content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 1.75rem 2rem 2rem;
  min-height: 100vh;
}

@media (max-width: 991.98px) {
  .main-content {
    margin-left: 0;
    padding: 1rem 1rem calc(var(--bottom-h) + 1rem);
    margin-top: var(--topbar-h);
  }
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .15rem;
}

/* ── Topbar (mobile) ────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  z-index: 99;
}
.topbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

/* ── Bottom nav (mobile) ────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: #fff;
  border-top: 1px solid #e9ecef;
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 .25rem;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #8898aa;
  font-size: .65rem;
  font-weight: 500;
  flex: 1;
  padding: .5rem 0;
  transition: color .15s;
}
.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--primary); }

/* ── Cards ──────────────────────────────────────────────── */
.card { border-radius: var(--card-radius) !important; }

/* Stat cards */
.stat-card .card-body { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.25rem; }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: .25rem;
}
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; color: #8898aa; font-weight: 500; }

/* List cards */
.list-card { transition: transform .15s, box-shadow .15s; cursor: pointer; }
.list-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08) !important; }

/* Task cards */
.task-card { transition: transform .15s; }
.task-done { opacity: .65; }
.task-done .task-name { text-decoration: line-through; color: #8898aa; }
.days-row { display: flex; flex-wrap: wrap; gap: .25rem; }
.day-chip {
  font-size: .7rem; font-weight: 600;
  background: rgba(41,128,185,.1); color: var(--secondary);
  padding: 2px 8px; border-radius: 20px;
}

/* ── Category badges ────────────────────────────────────── */
.cat-badge { font-size: .7rem; font-weight: 600; text-transform: capitalize; }
.cat-supermercado { background: rgba(39,174,96,.15); color: #1a7a3f; }
.cat-feira        { background: rgba(243,156,18,.15); color: #b85c00; }
.cat-farmácia     { background: rgba(231,76,60,.15);  color: #922b21; }
.cat-padaria      { background: rgba(142,68,173,.15); color: #6c3483; }
.cat-outros       { background: rgba(127,140,141,.15);color: #4d5f60; }

/* Freq badges */
.badge-freq-daily  { background: rgba(231,76,60,.15);  color:#922b21; }
.badge-freq-weekly { background: rgba(41,128,185,.15); color: #1a527a; }
.badge-freq-custom { background: rgba(142,68,173,.15); color: #6c3483; }

/* ── Shopping items ─────────────────────────────────────── */
.item-row { transition: background .2s; }
.item-bought { background: rgba(39,174,96,.06); }
.item-bought .item-name { text-decoration: line-through; color: #8898aa; }
.item-not-found { background: rgba(231,76,60,.05); }
.item-not-found .item-name { color: #c0392b; }

.status-btn { background: none; border: none; padding: 0; font-size: 1.15rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover  { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: none; border: none; padding: .2rem .4rem; color: #6c757d; }
.btn-ghost:hover { background: rgba(0,0,0,.05); }

/* ── Login page ─────────────────────────────────────────── */
.login-page {
  background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-wrapper { width: 100%; max-width: 420px; }
.login-card { background: #fff !important; }

.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #fff;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(39,174,96,.3);
}

.login-features li {
  padding: .3rem 0;
  font-size: .9rem;
  color: #4a5568;
}

.btn-google {
  background: #fff;
  border: 1.5px solid #dadce0;
  color: #3c4043;
  font-weight: 500;
  border-radius: 10px;
  transition: box-shadow .15s;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); background: #fafafa; }

/* ── Avatar placeholder ─────────────────────────────────── */
.avatar-placeholder {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; }
.empty-state i { display: block; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

/* ── Task list (dashboard) ──────────────────────────────── */
.task-list .list-group-item { padding: .65rem 0; }

/* ── Utilities ──────────────────────────────────────────── */
.rounded-4 { border-radius: 1rem !important; }
.fw-600 { font-weight: 600; }
