/* ====== Cleaner — tema rosé / lilás ====== */
:root,
[data-bs-theme="light"] {
  --rose:        #b8386c;
  --rose-rgb:    184, 56, 108;
  --rose-dark:   #9a2a58;
  --rose-soft:   #fbe4ee;
  --lilac:       #8e6cc8;
  --lilac-soft:  #efe7fb;
  --blush-bg:    #fdf6f9;
  --card-shadow: 0 6px 24px -10px rgba(184, 56, 108, .28);

  --bs-primary: var(--rose);
  --bs-primary-rgb: var(--rose-rgb);
  --bs-primary-text-emphasis: #7d1f47;
  --bs-primary-bg-subtle: var(--rose-soft);
  --bs-primary-border-subtle: #f3bfd4;
  --bs-success: #2a8c73;
  --bs-success-rgb: 42, 140, 115;
  --bs-link-color: var(--rose);
  --bs-link-color-rgb: var(--rose-rgb);
  --bs-link-hover-color: var(--rose-dark);
  --bs-link-hover-color-rgb: 154, 42, 88;
  --bs-body-bg: var(--blush-bg);
  --bs-body-color: #4a3540;
  --bs-secondary-color: rgba(74, 53, 64, .68);
  --bs-border-color: #f0dbe4;
  --bs-tertiary-bg: #fbeef3;
  --bs-border-radius: .85rem;
  --bs-border-radius-sm: .6rem;
  --bs-border-radius-lg: 1.2rem;
  --bs-focus-ring-color: rgba(var(--rose-rgb), .25);
  --bs-body-font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-weight: 500;
}

[data-bs-theme="dark"] {
  --rose:        #f28ab4;
  --rose-rgb:    242, 138, 180;
  --rose-dark:   #f7a9c8;
  --rose-soft:   #4a2537;
  --lilac:       #c3a8f0;
  --lilac-soft:  #33284a;
  --blush-bg:    #1d1519;
  --card-shadow: 0 6px 24px -12px rgba(0, 0, 0, .7);

  --bs-primary: var(--rose);
  --bs-primary-rgb: var(--rose-rgb);
  --bs-primary-text-emphasis: #f9c4da;
  --bs-primary-bg-subtle: var(--rose-soft);
  --bs-primary-border-subtle: #6b3550;
  --bs-success: #6fd3b3;
  --bs-success-rgb: 111, 211, 179;
  --bs-link-color: var(--rose);
  --bs-link-color-rgb: var(--rose-rgb);
  --bs-link-hover-color: var(--rose-dark);
  --bs-link-hover-color-rgb: 247, 169, 200;
  --bs-body-bg: var(--blush-bg);
  --bs-body-color: #f1e3ea;
  --bs-secondary-color: rgba(241, 227, 234, .66);
  --bs-border-color: #3d2a34;
  --bs-tertiary-bg: #2a1d24;
  --bs-secondary-bg: #2a1d24;
  --bs-emphasis-color: #fff;
  --bs-focus-ring-color: rgba(var(--rose-rgb), .3);
}

