:root {
    --brand-900: #7f0000;
    --brand-800: #991b1b;
    --brand-700: #b91c1c;
    --slate-900: #0f172a;
    --slate-700: #334155;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --white: #ffffff;
    --green-100: #dcfce7;
    --green-700: #15803d;
    --yellow-100: #fef3c7;
    --yellow-700: #b45309;
    --blue-100: #dbeafe;
    --blue-700: #1d4ed8;
    --gray-100: #e5e7eb;
    --gray-700: #374151;
    --red-100: #fee2e2;
    --red-700: #b91c1c;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #fff8f8 0%, #f8fafc 35%, #eef2ff 100%);
    color: var(--slate-900);
}

a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
    background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-800) 60%, #7f1d1d 100%);
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.12); }
.brand-badge { width: 3rem; height: 3rem; border-radius: 1rem; background: rgba(255,255,255,0.18); display: grid; place-items: center; font-weight: 700; }
.brand-title { font-size: 1rem; font-weight: 800; letter-spacing: 0.08em; display: flex; align-items: center; gap: 0.45rem; }
.country-flag-icon { display: inline-block; width: 1.4rem; height: 1.05rem; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.35); vertical-align: middle; flex-shrink: 0; }
.brand-title .country-flag-icon { width: 1.45rem; height: 1.05rem; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.45); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.country-badge-flag .country-flag-icon { width: 1.25rem; height: 0.95rem; border: 1px solid rgba(15, 23, 42, 0.12); }
.country-option .country-flag-icon { width: 1.6rem; height: 1.2rem; border: 1px solid rgba(15, 23, 42, 0.12); }
.brand-subtitle { text-transform: uppercase; letter-spacing: 0.28em; color: #fecaca; font-size: 0.78rem; }
.role-panel { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.08); border-radius: 1rem; padding: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.role-panel-actions { margin-top: 0.45rem; display: flex; }
.role-tutorial-button { width: 100%; display: flex; align-items: center; gap: 0.8rem; justify-content: flex-start; padding: 0.88rem 1rem; background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%); border: 1px solid rgba(251,191,36,0.62); color: #4a1d06; box-shadow: 0 16px 30px rgba(120,53,15,0.26); transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.role-tutorial-button:hover { background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%); border-color: rgba(254,215,170,0.95); color: #4a1d06; transform: translateY(-1px); box-shadow: 0 18px 34px rgba(120,53,15,0.3); }
.role-tutorial-icon { width: 2.45rem; height: 2.45rem; flex-shrink: 0; border-radius: 0.9rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.34); border: 1px solid rgba(255,251,235,0.92); color: #7c2d12; font-size: 1.1rem; }
.role-tutorial-label { min-width: 0; flex: 1; font-size: 0.96rem; line-height: 1.1; font-weight: 800; letter-spacing: 0.01em; text-align: left; }
.role-tutorial-arrow { width: 1.9rem; height: 1.9rem; flex-shrink: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.4); color: #7c2d12; transition: transform 0.2s ease, background 0.2s ease; }
.role-tutorial-button:hover .role-tutorial-arrow { transform: translateX(2px); background: rgba(255,255,255,0.52); }
.role-chip { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.18em; color: #fecaca; }
.role-name { margin: 0.4rem 0 0; font-weight: 700; }
.nav-menu { display: flex; flex-direction: column; gap: 0.35rem; }
.nav-link { padding: 0.95rem 1rem; border-radius: 1rem; color: rgba(255,255,255,0.7); font-weight: 600; }
.nav-link.active, .nav-link:hover { background: rgba(255,255,255,0.14); color: var(--white); }
.content-shell { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--slate-200);
}
.topbar-kicker { margin: 0; color: var(--brand-700); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; }
.topbar-title { margin: 0.2rem 0 0; font-size: 1.15rem; }
.topbar-user { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; border-radius: 999px; background: var(--white); border: 1px solid var(--slate-200); color: var(--slate-700); font-weight: 600; }
.status-dot { width: 0.6rem; height: 0.6rem; background: #22c55e; border-radius: 999px; }
.page-body { padding: 2rem; }
.page-section { display: flex; flex-direction: column; gap: 1.5rem; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-heading h1 { margin: 0; font-size: 2rem; color: var(--brand-900); }
.page-heading p { margin: 0.35rem 0 0; color: var(--slate-500); }
.panel-card, .appointment-card, .modal-card, .stat-card, .loading-card { background: rgba(255,255,255,0.92); border: 1px solid rgba(226,232,240,0.9); border-radius: 1.4rem; box-shadow: var(--shadow); }
.panel-card, .loading-card { padding: 1.5rem; }
.accent-panel { background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%); }
.panel-card-header h3 { margin: 0; }
.panel-card-header p { margin: 0.25rem 0 0; color: var(--slate-500); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { padding: 1.25rem; }
.stat-card span { display: block; color: var(--slate-500); font-size: 0.9rem; }
.stat-card strong { display: block; margin-top: 0.4rem; font-size: 2rem; color: var(--brand-900); }
.two-column { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; }
.list-stack { display: flex; flex-direction: column; gap: 1rem; }
.appointment-card { padding: 1.25rem; }
.appointment-card.compact { display: flex; justify-content: space-between; align-items: center; }
.appointment-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.appointment-main p, .appointment-main small { display: block; color: var(--slate-500); margin-top: 0.35rem; }
.badge-row, .checkbox-grid, .card-actions, .filter-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.badge-row { margin-top: 1rem; }
.soft-badge, .status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.45rem 0.8rem; font-size: 0.82rem; font-weight: 700; }
.soft-badge { background: var(--slate-100); color: var(--slate-700); }
.soft-badge.warning { background: #fff7ed; color: var(--yellow-700); }
.quality-video-badge {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.1;
    padding: 0.72rem 1.15rem;
    box-shadow: 0 8px 18px rgba(22, 101, 52, 0.14);
}

.quality-video-date {
    background: #bbf7d0;
    color: #14532d;
    font-size: 1.06rem;
    font-weight: 850;
}
.status-pending { background: var(--yellow-100); color: var(--yellow-700); }
.status-confirmed { background: var(--blue-100); color: var(--blue-700); }
.status-approved { background: var(--green-100); color: var(--green-700); }
.status-completed { background: var(--gray-100); color: var(--gray-700); }
.status-rejected { background: var(--red-100); color: var(--red-700); }
button, input, select, textarea { font: inherit; }
.primary-button, .secondary-button, .success-button, .danger-button, .ghost-button, .filter-chip { border: 0; border-radius: 0.95rem; padding: 0.85rem 1rem; font-weight: 700; cursor: pointer; }
.primary-button { background: var(--brand-900); color: var(--white); }
.secondary-button { background: var(--slate-900); color: var(--white); }
.success-button { background: #15803d; color: var(--white); }
.danger-button { background: var(--red-700); color: var(--white); }
.ghost-button, .filter-chip { background: var(--white); color: var(--slate-700); border: 1px solid var(--slate-200); }
.filter-chip.active { background: var(--brand-900); color: var(--white); border-color: var(--brand-900); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: grid; place-items: center; padding: 1.5rem; z-index: 50; }
.modal-card { width: min(820px, 100%); padding: 1.5rem; }
.tutorial-modal-card { width: min(1240px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.75rem; }
.tutorial-learning-modal { background: radial-gradient(circle at top right, rgba(254,226,226,0.72), transparent 26%), radial-gradient(circle at bottom left, rgba(219,234,254,0.68), transparent 24%), linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,250,252,0.99) 100%); border: 1px solid rgba(255,255,255,0.92); box-shadow: 0 32px 80px rgba(15,23,42,0.24); }
.tutorial-modal-header { align-items: flex-start; margin-bottom: 0; padding-bottom: 1.25rem; border-bottom: 1px solid rgba(226,232,240,0.9); }
.tutorial-modal-intro { display: flex; flex-direction: column; gap: 0.4rem; }
.tutorial-modal-intro h3 { font-size: 1.7rem; letter-spacing: -0.03em; }
.tutorial-modal-intro p { max-width: 44rem; font-size: 0.98rem; color: var(--slate-600); }
.tutorial-modal-kicker { display: inline-flex; align-items: center; width: fit-content; padding: 0.42rem 0.82rem; border-radius: 999px; background: linear-gradient(135deg, rgba(127,0,0,0.1) 0%, rgba(251,191,36,0.14) 100%); border: 1px solid rgba(127,0,0,0.12); color: var(--brand-700); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.tutorial-close-button { flex-shrink: 0; padding-inline: 1.15rem; min-height: 3.3rem; background: rgba(255,255,255,0.82); box-shadow: 0 16px 32px rgba(15,23,42,0.08); }
.tutorial-modal-body { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 1.25rem; }
.tutorial-role-selector, .tutorial-preview-card, .tutorial-repository-card, .tutorial-editor-grid, .tutorial-editor-actions, .tutorial-status-message { margin-top: 1rem; }
.tutorial-control-card, .tutorial-repository-card, .tutorial-editor-card { padding: 1.2rem; background: rgba(255,255,255,0.78); backdrop-filter: blur(12px); }
.tutorial-control-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tutorial-control-badge { background: rgba(127,0,0,0.08); color: var(--brand-800); border: 1px solid rgba(127,0,0,0.12); }
.tutorial-preview-card { padding: 1.45rem; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1rem; }
.tutorial-preview-header { margin-bottom: 0; padding-bottom: 0.2rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tutorial-preview-heading { display: flex; flex-direction: column; gap: 0.35rem; }
.tutorial-preview-heading h3 { font-size: clamp(1.45rem, 2vw, 1.9rem); letter-spacing: -0.03em; }
.tutorial-preview-heading p { font-size: 0.96rem; color: var(--slate-500); }
.tutorial-preview-kicker { display: inline-flex; align-items: center; width: fit-content; padding: 0.36rem 0.68rem; border-radius: 999px; background: rgba(255,255,255,0.72); color: var(--brand-700); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.tutorial-preview-badge { background: rgba(127,0,0,0.08); color: var(--brand-800); border: 1px solid rgba(127,0,0,0.14); }
.tutorial-preview-note { margin: 0; color: var(--slate-600); line-height: 1.6; }
.tutorial-preview-lead { font-size: 0.98rem; color: var(--slate-700); max-width: 44rem; }
.tutorial-preview-media { width: min(100%, 980px); margin: 0.35rem auto 0; align-self: center; }
.tutorial-preview-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-start; }
.tutorial-media-shell { width: 100%; flex: 1; padding: 0.95rem; border-radius: 1.2rem; background: linear-gradient(180deg, rgba(30,41,59,0.96) 0%, rgba(2,6,23,0.98) 100%); border: 1px solid rgba(255,255,255,0.06); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 22px 50px rgba(2,6,23,0.32); }
.tutorial-media-frame { width: 100%; height: 100%; min-height: clamp(400px, 50vh, 620px); aspect-ratio: 16 / 9; border-radius: 1rem; overflow: hidden; background: radial-gradient(circle at top, #111827 0%, #020617 100%); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 18px 40px rgba(2,6,23,0.36); display: grid; place-items: center; }
.tutorial-video-frame, .tutorial-video-player { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.tutorial-video-player { object-fit: contain; }
.tutorial-management-grid { display: grid; grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr); gap: 1.2rem; align-items: start; }
.tutorial-repository-meta, .tutorial-repository-grid { margin-top: 1rem; }
.tutorial-repository-note { margin-top: 1rem; }
.tutorial-editor-card { background: rgba(255,255,255,0.86); }
.tutorial-editor-actions { justify-content: space-between; align-items: center; padding-top: 0.35rem; }
.tutorial-status-message { border-radius: 1rem; box-shadow: 0 14px 30px rgba(15,23,42,0.08); }
.tutorial-empty-state { min-height: 240px; border: 1px dashed rgba(148,163,184,0.36); border-radius: 1.2rem; background: rgba(255,255,255,0.55); }
.tutorial-stage-empty { margin-top: 0; min-height: 340px; background: linear-gradient(180deg, rgba(30,41,59,0.74) 0%, rgba(2,6,23,0.92) 100%); border-color: rgba(255,255,255,0.08); color: #e2e8f0; display: grid; place-items: center; padding: 1.5rem; text-align: center; }
.tutorial-stage-empty i { font-size: 2rem; color: #fda4af; }
.tutorial-stage-empty div { display: flex; flex-direction: column; gap: 0.45rem; align-items: center; }
.tutorial-stage-empty strong { color: #fff; font-size: 1.05rem; }
.tutorial-stage-empty span { max-width: 24rem; color: #cbd5e1; line-height: 1.55; }
.modal-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-header h3 { margin: 0; color: var(--brand-900); }
.modal-header p { margin: 0.35rem 0 0; color: var(--slate-500); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid label, .field-label { display: flex; flex-direction: column; gap: 0.45rem; color: var(--slate-700); font-weight: 600; }
.full-width { grid-column: 1 / -1; }
input, select, textarea { border: 1px solid var(--slate-200); border-radius: 0.9rem; padding: 0.85rem 0.95rem; background: var(--white); }
.checkbox-chip { display: inline-flex; align-items: center; gap: 0.65rem; padding: 0.8rem 1rem; border-radius: 1rem; background: var(--white); border: 1px solid var(--slate-200); color: var(--slate-700); }
.important-chip { border-color: #fdba74; background: #fff7ed; }
.new-tech-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.plain-list { margin: 0; padding-left: 1.1rem; color: var(--slate-700); }
.plain-list li + li { margin-top: 0.6rem; }

@media (max-width: 1024px) {
    .shell, .stats-grid, .two-column, .form-grid, .new-tech-row { grid-template-columns: 1fr; }
    .page-body, .topbar { padding: 1rem; }
    .tutorial-modal-card { width: min(100%, calc(100vw - 1rem)); max-height: calc(100vh - 1rem); padding: 1rem; }
    .tutorial-modal-header, .tutorial-control-header, .tutorial-preview-header, .tutorial-editor-actions { flex-direction: column; align-items: stretch; }
    .tutorial-close-button { width: 100%; justify-content: center; }
    .tutorial-management-grid { grid-template-columns: 1fr; }
    .tutorial-media-shell { padding: 0.75rem; }
    .tutorial-preview-media { width: 100%; }
    .tutorial-media-frame, .tutorial-stage-empty { min-height: clamp(240px, 42vh, 420px); aspect-ratio: 16 / 10; }
    .tutorial-preview-actions { justify-content: stretch; }
}

/* El menu lateral NO se oculta aqui: en movil es un panel deslizable (reglas de max-width: 980px).
   Ocultarlo con display:none dejaba el panel abierto pero vacio. Entre 981 y 1024px se mantiene la rejilla de escritorio. */
@media (min-width: 981px) and (max-width: 1024px) {
    .shell { grid-template-columns: 272px minmax(0, 1fr); }
    .shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
}


/* ==========================================================================
   SUPPLIER RESOURCES & COMPLIANCE STYLES
   ========================================================================== */

.supplier-hero-card {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 50%, #4c0519 100%);
    color: #ffffff;
    border-radius: 1.25rem;
    padding: 1.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 25px -5px rgba(185, 28, 28, 0.3), 0 8px 10px -6px rgba(185, 28, 28, 0.2);
    margin-bottom: 1.25rem;
}

.supplier-hero-content {
    flex: 1;
}

.supplier-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
}

.supplier-hero-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0.6rem 0 0.35rem 0;
    color: #ffffff;
    line-height: 1.2;
}

.supplier-hero-content p {
    margin: 0;
    font-size: 0.92rem;
    color: #fecaca;
    max-width: 48rem;
    line-height: 1.5;
}

.supplier-hero-tax {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    gap: 1rem;
}

.supplier-completion-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.1rem;
    padding: 1.25rem 1.75rem;
    min-width: 220px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.supplier-completion-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fecaca;
}

.supplier-completion-value {
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1;
    margin: 0.35rem 0 0.75rem 0;
    color: #ffffff;
}

.compliance-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    overflow: hidden;
}

.compliance-progress-bar-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* Account status banners */
.account-status-alert {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-radius: 0.9rem;
    padding: 0.9rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.account-status-alert.warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
}

.account-status-alert.pending {
    background: #fefce8;
    border: 1px solid #fef08a;
    color: #854d0e;
}

.account-status-alert.danger {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
}

.account-status-alert i {
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Certifications view */
.certifications-container {
    padding: 1.5rem 0;
}

.certification-item-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    padding: 1.1rem 1.35rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    transition: all 0.2s ease;
}

.certification-item-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.certification-item-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.certification-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #b91c1c;
    cursor: pointer;
}

.certification-item-info strong {
    font-size: 1rem;
    color: var(--slate-900);
    display: block;
}

.certification-item-info span {
    font-size: 0.82rem;
    color: var(--slate-500);
}

.certification-item-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.certification-date-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--slate-700);
}

.certification-date-picker input {
    padding: 0.45rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    border: 1px solid var(--slate-200);
}

/* Products table */
.products-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.products-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    overflow: hidden;
}

.products-table th {
    background: #f8fafc;
    padding: 0.85rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--slate-700);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--slate-200);
    text-align: left;
}

.products-table td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--slate-100);
    font-size: 0.9rem;
    color: var(--slate-700);
    vertical-align: middle;
}

.products-table tr:last-child td {
    border-bottom: none;
}

.products-table tr:hover td {
    background: #fafafa;
}

.item-compliance-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    font-weight: 700;
    font-size: 0.82rem;
}

