/* =========================================================
   ComboPRO – UI TOKENS
   ========================================================= */
:root {
  --cp-primary: #002c5c;
  --cp-primary-contrast: #ffffff;

  --cp-text-primary: #002c5c;
  --cp-text-secondary: #656f84;
  --cp-text-muted: #b4bcc4;

  --cp-divider-on-primary: rgba(255, 255, 255, 0.15);

  --cp-surface: #ffffff;
  --cp-background: #ffffff;
}

/* =========================================================
   BASE
   ========================================================= */
html, body {
  margin: 0;
  padding: 0;
  background: var(--cp-background);
  height: 100%;
}

.app-root {
  height: 100dvh;     /* 👈 clave para tablet/teclado */
  display: flex;
  flex-direction: column;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif !important;
  color: var(--cp-text-primary);
  font-size: 16px;
}



/* =========================================================
   APP BAR (TOP BAR)
   ========================================================= */
.mud-appbar {
  background-color: var(--cp-surface) !important;
  color: var(--cp-primary) !important;
  box-shadow: none !important;
  border-bottom: 0 !important;
}

/* Títols i icones dins l’AppBar */
.mud-appbar .mud-typography,
.mud-appbar .mud-icon-root {
  color: var(--cp-primary) !important;
}

/* =========================================================
   DRAWER (LEFT MENU)
   ========================================================= */
.mud-drawer {
  background-color: var(--cp-surface) !important;
  color: var(--cp-primary-contrast) !important;
  border-right: 0 !important;
}

/* =========================================================
   CONTINGUT PRINCIPAL
   ========================================================= */
.mud-main-content {
  background: var(--cp-background);
}

/* =========================================================
   TEXTOS SECUNDARIS (segons disseny)
   ========================================================= */
.text-secondary,
.mud-typography-body2,
.mud-typography-caption {
  color: var(--cp-text-secondary);
}

.text-muted {
  color: var(--cp-text-muted);
}

/* =========================================================
   BOTONS (coherència visual)
   ========================================================= */
.mud-button-filled-primary {
  background-color: var(--cp-primary) !important;
  color: var(--cp-primary-contrast) !important;
}

.mud-button-text-primary {
  color: var(--cp-primary) !important;
}

/* =========================================================
   FORMS / INPUTS (neteja visual)
   ========================================================= */
.mud-input-root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* ========================================================= 
    TEXTOS 
   ========================================================= */ 

.cp-text_Inter_Medium_18 
{
   font-size: 18px;
    font-weight: 500; /* Medium */
    color: var(--cp-primary);
    line-height: 1.3;
}

/* Inter Regular 18px #002c5c */
.cp-text-inter-regular-18 {
  font-size: 18px;
  font-weight: 400;          /* Regular */
  color: var(--cp-primary);  /* token */
  line-height: 1.3;
}

/* Inter Bold 16px – color corporatiu */
.cp-text-inter-bold-16 {
  font-size: 15px;
  font-weight: bold;          /* Bold */
  color: var(--cp-primary);  /* #002c5c */
  line-height: 1.3;
}

/* Inter Medium 14pt, #656f84 */ 
.cp-text-inter-medium-14 {
  font-size: 14px;
  font-weight: 500;          
  color: #656f84;  
  line-height: 1.3;
}

/* Inter Bold 30pt, #002c5c */ 
.cp-text-inter-bold-30 {
  font-size: 22px;
  font-weight: bold;          
  color: var(--cp-primary); 
  line-height: 1.3;
}

/* Inter Regular 16pt, #656f84 */ 
.cp-text-inter-regular-16 {
  font-size: 16px;
  font-weight: 400;          
  color: #656f84; 
  line-height: 1.3;
}

/* Inter Bold 22pt, #002c5c */ 
.cp-text-inter-bold-22 {
  font-size: 22px;
  font-weight: bold;          
  color: var(--cp-primary); 
  line-height: 1.3;
}

/* Inter Regular 18pt, #656f84 */
.cp-text-inter-regular-18-gris {
  font-size: 18px;
  font-weight: 400;          
  color: #656f84; 
  line-height: 1.3;
}

/* Inter Light 14pt, #0656f84 */ 
.cp-text-inter-light-14-gris {
  font-size: 18px;
  font-weight:lighter;          
  color: #656f84; 
  line-height: 1.3;
}

/* Inter Bold 18pt, #002c5c */ 
.cp-text-inter-bold-18 {
  font-size: 18px;
  font-weight: bold;          
  color: var(--cp-primary); 
  line-height: 1.3;
}

.cp-text-inter-bold-24 {
  font-size: 24px;
  font-weight: bold;          
  color: var(--cp-primary); 
  line-height: 1.3;
}

