:root {
    --color-bg: #fdfdfb;
    --color-primary: #001a2c;   /* azul oscuro logo */
    --color-accent:  #f59b31;   /* naranja logo */
    --color-teal:    #66a697;   /* verde agua logo */
    --color-sec-teal:	#920505;   /* rojo logo */
    --color-text:    #001a2c;
    --color-muted:   #7b8794;

    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.06);
    --sidebar-width: 260px;
    --transition-fast: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    background: var(--color-bg);
    color: var(--color-text);
}

/* Layout general */

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-primary);
    color: #fdfdfb;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.25rem;
}

.sidebar__logo {
    text-align: center;
    margin-bottom: 2rem;
}

.sidebar__logo img {
    max-width: 100px; /* tamaño reducido del logo */
    height: auto;
}

/* Navegación lateral */

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
}

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

.sidebar__nav li {
    margin: 0;
    padding: 0;
}

.nav-section-title {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    margin: 1.5rem 0 0.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.nav-level-1 > li > .nav-link {
    font-weight: 500;
}

.nav-link {
    position: relative;
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin-bottom: 0.1rem;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        padding var(--transition-fast);
}

.nav-link--active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}


/* Por defecto, submenús ocultos */
.nav-level-2,
.nav-level-3 {
    margin: 0.2rem 0 0.2rem;
    padding-left: 0;
    list-style: none;
    display: none;
}

/* Cuando el li está abierto, mostrar su submenú directo */
.nav-item.nav-item-open > .nav-level-2,
.nav-item.nav-item-open > .nav-level-3 {
    display: block;
}

/* Cursor en carpetas */
.nav-link--folder {
    cursor: pointer;
}

/* Sangrado por nivel */

.nav-level-2 .nav-link {
    padding-left: 1.6rem;
    font-size: 0.88rem;
    opacity: 0.95;
}

.nav-level-3 .nav-link {
    padding-left: 2.1rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Puntos / guiones por nivel */

.nav-level-2 .nav-link::before,
.nav-level-3 .nav-link::before {
    content: "";
    position: absolute;
    left: 0.8rem;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-50%);
}

.nav-level-3 .nav-link::before {
    width: 8px;
    height: 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.4);
}

/* Carpetas con hijos: texto + caret en la misma línea */

.nav-item.has-children > .nav-link--folder {
    display: flex;
    align-items: center;
    justify-content: space-between; /* texto izquierda, caret derecha */
    gap: 0.5rem;
}

/* Caret */

.nav-caret {
    font-size: 0.95rem;     /* un poco más grande */
    margin-left: 0.5rem;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Girar caret cuando está abierto */
.nav-item.nav-item-open > .nav-link--folder .nav-caret {
    transform: rotate(180deg);
    opacity: 1;
}

/* Zona derecha: topbar + contenido */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar */

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    background: linear-gradient(
        90deg,
        rgba(0, 26, 44, 0.96),
        rgba(102, 166, 151, 0.92)
    );
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar__breadcrumb {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.btn-ghost {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    display: none; /* se activará en responsive */
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar__user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.topbar__user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
}

/* Contenido */

.content {
    padding: 1.75rem 1.75rem 2.5rem;
}

.content__header {
    margin-bottom: 1.5rem;
}

.content__title {
    margin: 0;
    font-size: 1.5rem;
}

.content__subtitle {
    margin: 0.35rem 0 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* Tarjetas dashboard */

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

.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-soft);
}

.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 0.6rem;
}

.card--highlight {
    border-left: 4px solid var(--color-accent);
    background: linear-gradient(
        135deg,
        rgba(245, 155, 49, 0.08),
        rgba(102, 166, 151, 0.08)
    );
}

/* Footer */

.footer {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0.75rem 1.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-muted);
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    
}

.footer a {
	color: rgba(102, 166, 151, 1);
	font-size: 0.9rem;
    font-weight: 700;
   
}

/* Responsive básico */

@media (max-width: 900px) {
  /* NO ocultamos con display:none, porque queremos poder abrirla */
  .sidebar {
    display: flex;
  }

  .btn-menu {
    display: inline-block;
    color: #ffffff;
  }

  .layout {
    flex-direction: column;
  }
}

/* Login */

.login-body {
    background: radial-gradient(circle at top left, rgba(245, 155, 49, 0.12), transparent),
                radial-gradient(circle at bottom right, rgba(102, 166, 151, 0.16), transparent),
                var(--color-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem 2.25rem;
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-size: 1.6rem;
    color: var(--color-primary);
}

.login-subtitle {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
}

.login-form input {
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    font-size: 0.95rem;
    outline: none;
}

.login-form input:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 2px rgba(102, 166, 151, 0.2);
}

/* Alertas */

