/* ============================================================
   Soft Soluções — Design System
   Paleta derivada da logo (azul-marinho + azul-céu + vermelho)
   ============================================================ */

:root{
  --navy:        #2D2A6E;
  --navy-deep:   #1E1B3A;
  --navy-light:  #534AB7;
  --sky:         #29ABE2;
  --sky-dark:    #1C7FAE;
  --red:         #E63946;
  --red-dark:    #B32330;
  --green:       #2BA84A;
  --yellow:      #F2A900;
  --purple:      #7F77DD;
  --green-cta:      #4CAF50;
  --green-cta-dark: #357A38;

  --bg-page:     #F4F6FB;
  --bg-card:     #FFFFFF;
  --line:        #E4E7F0;
  --line-strong: #C9CEDF;

  --text-primary:   #1E1B3A;
  --text-secondary: #5B5A74;
  --text-muted:     #8482A0;
  --text-on-dark:   #FFFFFF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 1px 3px rgba(30, 27, 58, 0.06);
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body{
  height: 100%;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

body{
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a{ color: var(--sky-dark); text-decoration: none; }

/* ---------- Header da área do cliente ---------- */
.app-header{
  background: linear-gradient(135deg, var(--green-cta) 0%, var(--green-cta-dark) 100%);
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header .brand{
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header .brand-mark{
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.app-header .brand-mark img{ width: 100%; height: 100%; object-fit: contain; }
.app-header .brand-name{
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
}
.app-header .brand-sub{
  color: #C7C5E6;
  font-size: 12.5px;
  margin: 0;
}
.app-header .logout-btn{
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
.app-header .logout-btn:active{ background: rgba(255,255,255,0.22); }

/* ---------- Container geral ---------- */
.app-container{
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px calc(32px + env(safe-area-inset-bottom));
}

/* ---------- Cartão de filtro de datas ---------- */
.filter-card{
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.filter-card .filter-title{
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.filter-row{
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-field{ flex: 1; min-width: 140px; }
.filter-field label{
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.filter-field input[type="date"]{
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 16px;
  color: var(--text-primary);
  background: #fff;
}
.filter-field input[type="date"]:focus{
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(41,171,226,0.25);
}

/* ---------- Cartões de resumo por forma de pagamento ---------- */
.summary-row{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.summary-card{
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 14px 12px;
}
.summary-card.dinheiro{ border-left-color: var(--green); }
.summary-card.cartao{ border-left-color: var(--yellow); }
.summary-card.pix{ border-left-color: var(--sky); }
.summary-card .summary-label{
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 8px 0 3px;
  font-weight: 600;
}
.summary-card .summary-value{
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}
.icon-sm{ width: 22px; height: 22px; display: block; }
.summary-card.dinheiro .icon-sm{ color: var(--green); }
.summary-card.cartao .icon-sm{ color: var(--yellow); }
.summary-card.pix .icon-sm{ color: var(--sky); }

/* ---------- Gráfico de distribuição ---------- */
.chart-card{
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px 8px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.chart-card .chart-title{
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ---------- Bloco de total, estilo "recibo" ---------- */
.total-strip{
  border-top: 2px dashed var(--line-strong);
  border-bottom: 2px dashed var(--line-strong);
  padding: 16px 4px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.total-strip .total-label{
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.total-strip .total-value{
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: -0.01em;
}

/* ---------- Botões ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary{ background: var(--green-cta); color: #fff; }
.btn-primary:hover{ background: var(--green-cta-dark); }
.btn-danger{ background: var(--red); color: #fff; }
.btn-danger:hover{ background: var(--red-dark); }
.btn-ghost{ background: transparent; color: var(--text-secondary); border-color: var(--line); }
.btn-ghost:hover{ background: var(--bg-page); }
.btn-block{ width: 100%; }

/* ---------- Tela de login ---------- */
.login-page{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.login-card{
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.login-mark{
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  overflow: hidden;
}
.login-mark img{ width: 100%; height: 100%; object-fit: contain; }
.login-card h1{
  font-size: 24px;
  font-weight: 700;
  color: var(--navy-deep);
  margin: 0;
  letter-spacing: -0.01em;
}
.login-card p.subtitle{
  font-size: 15px;
  color: var(--text-muted);
  margin: 4px 0 34px;
}
.field-group{
  text-align: left;
  margin-bottom: 18px;
}
.field-group label{
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.field-group input{
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 16px;
  color: var(--text-primary);
}
.field-group input:focus{
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(41,171,226,0.25);
}
.password-wrap{ position: relative; }
.password-wrap input{ padding-right: 46px; }
.password-toggle{
  position: absolute;
  right: 8px;
  top: 8px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle:active{ background: var(--bg-page); }
.forgot-link{
  display: block;
  text-align: right;
  font-size: 13.5px;
  margin-bottom: 26px;
}
.security-note{
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------- Modais (compatível com Bootstrap 4) ---------- */
.modal-content{ border-radius: var(--radius-md); border: none; }
.modal-header{ border-bottom: 1px solid var(--line); }
.modal-footer{ border-top: 1px solid var(--line); }
.modal-title{ color: var(--navy-deep); font-size: 16px; }

/* ---------- Utilidades ---------- */
.text-center{ text-align: center; }
.valor-monetario{ text-align: right; }
.hidden{ display: none; }

@media (max-width: 380px){
  .summary-row{ gap: 6px; }
  .summary-card{ padding: 10px 8px; }
  .summary-card .summary-value{ font-size: 14px; }
  .total-strip .total-value{ font-size: 22px; }
}
