/* ============================================================
   Super Limpio — Business Manager Stylesheet
   Brand: Navy Blue · White · Mustard Yellow
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --navy:        #1B2A4A;
  --navy-dark:   #111C33;
  --navy-mid:    #243558;
  --navy-light:  #E8ECF4;
  --navy-xlight: #F3F5FA;
  --mustard:     #C9940A;
  --mustard-light: #FDF3D8;
  --mustard-mid: #E8AB14;
  --mustard-dark: #8A6300;
  --white:       #FFFFFF;
  --off-white:   #F8F8F6;
  --text:        #1B2A4A;
  --muted:       #6B7A99;
  --border:      #D6DCE8;
  --border-light:#EEF1F7;
  --success:     #1A7A4A;
  --success-bg:  #E6F5EE;
  --danger:      #B91C1C;
  --danger-bg:   #FEE2E2;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-sm:   6px;
  --shadow:      0 1px 4px rgba(27,42,74,0.08), 0 4px 16px rgba(27,42,74,0.06);
  --shadow-sm:   0 1px 3px rgba(27,42,74,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--off-white);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh;
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(201,148,10,0.12);
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(201,148,10,0.08);
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  position: relative; z-index: 1;
  text-align: center;
}
.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy-dark);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.login-logo span { color: var(--mustard); }
.login-tagline {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.login-divider {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.user-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.user-card-btn {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
}
.user-card-btn:hover { border-color: var(--navy); background: var(--navy-xlight); }
.user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 1rem; flex-shrink: 0;
}
.ua-joanna { background: var(--navy-light); color: var(--navy); }
.ua-andrea { background: var(--mustard-light); color: var(--mustard-dark); }
.user-card-name { font-weight: 600; font-size: 0.95rem; color: var(--navy-dark); }
.user-card-role { font-size: 0.75rem; color: var(--muted); }
.login-form-section { display: none; margin-top: 1.5rem; text-align: left; }
.login-form-section.active { display: block; }
.login-back { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.82rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 4px; }
.login-back:hover { color: var(--navy); }

/* ===== APP SHELL ===== */
.topbar {
  background: var(--navy-dark);
  color: var(--white);
  padding: 0 1.5rem;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.topbar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}
.topbar-logo span { color: var(--mustard); }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.user-pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--white);
}
.user-pill .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.btn-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.18); color: white; }

/* ===== SIDEBAR NAV ===== */
.app-layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--navy);
  padding: 1.25rem 0;
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  padding: 0 1.25rem;
  margin: 1rem 0 0.4rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 1.25rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 400;
  transition: all 0.15s;
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  font-family: 'Inter', sans-serif;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--white); background: rgba(255,255,255,0.07); }
.nav-item.active {
  color: var(--mustard-mid);
  background: rgba(201,148,10,0.12);
  border-left-color: var(--mustard);
  font-weight: 500;
}
.nav-icon { width: 16px; text-align: center; opacity: 0.8; flex-shrink: 0; }

.main-content { flex: 1; padding: 2rem 2rem 3rem; min-width: 0; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1.2;
}
.section-title small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.stat-card.accent { background: var(--navy-dark); border-color: var(--navy-dark); }
.stat-card.mustard { background: var(--mustard); border-color: var(--mustard); }
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 4px;
}
.stat-card.accent .stat-label { color: rgba(255,255,255,0.55); }
.stat-card.mustard .stat-label { color: rgba(255,255,255,0.7); }
.stat-value {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--navy-dark);
  line-height: 1.2;
}
.stat-card.accent .stat-value { color: var(--white); }
.stat-card.mustard .stat-value { color: var(--white); }
.stat-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 1rem; }
.card-body { padding: 1.25rem; }
.card-header-bar {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy-xlight);
}
.card-header-title { font-weight: 600; font-size: 0.88rem; color: var(--navy-dark); }

/* ===== CLIENT CARD ===== */
.client-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.client-card:hover { box-shadow: var(--shadow); }
.client-card-header {
  padding: 1rem 1.25rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  border-left: 4px solid var(--mustard);
}
.client-name { font-weight: 600; font-size: 1rem; color: var(--navy-dark); }
.client-property { font-size: 0.82rem; color: var(--muted); margin-top: 1px; }
.client-meta {
  padding: 0.75rem 1.25rem;
  background: var(--off-white);
  border-top: 1px solid var(--border-light);
  display: flex; flex-wrap: wrap; gap: 0.75rem;
}
.client-meta-item { font-size: 0.8rem; color: var(--text); }
.client-meta-item span { color: var(--muted); }
.client-notes { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border-light); }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead { background: var(--navy-xlight); }
th {
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--navy);
  white-space: nowrap;
  border-bottom: 2px solid var(--navy-light);
}
td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--navy-xlight); }
.td-amount { font-weight: 600; color: var(--navy-dark); }
.td-amount.out { color: var(--danger); }
.td-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-muted { color: var(--muted); font-size: 0.8rem; }