.item-compliance-pill.high {
    background: #dcfce7;
    color: #15803d;
}

.item-compliance-pill.medium {
    background: #fef3c7;
    color: #b45309;
}

.item-compliance-pill.low {
    background: #fee2e2;
    color: #b91c1c;
}

.item-expired-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.item-modal-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.item-modal-hero-copy h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
}

.item-modal-hero-copy p {
    margin: 0.25rem 0 0;
    color: #94a3b8;
    font-size: 0.85rem;
}

.item-modal-compliance {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.85rem;
    padding: 0.75rem 1.25rem;
    min-width: 180px;
    text-align: center;
}

.item-modal-compliance-percent {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.item-modal-compliance span {
    font-size: 0.75rem;
    color: #cbd5e1;
}


/* ==========================================================================
   PROVCONTROL SUPPLIER RESOURCES & COMPLIANCE (ENHANCED UI)
   ========================================================================== */

.supplier-hero-card {
    background: linear-gradient(135deg, #8f1212 0%, #6f0a0a 50%, #4d0707 100%) !important;
    color: #ffffff !important;
    border-radius: 1.25rem !important;
    padding: 1.75rem 2rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 2rem !important;
    box-shadow: 0 14px 30px rgba(111, 10, 10, 0.25) !important;
    margin-bottom: 1.25rem !important;
}

.supplier-hero-content {
    flex: 1 !important;
}

.supplier-hero-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.8rem !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
}

.supplier-hero-content h2 {
    font-size: 1.85rem !important;
    font-weight: 800 !important;
    margin: 0.6rem 0 0.35rem 0 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
}

.supplier-hero-content p {
    margin: 0 !important;
    font-size: 0.95rem !important;
    color: #fecaca !important;
    max-width: 48rem !important;
    line-height: 1.5 !important;
}

.supplier-hero-tax {
    margin-top: 0.75rem !important;
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1.25rem !important;
}

.supplier-hero-tax span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
}

