/* proveedor_5.css (sin Tailwind)
   - Diseño mejorado y profesional basado en Material Dashboard
   - Mantiene la estructura original
*/

:root {
  --bg: #f0f2f5;
  --text: #344767;
  --sidebar-bg: linear-gradient(195deg, #42424a, #191919);
  /* Dark modern sidebar */
  --sidebar-active-bg: linear-gradient(195deg, #bb9a24, #9a7f1d);
  /* Gold gradient */
  --gold: #bb9a24;
  --gold-hover: #d4b545;
  --content-bg: #ffffff;
  --content-text: #344767;
  --border-color: #f0f2f5;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 80px;
  --page-pad: 24px;
  --gap: 24px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.75rem;
}

body {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Marca de agua sutil */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 15% auto;
  opacity: 0.05;
  pointer-events: none;
  z-index: -1;
}

/* ---------------- Sidebar ---------------- */

#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  /* El usuario usa tonos marrones, mantenemos la identidad pero mejorada */
  background: linear-gradient(180deg, #572625 0%, #3e1b1b 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border-radius: 0 1rem 1rem 0;
}

/* Custom Scrollbar for sidebar */
#sidebar::-webkit-scrollbar {
  width: 5px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px 20px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.sidebar__toggle img {
  width: auto;
  max-width: 120px;
  max-height: 50px;
  object-fit: contain;
  transition: all 0.3s;
}

.user-provider-group {
  padding: 0 16px;
  margin-bottom: 8px;
  width: 100%;
}

.sidebar__user {
  background: rgba(255, 255, 255, 0.08);
  /* Glass effect */
  backdrop-filter: blur(4px);
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}

.sidebar__user:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.sidebar__user span {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.provider-info-sidebar {
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  max-height: 200px;
  opacity: 1;
}

.provider-info-sidebar.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.provider-title-sidebar {
  padding: 10px 14px;
  font-size: 0.75rem;
  color: #e5e7eb;
  border-left: 3px solid var(--gold);
}

#sidebarContent {
  flex: 1;
  padding: 10px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.sidebar__section {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Bottom Container (Holds Context & Footer) */
.sidebar__bottom-container {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

/* Context Section */
.sidebar__section--context {
  padding-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  /* Separator from Main Nav */
  display: flex;
  flex-direction: column;
}

/* Footer Section */
.sidebar__section--footer {
  padding-top: 8px;
  padding-bottom: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  /* Separator from Context */
  display: flex;
  flex-direction: column;
}

/* Context Option Styles (Matches Standard Sidebar Option) */
/* Context Option Styles (Matches Standard Sidebar Option) */
.context-option {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75) !important;
  /* Force base color */
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  /* Prepare for border transition */
}

.context-option i {
  width: 24px;
  font-size: 1.1rem;
  text-align: center;
  margin-right: 12px;
  transition: color 0.3s;
  color: inherit;
}

.context-option:hover {
  background-color: rgba(255, 255, 255, 0.12);
  /* Matches .sidebar-option hover */
  color: #ffffff !important;
}

/* Distinct Selected State for Context (Left Pill Indicator) */
.context-option.selected {
  /* background: rgba(255, 255, 255, 0.05); */
  /* Minimal background distinction */
  color: #fff !important;
  /* Force white selected text */
  border: 1px solid transparent;
  /* maintain sizing */
  font-weight: 500;
  box-shadow: none;
}

.context-option.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  /* Fixed height for pill look */
  background-color: var(--gold);
  border-radius: 4px;
  /* Half-pill shape */
  z-index: 10;
}

.context-option.selected i {
  color: var(--gold) !important;
  transition: color 0.3s;
  /* Force gold icon */
}

.context-option.selected span {
  color: var(--gold) !important;
}

.context-option:visited,
.context-option:active,
.context-option:focus {
  color: rgba(255, 255, 255, 0.75) !important;
}

.context-option.selected:visited,
.context-option.selected:active {
  color: #fff !important;
}

.context-option.selected:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-option {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-option i {
  width: 24px;
  font-size: 1.1rem;
  text-align: center;
  margin-right: 12px;
  transition: color 0.3s;
  color: inherit;
}

.sidebar-option:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Active State */
.sidebar-option.selected {
  background: var(--sidebar-active-bg);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.sidebar-option.selected i {
  color: #fff;
}

.sidebar-option.selected::after {
  display: none;
}

.sidebar-badge {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Sidebar collapsed logic */
#sidebar.is-collapsed {
  width: var(--sidebar-w-collapsed);
}

#sidebar.is-collapsed .sidebar-option span,
#sidebar.is-collapsed .context-option span,
#sidebar.is-collapsed .user-provider-group,
#sidebar.is-collapsed .sidebar-badge {
  display: none;
}

#sidebar.is-collapsed .sidebar-option {
  justify-content: center;
  padding: 12px 0;
}

#sidebar.is-collapsed .sidebar-option i {
  margin-right: 0;
  font-size: 1.25rem;
}

#sidebar.is-collapsed .sidebar__toggle {
  padding: 12px;
}

#sidebar.is-collapsed .sidebar__toggle img {
  max-width: 40px;
}

