/* =============================================================
   COLOR PALETTE — BRINO CRM 
   -------------------------------------------------------------
   SHELL (dark theme — top bar, sidebar)  
     --bg:            #0a0f1a   Page background 
     --shell-top:     #001127   Top bar
     --shell-side:    #0e1a33   Sidebar
     --fg:            #fff      Shell text
     --accent:        #ff5201   Orange-red — candidate for
                                primary CTA once palette is set

   CONTENT AREA (light theme) — all as CSS variables below
     --color-text:    #111      Primary text in cards/content
     --color-label:   #545454   Muted uppercase field labels 
     --color-slate:   #334155   Buttons, secondary text
     --color-border:  #e2e6ea   Card and photo borders
     --color-card-bg: #fff      Card backgrounds

   BUTTONS (page header)
     Default/Primary: var(--color-slate)
     Hover:           #1e293b
     Danger:          #c0392b   Red — Eliminar (CSS ready,
                                .danger class not yet in JS)
     Hover:           #96281b
     Disabled:        opacity 0.4

   TABLES / BADGES / SECTION LABELS
     --color-chrome:  #586379   Table headers, badges, card section titles
     Header text:     #fff
     Row hover:       #e8edf5
     Border:          #eee / #ddd

   STATUS
     Active:          #15945b   Green
     Inactive:        #c01212   Red

   TODO: explore palette combinations — swap any variable above
   to instantly recolor all usages across the app.
   ============================================================= */

/* === GLOBAL VARIABLES === */
:root {
  /* Shell */
  --bg:            #0a0f1a;
  --shell-top:     #001127;
  --shell-side:    #0e1a33;
  --fg:            #fff;
  --accent:        #ff5201;

  /* Content area */
  --color-text:    #111;
  --color-label:   #545454;
  --color-slate:   #334155;
  --color-chrome:  #586379;
  --color-border:  #e2e6ea;
  --color-card-bg: #fff;
}

/* === BASE STYLES === */
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, Arial, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* === LOGIN PAGE === */
.page.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
}

.login-box {
  background: #0a1839;
  width: min(300px, 80%);
  padding: 2rem 2.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.login-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #334;
  background: #fff;
  color: #000;
}

.login-form button {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease; 
}

.login-form button:hover {
  background: #a83804; 
}

/* === APP SHELL LAYOUT === */
.app-shell {
  display: grid;
  grid-template-rows: 60px 1fr;
  grid-template-columns: 180px 1fr;   
  grid-template-areas:
    "top top"
    "side main";  
  height: 100vh;
  background: var(--bg);     
  color: var(--fg); 
}

/* === TOP BAR === */ 
.top-bar {
  grid-area: top;
  display: flex;
  justify-content: space-between;   
  align-items: center;
  padding: 0 1rem;
  background: var(--shell-top);
}

#logout-btn {
  padding: 6px 14px;
  margin-left: 5px;
  border: none;
  border-radius: 20px;
  background: #e7e9eb;
  color: #2a2a2a;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

#logout-btn:hover {
  background: #b0b5be;
}

#settings-btn {
  padding: 6px 10px;
  margin-left: 5px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: #e7e9eb;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

#settings-btn:hover {
  color: #b0b5be;
}

/* === SIDEBAR === */
.sidebar {
  grid-area: side;
  background: var(--shell-side);
  padding: 1rem;
  overflow-y: auto;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 0.75rem 1rem;
  margin-bottom: 5px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  outline: none;      
}

.sidebar li:hover,
.sidebar li.active {
  background: rgba(255, 255, 255, 0.15);
  outline: none;     
}

.sidebar_icon {
  padding-right: 5px;   
}

/* === MAIN CONTENT AREA === */
.module-container {
  grid-area: main;
  padding: 1.5rem;
  overflow-y: auto;
  background: #f8f9fb;
  color: var(--color-text);
}

/* === DASHBOARD PAGE === */
.page.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === RESPONSIVE === */
@media (max-width: 959px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "main";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 220px;
    height: 100vh;
    transition: left 0.3s ease;
    z-index: 200;
  }

  body.sidebar-open .sidebar {
    left: 0;
  }

  .module-container {
    border-radius: 0;
  }
}
/* === HIDE MOBILE BUTTONS ON DESKTOP === */
.menu-toggle,
.close-sidebar {
  display: none;
}