.supplier-completion-box {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 1.1rem !important;
    padding: 1.25rem 1.75rem !important;
    min-width: 230px !important;
    text-align: center !important;
    backdrop-filter: blur(10px) !important;
}

.supplier-completion-label {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #fecaca !important;
}

.supplier-completion-value {
    font-size: 2.85rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    margin: 0.35rem 0 0.75rem 0 !important;
    color: #ffffff !important;
}

.compliance-progress-bar-bg {
    width: 100% !important;
    height: 8px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 9999px !important;
    overflow: hidden !important;
}

.compliance-progress-bar-fill {
    height: 100% !important;
    background: #ffffff !important;
    border-radius: 9999px !important;
    transition: width 0.4s ease !important;
}

/* Account status banners */
.account-status-alert {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    border-radius: 0.95rem !important;
    padding: 0.9rem 1.25rem !important;
    margin-bottom: 1.1rem !important;
    font-size: 0.9rem !important;
}

.account-status-alert.warning {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
}

.account-status-alert.danger {
    background: #fef2f2 !important;
    border: 1px solid #fee2e2 !important;
    color: #991b1b !important;
}

.account-status-alert i {
    font-size: 1.45rem !important;
    flex-shrink: 0 !important;
}

.account-status-alert strong {
    font-weight: 800 !important;
    display: inline !important;
    margin-right: 0.35rem !important;
}

