/* Global app color overrides */
:root {
  --app-bg: #FAF9F7;
  --btn-bg: #0A1F47;
  --btn-text: #ffffff;
  --hover-bg: #0A1F47;
  --btn-hover-bg: rgba(42, 84, 161, 0.452);
}
 
/* Background */
html, body, #__next, #root {
  background-color: var(--app-bg) !important;
}
 
/* Buttons - target native, role-based, utility, and Chakra/Reflex buttons */
button,
button[type],
[role="button"],
.btn,
.button,
.chakra-button,
.pc-button {
  background-color: var(--btn-bg) !important;
  color: var(--btn-text) !important;
  border-color: var(--btn-bg) !important;
}
 
/* Hover/active states */
button:hover,
[role="button"]:hover,
.btn:hover,
.button:hover,
.chakra-button:hover,
.pc-button:hover {
  background-color: var(--btn-hover-bg) !important;
  border-color: var(--btn-hover-bg) !important;
  color: var(--btn-text) !important;
}
 
button:active,
[role="button"]:active,
.btn:active,
.button:active,
.chakra-button:active,
.pc-button:active {
  background-color: var(--btn-hover-bg) !important;
  border-color: var(--btn-hover-bg) !important;
  color: var(--btn-text) !important;
}
 
/* Disabled state */
button[disabled],
[aria-disabled="true"],
.chakra-button[disabled],
.pc-button[disabled] {
  opacity: 0.7;
}
 
/* Sidebar styles */
.sidebar .sidebar-item:hover,
.sidebar .sidebar-item--active {
  background-color: var(--hover-bg) !important;
  color: #ffffff !important;
}
 
/* Ensure icons inside sidebar items use stroke color (outline), not fill */
.sidebar .sidebar-item svg,
.sidebar .sidebar-item .h-5,
.sidebar .sidebar-item .w-5 {
  color: inherit !important;
  fill: none !important;
  stroke: currentColor !important;
}
 
/* Unified blue select style to match app buttons and keep white text */
.blue-select {
  background-color: var(--btn-bg) !important;
  color: #ffffff !important;
  border: 1px solid var(--btn-bg) !important;
}
.blue-select:hover,
.blue-select:focus {
  background-color: var(--btn-hover-bg) !important;
  border-color: var(--btn-hover-bg) !important;
  color: #ffffff !important;
  outline: none !important;
  box-shadow: none !important;
}
/* Options keep dark text for readability in dropdown list */
.blue-select option { color: #111827; }
 
/* Minimal, scoped fix: ensure Radix Select trigger text/placeholder are white
   for selects we mark with `perimeter-select` */
.perimeter-select .rt-SelectTrigger,
.perimeter-select .rt-SelectTrigger *,
.perimeter-select .rt-SelectValue,
.perimeter-select [data-placeholder] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 0.75rem;
}

/* Upload Zone */
.upload-zone {
  transition: all 0.3s ease;
  border: 2px dashed #cbd5e1;
  background-color: #f8fafc;
}

.upload-zone:hover {
  border-color: var(--btn-bg);
  background-color: #f1f5f9;
  transform: scale(1.01);
}

/* Modern Table */
.modern-table-container {
  border-radius: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

.modern-table thead {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.modern-table th {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.75rem 1rem;
  text-align: left;
  letter-spacing: 0.05em;
}

.modern-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s;
}

.modern-table tbody tr:last-child {
  border-bottom: none;
}

.modern-table tbody tr:hover {
  background-color: #f8fafc;
}

.modern-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #334155;
}

/* Chips */
.bool-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.bool-true {
  background-color: #dcfce7;
  color: #166534;
}

.bool-false {
  background-color: #fee2e2;
  color: #991b1b;
}

.pisos-tag {
  display: inline-block;
  background-color: #f1f5f9;
  color: #475569;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  border: 1px solid #e2e8f0;
}

/* Loader styles from Uiverse.io by Satwinder04 */
.loader {
  /* background-color: blue; */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
 
.loader-text {
  font-size: 24px;
  color: rgb(0, 0, 0);
  margin-bottom: 20px;
  align-self: center;
}
 
.loader-bar {
  width: 30%;
  height: 10px;
  border-radius: 5px;
  background-color: rgb(0, 0, 0);
  animation: loader-bar-animation 2s ease-in-out infinite;
}
 
@keyframes loader-bar-animation {
  0% {
    /* transform: translateX(-100%) rotate(270deg); */
    transform: translateX(-100%);
  }
 
  50% {
    /* transform: translateX(100%) rotate(-90deg); */
    transform: translateX(100%);
  }
 
  100% {
    /* transform: translateX(-100%) rotate(270deg); */
    transform: translateX(-100%);
  }
}

/* Catastro data table styling */
.catastro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.catastro-table thead {
  background: var(--btn-bg);
  color: #ffffff;
}
.catastro-table th, .catastro-table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #eef2f7;
}
.catastro-table tbody tr:nth-child(even) { background: #f8fafc; }
.catastro-table tbody tr:hover { background: #f1f5f9; }

/* Variant: preview table (lighter header) */
.preview-table thead {
  background: #12325f;
  color: #1C2024 !important;
  text-align: left;          /* align header text left */
  letter-spacing: 0.5px;     /* subtle refinement */
  text-transform: uppercase; /* optional: gives a clean table-header look */
}

.preview-table tbody tr:hover {
  background: #e9f0f7;
}

/* Variant: result table (accent gradient header) */
.result-table thead {
  background: linear-gradient(90deg, var(--btn-bg) 0%, #1d4ed8 100%);
}
.result-table tbody tr:hover {
  background: #e2e8f0;
}

/* Force white header text across all variants */
.catastro-table thead th,
.result-table thead th { color: #ffffff !important; }

/* Boolean chips */
.bool-chip {
  display: inline-block;
  min-width: 36px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  text-align: center;
  font-weight: 600;
  letter-spacing: .3px;
}
.bool-true { background: #057A55; color: #fff; }
.bool-false { background: #CBD5E0; color: #1A202C; }

/* Lista Pisos tag list */
.pisos-list { display: flex; flex-wrap: wrap; gap: 4px; }
.pisos-tag {
  background: #0A1F47;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.2;
}

/* Responsive scroll container */
.table-scroll { width: 100%; overflow-x: auto; }

/* No-role (permission denied) page styles */
.no-role-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 16px;
  background: linear-gradient(180deg, rgba(250,250,250,0.6), rgba(250,250,250,0.9));
}

.no-role-card {
  max-width: 720px;
  width: 100%;
  padding: 36px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.78), rgba(250,250,255,0.72));
  border-radius: 12px;
  border: 1px solid rgba(10,31,71,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.no-role-logo {
  width: 120px;
  height: auto;
  margin: 0 0 18px 0;
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(10,31,71,0.08);
}

.no-role-heading {
  font-size: 1.6rem;
  color: #0A1F47;
  margin-bottom: 8px;
  font-weight: 700;
}

.no-role-text {
  color: #475569;
  margin-bottom: 24px;
  font-size: 1rem;
  max-width: 560px;
}

.no-role-button {
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(10,31,71,0.10);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  width: 40%;
  max-width: 260px;
  min-width: 140px;
  text-align: center;
}

.no-role-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(10,31,71,0.14);
  background: var(--btn-hover-bg);
}

@media (max-width: 640px) {
  .no-role-card { padding: 20px; }
  .no-role-logo { width: 92px; }
  .no-role-heading { font-size: 1.15rem; }
  .no-role-button { width: 60%; max-width: 220px; }
}

/* Email emphasis in no-role page */
.no-role-email {
  font-weight: 800;
  color: #0A1F47;
}