/* === SHOW ONLY ON SMALL SCREENS === */
@media (max-width: 959px) {
  .menu-toggle {
    display: inline-block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
  }

  .close-sidebar {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1rem;
    cursor: pointer;
  }
}

/* === PROPIEDADES PAGE === */

#search-listings-input,
#search-users-input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
.page.propiedades {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.propiedades-container {
  /*background: #fff;*/
  color: var(--color-text);
  border-radius: 8px;
  /*padding: 1rem;*/
  overflow-x: auto;
}

.propiedades-table-wrapper {
  height: calc(100vh - 280px); /* header + padding */
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}


.propiedades-table {
  min-width: 1200px; /* allows horizontal scroll when adding columns */
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.propiedades-table th,
.propiedades-table td {
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
  border-bottom: 1px solid #eee;   
  text-align: left;
}

/* Header cells */
.propiedades-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  /*border-bottom: 1px solid #ddd;*/
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
}

.propiedades-table th {
  background: var(--color-chrome);
  color: #fff;
  font-weight: 600;
}

.propiedades-table tr:hover {
  background: #e8edf5;
}

.loading, .error, .empty {
  text-align: center;
  padding: 1rem;
  color: #555;
}
.error { color: #b00; }

.propiedades-table .col-nombre { 
  white-space: normal;
  min-width: 240px;
  max-width: 300px;
  word-break: break-word;
}

.propiedades-table a{color: #001127;
    text-decoration: none; }
.propiedades-table a:hover{color: #013272; 
    text-decoration: none; }

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: center;
  padding: 1rem 0 0.5rem;
}

.pagination-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-card-bg);
}

.pagination-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--color-slate);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.pagination-btn:hover:not(:disabled) {
  background: #e8edf5;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-info {
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--color-chrome);
  border-left: 1px solid #d1d5db;
  border-right: 1px solid #d1d5db;
  white-space: nowrap;
}

/* === LISTING DETAILS === */
.listing-details-container { 
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.listing-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  gap: 1rem;
}

.listing-hero-title h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.listing-price {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-slate);
}

.listing-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.status-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.status-active {
  color: #15945b;
  /*background: #edfaf4;*/
}

.status-inactive {
  color: #c01212;
  /*background: #fdf0f0;*/
}

.listing-type-badge {
  display: inline-block;
  background: var(--color-chrome);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.listing-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.listing-details-card,
.listing-agent-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.listing-details-card h3,
.listing-agent-card h3 {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-chrome);
}

.listing-areas-text {
  margin: 0;
  font-size: 0.95rem; 
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
}

.listing-agent-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.listing-agent-photo {
  width: 100px;
  /*height: 134px;*/
  border-radius: 5%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  background: #f0f0f0;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .listing-details-grid {
    grid-template-columns: 1fr;
  }
  .listing-hero {
    flex-direction: column;
  }
  .listing-hero-meta {
    align-items: flex-start;
  }
}


