/* ===== Daiana Vaz Luxury Salon — Sistema Dia da Noiva ===== */
:root {
  --bg: #faf7f4;
  --panel: #ffffff;
  --sidebar: #2b2126;
  --sidebar-hover: #3d3037;
  --rose: #b76e79;
  --rose-dark: #9a5560;
  --rose-soft: #f6e8ea;
  --gold: #c9a227;
  --gold-soft: #f7efd8;
  --ink: #3a2e33;
  --muted: #8d7f85;
  --line: #ece4e0;
  --green: #4e9a6f;
  --green-soft: #e4f2ea;
  --red: #c05555;
  --red-soft: #f9e7e7;
  --blue: #5b7fa6;
  --blue-soft: #e7eef6;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(58, 46, 51, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
h1, h2, h3, .brand, .stat-value { font-family: "Didot", "Bodoni 72", Georgia, serif; }

/* ===== Layout ===== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px; min-width: 230px;
  background: var(--sidebar);
  color: #e9dfe3;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 26px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand .name { font-size: 21px; letter-spacing: 1px; color: #fff; }
.brand .sub { font-size: 10px; letter-spacing: 4px; color: var(--rose); margin-top: 3px; text-transform: uppercase; }
.nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; margin-bottom: 2px;
  color: #cbbfc5; text-decoration: none;
  border-radius: 9px; font-size: 13.5px;
}
.nav a .ico { width: 20px; text-align: center; font-size: 15px; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--rose); color: #fff; }
.sidebar .foot { padding: 14px 22px; font-size: 11px; color: #7d6f76; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; padding: 26px 32px 60px; max-width: 1250px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 600; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ===== Components ===== */
.btn {
  border: none; cursor: pointer; border-radius: 9px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 600;
  background: var(--rose); color: #fff;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { background: var(--rose-dark); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--rose-soft); border-color: var(--rose); color: var(--rose-dark); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #af8c1d; }

.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h2 .count { font-family: inherit; font-size: 12px; background: var(--rose-soft); color: var(--rose-dark); padding: 2px 9px; border-radius: 20px; }

.grid { display: grid; gap: 16px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: 1fr; } }

.stat { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rose); }
.stat.gold::before { background: var(--gold); }
.stat.green::before { background: var(--green); }
.stat.blue::before { background: var(--blue); }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 30px; margin-top: 6px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--line);
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--rose-soft); }
.tbl .strong { font-weight: 600; }
.tbl-scroll { overflow-x: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
  background: var(--rose-soft); color: var(--rose-dark); white-space: nowrap;
}
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.gold { background: var(--gold-soft); color: #8f741c; }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.gray { background: #efeae7; color: var(--muted); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--rose-soft); color: var(--rose-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }

.search {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; width: 260px; background: #fff; color: var(--ink);
}
.search:focus, select:focus, input:focus, textarea:focus { outline: 2px solid var(--rose); outline-offset: 0; border-color: transparent; }

select.inp, input.inp, textarea.inp {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; background: #fff; color: var(--ink); width: 100%;
  font-family: inherit;
}
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.field { margin-bottom: 14px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }

/* ===== Modal ===== */
.modal-back {
  position: fixed; inset: 0; background: rgba(43, 33, 38, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; z-index: 100; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 760px;
  padding: 26px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal.sm { max-width: 480px; }
.modal h2 { font-size: 21px; margin-bottom: 4px; }
.modal .msub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fgrid .full { grid-column: 1 / -1; }
.fsec { grid-column: 1 / -1; font-family: Georgia, serif; font-size: 15px; color: var(--rose-dark); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 12px 0 14px; }
.fsec:first-child { margin-top: 0; }

/* ===== Ficha da noiva ===== */
.ficha-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ficha-head .info { flex: 1; min-width: 200px; }
.ficha-head h1 { font-size: 24px; }
.ficha-head .meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 12px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rose); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--rose-soft);
}
.tl-item .tl-time { font-weight: 700; font-size: 13px; color: var(--rose-dark); }
.tl-item .tl-desc { font-size: 13px; color: var(--ink); margin-top: 2px; }