/* ---------------- Content area ---------------- */

#content {
  /* Dynamic margin based on sidebar width */
  margin-left: calc(var(--sidebar-w) + var(--gap));
  margin-right: var(--gap);
  margin-top: 24px;
  margin-bottom: 24px;
  min-height: calc(100vh - 48px);

  /* Glass/Card Effect */
  background: var(--content-bg);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  padding: 32px;

  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

body.sidebar-collapsed #content {
  margin-left: calc(var(--sidebar-w-collapsed) + var(--gap));
}

/* Header & Tabs */

/* Contenedor de tabs estilo burbuja */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: #f0f2f5;
  border-radius: 12px;
  /* margin-bottom: 32px; */
  width: fit-content;
}

.pill-tab {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #7b809a;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.pill-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #344767;
}

.pill-tab.selected {
  background: #fff;
  color: var(--gold);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
  font-weight: 600;
  transform: translateY(-1px);
}

/* Títulos */
.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #344767;
  margin-bottom: 16px;
}

hr {
  border: 0;
  border-top: 1px solid #e0e0e0;
  margin: 20px 0 32px 0;
  opacity: 0.6;
}

/* ---------------- Formulario Profesional ---------------- */

.datos-lista {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.fila-dato {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fila-doble {
  display: flex;
  gap: 24px;
  width: 100%;
}

.fila-doble .fila-dato {
  flex: 1;
}

/* Labels más limpios */
.fila-dato label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #7b809a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-left: 2px;
}

/* Inputs estilo Material (Outlined pero limpios) */
.fila-dato input {
  background: #fafafa;
  border: 1px solid #d2d6da;
  border-radius: 6px;
  height: 36px;
  /* Altura confortable táctil */
  padding: 0 14px;
  font-size: 0.95rem;
  color: #495057;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.fila-dato input:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(187, 154, 36, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.01);
  outline: none;
}

.fila-dato input:hover:not(:focus) {
  border-color: #b1b7c1;
}

/* Botón de acción */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 32px;
  background: linear-gradient(195deg, #42424a, #191919);
  color: #fff;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.15), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  margin-top: 24px;
  align-self: flex-start;
  /* No ocupar todo el ancho */
}

.btn:hover {
  background: linear-gradient(195deg, #666, #333);
  box-shadow: 0 14px 26px -12px rgba(66, 68, 74, 0.4), 0 4px 23px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(66, 68, 74, 0.2);
  transform: translateY(-2px);
}

.btn i {
  margin-right: 10px;
}

button:focus {
  outline: 0px dotted !important;
}

.form-control, .is-focused .form-control {
    background-image: linear-gradient(to top, #fdd64b 2px, rgba(255, 255, 255, 0) 0px), linear-gradient(to top, #d2d2d2 1px, rgba(210, 210, 210, 0) 0px) !important;
}

thead tr th.text-center,
    thead tr th.text-right { text-align: left !important; }

.card .card-header-primary .card-icon, .card .card-header-primary .card-text, .card .card-header-primary:not(.card-header-icon):not(.card-header-text) {
    box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px #6c140e7a !important;
}    

/* Responsive adjustments */
@media (max-width: 768px) {
  #content {
    margin-left: calc(var(--sidebar-w-collapsed) + 12px);
    padding: 24px;
  }

  .fila-doble {
    flex-direction: column;
    gap: 16px;
  }

  .tabs {
    width: 100%;
  }

  .pill-tab {
    flex: 1;
    text-align: center;
  }
}