/* === PAGE HEADER === */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.page-header .actions button {
  background: var(--color-slate);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.page-header .actions button:hover {
  background: #1e293b;
}

.page-header .actions button.primary {
  background: var(--color-slate);
}

.page-header .actions button.primary:hover {
  background: #1e293b;
}

.page-header .actions button.danger {
  background: #c0392b;
}

.page-header .actions button.danger:hover {
  background: #96281b;
}

.page-header .actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === USERS PAGE === */

.page.users {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/*
.users-container {
  background: #fff;
  color: var(--color-text);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}
*/
/* Outer container (same role as propiedades-container) */
.users-container {
  /* background: #fff; */ /* optional – same as propiedades */
  color: var(--color-text);
  border-radius: 8px;
  overflow-x: auto;
}

/* Scroll wrapper (CRITICAL) */
.users-table-wrapper {
  height: calc(100vh - 280px); /* header + spacing */
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}
/*
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
*/
/* Table */
.users-table {
  min-width: 1400px; /* enables horizontal scroll */
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
/*
.users-table th,
.users-table td {
  border-bottom: 1px solid #ddd;
  padding: 0.75rem 0.5rem;
  text-align: left;
}
*/
.users-table th,
.users-table td {
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
  border-bottom: 1px solid #eee;
  text-align: left;
}
/*
.users-table th {
  background: #f2f4f8;
  color: #333;
  font-weight: 600;
}
*/
/* Sticky header */
.users-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-chrome);
  color: #fff;
  font-weight: 600;
}

.users-table tr:hover {
  background: #e8edf5;
}

.loading, .error, .empty {
  text-align: center;
  padding: 1rem;
  color: #555;
}
.error { color: #b00; }

.users-table a{color: #001127;
    text-decoration: none; }
.users-table a:hover{color: #013272;
    text-decoration: none; }



/* === USER DETAILS PAGE === */ 
.page.user-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-details-container {
  max-width: 700px;
}

.user-profile-card {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 2rem;
}

.user-profile-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.user-profile-avatar img {
  width: 120px;
  /*height: 120px;*/
  border-radius: 5%;
  object-fit: cover;
  border: 3px solid var(--color-border);
  background: #f0f0f0;
}

.user-profile-avatar button {
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.user-profile-avatar button:hover {
  background: #e2e2e2;
}

#photo-upload-status {
  display: none;
  font-size: 0.8rem;
  color: #888;
}

.user-profile-info {
  flex: 1;
}

.user-profile-info h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
}

.user-role-badge {
  display: inline-block;
  background: var(--color-chrome);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
  gap: 1rem;
}

.user-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-info-item .label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-info-item .value {
  font-size: 0.95rem;
  color: #222;
}

@media (max-width: 600px) {
  .user-profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .user-info-grid {
    justify-items: center;
  }
}

/* === SLIDER CSS === */

#listing-slider {
  width: 100%;
  background: var(--color-card-bg);
  border: 1px solid #e7e7e7;
  border-radius: 3px;

}
.slider {
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: auto;
}
.slides {
  display: flex;
  transition: transform 0.5s ease;
}
.slide {
  flex: 0 0 100%;
}
.slider img {
  max-width: 100%;
  display: block;
  object-fit: cover;
  height: 400px;
  max-height: 400px;
  margin: auto;
}
.dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
}
.dot.bg-white {
  background: white;
}

.slider .prev,
.slider .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.slider .prev:hover,
.slider .next:hover {
  background: rgba(255, 255, 255, 1);
}

.slider .prev {
  left: 10px;
}

.slider .next {
  right: 10px;
}

/* === FORMS === */

.listing-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 960px;
}

.form-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.form-card--subtle {
  background: #f8f9fb;
  border-color: #e9ecef;
}

.form-card h3 {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-chrome);
}

.form-label-note {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--color-label);
  text-transform: none;
  letter-spacing: 0;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile default */
  gap: 1rem;
}

.app-grid label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.app-grid input,
.app-grid textarea,
.app-grid select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Desktop breakpoints */
@media (min-width: 768px) {
  .app-grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .span-1 {
    grid-column: span 12;
  }
  .span-2 {
    grid-column: span 6;
  }
  .span-3 {
    grid-column: span 4;
  }
}

/* === MANAGE PHOTOS PAGE === */

/* --- Base container --- */
.page.manage-photos {
  padding: 1.5rem;
}

.manage-photos-container {
  margin-top: 1rem;
}

/* --- Loading / error / empty states --- */
.manage-photos-container .loading,
.manage-photos-container .error,
.manage-photos-container .empty {
  text-align: center;
  padding: 2rem;
  font-size: 1.1rem;
  color: #555;
}

/* --- Photo grid --- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* --- Individual Photo Card --- */
.photo-card {
  position: relative;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.photo-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* --- Photo Image --- */
.photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: #eee;
}

/* --- Action bar (always visible on hover) --- */
.photo-card-actions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-card:hover .photo-card-actions {
  opacity: 1;
}