/* Inter Regular 18pt, #656f84 */
.cp-text-inter-regular-18-gris {
  font-size: 18px;
  font-weight: bold;          
  color: #656f84; 
  line-height: 1.3;
}

.cp-text-inter-regular-20-gris {
  font-size: 20x;
  font-weight: 600;          
  color: #656f84; 
  line-height: 1.3;
}

/* ========================================================= 
    TOOLBARS BUTTONS 
   ========================================================= */ 
.cp-btn-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;            /* gap-1 */
  padding: 0.375rem 0.5rem;/* py-1.5 px-2 */
  border-radius: 0.25rem;  /* rounded */
  font-size: 14px;     /* text-sm */
  font-weight: 500;        /* font-medium */
  color: var(--cp-primary);          /* text-slate-600 */
  transition: color 150ms ease, background-color 150ms ease;
}

/* Hover (light) */
.cp-btn-toolbar:hover {
  background-color: #F9F8F9; /* slate-200 */
}

/* Toolbar responsive: in tablet and below keep only icon */
@media (max-width: 1024px) {
  .cp-btn-toolbar {
    justify-content: center;
    gap: 0;
    min-width: 2rem;
    padding-inline: 0.5rem;
    font-size: 0;
  }

  .cp-btn-toolbar .material-symbols-outlined,
  .cp-btn-toolbar .material-icons,
  .cp-btn-toolbar svg,
  .cp-btn-toolbar img {
    margin: 0 !important;
  }
}


/* ========================================================= 
    BUTTONS 
   ========================================================= */ 
.cp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 2.25rem;          /* h-9 = 36px */
  padding: 0 0.75rem;       /* px-3 */

  border-radius: 0.5rem;    /* rounded-lg */
  border: 1px solid #cbd5e1;/* border-slate-300 */
  background-color: #ffffff;
  color: var(--cp-primary);           /* text-slate-700 */

  font-size: 0.875rem;      /* text-sm */
  font-weight: 500;         /* font-medium */

  box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* shadow-sm */

  transition: background-color 150ms ease,
              border-color 150ms ease,
              box-shadow 150ms ease,
              color 150ms ease;
}

/* Hover (light) */
.cp-btn:hover {
  background-color: #F9F8F9; /* slate-50 */
}

/* Focus */
.cp-btn:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(var(--cp-primary-rgb), 0.2),
    0 1px 2px rgba(0,0,0,0.05);
}

/* ========================================================= 
    MUD BUTTONS 
   ========================================================= */ 
/* Filled */
.cp-btn.mud-button-filled{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 2.25rem;          /* h-9 = 36px */
    padding: 0 0.75rem;       /* px-3 */

    border-radius: 0.5rem;    /* rounded-lg */
    border: 1px solid var(--cp-primary);/* border-slate-300 */
    background-color: var(--cp-primary);
    color: #ffffff;           /* text-slate-700 */

    font-size: 0.875rem;      /* text-sm */
    font-weight: 500;         /* font-medium */

    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* shadow-sm */

    transition: background-color 150ms ease,
                border-color 150ms ease,
                box-shadow 150ms ease,
                color 150ms ease;

    text-transform: inherit;
}

/* Ensure MudButton inner label/icon keeps the same foreground color as the button */
.cp-btn.mud-button-filled .mud-button-label,
.cp-btn.mud-button-filled .mud-icon-root{
  color: inherit !important;
}

.cp-btn.mud-button-filled:hover{
  background-color: #F9F8F9;
  color: var(--cp-primary); 
}

.cp-btn.mud-button-filled:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(var(--cp-primary-rgb), 0.2),
    0 1px 2px rgba(0,0,0,0.05);
  color: var(--cp-primary); 
}

/* Text */
.cp-btn.mud-button-text{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 2.25rem;          /* h-9 = 36px */
  padding: 0 0.75rem;       /* px-3 */

  border-radius: 0.5rem;    /* rounded-lg */
  border: 1px solid #cbd5e1;/* border-slate-300 */
  background-color: #ffffff;
  color: var(--cp-primary);           /* text-slate-700 */

  font-size: 0.875rem;      /* text-sm */
  font-weight: 500;         /* font-medium */

  box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* shadow-sm */

  transition: background-color 150ms ease,
              border-color 150ms ease,
              box-shadow 150ms ease,
              color 150ms ease;

 text-transform: inherit;
}

.cp-btn.mud-button-text:hover{
  background-color: #F9F8F9; /* slate-50 */
}

.cp-btn.mud-button-text:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(var(--cp-primary-rgb), 0.2),
    0 1px 2px rgba(0,0,0,0.05);
}


