/*
  GASTO EN CASA — Identidad visual V1.2
  Referencia: boceto del administrador compartido el 23/11/2026.
  Verde petróleo + naranja + marfil + menta suave.

  Solo presentación. Este archivo no altera lógica, cuentas, saldos o datos.
  Se carga DESPUÉS de styles.css para aislar la identidad visual y evitar
  modificar los estilos funcionales de la versión 1.1.
*/
:root {
  color-scheme: light;
  --ink: #103638;
  --muted: #627879;
  --border: #e2e0d8;
  --paper: #fcf7ef;
  --card: #fffdf8;
  --accent: #d65d09;
  --accent-hover: #c65005;
  --accent-soft: #fff0de;
  --petrol: #003e3d;
  --petrol-light: #075451;
  --mint: #e1eee5;
  --mint-strong: #d5e9dc;
  --soft: #e1eee5;
  --warn: #d86616;
  --negative: #b94740;
  --navy: #003e3d;
  --shadow: 0 6px 24px rgba(0, 62, 61, .055);
}

/* Fondos y textos: blanco cálido y verde petróleo, como el boceto. */
body { background: var(--paper); color: var(--ink); }
h1, h2, h3, .profile-name, .stat-value, .balance-amount,
.expense-name strong, .value-secondary { color: var(--ink); }
p, .page-heading p { color: var(--muted); }
.eyebrow, .auth-intro h1 em, .auth-feature span,
.text-link, .text-button { color: var(--accent); }
.muted, .muted-heading { color: #788b87; }

/* Barra superior petróleo: lectura clara y activo naranja. */
.site-header {
  background: var(--petrol);
  border-bottom: 3px solid #e67820;
  box-shadow: 0 5px 18px rgba(0, 44, 43, .13);
}
.brand { color: #ffffff; }
.brand-icon {
  color: var(--petrol);
  background: #ffd5aa;
}
.brand-light { color: #ffae67; }
.brand small { color: #c4ddd5; }
.main-nav a {
  color: #e5efea;
  border-radius: 9px;
  padding: 8px 9px;
  transition: background-color .15s ease, color .15s ease;
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--accent);
  color: #ffffff;
}
.profile-name { color: #ffffff; }
.logout {
  background: transparent;
  border-color: #7a9b93;
  color: #ffffff;
}
.logout:hover { background: rgba(255,255,255,.14); }

/* Tarjetas crema con contornos cálidos. */
.card, .stat-card, .auth-card {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.stat-card.emphasis {
  background: var(--petrol);
  border-color: var(--petrol);
  color: #ffffff;
}
.stat-card.emphasis .stat-value { color: #ffffff; }
.stat-card.emphasis .stat-label,
.stat-card.emphasis p { color: #d4e5dd; }
.stat-card.emphasis .stat-icon { color: #ffad61; }
.stat-label, .balance-person small, .budget-bottom,
.transfer-line small { color: #667b78; }

/* Acción principal: naranja del boceto; oscuro al pasar el ratón. */
.btn.primary, .btn.dark {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.btn.primary:hover, .btn.dark:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  filter: none;
}
.btn:not(.primary):not(.dark):not(.outline) {
  background: var(--accent-soft);
  color: #923c08;
}
.btn.outline {
  border-color: #cddbd2;
  color: var(--petrol);
  background: var(--card);
}
.btn.outline:hover { background: var(--mint); }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, .receipt-pick:focus-within {
  outline: 3px solid #f3984d;
  outline-offset: 3px;
}

/* Píldoras, gráficos, balances y resguardos. */
.pill.confirmed { color: #146e4b; background: #d9f0df; }
.pill.planned { color: #215c57; background: #e1eee5; }
.pill.warning { color: #a34b0f; background: #fff0de; }
.pill.quiet { color: #667575; background: #eeece6; }
.avatar, .cat-icon, .balance-ok, .receipt-gallery a {
  background: var(--mint);
  color: var(--petrol);
}
.progress { background: #e8e8dc; }
.progress-fill { background: #e97823; }
.progress-fill.over { background: var(--negative); }
.bizum-banner, .side-note, .tip {
  background: var(--mint);
  border-color: #c9e2d2;
}
.big-symbol { background: #cee9d9; color: var(--petrol); }
.bizum-mark, .balance-ok>span { background: var(--petrol-light); }
.receipt-area {
  background: #fff9f0;
  border-color: #e4ba90;
}
.receipt-pick {
  background: #fffdf8;
  border-color: #d89d73;
  color: #a64405 !important;
}
.receipt-pick:hover { background: var(--accent-soft); }
.receipt-links a, .receipt-inline { color: #a7480b; }
.notice.success { background: #e0f1e5; color: #165942; border-color: #badbc6; }
.notice.error { background: #fff0eb; color: #a23c34; border-color: #ebcbc5; }

/* Inputs, separadores y tablas. */
input, select {
  background: #fffefa;
  border-color: #d2ded5;
  color: var(--ink);
  outline-color: #e97823;
}
input:focus, select:focus { border-color: var(--accent); }
label { color: #325252; }
.month-arrow { border-color: #d6e2d8; background: #fffdf8; color: var(--petrol); }
.month-arrow:hover { background: var(--mint); }
.budget-item, .balance-person, .transfer-line,
.budget-edit-row, th, td { border-color: #ebe8df; }
hr { border-color: #ebe8df; }
.expense-name strong { color: var(--petrol); }
.footer {
  border-top-color: #d8ded5;
  color: #6a7a79;
}
.footer a { color: #a84b0b; font-weight: 800; }
.footer a:hover { color: #8e3d06; }

/* Adaptación al móvil: navegación accesible y sin recortes. */
@media (max-width: 1050px) {
  .main-nav { row-gap: 6px; }
  .main-nav a { padding: 6px 9px; }
}
@media (max-width: 650px) {
  .site-header { border-bottom-width: 2px; }
  .brand { font-size: 20px; }
  .main-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
  }
  .main-nav a { min-height: 36px; display: inline-flex; align-items: center; }
  .main-content { padding-top: 24px; }
}

/* Gasto en Casa V1.3: administrador, accesibilidad móvil y PWA. */
.brand-app-icon{width:44px;height:44px;display:block;flex:0 0 44px;border-radius:12px}
.menu-toggle{display:none;background:#d65d09;color:#fff;border:0;border-radius:9px;padding:10px 14px;font-weight:700;cursor:pointer}
.mobile-install-shortcut{margin:0 0 20px}
.install-details{background:#e1eee5;border:1px solid #c8dfd2;border-radius:12px;padding:10px 16px}
.install-details summary{cursor:pointer;font-weight:750;color:#003e3d}
.install-details p{font-size:13px;max-width:72ch;margin:12px 0;color:#325252;line-height:1.55}
.pwa-install-button[hidden]{display:none!important}
.admin-categories{scroll-margin-top:24px}
.admin-category-grid{display:grid;grid-template-columns:minmax(220px,.75fr) minmax(0,1.55fr);gap:24px;margin-top:20px}
.category-new{background:#e1eee5;border-radius:14px;padding:18px;align-self:start}
.category-manage{min-width:0}
.category-manage-item{border:1px solid #deded5;border-radius:12px;padding:15px;margin:12px 0;background:#fffef9}
.category-manage-item.is-archived{background:#f5f2eb;border-style:dashed}
.category-manage-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.category-edit-form{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:0}
.category-edit-form label{flex:2;min-width:130px;margin:0}
.category-edit-form label:nth-of-type(2){flex:0 1 85px;min-width:80px}
.category-edit-form input{margin-top:5px}
.category-edit-form .btn{min-height:43px}
.category-manage-item>.muted-action,.category-manage-item>form:last-child{margin-top:9px}
.form-card{max-width:850px}
.back-link{color:#d65d09}
/* Ajustes de diseño responsive (teléfonos 320px en adelante) */
html{overflow-x:hidden}
body{min-width:0}
img{max-width:100%}
input,select,textarea{max-width:100%}
@media(max-width:900px){
  .admin-category-grid{grid-template-columns:1fr}
  .category-new{max-width:none}
  .header-inner{justify-content:space-between}
}
@media(max-width:650px){
  .site-header{position:relative}
  .header-inner{display:flex;flex-wrap:wrap;align-items:center;gap:9px;padding-top:10px;padding-bottom:11px}
  .brand{font-size:17px;min-width:0;max-width:100%;margin-right:auto}
  .brand-app-icon{width:38px;height:38px;flex-basis:38px}
  .brand small{font-size:7px;letter-spacing:.3px}
  .menu-toggle{display:inline-flex;justify-content:center;align-items:center;min-height:44px;font-size:13px;order:2}
  .main-nav{display:none;order:4;width:100%;flex-direction:column;align-items:stretch;gap:4px;padding:10px 0;overflow:visible}
  .main-nav.is-open{display:flex}
  .main-nav a{display:flex;min-height:44px;align-items:center;font-size:14px;padding:11px 14px}
  .profile{order:3;flex:0 0 auto}
  .profile form button{min-height:42px;padding:8px 11px}
  .footer{line-height:1.7}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stat-card{min-width:0}
  .card{min-width:0}
  .form-card{max-width:100%}
  .page-heading h1{overflow-wrap:anywhere}
  .category-edit-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(75px,.28fr)}
  .category-edit-form label{min-width:0}
  .category-edit-form .btn{grid-column:1/-1;width:100%}
  .category-manage-head{align-items:flex-start}
  /* Movimientos como tarjetas: sin desplazamiento horizontal para corregir gastos. */
  .transactions .table-scroll{overflow:visible}
  .transactions table,.transactions tbody,.transactions tr,.transactions td{display:block;width:100%;min-width:0}
  .transactions thead{display:none}
  .transactions tr{border:1px solid #dce6da;border-radius:12px;padding:12px;margin-bottom:12px;background:#fffef9}
  .transactions td{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 3px;border-bottom:1px solid #ecebe4;text-align:right;flex-wrap:wrap}
  .transactions td::before{content:attr(data-label);font-size:12px;color:#57716e;font-weight:700;flex:0 0 auto}
  .transactions td:first-child{align-items:flex-start}
  .transactions td:first-child .expense-name{flex:1;justify-content:flex-end;max-width:75%}
  .transactions td.action-cell{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:10px;border:0}
  .transactions td.action-cell:before{margin-right:auto}
  .transactions td.action-cell a,.transactions td.action-cell button{min-height:36px;display:inline-flex;align-items:center}
  .transactions td.action-cell form{margin:0}
}
@media(max-width:370px){
  .brand{font-size:15px}
  .brand small{font-size:6px}
  .menu-toggle{padding:9px 10px}
  .stats-grid{grid-template-columns:1fr}
  .brand-app-icon{width:35px;height:35px;flex-basis:35px}
}