.photo-drag-handle {
  cursor: grab;
  font-size: 1.1rem;
  color: #fff;
  user-select: none;
  padding: 2px 6px;
  background: none;
  border: none;
}

.photo-drag-handle:active {
  cursor: grabbing;
}

.photo-card-actions button {
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.photo-card-actions button:hover {
  background: rgba(255,255,255,0.35);
}

.set-cover-btn .fa-star {
  color: rgba(255, 255, 255, 0.5);
}

.set-cover-btn .fa-star.star-cover {
  color: #f59e0b;
}

/* --- Card being dragged --- */
.photo-card.dragging {
  opacity: 0.35;
  transform: scale(0.97);
}

/* --- Drop overlay on other cards during drag --- */
.photo-drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(51, 65, 85, 0.35);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.photo-card.drop-target-active .photo-drop-overlay {
  opacity: 1;
}

/* --- Highlighted drop target --- */
.photo-card.drop-over {
  border: 2px solid var(--color-slate);
  transform: scale(1.03);
}

.photo-card.drop-over .photo-drop-overlay {
  background: rgba(51, 65, 85, 0.55);
}

/* --- Cover photo --- */
.photo-card.cover {
  border: 2px solid #0077cc;
  box-shadow: 0 0 0 3px rgba(0, 119, 204, 0.25);
}

/* === Dashboard === */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
}

.dashboard-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem;
}

.dashboard-card.span-full {
  grid-column: 1 / -1;
}

.dashboard-card.span-half {
  grid-column: span 1;
}

.dashboard-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
}

.dashboard-chart-area {
  height: 280px;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-chrome);
  font-size: 0.9rem;
}

.dashboard-chart-area .bar-chart {
  align-self: flex-start;
}

.dashboard-card.span-full .dashboard-chart-area {
  height: 240px;
  overflow-y: visible;
}

/* Bar chart */
.bar-chart {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bar-chart-row {
  display: grid;
  grid-template-columns: 140px 1fr 2rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.bar-label {
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  background: var(--color-border);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  position: relative;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
  overflow: hidden;
}

.bar-fill-inactive {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  background: #94a3b8;
  border-radius: 0 4px 4px 0;
  transition: width 0.4s ease;
}

.bar-value {
  color: var(--color-label);
  text-align: right;
  font-weight: 600;
}

/* Own listings summary (asesor dashboard card) */
.own-listings-summary {
  text-align: center;
}

.own-listings-total {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.own-listings-caption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-label);
}

.own-listings-breakdown {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  font-size: 0.85rem;
}

.own-listings-activas {
  color: var(--accent);
  font-weight: 600;
}

.own-listings-inactivas {
  color: #94a3b8;
  font-weight: 600;
}

/* Column chart */
.col-chart-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.col-chart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 1.4rem;
  flex-shrink: 0;
}

.col-chart-ytick {
  font-size: 0.68rem;
  color: var(--color-chrome);
  text-align: right;
  line-height: 1;
}

.col-chart-area {
  flex: 1;
  position: relative;
  min-width: 0;
}

.col-chart-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.col-chart-gridline {
  width: 100%;
  height: 1px;
  background: var(--color-border);
}

.col-chart {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  position: relative;
}

.col-chart-col {
  flex: 1;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 0.2rem;
}

.col-chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.col-chart-bar {
  position: relative;
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
}

.col-chart-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-slate);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.col-chart-bar:hover .col-chart-tooltip {
  opacity: 1;
}

.col-chart-label {
  font-size: 0.62rem;
  color: var(--color-chrome);
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-card.span-half {
    grid-column: 1 / -1;
  }
}

/* === Upload Drop Zone === */
.upload-drop-zone {
  margin: 1.5rem 1rem;
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  color: var(--color-chrome);
  background: transparent;
}

.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
  background: rgba(0, 119, 204, 0.05);
  border-color: #0077cc;
  color: #0077cc;
}

.upload-drop-zone .fa-cloud-arrow-up {
  font-size: 2rem;
}

.upload-drop-zone p {
  margin: 0;
  font-size: 0.95rem;
}

/* ----------------------------------------
   API Keys
   ---------------------------------------- */