/* ========================================================= 
    CASILLA DE BUSQUEDA 
   ========================================================= */ 

.cp-search-wrap{
  position: relative;
  width: 100%;
  max-width: 320px;   /* ajusta */
}

/* icono lupa */
.cp-search-icon{
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--cp-primary);
  pointer-events: none;
  z-index: 2;
}

/* input */
.cp-search-input{
  width: 100%;
  display: block;

  /* 🔑 RESERVA espacio real para el icono */
  padding-left: 44px !important;   /* prueba 48px si aún lo roza */
  padding-right: 12px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;

  /* 🔑 bordes redondos sí o sí */
  border-radius: 10px !important;  /* o 999px si lo quieres pill */
  border: 0px solid #cbd5e1 !important;

  background: #F9F8F9 !important;
  color: var(--cp-primary) !important;

  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px !important;      /* text-sm */
  line-height: 1.2;

  box-sizing: border-box;
}

/* placeholder */
.cp-search-input::placeholder{
  color: var(--cp-primary) !important;
  opacity: 1;
}

/* focus */
.cp-search-input:focus{
  outline: none !important;
  border-color: var(--cp-primary) !important;
  box-shadow: 0 0 0 1px rgba(var(--cp-primary-rgb), 0.35) !important;
}

/* ========================================================= 
    MUD-INPUT OUTLINED 
   ========================================================= */
/* Borde en reposo */
.cp-outlined .mud-input-outlined-border{
  border-color: #cbd5e1 !important; /* slate-300 */
  border-width: 1px !important;
  border-radius: 8px !important;
}

/* Hover */
.cp-outlined:hover .mud-input-outlined-border{
  border-color: var(--cp-primary) !important;
}

/* Focus (cuando está activo) */
.cp-outlined.mud-input-control-focused .mud-input-outlined-border{
  border-color: var(--cp-primary) !important;
  border-width: 2px !important;
}

/* Color del label */
.cp-outlined .mud-input-label{
  font-size: 14px !important;
  font-weight: 600 !important;          
  color: #656f84 !important; 
  line-height: 1.3 !important;

}

/* Label en focus */
.cp-outlined.mud-input-control-focused .mud-input-label{
  color: var(--cp-primary) !important;
  border-width: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Normaliza el texto seleccionado y el label dentro de los MudSelect cp-outlined */
.cp-outlined .mud-input-slot,
.cp-outlined .mud-select-input,
.cp-outlined input{
  font-size: 14px !important;
  line-height: 1.2 !important;
}

/**** SELECTOR DE IDIOMA *********/ 
.flag-icon {
    width: 20px;
    height: 14px;
    margin-right: 8px;
    border-radius: 2px;
    object-fit: cover;
}

.idioma-item {
    display: flex;
    align-items: center;
}

.idioma-select .mud-select-value {
    display: flex;
    align-items: center;
}

.idioma-select .mud-select-input {
    display: flex;
    align-items: center;
}


/********** MUD TEXTFIELD BORDES
/* Quitar el rectángulo azul de focus (Outlined) */
.cp-nofocus .mud-input-outlined-border{
  border-color: #cbd5e1 !important; /* gris normal */
}

/* Cuando está enfocado */
.cp-nofocus.mud-input-control-focused .mud-input-outlined-border{
  border-color: var(--cp-primary) !important;
  border-width: 1px !important;
}

/* Quita el glow / ring */
.cp-nofocus.mud-input-control-focused{
  box-shadow: none !important;
}

/* Algunos componentes añaden foco al root */
.cp-nofocus .mud-input-root:focus-within{
  box-shadow: none !important;
}

/* Para MudSelect / adornos */
.cp-nofocus.mud-input-control-focused .mud-input-adorned-end,
.cp-nofocus.mud-input-control-focused .mud-input-adorned-start{
  box-shadow: none !important;
}

/* Hover no azul */
.cp-nofocus:hover .mud-input-outlined-border{
  border-color: var(--cp-primary) !important;
}

/* CompanyUsersDialog: same header style as Usuaris grid */
.cp-users-grid-table .mud-table-head .mud-table-cell{
  background: var(--cp-primary) !important;
  color: #ffffff !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 12px;
  font-weight: 700;
  padding: 12px;
  border-right: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.cp-users-grid-table .mud-table-body .mud-table-cell{
  border-right: 1px solid #f1f5f9 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: var(--cp-primary) !important;
  padding: 12px;
}

.cp-users-grid-table .mud-table-body .mud-table-row{
  background: #ffffff;
}

.cp-users-grid-table .mud-table-body .mud-table-row:hover{
  background: #f8fafc;
}
