/* Reset & Base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --accent: #4fc3f7;
  --text: #333;
  --text-light: #fff;
  --bg: #f5f7fa;
  --card-bg: #fff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Header & Nav */
.header {
  background: #fff;
  padding: 0 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.nav-brand h1 {
  font-size: 1.5rem;
  letter-spacing: 2px;
}

.nav-brand span {
  font-size: 0.75rem;
  opacity: 0.85;
  display: block;
  margin-top: -4px;
}

.nav-logo {
  height: 58px;
  width: 220px;
  object-fit: cover;
  object-position: 18% 46%;
  display: block;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links > li > a {
  color: #4a5568;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-links > li > a:hover {
  color: var(--primary);
  background: #f0f4ff;
}

/* Nav auth buttons */
.nav-btn-outline {
  border: 1.5px solid #cbd5e0 !important;
  border-radius: 6px !important;
  padding: 0.4rem 1rem !important;
  color: #4a5568 !important;
  font-weight: 600 !important;
  transition: border-color 0.15s, color 0.15s !important;
}

.nav-btn-outline:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: transparent !important;
}

.nav-btn-solid {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 0.45rem 1.1rem !important;
  font-weight: 600 !important;
  transition: background 0.15s !important;
}

.nav-btn-solid:hover {
  background: var(--primary-dark) !important;
}

/* Nav dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  list-style: none;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  min-width: 180px;
  z-index: 200;
  padding: 0.4rem;
  border: 1px solid #e8ecf1;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu li a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #4a5568;
  text-decoration: none;
  font-weight: 400;
  font-size: 0.875rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu li a:hover {
  background: #f0f4ff;
  color: var(--primary);
}

/* Nav user */
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid #e8ecf1;
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.nav-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #4a5568;
}

.nav-logout-btn {
  font-size: 0.8rem !important;
  color: #a0aec0 !important;
  padding: 0.25rem 0.5rem !important;
  font-weight: 400 !important;
}

.nav-logout-btn:hover {
  color: #c62828 !important;
  background: #fff5f5 !important;
}

/* Admin org selector bar */
.admin-org-bar {
  background: var(--primary-dark);
  padding: 0.4rem 2rem;
}