.fin-bar { height: 9px; border-radius: 6px; background: var(--red-soft); overflow: hidden; margin-top: 8px; }
.fin-bar > div { height: 100%; background: var(--green); border-radius: 6px; }

/* ===== Cronograma do dia (board) ===== */
.day-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.day-card .dc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.day-card .dc-name { font-weight: 700; font-size: 14.5px; }
.day-card .dc-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.date-nav { display: flex; align-items: center; gap: 8px; }
.date-nav input[type=date] { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px; font-family: inherit; background: #fff; color: var(--ink); }

.team-card { display: flex; align-items: center; gap: 13px; }
.team-card .tc-info { flex: 1; }
.team-card .tc-name { font-weight: 700; font-size: 14.5px; }
.team-card .tc-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--sidebar); color: #fff; padding: 12px 22px; border-radius: 30px;
  font-size: 13.5px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.3);
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.tag-sala { font-weight: 700; color: var(--rose-dark); letter-spacing: .5px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 14px; }
.warn-box { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #4a3941 0%, var(--sidebar) 55%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 34px 30px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.login-sub {
  text-align: center; color: var(--rose); font-size: 11px;
  letter-spacing: 3px; text-transform: uppercase; margin: 0 0 24px;
}
.login-card .inp { background: rgba(255,255,255,.92); }
.login-erro {
  background: var(--red-soft); color: var(--red);
  padding: 9px 13px; border-radius: 9px; font-size: 13px;
  font-weight: 600; margin-bottom: 14px;
}

/* ===== Print (contrato / ficha) ===== */
.print-area { display: none; }
@media print {
  body { background: #fff; }
  .app, .modal-back, .toast, .login-wrap { display: none !important; }
  .print-area { display: block; position: static; width: 100%; padding: 0; font-size: 12.5px; line-height: 1.55; color: #000; }
  .print-area h1 { text-align: center; font-size: 17px; margin-bottom: 4px; }
  .print-area h2 { font-size: 13.5px; margin: 16px 0 6px; border-bottom: 1px solid #999; padding-bottom: 3px; }
  .print-area .p-brand { text-align: center; font-family: Georgia, serif; letter-spacing: 3px; font-size: 21px; margin-bottom: 2px; }
  .print-area .p-sub { text-align: center; font-size: 10px; letter-spacing: 4px; margin-bottom: 18px; }
  .print-area table { width: 100%; border-collapse: collapse; margin: 8px 0; }
  .print-area td, .print-area th { border: 1px solid #999; padding: 6px 8px; text-align: left; font-size: 12px; }
  .print-area .sig { margin-top: 50px; display: flex; justify-content: space-between; gap: 40px; }
  .print-area .sig div { flex: 1; border-top: 1px solid #000; text-align: center; padding-top: 6px; font-size: 11px; }

  /* modo compacto: cronogramas de operação em UMA página */
  .print-area.compact { font-size: 10px; line-height: 1.3; }
  .print-area.compact table { margin: 4px 0; page-break-inside: avoid; }
  .print-area.compact td, .print-area.compact th { padding: 3px 5px; font-size: 9px; }
  .print-area.compact h1 { font-size: 13px; margin-bottom: 2px; }
  .print-area.compact h2 { font-size: 11px; margin: 8px 0 3px; }
  .print-area.compact .p-brand { font-size: 15px; margin-bottom: 0; }
  .print-area.compact .p-sub { font-size: 8px; margin-bottom: 8px; }
  .print-area.compact small { font-size: 7.5px; }
  .print-area.compact p { font-size: 9px; margin: 3px 0; }
}

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; }
  .main { padding: 18px 14px 50px; }
  .fgrid { grid-template-columns: 1fr; }
}