.settings-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: -0.5rem 0 1rem;
}

.api-key-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.api-key-label { font-weight: 600; min-width: 140px; }
.api-key-masked { font-family: monospace; color: var(--color-text-muted); flex: 1; }
.api-key-date { color: var(--color-text-muted); font-size: 0.8rem; white-space: nowrap; }
.api-key-inactive { font-size: 0.8rem; color: var(--color-text-muted); font-style: italic; }

.api-key-generate {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.api-key-generate input { flex: 1; }

.api-key-new-result {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  font-size: 0.875rem;
}

.api-key-copy-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.api-key-copy-row code {
  flex: 1;
  background: #e8f5e9;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  word-break: break-all;
}

/* ---------------------------------------- */

/* ----------------------------------------
   Submissions
   ---------------------------------------- */
.submissions-container {
  color: var(--color-text);
  border-radius: 8px;
  overflow-x: auto;
}

.submissions-table-wrapper {
  height: calc(100vh - 280px);
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.submissions-table {
  min-width: 1000px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.submissions-table th,
.submissions-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.submissions-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-chrome);
  color: #fff;
  font-weight: 600;
}

.submissions-table tr:hover { background: #e8edf5; }

.submissions-date { white-space: nowrap; color: var(--color-text-muted); font-size: 0.85rem; }

/* ----------------------------------------
   Contacts
   ---------------------------------------- */
.contacts-container {
  color: var(--color-text);
  border-radius: 8px;
  overflow-x: auto;
}

.contacts-table-wrapper {
  height: calc(100vh - 280px);
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.contacts-table {
  min-width: 700px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.contacts-table th,
.contacts-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.contacts-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-chrome);
  color: #fff;
  font-weight: 600;
}

.contacts-table tr:hover { background: #e8edf5; }
.contacts-date { white-space: nowrap; color: var(--color-text-muted); font-size: 0.85rem; }

/* Contact detail — submissions history table */
.contact-details-container {
  padding: 1.5rem;
  max-width: 860px;
}

.contacts-submissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.contacts-submissions-table th,
.contacts-submissions-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.contacts-submissions-table thead th {
  background: var(--color-chrome);
  color: #fff;
  font-weight: 600;
}

.contacts-submissions-table tr:hover { background: #e8edf5; }
.contact-message-preview { color: var(--color-text-muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------- */

/* Submission detail */
.submission-details-container {
  padding: 1.5rem;
  max-width: 720px;
}

.submission-detail-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.submission-detail-section h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.submission-detail-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}

.submission-detail-grid .label { color: var(--color-text-muted); }
.submission-detail-grid .value a { color: var(--color-chrome); text-decoration: none; }
.submission-detail-grid .value a:hover { text-decoration: underline; }

.submission-message-body {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.submission-detail-actions {
  padding-top: 0.5rem;
}

.submission-detail-actions .btn-primary {
  display: inline-block;
  background: var(--color-chrome);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.submission-detail-actions .btn-primary:hover { opacity: 0.9; }

/* ---------------------------------------- */

.upload-drop-zone-link {
  color: #0077cc;
  text-decoration: underline;
  cursor: pointer;
}

.photo-card.cover::after {
  content: "Portada";
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #0077cc;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

/* ----------------------------------------
   Paginas (CMS pages)
   ---------------------------------------- */
.paginas-container {
  color: var(--color-text);
  border-radius: 8px;
  overflow-x: auto;
}

.paginas-table-wrapper {
  height: calc(100vh - 280px);
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.paginas-table {
  min-width: 800px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.paginas-table th,
.paginas-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.paginas-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-chrome);
  color: #fff;
  font-weight: 600;
}

.paginas-table tr:hover { background: #e8edf5; }

.paginas-table a { color: #001127; text-decoration: none; }
.paginas-table a:hover { color: #013272; text-decoration: none; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-content  { background: #e3f0ff; color: #0056b3; }
.badge-form     { background: #eee3ff; color: #5a1fb3; }
.badge-active   { background: #e3ffe8; color: #157a2f; }
.badge-inactive { background: #f0f0f0; color: #666; }