.admin-org-form {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-org-form label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.admin-org-form select {
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  min-width: 200px;
}

.admin-org-form select option {
  color: var(--text);
  background: #fff;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #4a5568;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Landing hero */
.landing-hero {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 40%, #1976d2 100%);
  color: #fff;
  padding: 5rem 2rem 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.landing-hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.landing-hero-content {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.landing-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.landing-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2.25rem;
  line-height: 1.7;
}

.landing-hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero-primary {
  display: inline-block;
  background: #fff;
  color: var(--primary-dark);
  padding: 0.8rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-hero-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-hero-secondary {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  transition: background 0.15s;
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Landing features */
.landing-features {
  padding: 4rem 2rem 3rem;
}

.landing-features-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.landing-section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.5rem;
}

.landing-section-subtitle {
  text-align: center;
  color: #718096;
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #edf2f7;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-icon-blue  { background: #ebf4ff; color: #2b6cb0; }
.feature-icon-teal  { background: #e6fffa; color: #2c7a7b; }
.feature-icon-amber { background: #fefcbf; color: #b7791f; }
.feature-icon-green { background: #f0fff4; color: #276749; }

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: #718096;
  line-height: 1.5;
}

/* Landing trust bar */
.landing-trust {
  background: #fff;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  padding: 2rem;
}

.landing-trust-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
}

.trust-item {
  text-align: center;
}

.trust-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.trust-label {
  font-size: 0.82rem;
  color: #a0aec0;
  font-weight: 500;
}

.trust-divider {
  width: 1px;
  height: 36px;
  background: #e2e8f0;
}

/* Landing hero with background image */
.landing-hero-img {
  background-size: cover;
  background-position: center;
}

.landing-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 71, 161, 0.75);
  z-index: 0;
}

/* Landing gallery / photo reel */
.landing-gallery {
  padding: 3rem 2rem 4rem;
  text-align: center;
  background: #f7fafc;
}

.gallery-reel {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 960px;
  margin: 0 auto;
}

.gallery-item {
  flex: 1 1 280px;
  max-width: 300px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.gallery-item:hover {
  transform: translateY(-4px);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Landing about */
.landing-about {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  text-align: center;
}

.landing-about p {
  font-size: 1.05rem;
  color: #718096;
  line-height: 1.7;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 0.75rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

/* Section titles */
.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--primary-dark);
}

/* Footer */
.footer {
  background: #1a202c;
  color: #a0aec0;
  text-align: center;
  padding: 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.footer-text {
  font-size: 0.82rem;
}

/* Alerts */
.alert {
  max-width: 800px;
  margin: 1rem auto;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  text-align: center;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.alert-danger {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.alert-info {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.alert-info a {
  color: #0d47a1;
  font-weight: 600;
  text-decoration: underline;
}

/* Auth forms */
.auth-section {
  display: flex;
  justify-content: center;
  padding: 4rem 2rem;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input[readonly] {
  background: #f5f5f5;
  color: #888;
}

.consumo-preview {
  padding: 0.6rem 0.75rem;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2e7d32;
}

.btn-block {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: var(--text-light);
  margin-top: 1rem;
  transition: background 0.2s;
}

.btn-block:hover {
  background: var(--primary-dark);
}

.auth-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.auth-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-link a:hover {
  text-decoration: underline;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 0.2rem;
  display: flex;
  align-items: center;
}

.password-toggle:hover {
  color: #555;
}

.nav-brand a {
  color: var(--text-light);
  text-decoration: none;
}

/* Select inputs */
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s;
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Filter bar */
.filter-bar {
  margin-bottom: 1.5rem;
}

/* Two-column filter layout */
.filter-row-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-box {
  background: var(--card-bg);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filter-box-title {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-box-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 140px;
}

.filter-field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #666;
}

.filter-field select,
.filter-field input[type="date"] {
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  width: 100%;
}

.filter-field select:focus,
.filter-field input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .filter-row-container {
    grid-template-columns: 1fr;
  }
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--card-bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filter-form label {
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

.filter-form select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  min-width: 180px;
  background: #fff;
}

.filter-form select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-form input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  min-width: 160px;
}

.filter-form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-filter {
  padding: 0.5rem 1.25rem;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-filter:hover {
  background: var(--primary-dark);
}

.btn-clear {
  padding: 0.5rem 1rem;
  color: #777;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-clear:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-secondary {
  background: #eee;
  color: #666;
}

.badge-danger {
  background: #ffebee;
  color: #c62828;
}

.badge-warning {
  background: #fff3e0;
  color: #e65100;
}

.badge-cat {
  background: #e3f2fd;
  color: #1565c0;
}

/* Detail card */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.detail-header .section-title {
  margin-bottom: 0;
  text-align: left;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 1rem;
  color: var(--text);
}

/* Sub-section */
.sub-section {
  margin-top: 2rem;
}

.sub-section .section-title {
  font-size: 1.3rem;
}

/* Form subtitle */
.form-subtitle {
  text-align: center;
  color: #555;
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* View button */
.btn-view {
  background: var(--accent);
  color: var(--primary-dark);
}

/* Content sections */
.content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.content-header .section-title {
  margin-bottom: 0;
  text-align: left;
}

/* Data tables */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table thead {
  background: var(--primary);
  color: var(--text-light);
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
}

.data-table tbody tr {
  border-bottom: 1px solid #eee;
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: #f0f4ff;
}

.data-table .actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-form {
  display: inline;
}

.btn-sm {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-sm:hover {
  opacity: 0.8;
}

.btn-edit {
  background: var(--primary);
  color: var(--text-light);
}

.btn-delete {
  background: #c62828;
  color: var(--text-light);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  background: #fff;
  color: #333;
  border: 1.5px solid #ddd;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-whatsapp:hover {
  border-color: #25D366;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.btn-whatsapp img {
  width: 22px;
  height: 22px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.empty-state p {
  color: #777;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Form sections (wider than auth) */
.form-section {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.form-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 2.5rem;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow);
}

.form-card h2 {
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Pending periods (factura generation) */
.form-label-sm {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.4rem;
}

.periodos-pendientes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.periodo-pendiente-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #f7fafc;
  color: #2d3748;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.periodo-pendiente-btn:hover {
  background: #edf2f7;
  border-color: #a0aec0;
}

.periodo-pendiente-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.periodos-pendientes-empty {
  font-size: 0.85rem;
  color: #a0aec0;
  font-style: italic;
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.form-actions .btn-block {
  margin-top: 0;
}

.btn-cancel {
  color: #777;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-cancel:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Lecturas table */
.row-form {
  display: contents;
}

.row-date {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  width: 140px;
}

.row-date:focus {
  outline: none;
  border-color: var(--primary);
}

.bulk-input {
  width: 110px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  text-align: right;
}

.bulk-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #f0f7ff;
}

.consumo-cell {
  font-weight: 600;
  color: #888;
}

.consumo-positive {
  color: #2e7d32;
}

.data-table small {
  display: block;
  color: #888;
  font-size: 0.8rem;
}

.fecha-ultima {
  font-size: 0.85rem;
}

.text-muted {
  color: #aaa;
  font-style: italic;
}

.btn-save {
  background: #2e7d32;
  color: var(--text-light);
}

/* Report filters */
.report-filters {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.report-filter-form .filter-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.report-filter-form .filter-row + .filter-row {
  margin-top: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-group select,
.filter-group input[type="date"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-group select:disabled {
  background: #f0f0f0;
  color: #aaa;
}

.filter-actions-row {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-start;
  padding-bottom: 0.15rem;
}

/* Report summary */
.report-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.summary-item {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* Bloques tarifa */
.bloques-section {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.bloques-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bloques-header h3 {
  color: var(--primary-dark);
  font-size: 1rem;
}

.bloques-table {
  font-size: 0.9rem;
}

.bloques-table .bulk-input {
  width: 100px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-info {
  font-size: 0.9rem;
  color: #666;
}

.pagination-links {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-links .btn-sm {
  min-width: 2rem;
  text-align: center;
  background: var(--bg-white);
  color: var(--primary);
  border: 1px solid #ddd;
}

.pagination-links .btn-sm:hover {
  background: var(--primary);
  color: var(--text-light);
}

.pagination-links .btn-active {
  background: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
  cursor: default;
}

/* Dashboard */
.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-greeting {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.25rem;
}

.dashboard-subtitle {
  color: #718096;
  font-size: 0.95rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.dash-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.dash-card:hover {
  border-color: #cbd5e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-icon-blue   { background: #ebf4ff; color: #2b6cb0; }
.dash-icon-indigo { background: #ebf4ff; color: #4c51bf; }
.dash-icon-teal   { background: #e6fffa; color: #2c7a7b; }
.dash-icon-amber  { background: #fefcbf; color: #b7791f; }
.dash-icon-orange { background: #feebc8; color: #c05621; }
.dash-icon-green  { background: #f0fff4; color: #276749; }
.dash-icon-purple { background: #faf5ff; color: #6b46c1; }
.dash-icon-slate  { background: #edf2f7; color: #4a5568; }

.dash-card-body {
  flex: 1;
  min-width: 0;
}

.dash-card-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.1rem;
}

.dash-card-body p {
  font-size: 0.8rem;
  color: #a0aec0;
}

.dash-card-arrow {
  color: #cbd5e0;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.dash-card:hover .dash-card-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    gap: 0.25rem;
    border-top: 1px solid #edf2f7;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links > li > a {
    display: block;
    padding: 0.6rem 0.75rem;
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    background: #f7fafc;
    border-radius: 6px;
  }

  .nav-user {
    border-left: none;
    border-top: 1px solid #edf2f7;
    margin-left: 0;
    padding-left: 0;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
  }

  .nav-btn-outline,
  .nav-btn-solid {
    display: block !important;
    text-align: center;
  }

  .landing-hero h1 {
    font-size: 1.8rem;
  }

  .landing-hero {
    padding: 3.5rem 1.5rem 4.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .landing-trust-inner {
    gap: 1.5rem;
  }

  .gallery-reel {
    flex-direction: column;
    align-items: center;
  }

  .gallery-item {
    max-width: 100%;
  }

  .trust-number {
    font-size: 1.15rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .content-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Registro en Campo — mobile-first field reading view */
.registro-section {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  overflow-x: hidden;
}

.registro-header {
  text-align: center;
  margin-bottom: 1rem;
}

.registro-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.15rem;
}

.registro-count {
  font-size: 0.85rem;
  color: #718096;
}

.registro-org-picker {
  margin-bottom: 0.75rem;
}

.registro-org-picker select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
}

.registro-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.registro-search input[type="search"] {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  -webkit-appearance: none;
}

.registro-search input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.registro-search-clear {
  font-size: 0.85rem;
  color: #c62828;
  text-decoration: none;
  white-space: nowrap;
}

.registro-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #718096;
  font-size: 1rem;
}

/* Card list */
.registro-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.registro-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.registro-card-open {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(21, 101, 192, 0.12);
}

.registro-card-saved {
  border-color: #2e7d32;
}

/* Card header — tappable */
.registro-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
  gap: 0.75rem;
}

.registro-card-header:active {
  background: #f7fafc;
}

.registro-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.registro-owner {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1a202c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registro-meta {
  font-size: 0.8rem;
  color: #a0aec0;
}

.registro-card-reading {
  text-align: right;
  flex-shrink: 0;
}

.registro-last-value {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-dark);
}

.registro-last-date {
  display: block;
  font-size: 0.75rem;
  color: #a0aec0;
}

/* Card form area */
.registro-card-form {
  padding: 0 1rem 1rem;
  border-top: 1px solid #edf2f7;
  overflow: hidden;
}

.registro-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.registro-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.registro-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.registro-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.6rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.registro-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.registro-anterior-input {
  margin-bottom: 0;
}

.registro-consumo {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: #555;
}

.registro-consumo strong {
  color: #2e7d32;
  font-size: 1rem;
}

.registro-save-btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.75rem;
  border: none;
  border-radius: 8px;
  background: #2e7d32;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.registro-save-btn:hover {
  background: #1b5e20;
}

.registro-save-btn:disabled {
  background: #a5d6a7;
  cursor: default;
}

/* Done state */
.registro-card-done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid #c8e6c9;
  background: #e8f5e9;
}

.registro-done-check {
  font-size: 1.2rem;
  color: #2e7d32;
  font-weight: 700;
}

.registro-done-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2e7d32;
}