body {
  background:
    radial-gradient(1200px 500px at 100% -10%, var(--lilac-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, var(--rose-soft), transparent 55%),
    var(--blush-bg);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, .h1, h2, .h2, h4, .h4, .navbar-brand, .stat-value {
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: .01em;
}
.stat-value { font-family: "Quicksand", sans-serif; font-weight: 700; }
h1.h4 { font-size: 1.6rem; color: var(--bs-emphasis-color); }

/* ---- navbar ---- */
.navbar {
  background: rgba(255, 255, 255, .72) !important;
  backdrop-filter: blur(10px);
  border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .navbar { background: rgba(29, 21, 25, .78) !important; }
.navbar-brand { font-size: 1.45rem; color: var(--rose) !important; font-style: italic; }
.brand-flower { color: var(--rose); display: inline-block; transition: transform .6s ease; }
.navbar-brand:hover .brand-flower { transform: rotate(72deg); }
.nav-link { font-weight: 600; border-radius: 999px; padding: .35rem .9rem !important; }
.nav-link.active { background: var(--rose-soft); color: var(--bs-primary-text-emphasis) !important; }

/* ---- botões ---- */
.btn { border-radius: 999px; font-weight: 600; }
.btn-primary {
  --bs-btn-bg: var(--rose);
  --bs-btn-border-color: var(--rose);
  --bs-btn-hover-bg: var(--rose-dark);
  --bs-btn-hover-border-color: var(--rose-dark);
  --bs-btn-active-bg: var(--rose-dark);
  --bs-btn-active-border-color: var(--rose-dark);
  --bs-btn-disabled-bg: var(--rose);
  --bs-btn-disabled-border-color: var(--rose);
  --bs-btn-focus-shadow-rgb: var(--rose-rgb);
  background-image: linear-gradient(135deg, var(--rose), color-mix(in srgb, var(--rose) 70%, var(--lilac)));
  border: 0;
  box-shadow: 0 4px 14px -6px rgba(var(--rose-rgb), .7);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #2a1520; --bs-btn-hover-color: #2a1520; --bs-btn-active-color: #2a1520; }
.btn-outline-primary {
  --bs-btn-color: var(--rose);
  --bs-btn-border-color: var(--rose);
  --bs-btn-hover-bg: var(--rose);
  --bs-btn-hover-border-color: var(--rose);
  --bs-btn-active-bg: var(--rose);
  --bs-btn-active-border-color: var(--rose);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-hover-color: #2a1520; --bs-btn-active-color: #2a1520; }
.btn-outline-secondary {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-bg: var(--rose-soft);
  --bs-btn-hover-color: var(--bs-primary-text-emphasis);
  --bs-btn-hover-border-color: var(--bs-primary-border-subtle);
  --bs-btn-active-bg: var(--rose-soft);
  --bs-btn-active-color: var(--bs-primary-text-emphasis);
  --bs-btn-active-border-color: var(--bs-primary-border-subtle);
  background: var(--bs-body-bg);
}
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.btn-group > .btn:last-child { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.btn-link.text-body-secondary:hover { color: var(--rose) !important; }

/* ---- formulários ---- */
.form-control, .form-select { border-color: var(--bs-border-color); background-color: var(--bs-body-bg); }
.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary-border-subtle);
  box-shadow: 0 0 0 .22rem rgba(var(--rose-rgb), .18);
}
.input-group-text { background: var(--rose-soft); color: var(--bs-primary-text-emphasis); border-color: var(--bs-border-color); font-weight: 700; }
.input-group-sm > .btn { border-radius: 0 var(--bs-border-radius-sm) var(--bs-border-radius-sm) 0; }

/* ---- cards ---- */
.card {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--card-shadow);
  background: var(--bs-body-bg);
  overflow: hidden;
}
[data-bs-theme="light"] .card { background: #fff; }
[data-bs-theme="dark"] .card { background: #251a20; }
.card-header, .card-footer { background: transparent; border-color: var(--bs-border-color); }

.stat .card-body { padding: .9rem 1rem; }
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bs-secondary-color); font-weight: 700; }
.stat-label .bi { color: var(--rose); }
.stat-value { font-size: 1.45rem; line-height: 1.2; margin-top: .2rem; }
.row > div:nth-child(6n+2) .stat { background-image: linear-gradient(160deg, var(--lilac-soft), transparent 70%); }
.row > div:nth-child(6n+3) .stat { background-image: linear-gradient(160deg, var(--rose-soft), transparent 70%); }

/* ---- cartões dos dias ---- */
.day-card .card-header {
  padding: .75rem 1rem;
  background: linear-gradient(90deg, var(--rose-soft), transparent 85%);
}
.day-card .card-header .fw-semibold { font-family: "Playfair Display", Georgia, serif; font-size: 1.12rem; font-style: italic; color: var(--bs-primary-text-emphasis); }
.day-card:nth-child(odd) .card-header { background: linear-gradient(90deg, var(--lilac-soft), transparent 85%); }
.col:nth-child(even) .day-card .card-header { background: linear-gradient(90deg, var(--lilac-soft), transparent 85%); }
.day-card.border-primary { border-color: var(--rose) !important; box-shadow: 0 0 0 3px rgba(var(--rose-rgb), .15), var(--card-shadow); }
.day-card:target { animation: pulse 1.4s ease 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--rose-rgb), .5); } 100% { box-shadow: 0 0 0 14px rgba(var(--rose-rgb), 0); } }