/* Certifications Container & Card */
.certifications-container {
    padding: 0.5rem 0 1rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
}

.certification-item-card {
    background: #ffffff !important;
    border: 1px solid var(--field-border, #e2e8f0) !important;
    border-radius: 1rem !important;
    padding: 1.1rem 1.35rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1.25rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
}

.certification-item-card:hover {
    border-color: rgba(177, 31, 31, 0.3) !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06) !important;
}

.certification-item-left {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.certification-checkbox {
    width: 1.3rem !important;
    height: 1.3rem !important;
    accent-color: #8f1212 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.certification-item-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.15rem !important;
    min-width: 0 !important;
}

.certification-item-info strong {
    font-size: 1rem !important;
    color: var(--ink-950, #111827) !important;
    font-weight: 800 !important;
}

.certification-item-info span {
    font-size: 0.82rem !important;
    color: var(--ink-500, #64748b) !important;
}

.certification-item-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    flex-shrink: 0 !important;
}

.certification-date-picker {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.85rem !important;
    color: var(--ink-700, #334155) !important;
    background: #f8fafc !important;
    padding: 0.35rem 0.65rem !important;
    border-radius: 0.75rem !important;
    border: 1px solid var(--field-border, #e2e8f0) !important;
}

.certification-date-picker input {
    padding: 0.35rem 0.55rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.85rem !important;
    border: 1px solid var(--field-border, #cbd5e1) !important;
    background: #ffffff !important;
}

/* Products Table */
.products-table-container {
    overflow-x: auto !important;
    margin-top: 1rem !important;
    border-radius: 1rem !important;
    border: 1px solid var(--field-border, #e2e8f0) !important;
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
}

.products-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.products-table th {
    background: #f8fafc !important;
    padding: 0.95rem 1.15rem !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    color: var(--ink-700, #334155) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-bottom: 1px solid var(--field-border, #e2e8f0) !important;
    text-align: left !important;
}

.products-table td {
    padding: 1rem 1.15rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 0.9rem !important;
    color: var(--ink-700, #334155) !important;
    vertical-align: middle !important;
}

.products-table tr:last-child td {
    border-bottom: none !important;
}

.products-table tr:hover td {
    background: #fbfcfe !important;
}

.item-compliance-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    border-radius: 9999px !important;
    padding: 0.3rem 0.75rem !important;
    font-weight: 800 !important;
    font-size: 0.82rem !important;
}

.item-compliance-pill.high {
    background: #dcfce7 !important;
    color: #15803d !important;
}

.item-compliance-pill.medium {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

.item-compliance-pill.low {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.item-expired-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.65rem !important;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
}

.item-modal-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
    border-radius: 1rem !important;
    padding: 1.25rem 1.5rem !important;
    margin-bottom: 1.25rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

.item-modal-hero-copy h3 {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
}

.item-modal-hero-copy p {
    margin: 0.25rem 0 0 !important;
    color: #94a3b8 !important;
    font-size: 0.85rem !important;
}

.item-modal-compliance {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 0.85rem !important;
    padding: 0.75rem 1.25rem !important;
    min-width: 190px !important;
    text-align: center !important;
}

.item-modal-compliance-percent {
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    line-height: 1 !important;
    margin-bottom: 0.35rem !important;
}

.item-modal-compliance span {
    font-size: 0.75rem !important;
    color: #cbd5e1 !important;
}

@media (max-width: 768px) {
    .supplier-hero-card {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 1.25rem !important;
    }
    .supplier-completion-box {
        min-width: 0 !important;
        width: 100% !important;
    }
    .certification-item-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.85rem !important;
    }
    .certification-item-right {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

/* =========================================================
   ENHANCED PREVIEW MODAL & EXPIRED DOCUMENTS MODAL
   ========================================================= */
.resource-preview-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(6px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2000 !important;
    padding: 1.25rem !important;
}

.resource-preview-modal {
    width: min(96vw, 1250px) !important;
    max-width: 1250px !important;
    height: 92vh !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.resource-preview-header {
    padding: 1rem 1.5rem !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.resource-preview-body {
    flex: 1 1 0% !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #f1f5f9 !important;
    position: relative !important;
}

.resource-preview-body iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    border: none !important;
    display: block !important;
}

.dialog-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    padding: 1.5rem !important;
}

.dialog-card {
    background: #ffffff !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
    width: 100% !important;
    max-width: 560px !important;
    overflow: hidden !important;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.resource-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(5px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    padding: 1.25rem !important;
}

.resource-modal-priority {
    z-index: 3500 !important;
}

.resource-preview-backdrop {
    z-index: 4000 !important;
}

.resource-modal-nested {
    z-index: 5000 !important;
}

/* ==========================================================================
   TOPBAR HEADER BREADCRUMB
   ========================================================================== */
.topbar-header-info {
    display: flex;
    align-items: center;
    min-width: 0;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    line-height: 1;
}

.topbar-kicker-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.72rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.12), rgba(239, 68, 68, 0.08));
    border: 1px solid rgba(185, 28, 28, 0.22);
    color: var(--brand-700, #b91c1c);
    font-weight: 850;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.topbar-kicker-pill i {
    font-size: 0.82rem;
    color: var(--brand-700, #b91c1c);
}

.topbar-kicker-sep {
    color: var(--ink-500, #94a3b8);
    font-size: 0.82rem;
    opacity: 0.5;
    user-select: none;
}

.topbar-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink-700, #334155);
    font-weight: 750;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.65rem;
    border-radius: 0.55rem;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid rgba(100, 116, 139, 0.12);
}

.topbar-breadcrumb-item i {
    font-size: 0.95rem;
    color: var(--brand-700, #b91c1c);
}

/* Dark mode styling */
html[data-theme="dark"] .topbar-kicker-pill {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(248, 113, 113, 0.32);
    color: #fca5a5;
}

html[data-theme="dark"] .topbar-kicker-pill i {
    color: #fca5a5;
}

html[data-theme="dark"] .topbar-breadcrumb-item {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .topbar-breadcrumb-item i {
    color: #f87171;
}

/* Responsive adjustments */
@media (max-width: 980px) {
    .topbar-header-info {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .topbar-header-info {
        width: 100%;
    }
    .topbar-breadcrumb {
        gap: 0.4rem;
    }
}

/* ==========================================================================
   PAGE HEADING (MODERN EXECUTIVE TITLE & ACCENT BAR)
   ========================================================================== */
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    position: relative;
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
}

.page-heading > div:first-child {
    position: relative;
    padding-left: 1.25rem;
    border-left: 4.5px solid var(--brand-700, #b91c1c);
    border-radius: 2px;
    min-width: 0;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(1.85rem, 2.8vw, 2.35rem) !important;
    font-weight: 850 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.18 !important;
    background: linear-gradient(135deg, var(--brand-950, #4d0707) 0%, var(--brand-900, #6f0a0a) 45%, var(--brand-700, #b11f1f) 100%);
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: var(--brand-900, #6f0a0a);
}

.page-heading p {
    margin: 0.45rem 0 0 !important;
    color: var(--ink-500, #64748b) !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.55 !important;
    max-width: 60rem !important;
}

.eyebrow,
.page-eyebrow,
.resource-eyebrow {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    margin-bottom: 0.5rem !important;
    padding: 0.25rem 0.72rem !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.1), rgba(239, 68, 68, 0.05)) !important;
    border: 1px solid rgba(185, 28, 28, 0.2) !important;
    color: var(--brand-700, #b91c1c) !important;
    font-size: 0.72rem !important;
    font-weight: 850 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
}

.eyebrow i,
.page-eyebrow i,
.resource-eyebrow i {
    font-size: 0.85rem !important;
    color: var(--brand-700, #b91c1c) !important;
}

/* Dark mode overrides for page heading */
html[data-theme="dark"] .page-heading > div:first-child {
    border-left-color: #f87171 !important;
}

html[data-theme="dark"] .page-heading h1 {
    background: linear-gradient(135deg, #ffffff 0%, #fca5a5 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .page-heading p {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .page-eyebrow,
html[data-theme="dark"] .resource-eyebrow {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .eyebrow i,
html[data-theme="dark"] .page-eyebrow i,
html[data-theme="dark"] .resource-eyebrow i {
    color: #fca5a5 !important;
}

/* Responsive adjustments */
@media (max-width: 760px) {
    .page-heading {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.85rem !important;
    }
    .page-heading > div:first-child {
        padding-left: 1rem !important;
        border-left-width: 3.5px !important;
    }
    .page-heading h1 {
        font-size: 1.6rem !important;
    }
}

/* ==========================================================================
   ENHANCED MOBILE COMPATIBILITY & MODERN TOUCH ERGONOMICS
   ========================================================================== */

/* Smooth momentum scrolling for responsive tables */
.table-responsive,
.data-table-container,
.table-container {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    /* Touch target ergonomics for inputs and buttons */
    button, 
    .primary-button, 
    .secondary-button, 
    .ghost-button, 
    .success-button, 
    .danger-button {
        min-height: 44px;
        touch-action: manipulation;
    }

    input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    }

    /* Transform floating centered modals into native-feeling Bottom Sheets */
    .modal-backdrop {
        padding: 0 !important;
        align-items: flex-end !important;
        background: rgba(15, 23, 42, 0.65) !important;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .modal-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-top-left-radius: 1.5rem !important;
        border-top-right-radius: 1.5rem !important;
        padding: 1.25rem 1rem !important;
        margin: 0 !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25) !important;
        animation: slideUpBottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Small handle at the top of the modal bottom sheet */
    .modal-card::before {
        content: "";
        display: block;
        width: 38px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 9999px;
        margin: -0.25rem auto 0.75rem auto;
    }

    /* Grid layouts single column on small screens */
    .form-grid,
    .filter-grid,
    .controls-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Action bar on cards wrap gracefully */
    .card-actions,
    .visit-card-actions,
    .gate-visit-actions {
        flex-direction: column !important;
        width: 100% !important;
    }

    .card-actions > button,
    .visit-card-actions > button {
        width: 100% !important;
    }
}

@keyframes slideUpBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}


/* ===== Tipo de proveedor: etiqueta y filtro (listado de Proveedores) ===== */
.supplier-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}
.supplier-type-badge.productos { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.supplier-type-badge.trabajos { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.supplier-type-badge.transportista { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.supplier-type-badge.none { background: #fffbeb; color: #a16207; border-color: #fde68a; }

.supplier-type-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.supplier-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.supplier-type-chip:hover { border-color: #fca5a5; }
.supplier-type-chip.active { background: #7f1d1d; border-color: #7f1d1d; color: #ffffff; }
.supplier-type-count {
    min-width: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.72rem;
    text-align: center;
}
.supplier-type-chip.active .supplier-type-count { background: rgba(255, 255, 255, 0.22); }

/* ===== Modo oscuro =====
   Este archivo se carga después de site.css y fija fondos blancos y textos oscuros para el modo claro
   (.panel-card, .stat-card, .modal-card…): sin estas reglas el modo oscuro mostraba paneles blancos,
   números en rojo oscuro sobre fondo oscuro y textos sin contraste. */
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .appointment-card,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .loading-card {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(51, 65, 85, 0.85);
    color: #e2e8f0;
}
html[data-theme="dark"] .accent-panel { background: linear-gradient(135deg, rgba(69, 10, 10, 0.55) 0%, rgba(15, 23, 42, 0.92) 100%); }
html[data-theme="dark"] .panel-card-header h3,
html[data-theme="dark"] .modal-card h3 { color: #f8fafc; }
html[data-theme="dark"] .panel-card-header p,
html[data-theme="dark"] .stat-card span,
html[data-theme="dark"] .stat-card small { color: #94a3b8; }
html[data-theme="dark"] .stat-card strong { color: #fca5a5; }
html[data-theme="dark"] .supplier-stat-card.approved strong { color: #86efac; }
html[data-theme="dark"] .supplier-stat-card.pending strong { color: #fcd34d; }

/* Encabezado de página: título legible sobre el fondo oscuro */
html[data-theme="dark"] .page-heading,
html[data-theme="dark"] .page-heading > div:first-child { background: transparent; }

/* Filas de listados (proveedores, usuarios, centros) */
html[data-theme="dark"] .supplier-row { background: rgba(15, 23, 42, 0.96); border-color: rgba(51, 65, 85, 0.85); }
html[data-theme="dark"] .supplier-copy strong { color: #f8fafc; }
html[data-theme="dark"] .supplier-copy p { color: #cbd5e1; }
html[data-theme="dark"] .supplier-copy small { color: #94a3b8; }
html[data-theme="dark"] .supplier-avatar { background: linear-gradient(135deg, rgba(248, 113, 113, 0.18), rgba(30, 41, 59, 0.9)); color: #fca5a5; }

/* Insignias */
html[data-theme="dark"] .soft-badge { background: #1f2937; color: #e2e8f0; border-color: #334155; }
html[data-theme="dark"] .soft-badge.warning { background: #3b2a0f; color: #fcd34d; }
html[data-theme="dark"] .accent-panel .soft-badge,
html[data-theme="dark"] .important-chip { background: #3b2a0f; border-color: #a16207; color: #fde68a; }

/* Campos de formulario */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b; }

/* Tipo de proveedor en modo oscuro */
html[data-theme="dark"] .supplier-type-badge.productos { background: #052e1f; color: #6ee7b7; border-color: #065f46; }
html[data-theme="dark"] .supplier-type-badge.trabajos { background: #0b1e3f; color: #93c5fd; border-color: #1e3a8a; }
html[data-theme="dark"] .supplier-type-badge.transportista { background: #3a1a07; color: #fdba74; border-color: #9a3412; }
html[data-theme="dark"] .supplier-type-badge.none { background: #3b2a0f; color: #fcd34d; border-color: #a16207; }
html[data-theme="dark"] .supplier-type-chip { background: #0f172a; border-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .supplier-type-chip.active { background: #b91c1c; border-color: #b91c1c; color: #ffffff; }
html[data-theme="dark"] .supplier-type-count { background: rgba(255, 255, 255, 0.1); }

/* ---- Invitaciones y accesos (/admin-security/accesos) ---- */
.access-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.access-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.access-report-search {
    flex: 1 1 280px;
    max-width: 420px;
    margin: 0;
}

.access-report-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.access-report-table-wrap {
    overflow-x: auto;
}

.access-report-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.access-report-table th {
    text-align: left;
    padding: 0.65rem 0.85rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-500);
    border-bottom: 1px solid var(--ink-200);
    white-space: nowrap;
}

.access-report-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--ink-200);
    color: var(--ink-800);
    vertical-align: top;
}

.access-report-table tbody tr:last-child td {
    border-bottom: 0;
}

.access-report-table td strong {
    display: block;
    color: var(--ink-950);
    font-weight: 600;
}

.access-report-table td small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--ink-500);
}

.access-report-table td small.access-report-warn {
    color: var(--danger-fg);
}

.access-report-note {
    margin: 1rem 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--ink-500);
}

/* ---- Seguimiento de cambios (/admin-security/seguimiento) ---- */
.activity-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.activity-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-500);
}

.activity-field select,
.activity-field input {
    min-width: 150px;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--field-border, var(--ink-200));
    background: var(--field-bg, transparent);
    color: var(--ink-950);
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    border-bottom: 1px solid var(--ink-200);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-item-main {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    padding: 0.8rem 0.25rem;
    cursor: pointer;
}

.activity-icon {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: 1.1rem;
    background: var(--info-bg);
    color: var(--info-fg);
}

.activity-icon.is-approved { background: var(--success-bg); color: var(--success-fg); }
.activity-icon.is-rejected { background: var(--danger-bg); color: var(--danger-fg); }
.activity-icon.is-pending { background: var(--warning-bg); color: var(--warning-fg); }

.activity-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.activity-copy strong {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink-950);
    overflow-wrap: anywhere;
}

.activity-copy small {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--ink-500);
}

.activity-meta {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    max-width: 46%;
    color: var(--ink-500);
}

.activity-meta time {
    font-size: 0.78rem;
    white-space: nowrap;
}

.activity-changes {
    width: calc(100% - 3.1rem);
    margin: 0 0 0.9rem 3.1rem;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.activity-changes th {
    text-align: left;
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-500);
    border-bottom: 1px solid var(--ink-200);
}

.activity-changes td {
    padding: 0.4rem 0.6rem;
    color: var(--ink-800);
    border-bottom: 1px solid var(--ink-200);
    overflow-wrap: anywhere;
    vertical-align: top;
}

.activity-changes td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

.activity-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--ink-500);
}

.activity-pager div {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 720px) {
    .activity-item-main {
        flex-wrap: wrap;
    }

    .activity-meta {
        max-width: 100%;
        justify-content: flex-start;
        padding-left: 3.1rem;
    }
}

.access-report-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    background: var(--success-bg);
    color: var(--success-fg);
}

.access-report-banner.is-error {
    background: var(--danger-bg);
    color: var(--danger-fg);
}

.access-report-actions-cell {
    min-width: 190px;
}

.access-report-actions-cell div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.access-report-actions-cell button {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

/* Celular: las acciones de la barra superior pasan a ser iconos en una sola fila. */
@media (max-width: 768px) {
    .topbar .topbar-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.4rem;
        width: 100%;
    }

    .topbar .topbar-actions > .ghost-button {
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
        justify-content: center;
    }

    .topbar .topbar-actions > .ghost-button:not(.environment-toggle-button) {
        width: 2.4rem;
        height: 2.4rem;
        padding: 0;
        border-radius: 999px;
        position: relative;
    }

    .topbar .topbar-actions > .ghost-button:not(.environment-toggle-button) > span {
        display: none;
    }

    .topbar .topbar-actions > .ghost-button:not(.environment-toggle-button) > i {
        font-size: 1.15rem;
        margin: 0;
    }

    .topbar .topbar-actions > .environment-toggle-button {
        height: 2.4rem;
    }

    .topbar .topbar-actions > .environment-toggle-button > i {
        display: none;
    }

    .topbar .topbar-actions .notification-pill {
        position: absolute;
        top: -0.3rem;
        right: -0.3rem;
        min-width: 1.15rem;
        height: 1.15rem;
        font-size: 0.65rem;
    }

    .topbar .topbar-actions > .topbar-user {
        order: 9;
        flex: 1 1 7rem;
        width: auto;
        min-width: 0;
        height: 2.4rem;
        padding: 0 0.75rem;
        gap: 0.45rem;
        border-radius: 999px;
    }

    .topbar .topbar-actions > .topbar-user > div {
        min-width: 0;
    }

    .topbar .topbar-actions > .topbar-user strong {
        font-size: 0.82rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar .topbar-actions > .topbar-user div > span {
        display: none;
    }

    /* El boton flotante del menu queda a la izquierda de la ruta de navegacion, sin taparla. */
    .topbar .topbar-header-info {
        display: flex;
        align-items: center;
        min-height: 2.8rem;
        padding-left: 3.4rem;
    }

    /* Una sola linea: en celular basta la seccion actual. */
    .topbar .topbar-kicker-pill,
    .topbar .topbar-kicker-sep {
        display: none;
    }

    .topbar .topbar-breadcrumb {
        flex-wrap: nowrap;
        min-width: 0;
    }
}

/* Celular: en Control y Cierre de Rutas se ocultan los indicadores para llegar antes a la lista. */
@media (max-width: 768px) {
    .routes-stat-cards {
        display: none !important;
    }
}

/* Proveedores: pestañas y listado de usuarios creados por cada proveedor. */
.supplier-page-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.35rem;
    overflow-x: auto;
    border: 1px solid var(--field-border);
    border-radius: 1rem;
    background: var(--panel-strong);
}

.supplier-page-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.95rem;
    border: 0;
    border-radius: 0.75rem;
    color: var(--ink-500);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.supplier-page-tab.active {
    color: #fff;
    background: var(--brand-900);
}

.supplier-users-group {
    margin-top: 1rem;
}

.supplier-users-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.supplier-users-header h3 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.supplier-users-list {
    display: grid;
    gap: 0.6rem;
}

.supplier-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--field-border);
    border-radius: 0.9rem;
}

.supplier-user-main,
.supplier-user-detail {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.supplier-user-main small,
.supplier-user-detail small,
.supplier-user-label {
    color: var(--ink-500);
    font-size: 0.78rem;
}

.supplier-user-label {
    font-weight: 700;
}

@media (max-width: 768px) {
    .supplier-page-tab {
        flex: 1 1 0;
        justify-content: center;
        padding: 0.55rem 0.4rem;
        font-size: 0.85rem;
    }

    .supplier-user-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }
}