.alert {
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.alert-error {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #a01622;
}

.alert-success {
    background: rgba(40, 167, 69, 0.08);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #216333;
}

/* ---- BOTONES GENÉRICOS ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  cursor: pointer;
  text-decoration: none;
  gap: 0.35rem;
  white-space: nowrap;

  font: inherit;          /* 👈 iguala <a> y <button> */
  line-height: 1;         /* 👈 evita descuadres */
  user-select: none;
}

.btn-primary {
  margin-top: 0; /* 👈 clave */
  background: linear-gradient(90deg, var(--color-primary), var(--color-teal));
  color: #ffffff;
  font-weight: 600;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-secondary {
  margin-top: 0; /* 👈 clave */
  background: linear-gradient(90deg, var(--color-primary), var(--color-sec-teal));
  color: #ffffff;
  font-weight: 600;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-primary:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}


.btn-sm {
    padding: 0.28rem 0.7rem;
    font-size: 0.78rem;
}

.btn-danger {
    background: #b3261e;
    color: #ffffff;
}

.btn-action {
    background: #1D21E7;
    color: #ffffff;
}


.btn-icon {
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15); /* MISMO BORDE PARA TODOS */

    background: #4c6fff; /* azul corporativo por defecto */
    color: white;

    cursor: pointer;
    transition: transform 0.15s ease;
}

.btn-icon:hover {
    transform: scale(1.07);
}

.btn-icon-primary {
    background: #4c6fff;
    color: #fff;
}

.btn-icon-primary:hover {
    opacity: 0.85;
}

.btn-icon-success {
    background: #28a745;
    color: #fff;
}

a.btn-icon {
    line-height: 1; /* evita descuadres de fuentes */
}