.day-table { --bs-table-bg: transparent; }
.day-table thead th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--bs-secondary-color); font-weight: 700; border-bottom-color: var(--bs-border-color);
}
.day-table td, .day-table th { border-color: var(--bs-border-color); }
.table-total th { background: var(--rose-soft) !important; color: var(--bs-primary-text-emphasis) !important; }
.table { --bs-table-hover-bg: rgba(var(--rose-rgb), .05); --bs-table-bg: transparent; }
.table > :not(caption) > * > * { border-color: var(--bs-border-color); }
.hours-input { max-width: 84px; }
.add-form .form-control { background: var(--bs-tertiary-bg); }

.badge.text-bg-primary { background: var(--rose) !important; }
.badge.text-bg-primary-subtle { background: var(--rose-soft) !important; }
.alert { border-radius: var(--bs-border-radius-lg); border: 1px solid var(--bs-border-color); }
.alert-success { background: #e6f6f0; color: #1f6b57; }
[data-bs-theme="dark"] .alert-success { background: #183128; color: #a9e9d3; }
.alert-light { background: var(--lilac-soft); }
.modal-content { border-radius: var(--bs-border-radius-lg); border: 0; }
.modal-header { background: linear-gradient(90deg, var(--rose-soft), var(--lilac-soft)); }
.modal-title { font-family: "Playfair Display", Georgia, serif; font-style: italic; }

/* ---- login ---- */
.login-wrap {
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(var(--rose-rgb), .22), transparent 70%),
    radial-gradient(600px 400px at 85% 80%, rgba(142, 108, 200, .22), transparent 70%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: "✿"; position: absolute; color: rgba(var(--rose-rgb), .12); pointer-events: none;
}
.login-wrap::before { font-size: 16rem; top: -3rem; left: -2rem; transform: rotate(-15deg); }
.login-wrap::after  { font-size: 12rem; bottom: -3rem; right: -1rem; color: rgba(142, 108, 200, .14); }
.login-card { width: 100%; max-width: 410px; backdrop-filter: blur(6px); position: relative; z-index: 1; }
.login-card h1 { font-size: 2.1rem; font-style: italic; color: var(--rose); }
.login-logo {
  width: 72px; height: 72px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.1rem; color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--lilac));
  box-shadow: 0 10px 24px -8px rgba(var(--rose-rgb), .7);
}
.form-floating > .form-control { border-radius: var(--bs-border-radius); }

::selection { background: rgba(var(--rose-rgb), .25); }

@media (max-width: 575.98px) {
  .stat-value { font-size: 1.2rem; }
  h1.h4 { font-size: 1.3rem; }
}