/* ===== BUTTONS ===== */
.btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: all 0.15s;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--navy-dark); color: var(--white); }
.btn-primary:hover { background: var(--navy-mid); }
.btn-mustard { background: var(--mustard); color: var(--white); }
.btn-mustard:hover { background: var(--mustard-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-xlight); }
.btn-ghost { background: transparent; color: var(--muted); border: none; padding: 0.3rem 0.6rem; }
.btn-ghost:hover { color: var(--navy); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 0.28rem 0.7rem; font-size: 0.78rem; }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group.half { grid-column: span 1; }
label { font-size: 0.76rem; font-weight: 600; color: var(--navy); text-transform: uppercase; letter-spacing: 0.04em; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
input[type="password"], select, textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,42,74,0.1);
}
textarea { resize: vertical; min-height: 72px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7A99' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

.filter-bar {
  display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center;
  margin-bottom: 1rem; padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.filter-bar select, .filter-bar input { width: auto; flex: 1; min-width: 120px; max-width: 220px; }
.filter-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(17,28,51,0.55);
  z-index: 500;
  align-items: center; justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 580px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(17,28,51,0.25);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy-xlight);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 600; color: var(--navy-dark); }
.btn-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 0.2rem 0.4rem; border-radius: 4px; }
.btn-close:hover { background: var(--border-light); color: var(--navy); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 0.65rem; background: var(--off-white); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ===== BADGE / PILL ===== */
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-navy { background: var(--navy-light); color: var(--navy); }
.badge-mustard { background: var(--mustard-light); color: var(--mustard-dark); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: #EEF1F7; color: var(--muted); }

/* ===== NOTES BOX ===== */
.notes-box {
  background: var(--mustard-light);
  border: 1px solid #F0D070;
  border-left: 3px solid var(--mustard);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
}
.notes-box-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mustard-dark);
  margin-bottom: 4px;
}
.notes-box p { font-size: 0.84rem; color: var(--text); }

/* ===== SECTION NOTES TEXTAREA ===== */
.section-notes-wrap {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--mustard);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.section-notes-wrap label { color: var(--mustard-dark); }

/* ===== EXPORT BOX ===== */
.export-box {
  background: var(--navy-xlight);
  border: 1px solid var(--navy-light);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-top: 1.5rem;
}
.export-box-title { font-weight: 600; font-size: 0.9rem; color: var(--navy-dark); margin-bottom: 4px; }
.export-box-desc { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.75rem; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty-icon { font-size: 2.8rem; margin-bottom: 0.75rem; opacity: 0.3; }
.empty-state h3 { font-weight: 600; font-size: 1rem; color: var(--navy); margin-bottom: 0.35rem; }
.empty-state p { font-size: 0.85rem; }

/* ===== GAS NOTICE ===== */
.info-notice {
  background: var(--mustard-light);
  border: 1px solid #F0D070;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.83rem;
  color: var(--mustard-dark);
  margin-bottom: 1rem;
  display: flex; gap: 0.5rem;
}

/* ===== PROFIT ROW ===== */
.profit-positive { color: var(--success); font-weight: 700; }
.profit-negative { color: var(--danger); font-weight: 700; }

/* ===== ALERTS ===== */
.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.alert-success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.alert-danger  { background: var(--danger-bg); color: var(--danger); border-left: 3px solid var(--danger); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 1rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
.mobile-nav {
  display: none;
  background: var(--navy);
  padding: 0.5rem 0;
  overflow-x: auto;
  position: sticky; top: 56px; z-index: 100;
}
@media (max-width: 768px) {
  .mobile-nav { display: flex; }
}
.mobile-nav .nav-item {
  white-space: nowrap;
  border-left: none;
  border-bottom: 3px solid transparent;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}
.mobile-nav .nav-item.active { border-bottom-color: var(--mustard); border-left: none; }

@media print {
  .topbar, .sidebar, .mobile-nav, .btn, .filter-bar, .export-box, .modal-overlay, .btn-group { display: none !important; }
  .main-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