.btn-edit        { background: #4c6fff; }           /* azul */
.btn-message     { background: #6a7dff; }           /* azul violeta */
.btn-danger      { background: #ff4b4b; }           /* rojo */
.btn-success     { background: #28a745; }           /* verde activar */

.btn-icon-danger {
    background: #ff4b4b;
    color: #fff;
}

.btn[disabled],
.btn:disabled,
a.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.acciones-cell {
    display: flex;
    align-items: center;   /* 👈 CLAVE */
    gap: 6px;
}

.acciones-cell form {
    margin: 0;
    display: flex;         /* 👈 MUY IMPORTANTE */
    align-items: center;
}

/* ---- BARRA DE ACCIONES ---- */

.action-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0.75rem 0 1rem 0; /* top right bottom left */
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-md);
    background: linear-gradient(
        90deg,
        rgba(245, 155, 49, 0.10),
        rgba(102, 166, 151, 0.15)
    );
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.action-bar__right {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.action-bar .btn,
.action-bar .btn-primary,
.action-bar .btn-secondary {
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- FORMULARIOS (búsqueda / edición) ---- */

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

.search-form-grid{
  display:flex;
  flex-wrap:wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
  margin-bottom: 1.25rem; 
}

.search-form-grid .form-field{
  flex: 1 1 260px;   /* crece y se reparte */
  min-width: 0;
}

.search-form-grid .form-field--sm{
  flex: 0 0 220px;   /* fijo (ajusta a tu gusto) */
  max-width: none;   /* importante: en flex lo fija el flex-basis */
}

.search-form label {
    font-size: 0.8rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.2rem;
}

/* ----- CAMPOS DE FORMULARIO UNIFICADOS (MISMO TAMAÑO QUE BOTONES) ----- */

.search-form input,
.search-form select,
.search-form textarea,
.form-grid-3 input,
.form-grid-3 select,
.form-grid-3 textarea,
.form-field input,
.form-field select,
.form-field textarea,
.form-field-big input {
    width: 100%;
    padding: 0.22rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--color-text);
    background-color: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast),
                background-color var(--transition-fast);
}

/* Textareas: misma estética pero más altura y borde menos “píldora” */
.search-form textarea,
.form-grid-3 textarea,
.form-field textarea {
    height: 70px;
    padding: 0.45rem 0.9rem;
    border-radius: 12px;
    resize: vertical;
    min-height: 70px;
}

/* Focus consistente en toda la intranet */
.search-form input:focus,
.search-form select:focus,
.search-form textarea:focus,
.form-grid-3 input:focus,
.form-grid-3 select:focus,
.form-grid-3 textarea:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 2px rgba(102, 166, 151, 0.2);
}

/* Hover suave */
.search-form input:hover,
.search-form select:hover,
.search-form textarea:hover,
.form-grid-3 input:hover,
.form-grid-3 select:hover,
.form-grid-3 textarea:hover,
.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: #9ba4b5;
}

/* Select con flechita personalizada (seguimos tu estilo limpio) */
.search-form select,
.form-grid-3 select,
.form-field select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='14' viewBox='0 0 20 20' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 2.2rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ---- TABLA DE LISTADO ---- */

.table-wrapper {
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table thead {
    background: #e7eef3;
    font-weight: 600;
}

.table th,
.table td {
    padding: 0.3rem 0.45rem;
    text-align: left;
}

.table tbody tr:nth-child(even) {
    background: #fafafa;
}

.table tbody tr:hover {
    background: rgba(102, 166, 151, 0.06);
}

.table .col-actions {
    text-align: right;
    white-space: nowrap;
}

.table a {
    color: var(--color-teal);          /* el verde agua del logo */
    text-decoration: none;
    font-weight: 500;
}

.table a:hover {
    text-decoration: underline;
}

/* Alineación coherente para números (th y td) */
.table th.col-num,
.table td.col-num {
  text-align: right;
  white-space: nowrap;
}

/* Si dentro hay inputs, que ocupen ancho y no “bailen” */
.table td.col-num input,
.table td.col-num select {
  width: 100%;
  box-sizing: border-box;
  text-align: right;
}

/* Para que el padding sea el mismo y se vea “cuadrado” */
.table th, .table td {
  vertical-align: middle;
}

.section-gap{
  margin-top: 25px;
}

.section-title{
  margin: 6px 0 10px 0;
}

.section-title h4{
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
}

.table-wrap{
  margin-top: 8px;
}

.info-chips{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:14px;
}

.info-chip{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:160px;
}

.info-chip__label{
  font-size:0.78rem;
  opacity:.8;
  font-weight:600;
}

.info-chip__value{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  font-weight:700;
  font-size:0.85rem;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  border-radius:999px;
  font-weight:600;
  font-size:0.80rem;
  
}

.badge-estado {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-estado-borrador {
    background: rgba(220, 220, 10, 0.12);
    color: #aea209;
}

.badge-estado-enviado,
.badge-estado-creado,
.badge-estado-alta { 
	background: rgba(35, 197, 94, 0.12);
    color: #1e7a3a;
}
.badge-estado-cancelado,
.badge-estado-caducado,
.badge-estado-baja { 
	background: rgba(220, 53, 69, 0.12);
    color: #a01622;
 }

.badge-estado-aceptado { 
	background: #0310b4;
    color: #FFFFFF;
 }

/* Neutro */
.badge--neutral{
  background: rgba(0,0,0,0.04);
}

/* ---- FORMULARIO DE ENTIDAD (CLIENTES, ETC.) ---- */

.entity-form {
    margin-top: 0.75rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
}

.form-grid-3 label {
    font-size: 0.8rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.2rem;
}

.form-row-full {
    margin-top: 0.5rem;
}

.form-row-full .form-field {
    display: flex;
    flex-direction: column;
}

/* Responsive: en pantallas pequeñas, 1 columna */
@media (max-width: 1024px) {
    .form-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Fila de formulario (CLIENTES, etc.) */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
}

/* Campo “normal”: se estira y ocupa el espacio restante */
.form-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 260px;   /* parecido a tu minmax(230px, 1fr) anterior */
}

.form-field-big {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 700px;   
}

/* Campo pequeño (CIF, CP, teléfono…) */
.form-field--sm {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;    /* no se estira */
    max-width: 180px;  /* ancho compacto en escritorio */
}


/* Campo pequeño (CIF, CP, teléfono…) */
.form-field--mini {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;    
    max-width: 100px;  
}

/* En móvil / tablet: todo a ancho completo */
@media (max-width: 1024px) {
    .form-row {
        flex-direction: column;
    }

    .form-field,
    .form-field--sm {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.form-field label {
    font-size: 0.8rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.2rem;
}

.form-field--sm label {
    font-size: 0.8rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.2rem;
}

.form-readonly {
    padding: 0.22rem 0.75rem;
    border-radius: 999px;
    background: #f2f2f2;
    color: #555;
    font-size: 0.82rem;
}

/* ----- PAGINACIÓN ----- */

.pagination-wrapper {
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;   /* texto izq, controles dcha */
    align-items: center;
    font-size: 0.85rem;
}

.pagination-info {
    color: var(--color-muted);
    font-size: 0.8rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;                      /* separación entre elementos */
    font-size: 0.8rem;
}

.pagination-controls a,
.pagination-controls .current-page {
    padding: 0.20rem 0.40rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.82rem;
}

/* Enlaces normales */
.pagination-controls a {
    color: var(--color-primary);
    border: 1px solid transparent;
}

.pagination-controls a:hover {
    background: rgba(0, 26, 44, 0.06);
    border-color: rgba(0, 26, 44, 0.15);
}

/* Página actual con recuadro */
.pagination-controls .current-page {
    border: 1px solid var(--color-primary);
    background: #ffffff;
    color: var(--color-primary);
    font-weight: 600;
}

/* Selector "Mostrar X registros" encima de la tabla */
.page-size-top {
    margin-top: 0.5rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.page-size-top select {
    width: auto;
    min-width: 70px;
}

/* ---- ESTADO DE ERROR EN CAMPOS ---- */

.is-invalid {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.18);
}

.field-error {
    margin-top: 0.2rem;
    color: #c0392b;
    font-size: 0.75rem;
}

/* ===== NOTIFICACIONES GLOBALES (TOASTS) ===== */

.ip-toast-container {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none; /* no bloquea clics en la página */
}

.ip-toast {
    min-width: 320px;
    max-width: 600px;
    padding: 0.75rem 1.3rem;
    border-radius: 16px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(-10px);
    animation:
        ip-toast-in 0.25s ease-out forwards,
        ip-toast-out 0.6s ease-in forwards 4.4s; /* empieza a desvanecerse a los 4.4s */
}

.ip-toast__message {
    flex: 1;
}

.ip-toast__close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    pointer-events: auto; /* sí permite clic en la X */
}

/* Tipos de notificación */
.ip-toast--success {
    background: linear-gradient(
        90deg,
        rgba(46, 204, 113, 0.90),
        rgba(102, 166, 151, 0.92)
    );
}

.ip-toast--warning {
    background: linear-gradient(
        90deg,
        rgba(245, 155, 49, 0.94),
        rgba(243, 156, 18, 0.90)
    );
}

.ip-toast--error {
    background: linear-gradient(
        90deg,
        rgba(192, 57, 43, 0.94),
        rgba(146, 5, 5, 0.95)
    );
}

/* Animaciones */
@keyframes ip-toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ip-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ===== MODAL GENÉRICO IMPULSYS ===== */

.modal-open {
    overflow: hidden;
}

.ip-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.ip-modal-overlay.is-visible {
    display: flex;
}

.ip-modal {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    width: min(760px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ip-modal__header {
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ip-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.ip-modal__body {
    padding: 0.9rem 1.1rem 0.5rem;
    overflow-y: auto;
}

.ip-modal__footer {
    padding: 0.65rem 1.1rem 0.9rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Fila de formulario dentro del modal: reutiliza tu form-row */
.ip-modal .form-row {
    margin-bottom: 0.55rem;
}

/* Etiquetas de solo lectura en línea dentro del modal */
.ip-modal .form-readonly {
    padding: 0.22rem 0.75rem;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 0.82rem;
}

/* Botón X del modal */
.ip-modal__close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--color-muted);
}

/* ===== FORZAR MISMO ESTILO QUE LOS INPUTS REDONDEADOS ===== */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 999px !important;

    padding: 0.22rem 0.75rem !important;  /* mismo tamaño que los demás */
    height: 25px !important;             /* fuerza altura idéntica */
    line-height: 1 !important;

    font-size: 0.82rem !important;       /* coincidir con inputs */
    font-family: inherit !important;
    color: #202020;

    box-sizing: border-box !important;
    width: 100%;
}


input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;              /* más discreto */
    margin-right: 4px;
}

input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

input[type="datetime-local"]:focus {
    outline: none !important;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 2px rgba(102, 166, 151, 0.25);
}

/* ====== ESTILIZAR EL CALENDARIO NATIVO (CHROME / EDGE / WEBKIT) ====== */

/* Fondo del calendario */
input[type="date"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit {
    padding: 0.2rem 0.4rem;
}

/* Contenedor del calendario */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.4);
    opacity: 0.9;
}

/* === CAJA COMPLETA DEL CALENDARIO === */
::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* === APLICAR BORDE AL PANEL EMERGENTE === */

::-webkit-datetime-calendar {
    border: 2px solid #4a90e2 !important;        /* color del borde */
    border-radius: 12px !important;              /* redondeo */
    background-color: white !important;
    overflow: hidden !important;
}

/* Bordes internos */
::-webkit-datetime-calendar thead,
::-webkit-datetime-calendar tbody {
    border-color: rgba(0,0,0,0.15) !important;
}

/* por defecto */
.sidebar-overlay { display: none; }

/* móvil */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-105%);
    transition: transform .2s ease;
    z-index: 10000;
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 9999;
  }

  .sidebar-overlay.sidebar-overlay--show {
    display: block;
  }
}

/* ===== MODAL ENVIAR PRESUPUESTO (AJUSTES) ===== */

#modalEnviarOverlay .ip-modal {
    max-height: 95vh;        /* un poco más alto */
}

#modalEnviarOverlay .ip-modal__body {
    max-height: calc(95vh - 120px); /* header + footer aprox */
}

/* textarea del cuerpo del email: más alto por defecto */
#modalEnviarOverlay textarea#emailCuerpo {
    min-height: 180px;
    resize: vertical;        /* permitimos crecer si quiere */
}