/* ====== Responsivo: celular / tablet / desktop ====== */
.navbar { flex-wrap: nowrap; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* barra inferior estilo app (só no celular) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; justify-content: space-around;
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--bs-border-color);
  box-shadow: 0 -6px 20px -12px rgba(var(--rose-rgb), .35);
}
[data-bs-theme="dark"] .bottom-nav { background: rgba(29, 21, 25, .92); }
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .3rem 0; border-radius: 1rem;
  color: var(--bs-secondary-color); text-decoration: none; font-size: .72rem; font-weight: 700;
}
.bottom-nav a .bi { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.active { color: var(--rose); background: var(--rose-soft); }

/* atalhos dos dias */
.day-pills {
  position: sticky; top: 57px; z-index: 1010;
  display: flex; gap: .4rem; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -.75rem .75rem; padding: .5rem .75rem;
  background: linear-gradient(var(--blush-bg) 75%, transparent);
  scrollbar-width: none;
}
.day-pills::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 1 0 64px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center;
  padding: .4rem .3rem; border-radius: 1rem;
  border: 1px solid var(--bs-border-color); background: var(--bs-body-bg);
  text-decoration: none; color: var(--bs-body-color); line-height: 1.15;
}
[data-bs-theme="light"] .day-pill { background: #fff; }
.day-pill .dp-name { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); font-weight: 700; }
.day-pill .dp-date { font-size: 1.15rem; font-weight: 700; }
.day-pill .dp-val  { font-size: .68rem; color: var(--bs-secondary-color); }
.day-pill.has { border-color: var(--bs-primary-border-subtle); }
.day-pill.has .dp-val { color: var(--rose); font-weight: 700; }
.day-pill.today { background: var(--rose) !important; border-color: var(--rose); color: #fff; }
.day-pill.today .dp-name, .day-pill.today .dp-val { color: rgba(255, 255, 255, .88); }
[data-bs-theme="dark"] .day-pill.today { color: #2a1520; }
[data-bs-theme="dark"] .day-pill.today .dp-name, [data-bs-theme="dark"] .day-pill.today .dp-val { color: rgba(42, 21, 32, .8); }

/* âncora dos dias não fica escondida atrás das barras fixas */
.day-card { scroll-margin-top: 140px; }

.hist-card { color: inherit; transition: transform .15s ease; }
.hist-card:active { transform: scale(.98); }
.hist-week { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-size: 1.1rem; color: var(--bs-primary-text-emphasis); }

@media (max-width: 767.98px) {
  body.has-bottom-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .navbar-brand { font-size: 1.3rem; }
  .btn-icon-md { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
  /* iOS não dá zoom ao focar campos com fonte >= 16px */
  .form-control, .form-select, .input-group-text { font-size: 16px !important; }
  .day-table td, .day-table th { font-size: .92rem; }
  .day-table .btn-link { padding: .35rem !important; font-size: 1.05rem; }
  .add-form { padding-top: .75rem !important; padding-bottom: .75rem !important; }
  .add-form .btn { min-width: 42px; }
  .card-footer .btn { min-width: 42px; min-height: 36px; }
  main.container-xl { padding-left: .75rem; padding-right: .75rem; }
  .modal-dialog { margin: .5rem; }
}
@media (min-width: 768px) {
  .day-card { scroll-margin-top: 80px; }
}
@media (min-width: 1400px) {
  .stat-value { font-size: 1.6rem; }
}

/* ---- instalador / toasts ---- */
.app-toasts { bottom: 0; z-index: 1090; }
@media (max-width: 767.98px) { .app-toasts { bottom: calc(70px + env(safe-area-inset-bottom)); } }
.toast { border-radius: 1rem; background: var(--rose); color: #fff; box-shadow: var(--card-shadow); }
.toast .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.toast.toast-aviso { background: #4a3540; }
[data-bs-theme="dark"] .toast { color: #2a1520; }
[data-bs-theme="dark"] .toast .btn-close { filter: none; }
[data-bs-theme="dark"] .toast.toast-aviso { background: #f1e3ea; }
.install-steps { padding-left: 1.2rem; margin: 0; }
.install-steps li { margin-bottom: .6rem; }
.install-steps .bi { color: var(--rose); }
/* no app instalado, respeita o notch do iPhone */
@media (display-mode: standalone) {
  .navbar { padding-top: env(safe-area-inset-top); }
}

/* ---- histórico mensal ---- */
.month-bar { height: 8px; border-radius: 999px; background: var(--rose-soft); overflow: hidden; min-width: 60px; }
.month-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--rose), var(--lilac)); }
.hist-empty { opacity: .55; }
.hist-empty .hist-week { color: var(--bs-secondary-color); }
.btn-group > .btn-primary { position: relative; z-index: 1; }

/* ---- cadastro de usuários ---- */
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--rose), var(--lilac));
}
[data-bs-theme="dark"] .user-avatar { color: #2a1520; }
.min-w-0 { min-width: 0; }
.user-list .list-group-item { border-color: var(--bs-border-color); }
.input-group > .js-show-pass { border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0 !important; background: var(--bs-body-bg); }
.input-group.has-validation > .form-control.is-invalid ~ .js-show-pass { border-color: var(--bs-form-invalid-border-color); }
.form-control.is-valid, .was-validated .form-control:valid { border-color: #6fbf9f; }
code { color: var(--bs-primary-text-emphasis); background: var(--rose-soft); padding: .05rem .35rem; border-radius: .4rem; }
