/* ============================================================
   PANEL LOGÍSTICO PLUS — Logistics Management
   Estilos principales
   ============================================================ */

/* === IMPORTACIÓN DE FUENTES === */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* === VARIABLES CSS === */
:root {
    --lm-primary: #0B1F3A;
    --lm-primary-light: #153B6F;
    --lm-primary-lighter: #EAF2FF;
    --lm-accent: #D4AF37;
    --lm-bg: #F5F7FA;
    --lm-white: #FFFFFF;
    --lm-text: #172033;
    --lm-text-light: #64748B;
    --lm-border: #E2E8F0;
    --lm-success: #128C7E;
    --lm-danger: #B42318;
    --lm-warning: #F59E0B;
    --lm-info: #2563EB;
    
    --lm-header-height: 64px;
    --lm-radius: 12px;
    --lm-radius-lg: 20px;
    --lm-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --lm-shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --lm-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-icon { width: 24px; height: 24px; display: block; }
.app-icon-sm { width: 18px; height: 18px; display: block; }
.app-icon-lg { width: 34px; height: 34px; display: block; }

/* === RESET === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--lm-bg);
    color: var(--lm-text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* === LAYOUT PRINCIPAL === */
.lm-app-layout {
    display: flex;
    min-height: 100vh;
}

/* === CENTRO DE APLICACIONES (MODAL) === */
.lm-sidebar {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    width: 100%;
    height: 100dvh;
    padding: 28px;
    place-items: center;
    color: var(--lm-text);
    background: rgba(7, 26, 49, .66);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
}

.lm-sidebar.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.lm-app-modal-open { overflow: hidden; }

.lm-sidebar-brand-copy { min-width: 0; flex: 1; }

.lm-app-launcher-close {
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--lm-border);
    border-radius: 12px;
    color: var(--lm-text-light);
    background: #fff;
    cursor: pointer;
    transition: .2s ease;
}

.lm-app-launcher-close:hover { color: var(--lm-primary); background: var(--lm-primary-lighter); }
.lm-app-launcher-close .app-icon { width: 19px; height: 19px; }

.lm-app-launcher-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px 4px;
}

.lm-app-launcher-intro strong { color: var(--lm-primary); font-size: 20px; letter-spacing: -.02em; }
.lm-app-launcher-intro span { max-width: 420px; color: var(--lm-text-light); font-size: 12px; text-align: right; }

.lm-sidebar-inner {
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    max-height: min(820px, calc(100dvh - 48px));
    overflow: hidden;
    border: 1px solid rgba(220, 228, 238, .95);
    border-radius: 28px;
    background: #F7FAFD;
    box-shadow: 0 30px 90px rgba(3, 14, 29, .34);
    transform: translateY(14px) scale(.985);
    transition: transform .24s ease;
}

.lm-sidebar.open .lm-sidebar-inner { transform: translateY(0) scale(1); }

.lm-sidebar-brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--lm-border);
    background: rgba(255,255,255,.88);
}

.lm-sidebar-logo {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, #071A31, #2463D4);
    box-shadow: 0 10px 24px rgba(7,26,49,.2);
}

.lm-sidebar-title {
    overflow: hidden;
    color: var(--lm-primary);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-sidebar-subtitle {
    font-size: 11px;
    color: var(--lm-text-light);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lm-sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lm-app-group h2 {
    margin: 0 0 9px 2px;
    color: #718096;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.lm-app-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.lm-app-nav-item {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 112px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 10px;
    border: 1px solid var(--lm-border);
    border-radius: 18px;
    color: var(--lm-primary);
    background: #fff;
    box-shadow: 0 8px 22px rgba(15,35,60,.045);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    transition: .2s ease;
}

.lm-app-nav-item:hover {
    transform: translateY(-3px);
    border-color: #AFC8E8;
    color: #174F99;
    box-shadow: 0 14px 30px rgba(15,35,60,.1);
}

.lm-app-nav-item.active {
    border-color: #2463D4;
    color: #174F99;
    background: linear-gradient(145deg, #F7FAFF, #EAF2FF);
    box-shadow: inset 0 0 0 1px rgba(36,99,212,.12), 0 10px 24px rgba(36,99,212,.1);
}

.lm-app-nav-item.active::before {
    content: '';
    position: absolute;
    top: 7px;
    right: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--lm-accent);
    box-shadow: 0 0 0 3px rgba(212,175,55,.13);
}

.lm-app-nav-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    color: #2463D4;
    background: #EAF2FF;
}

.lm-app-nav-icon .app-icon { width: 23px; height: 23px; }

.lm-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--lm-transition);
    position: relative;
}

.lm-nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.lm-nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    font-weight: 600;
}

.lm-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--lm-accent);
    border-radius: 0 3px 3px 0;
}

.lm-nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.lm-nav-label {
    flex: 1;
}

.lm-sidebar-footer {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--lm-border);
    background: #fff;
}

.lm-sidebar-footer .lm-nav-item {
    justify-content: center;
    color: #8A2D2D;
    background: #FFF7F7 !important;
    border: 1px solid #F3DCDC !important;
}

.lm-sidebar-footer .lm-nav-item:hover {
    color: #B42318;
    background: #FEECEC !important;
}

/* === MAIN CONTENT === */
.lm-main {
    flex: 1;
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.lm-header {
    height: var(--lm-header-height);
    background: var(--lm-white);
    border-bottom: 1px solid var(--lm-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.lm-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
}

.lm-header-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--lm-border);
    border-radius: 11px;
    color: #23456D;
    background: #F8FAFC;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: .2s ease;
}

.lm-header-toggle:hover { border-color: #B8CCE5; background: var(--lm-primary-lighter); }

.lm-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--lm-text);
    flex: 1;
}

.lm-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lm-wtm-menu { position:relative; }
.lm-wtm-menu summary { display:flex;min-height:36px;align-items:center;gap:6px;padding:7px 10px;border:1px solid #C9D7E7;border-radius:10px;color:#174F88;background:#F5F9FE;font-size:10px;font-weight:900;letter-spacing:.04em;list-style:none;cursor:pointer; }
.lm-wtm-menu summary::-webkit-details-marker { display:none; }
.lm-wtm-menu summary > .app-icon:first-child { width:16px;height:16px; }
.lm-wtm-menu summary > .app-icon:last-child { width:12px;height:12px;transition:transform .18s; }
.lm-wtm-menu[open] summary > .app-icon:last-child { transform:rotate(90deg); }
.lm-wtm-menu-panel { position:absolute;top:calc(100% + 10px);right:0;z-index:320;width:290px;padding:8px;border:1px solid var(--lm-border);border-radius:16px;background:var(--lm-white);box-shadow:0 20px 55px rgba(4,17,34,.22); }
.lm-wtm-menu-panel a,.lm-wtm-menu-panel button { display:grid;width:100%;grid-template-columns:auto 1fr;align-items:center;gap:10px;padding:11px;border:0;border-radius:11px;color:var(--lm-text);background:transparent;font:inherit;text-align:left;cursor:pointer; }
.lm-wtm-menu-panel a:hover,.lm-wtm-menu-panel button:hover { background:var(--lm-primary-lighter); }
.lm-wtm-menu-panel > * + * { border-top:1px solid var(--lm-border); }
.lm-wtm-menu-panel .app-icon { width:18px;height:18px;color:#2463D4; }
.lm-wtm-menu-panel strong,.lm-wtm-menu-panel small { display:block; }
.lm-wtm-menu-panel strong { font-size:10px;letter-spacing:.02em; }
.lm-wtm-menu-panel small { margin-top:2px;color:var(--lm-text-light);font-size:9px; }

.lm-admin-license { display:grid;gap:4px;margin-top:auto;padding:22px max(24px,calc((100% - 1400px)/2 + 24px)) calc(112px + env(safe-area-inset-bottom));border-top:1px solid var(--lm-border);color:var(--lm-text-light);background:var(--lm-white);font-size:10px;line-height:1.5;text-align:center; }
.lm-admin-license strong { color:var(--lm-text);font-size:10px;letter-spacing:.08em;text-transform:uppercase; }

body.wos-modal-open { overflow:hidden; }
.wos-information-overlay { position:fixed;inset:0;z-index:5000;display:grid;padding:18px;place-items:center;background:rgba(3,14,29,.72);backdrop-filter:blur(8px); }
.wos-information-dialog { width:min(790px,100%);max-height:min(92dvh,880px);overflow:hidden;border:1px solid var(--lm-border);border-radius:26px;color:var(--lm-text);background:var(--lm-white);box-shadow:0 35px 110px rgba(2,12,25,.45); }
.wos-information-header { position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 22px;border-bottom:1px solid var(--lm-border);background:var(--lm-white); }
.wos-information-header span { color:#2463D4;font-size:9px;font-weight:900;letter-spacing:.12em;text-transform:uppercase; }
.wos-information-header h1 { margin:3px 0 0;font-size:18px; }
.wos-information-header button { display:grid;flex:0 0 auto;width:40px;height:40px;place-items:center;border:1px solid var(--lm-border);border-radius:12px;color:var(--lm-text-light);background:var(--lm-white);cursor:pointer; }
.wos-information-header button .app-icon { width:19px;height:19px; }
.wos-information-content { max-height:calc(min(92dvh,880px) - 82px);overflow-y:auto;padding:22px; }
.wos-product-card { display:flex;align-items:center;gap:16px;padding:18px;border:1px solid #C9DCF0;border-radius:20px;background:linear-gradient(135deg,#F8FBFF,#EAF3FF); }
.wos-product-mark { display:grid;flex:0 0 auto;width:64px;height:64px;place-items:center;border-radius:18px;color:#fff;background:linear-gradient(145deg,#071A31,#2463D4);box-shadow:0 12px 25px rgba(7,26,49,.2);font-size:17px;font-weight:900; }
.wos-product-card span { color:#2463D4;font-size:9px;font-weight:900;letter-spacing:.1em;text-transform:uppercase; }
.wos-product-card h2 { margin:3px 0;color:#071A31;font-size:24px; }
.wos-product-card p { margin:0;color:#50677F;font-size:11px;font-weight:800; }
.wos-introduction { margin:18px 0;color:var(--lm-text-light);font-size:13px;line-height:1.65; }
.wos-facts,.wos-settings-facts { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;overflow:hidden;border:1px solid var(--lm-border);border-radius:17px;background:var(--lm-border); }
.wos-facts > div,.wos-settings-facts > div { min-width:0;padding:12px 14px;background:var(--lm-white); }
.wos-facts dt,.wos-settings-facts dt { color:var(--lm-text-light);font-size:9px;font-weight:900;letter-spacing:.06em;text-transform:uppercase; }
.wos-facts dd,.wos-settings-facts dd { display:flex;align-items:center;gap:7px;margin:4px 0 0;color:var(--lm-text);font-size:12px;font-weight:800; }
.wos-status-dot { display:inline-block;width:8px;height:8px;border-radius:50%;background:#18A27E;box-shadow:0 0 0 3px rgba(24,162,126,.13); }
.wos-section { margin-top:20px; }
.wos-section h3 { margin:0 0 8px;font-size:14px; }
.wos-section p,.wos-section li { color:var(--lm-text-light);font-size:12px;line-height:1.6; }
.wos-section ul { display:grid;gap:4px;margin:0;padding-left:20px; }
.wos-section p { margin:8px 0 0; }
.wos-signoff { margin:24px 0 0;padding-top:17px;border-top:1px solid var(--lm-border);color:#2463D4;font-size:11px;font-weight:900;text-align:center; }
.wos-settings-card { overflow:hidden;background:linear-gradient(135deg,var(--lm-white) 60%,var(--lm-primary-lighter)); }
.wos-settings-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:17px; }
.wos-settings-heading span { color:#2463D4;font-size:9px;font-weight:900;letter-spacing:.11em;text-transform:uppercase; }
.wos-settings-heading h3 { margin:4px 0 2px;font-size:21px; }
.wos-settings-heading p { margin:0;color:var(--lm-text-light);font-size:11px; }
.wos-settings-facts .span-2 { grid-column:1/-1; }

.lm-header-user {
    font-size: 14px;
    color: var(--lm-text-light);
    font-weight: 500;
}

.lm-header-logout-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background var(--lm-transition);
}

.lm-header-home {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--lm-border);
    border-radius: 10px;
    color: var(--lm-text-light);
    background: #fff;
}

.lm-header-home:hover { color: var(--lm-primary); background: var(--lm-primary-lighter); }
.lm-header-home .app-icon,
.lm-header-logout-btn .app-icon,
.lm-header-toggle .app-icon { width: 19px; height: 19px; }

.lm-header-logout-btn:hover {
    background: #FEE2E2;
}

/* === CONTENT WRAPPER === */
.lm-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* === CARDS === */
.lm-card {
    background: var(--lm-white);
    border-radius: var(--lm-radius-lg);
    border: 1px solid var(--lm-border);
    padding: 24px;
    box-shadow: var(--lm-shadow);
    transition: box-shadow var(--lm-transition);
}

.lm-card:hover {
    box-shadow: var(--lm-shadow-lg);
}

.lm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lm-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--lm-text);
}

.lm-card-subtitle {
    font-size: 13px;
    color: var(--lm-text-light);
    margin-top: 2px;
}

/* === STAT CARDS === */
.lm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.lm-stat-card {
    background: var(--lm-white);
    border-radius: var(--lm-radius);
    border: 1px solid var(--lm-border);
    padding: 20px;
    box-shadow: var(--lm-shadow);
}

.lm-stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.lm-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--lm-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lm-stat-icon {
    font-size: 24px;
}

.lm-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--lm-text);
    line-height: 1.2;
}

.lm-stat-change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

/* === TABLES === */
.lm-table-container {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

.lm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lm-table th {
    text-align: left;
    padding: 12px 12px;
    color: var(--lm-text-light);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--lm-border);
    white-space: nowrap;
}

.lm-table td {
    padding: 12px;
    border-bottom: 1px solid var(--lm-border);
    vertical-align: middle;
}

.lm-table tr:hover {
    background: var(--lm-primary-lighter);
}

.lm-table .lm-cell-actions {
    display: flex;
    gap: 6px;
}

/* === BUTTONS === */
.lm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    transition: all var(--lm-transition);
    white-space: nowrap;
}

.lm-btn:hover {
    transform: translateY(-1px);
}

.lm-btn:active {
    transform: translateY(0);
}

.lm-btn-primary {
    background: var(--lm-primary);
    color: white;
}

.lm-btn-primary:hover {
    background: var(--lm-primary-light);
    box-shadow: 0 4px 12px rgba(11, 31, 58, 0.3);
}

.lm-btn-secondary {
    background: var(--lm-bg);
    color: var(--lm-text);
    border: 1px solid var(--lm-border);
}

.lm-btn-secondary:hover {
    background: var(--lm-border);
}

.lm-btn-danger {
    background: var(--lm-danger);
    color: white;
}

.lm-btn-danger:hover {
    background: #961D13;
    box-shadow: 0 4px 12px rgba(180, 35, 24, 0.3);
}

.lm-btn-success {
    background: var(--lm-success);
    color: white;
}

.lm-btn-success:hover {
    background: #0E6F63;
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.3);
}

.lm-btn-warning {
    background: var(--lm-warning);
    color: white;
}

.lm-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.lm-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.lm-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    font-size: 16px;
}

/* === FORM ELEMENTS === */
.lm-form-group {
    margin-bottom: 16px;
}

.lm-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--lm-text);
    margin-bottom: 6px;
}

.lm-form-label .lm-required {
    color: var(--lm-danger);
    margin-left: 2px;
}

.lm-form-input,
.lm-form-select,
.lm-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--lm-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    color: var(--lm-text);
    background: var(--lm-white);
    transition: all var(--lm-transition);
}

.lm-form-input:focus,
.lm-form-select:focus,
.lm-form-textarea:focus {
    outline: none;
    border-color: var(--lm-primary);
    box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.1);
}

.lm-form-input::placeholder,
.lm-form-textarea::placeholder {
    color: #94A3B8;
}

.lm-form-textarea {
    min-height: 80px;
    resize: vertical;
}

.lm-form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8.5L1 3.5h10L6 8.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* === EXPORTACIÓN DE GUÍAS === */
.guide-export-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.guide-copy-control {
    display: grid;
    gap: 4px;
    min-width: 230px;
    padding: 8px 10px;
    border: 1px solid var(--lm-border);
    border-radius: 12px;
    background: var(--lm-white);
}

.guide-copy-control > label {
    color: var(--lm-text);
    font-size: 12px;
    font-weight: 800;
}

.guide-copy-control > small {
    color: var(--lm-text-light);
    font-size: 11px;
}

.guide-copy-counter {
    display: grid;
    grid-template-columns: 38px 60px 38px;
    gap: 5px;
    align-items: center;
}

.guide-copy-counter button {
    min-height: 36px;
    border: 1px solid var(--lm-border);
    border-radius: 9px;
    color: var(--lm-primary);
    background: var(--lm-primary-lighter);
    font: inherit;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

.guide-copy-counter .lm-form-input {
    min-height: 36px;
    padding: 6px;
    text-align: center;
    font-weight: 800;
}

.guide-download-panel {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    background: #EFF6FF;
}

.guide-download-panel[hidden] { display: none; }
.guide-download-panel strong,
.guide-download-panel span { display: block; }
.guide-download-panel span { margin-top: 2px; color: #475569; font-size: 12px; }
.guide-download-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* === COMPLETITUD OPERATIVA DE CLIENTES === */
.client-overview-stats { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:16px; }
.client-overview-stats > div { padding:13px 15px;border:1px solid var(--lm-border);border-radius:13px;background:var(--lm-white); }
.client-overview-stats span { display:block;color:var(--lm-text-light);font-size:11px;font-weight:800;text-transform:uppercase; }
.client-overview-stats strong { display:block;margin-top:3px;color:var(--lm-primary);font-size:23px; }
.client-overview-stats .complete { border-color:#A7DDCE;background:#EFFBF7; }
.client-overview-stats .complete strong { color:#087361; }
.client-overview-stats .missing { border-color:#F2BBB6;background:#FFF4F3; }
.client-overview-stats .missing strong { color:#B42318; }
.client-sync-checklist { min-width:210px; }
.client-sync-checklist summary { cursor:pointer;font-size:12px;font-weight:900; }
.client-sync-checklist summary.complete { color:#087361; }
.client-sync-checklist summary.incomplete { color:#B42318; }
.client-sync-checklist > div { display:grid;gap:3px;margin-top:7px; }
.client-sync-checklist span { display:block;padding:3px 6px;border-radius:6px;font-size:10px;font-weight:700; }
.client-sync-checklist .ok { color:#086555;background:#E8F8F2; }
.client-sync-checklist .missing { color:#A52B22;background:#FDEDEC; }

.lm-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.lm-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--lm-primary);
}

.lm-form-hint {
    font-size: 12px;
    color: var(--lm-text-light);
    margin-top: 4px;
}

.lm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lm-form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--lm-border);
}

.lm-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.lm-form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--lm-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === BADGES === */
.lm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.lm-badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.lm-badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.lm-badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.lm-badge-info {
    background: var(--lm-primary-lighter);
    color: var(--lm-primary-light);
}

/* === GRID SYSTEM === */
.lm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lm-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.lm-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* === TABS === */
.lm-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--lm-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.lm-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--lm-text-light);
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--lm-transition);
}

.lm-tab:hover {
    color: var(--lm-text);
}

.lm-tab.active {
    color: var(--lm-primary);
    font-weight: 600;
    border-bottom-color: var(--lm-primary);
}

.lm-tab-content {
    display: none;
}

.lm-tab-content.active {
    display: block;
}

/* === TIMELINE === */
.lm-timeline {
    position: relative;
    padding-left: 24px;
}

.lm-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--lm-border);
}

.lm-timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.lm-timeline-item:last-child {
    padding-bottom: 0;
}

.lm-timeline-dot {
    position: absolute;
    left: -18px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lm-primary);
    border: 2px solid var(--lm-primary-lighter);
}

.lm-timeline-content {
    background: var(--lm-bg);
    padding: 12px 16px;
    border-radius: var(--lm-radius);
}

.lm-timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--lm-text);
}

.lm-timeline-time {
    font-size: 11px;
    color: var(--lm-text-light);
    margin-top: 2px;
}

/* === FILTERS BAR === */
.lm-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.lm-filters .lm-form-input,
.lm-filters .lm-form-select {
    width: auto;
    min-width: 160px;
}

.lm-filters .lm-search-input {
    flex: 1;
    min-width: 200px;
}

/* === ALERTS === */
.lm-alert {
    padding: 14px 18px;
    border-radius: var(--lm-radius);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lm-alert-info {
    background: var(--lm-primary-lighter);
    color: var(--lm-primary-light);
    border: 1px solid #B5D2FF;
}

.lm-alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.lm-alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.lm-alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* === LOADING === */
/* El atributo hidden siempre debe ganar sobre clases con display propio.
   Evita que un placeholder de carga siga visible después de renderizar. */
[hidden],
.lm-loading[hidden] {
    display: none !important;
}

.lm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: var(--lm-text-light);
}

.lm-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--lm-border);
    border-top-color: var(--lm-primary);
    border-radius: 50%;
    animation: lmSpin 0.6s linear infinite;
}

@keyframes lmSpin {
    to { transform: rotate(360deg); }
}

/* === PAGINATION === */
.lm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.lm-page-btn {
    padding: 8px 14px;
    border: 1px solid var(--lm-border);
    border-radius: 8px;
    background: var(--lm-white);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--lm-transition);
}

.lm-page-btn:hover {
    background: var(--lm-bg);
}

.lm-page-btn.active {
    background: var(--lm-primary);
    color: white;
    border-color: var(--lm-primary);
}

/* === EMPTY STATE === */
.lm-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--lm-text-light);
}

.lm-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.lm-empty-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.lm-empty-hint {
    font-size: 14px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .lm-grid-2, .lm-grid-3, .lm-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .lm-sidebar {
        padding: 10px;
    }

    .lm-sidebar-inner {
        max-height: calc(100dvh - 20px);
        border-radius: 22px;
    }

    .lm-sidebar-brand { padding: 15px; }
    .lm-app-launcher-intro { align-items: flex-start; flex-direction: column; gap: 4px; padding: 15px 16px 2px; }
    .lm-app-launcher-intro strong { font-size: 17px; }
    .lm-app-launcher-intro span { text-align: left; }
    .lm-sidebar-nav { padding: 14px 16px 18px; gap: 16px; }
    .lm-app-nav-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lm-app-nav-item { min-height: 100px; }
    .lm-sidebar-footer { padding: 12px 16px 15px; }

    .lm-content {
        padding: 16px;
    }

    .lm-grid-2, .lm-grid-3, .lm-grid-4 {
        grid-template-columns: 1fr;
    }

    .lm-form-row {
        grid-template-columns: 1fr;
    }

    .lm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lm-filters {
        flex-direction: column;
    }

    .lm-filters .lm-form-input,
    .lm-filters .lm-form-select,
    .lm-filters .lm-search-input {
        width: 100%;
        min-width: unset;
    }

    .lm-card {
        padding: 16px;
    }

    .lm-header-title {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .lm-sidebar-title { font-size: 13px; }
    .lm-sidebar-subtitle { font-size: 9px; }
    .lm-sidebar-logo { width: 38px; height: 38px; border-radius: 12px; }
    .lm-app-launcher-close { width: 36px; height: 36px; }
    .lm-app-nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lm-app-nav-item { min-height: 96px; padding: 11px 7px; }
    .lm-header-inner { padding: 0 12px; gap: 9px; }
    .lm-header-toggle span { display: none; }
    .lm-header-toggle { width: 38px; padding: 7px; justify-content: center; }
    .lm-header-actions { gap: 6px; }
    .lm-header-user { display: none; }

    .lm-stats-grid {
        grid-template-columns: 1fr;
    }

    .lm-content {
        padding: 12px;
    }

    .lm-card {
        padding: 14px;
        border-radius: 14px;
    }
}

/* === PRINT STYLES === */
@media print {
    .lm-sidebar,
    .lm-header,
    .lm-no-print {
        display: none !important;
    }

    .lm-main {
        margin-left: 0 !important;
    }

    .lm-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* ============================================================
   CAPA PWA ADAPTATIVA — iOS, Android y escritorio
   ============================================================ */
html {
    min-height: 100%;
    background: var(--lm-bg);
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100dvh;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }

:focus-visible {
    outline: 3px solid rgba(36, 99, 212, .42);
    outline-offset: 3px;
}

.lm-brand-logo-image {
    display: block;
    width: 72%;
    height: 72%;
    object-fit: contain;
    border-radius: 20%;
}

.launcher-brand-mark .lm-brand-logo-image,
.client-brand-mark .lm-brand-logo-image,
.request-brand-mark .lm-brand-logo-image,
.lm-sidebar-logo .lm-brand-logo-image,
.login-card-mark .lm-brand-logo-image { width: 100%; height: 100%; border-radius: inherit; }

.settings-brand-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    margin-bottom: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--lm-white) 55%, var(--lm-primary-lighter));
}
.settings-brand-copy h3 { margin: 8px 0 5px; font-size: 20px; }
.settings-brand-copy p { max-width: 680px; margin: 0; color: var(--lm-text-light); font-size: 13px; line-height: 1.6; }
.settings-brand-copy > small { display: block; margin-top: 9px; color: var(--lm-text-light); font-size: 10px; }
.settings-brand-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: #1D57A6; font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.settings-brand-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 17px; }
.settings-brand-actions label { cursor: pointer; }
.settings-brand-preview-wrap { display: grid; gap: 8px; justify-items: center; color: var(--lm-text-light); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.settings-brand-preview { display: grid; width: 112px; height: 112px; place-items: center; padding: 13px; border: 1px solid var(--lm-border); border-radius: 28px; background: var(--lm-white); box-shadow: 0 16px 34px rgba(11,31,58,.12); }
.settings-brand-preview img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 18px; }
.settings-theme-section { margin-bottom: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--lm-border); }
.settings-theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.settings-theme-choice { display: grid; grid-template-columns: auto 1fr; min-height: 78px; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--lm-border); border-radius: 16px; color: var(--lm-text); background: var(--lm-white); font: inherit; text-align: left; cursor: pointer; }
.settings-theme-choice > .app-icon { width: 25px; height: 25px; color: #2463D4; }
.settings-theme-choice strong, .settings-theme-choice small { display: block; }
.settings-theme-choice strong { font-size: 13px; }
.settings-theme-choice small { margin-top: 2px; color: var(--lm-text-light); font-size: 10px; }
.settings-theme-choice.active { border-color: #2463D4; background: #EAF2FF; box-shadow: inset 0 0 0 1px rgba(36,99,212,.15); }
.tracking-brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.tracking-brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: rgba(255,255,255,.12); }
.tracking-brand-mark .lm-brand-logo-image { width: 100%; height: 100%; border-radius: inherit; }

.pwa-bottom-nav { display: none; }

.pwa-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
    background: rgba(3, 14, 29, .56);
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
.pwa-menu-backdrop.open { opacity: 1; pointer-events: auto; }

.pwa-menu-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 2500;
    width: min(620px, 100%);
    max-height: min(82dvh, 760px);
    overflow-y: auto;
    padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
    border: 1px solid var(--lm-border);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    color: var(--lm-text);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -24px 70px rgba(3, 14, 29, .3);
    transform: translate(-50%, 105%);
    transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.pwa-menu-sheet.open { transform: translate(-50%, 0); }
.pwa-sheet-handle { width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 999px; background: #CBD5E1; }
.pwa-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.pwa-sheet-header strong { display: block; color: var(--lm-primary); font-size: 18px; }
.pwa-sheet-header span { display: block; color: var(--lm-text-light); font-size: 11px; }
.pwa-sheet-header button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--lm-border); border-radius: 12px; color: var(--lm-text-light); background: var(--lm-white); cursor: pointer; }
.pwa-sheet-header button .app-icon { width: 19px; height: 19px; }
.pwa-sheet-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.pwa-sheet-apps a { position: relative; display: grid; grid-template-columns: auto 1fr auto; min-width: 0; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--lm-border); border-radius: 16px; color: var(--lm-text); background: var(--lm-white); }
.pwa-sheet-apps a > .app-icon { width: 15px; height: 15px; color: var(--lm-text-light); }
.pwa-sheet-apps strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pwa-sheet-app-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #2463D4; background: #EAF2FF; }
.pwa-sheet-app-icon .app-icon { width: 20px; height: 20px; }

.pwa-theme-panel { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--lm-border); }
.pwa-theme-label { display: block; margin-bottom: 8px; color: var(--lm-text-light); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.pwa-theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pwa-theme-options button { display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 7px; padding: 8px; border: 1px solid var(--lm-border); border-radius: 13px; color: var(--lm-text-light); background: var(--lm-white); font: inherit; font-size: 11px; font-weight: 900; cursor: pointer; }
.pwa-theme-options button.active { border-color: #2463D4; color: #174F99; background: #EAF2FF; box-shadow: inset 0 0 0 1px rgba(36,99,212,.12); }
.pwa-install-button { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; border: 0; border-radius: 13px; color: #fff; background: var(--lm-primary); font: inherit; font-size: 12px; font-weight: 900; cursor: pointer; }
.pwa-ios-install-hint { display: none; margin: 8px 0 0; padding: 11px 13px; border: 1px solid var(--lm-border); border-radius: 12px; color: var(--lm-text-light); background: var(--lm-white); font-size: 11px; line-height: 1.5; text-align: center; }
.pwa-ios-install-hint.visible { display: block; }

/* Temas: claro, oscuro y alto contraste. */
html[data-theme="dark"] {
    --lm-primary: #9CC4FF;
    --lm-primary-light: #6EA5F5;
    --lm-primary-lighter: #142A46;
    --lm-bg: #07111F;
    --lm-white: #101D2D;
    --lm-text: #EEF5FF;
    --lm-text-light: #A8B7CB;
    --lm-border: #293B50;
    --app-navy: #EEF5FF;
    --app-surface: #101D2D;
    --app-cloud: #07111F;
    --app-ink: #EEF5FF;
    --app-muted: #A8B7CB;
    --app-line: #293B50;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .launcher-body,
html[data-theme="dark"] .request-public-body { color: var(--lm-text); background: radial-gradient(circle at 85% 0, #15345A, transparent 34rem), #07111F; }
html[data-theme="dark"] .lm-card,
html[data-theme="dark"] .dash-stat,
html[data-theme="dark"] .dash-recent,
html[data-theme="dark"] .app-tile,
html[data-theme="dark"] .launcher-app,
html[data-theme="dark"] .request-card,
html[data-theme="dark"] .tracking-card,
html[data-theme="dark"] .client-order,
html[data-theme="dark"] .tracking-search,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .client-app-dialog,
html[data-theme="dark"] .document-launcher-dialog,
html[data-theme="dark"] .lm-sidebar-inner { color: var(--lm-text); border-color: var(--lm-border); background: #101D2D; }
html[data-theme="dark"] .settings-theme-choice.active { color: #EEF5FF; border-color: #6EA5F5; background: #142A46; }
html[data-theme="dark"] .settings-brand-eyebrow,
html[data-theme="dark"] .settings-theme-choice > .app-icon { color: #9CC4FF; }
html[data-theme="dark"] .pwa-theme-options button.active { color: #EEF5FF; border-color: #6EA5F5; background: #142A46; }
html[data-theme="dark"] .lm-btn-primary,
html[data-theme="dark"] .request-submit,
html[data-theme="dark"] .pwa-install-button { color: #07111F; }
html[data-theme="dark"] .lm-header,
html[data-theme="dark"] .client-topbar,
html[data-theme="dark"] .lm-sidebar-brand,
html[data-theme="dark"] .lm-sidebar-footer,
html[data-theme="dark"] .document-launcher-head,
html[data-theme="dark"] .client-app-head { border-color: var(--lm-border); background: rgba(16,29,45,.94); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { color: #EEF5FF; border-color: #38506A; background: #0B1726; }
html[data-theme="dark"] input[readonly] { color: #B9C9DA; background: #152438; }
html[data-theme="dark"] .app-tile strong,
html[data-theme="dark"] .launcher-app h2,
html[data-theme="dark"] .client-section-head h2,
html[data-theme="dark"] .lm-header-title,
html[data-theme="dark"] .lm-sidebar-title { color: #EEF5FF; }
html[data-theme="dark"] .privacy-card,
html[data-theme="dark"] .settings-theme-choice,
html[data-theme="dark"] .app-menu-link,
html[data-theme="dark"] .wos-product-card { color: #EEF5FF; border-color: #293B50; background: #142A46; }
html[data-theme="dark"] .wos-product-card h2 { color:#EEF5FF; }
html[data-theme="dark"] .privacy-card h1,
html[data-theme="dark"] .privacy-card h2,
html[data-theme="dark"] .login-card h2,
html[data-theme="dark"] .login-field label,
html[data-theme="dark"] .request-section-heading h2,
html[data-theme="dark"] .setting-label { color: #EEF5FF; }
html[data-theme="dark"] .privacy-card p,
html[data-theme="dark"] .privacy-card li,
html[data-theme="dark"] .login-card-head p,
html[data-theme="dark"] .setting-desc,
html[data-theme="dark"] .request-section-heading p,
html[data-theme="dark"] .request-help { color: #A8B7CB; }
html[data-theme="dark"] .pwa-menu-sheet,
html[data-theme="dark"] .app-menu-sheet { color: #EEF5FF; border-color: #293B50; background: rgba(10,23,38,.98); }
html[data-theme="dark"] .pwa-existing-bottom-nav { border-color: #344A62; background: rgba(10,23,38,.95); }
html[data-theme="dark"] .pwa-existing-bottom-nav .app-nav-button { color: #C7D6E7; }
html[data-theme="dark"] .lm-content h1,
html[data-theme="dark"] .lm-content h2,
html[data-theme="dark"] .lm-content h3 { color: #EEF5FF !important; }
html[data-theme="dark"] .lm-content > p { color: #A8B7CB !important; }

html[data-theme="contrast"] {
    --lm-primary: #FFE600;
    --lm-primary-light: #FFE600;
    --lm-primary-lighter: #242000;
    --lm-bg: #000000;
    --lm-white: #080808;
    --lm-text: #FFFFFF;
    --lm-text-light: #FFFFFF;
    --lm-border: #FFFFFF;
    --lm-accent: #FFE600;
    --app-navy: #FFFFFF;
    --app-surface: #080808;
    --app-cloud: #000000;
    --app-ink: #FFFFFF;
    --app-muted: #FFFFFF;
    --app-line: #FFFFFF;
}
html[data-theme="contrast"] body,
html[data-theme="contrast"] .launcher-body,
html[data-theme="contrast"] .request-public-body { color: #fff; background: #000; }
html[data-theme="contrast"] .lm-card,
html[data-theme="contrast"] .dash-stat,
html[data-theme="contrast"] .dash-recent,
html[data-theme="contrast"] .app-tile,
html[data-theme="contrast"] .launcher-app,
html[data-theme="contrast"] .request-card,
html[data-theme="contrast"] .tracking-card,
html[data-theme="contrast"] .client-order,
html[data-theme="contrast"] .tracking-search,
html[data-theme="contrast"] .login-card,
html[data-theme="contrast"] .pwa-menu-sheet,
html[data-theme="contrast"] .lm-sidebar-inner { color: #fff; border: 2px solid #fff; background: #080808; box-shadow: none; }
html[data-theme="contrast"] .settings-theme-choice.active { color: #000; border-color: #FFE600; background: #FFE600; }
html[data-theme="contrast"] .privacy-card h1,
html[data-theme="contrast"] .privacy-card h2,
html[data-theme="contrast"] .login-card h2,
html[data-theme="contrast"] .login-field label,
html[data-theme="contrast"] .request-section-heading h2,
html[data-theme="contrast"] .setting-label,
html[data-theme="contrast"] .privacy-card p,
html[data-theme="contrast"] .privacy-card li,
html[data-theme="contrast"] .setting-desc { color: #fff; }
html[data-theme="contrast"] .pwa-existing-bottom-nav { border: 2px solid #fff; background: #000; box-shadow: none; }
html[data-theme="contrast"] .pwa-existing-bottom-nav .app-nav-button { color: #fff; }
html[data-theme="contrast"] .lm-content h1,
html[data-theme="contrast"] .lm-content h2,
html[data-theme="contrast"] .lm-content h3,
html[data-theme="contrast"] .lm-content > p { color: #fff !important; }
html[data-theme="contrast"] input,
html[data-theme="contrast"] select,
html[data-theme="contrast"] textarea { color: #fff; border: 2px solid #fff; background: #000; }
html[data-theme="contrast"] :focus-visible { outline-color: #FFE600; }
html[data-theme="contrast"] .pwa-theme-options button.active,
html[data-theme="contrast"] .lm-btn-primary,
html[data-theme="contrast"] .request-submit { color: #000; border-color: #FFE600; background: #FFE600; }

@media (min-width: 1500px) {
    .lm-content { width: 100%; max-width: 1540px; margin-inline: auto; padding-inline: 36px; }
    .launcher-shell { max-width: 1320px; }
}

@media (max-width: 1100px) {
    .lm-content { padding: 20px; }
    .lm-table { min-width: 820px; }
    .dash-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px), (display-mode: standalone) and (max-width: 1180px) {
    body.has-pwa-bottom-nav { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    body.pwa-menu-open { overflow: hidden; }
    .pwa-bottom-nav {
        position: fixed;
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 1800;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
        min-height: 70px;
        padding: 7px;
        border: 1px solid rgba(203,213,225,.88);
        border-radius: 22px;
        background: rgba(255,255,255,.94);
        box-shadow: 0 18px 48px rgba(3,14,29,.2);
        backdrop-filter: blur(20px) saturate(1.35);
    }
    .pwa-bottom-nav button { display: grid; min-width: 0; min-height: 54px; place-items: center; align-content: center; gap: 2px; padding: 5px 2px; border: 0; border-radius: 16px; color: #52657C; background: transparent; font: inherit; font-size: 10px; font-weight: 900; cursor: pointer; }
    .pwa-bottom-nav button:active { color: #0B1F3A; background: #EAF2FF; transform: scale(.96); }
    .pwa-bottom-nav .app-icon { width: 21px; height: 21px; }
    html[data-theme="dark"] .pwa-bottom-nav { border-color: #344A62; background: rgba(10,23,38,.95); }
    html[data-theme="dark"] .pwa-bottom-nav button { color: #C7D6E7; }
    html[data-theme="contrast"] .pwa-bottom-nav { border: 2px solid #fff; background: #000; box-shadow: none; }
    html[data-theme="contrast"] .pwa-bottom-nav button { color: #fff; }
    .lm-header { top: env(safe-area-inset-top); }
    .lm-header-inner { min-height: 64px; }
    .lm-content { padding: 16px max(12px, env(safe-area-inset-right)) 20px max(12px, env(safe-area-inset-left)); }
    .lm-card, .request-card, .app-tile { box-shadow: 0 8px 26px rgba(15,35,60,.07); }
    .lm-btn, .request-submit, .request-step-button { min-height: 46px; }
    input, select, textarea { font-size: 16px !important; }
    .lm-modal-overlay { padding: 10px !important; align-items: end !important; }
    .lm-modal { width: 100% !important; max-height: 88dvh; overflow-y: auto; border-radius: 24px 24px 14px 14px !important; }
}

@media (max-width: 640px) {
    .client-overview-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .guide-export-actions { width: 100%; justify-content: stretch; }
    .guide-copy-control { width: 100%; min-width: 0; }
    .guide-copy-counter { grid-template-columns: 44px minmax(70px, 1fr) 44px; }
    .guide-export-actions > .lm-btn { flex: 1 1 145px; }
    .guide-download-panel { align-items: stretch; flex-direction: column; }
    .guide-download-links { justify-content: flex-start; }
    .pwa-menu-sheet { padding-inline: 13px; border-radius: 24px 24px 0 0; }
    .pwa-sheet-apps { grid-template-columns: 1fr; gap: 7px; }
    .pwa-sheet-apps a { min-height: 58px; }
    .pwa-theme-options button { flex-direction: column; min-height: 58px; gap: 3px; }
    .lm-header-title { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
    .lm-header-home { display: none; }
    .lm-wtm-menu summary span { display:none; }
    .lm-wtm-menu summary { width:38px;justify-content:center;padding:7px; }
    .lm-wtm-menu summary > .app-icon:last-child { display:none; }
    .lm-wtm-menu-panel { right:-82px;width:min(290px,calc(100vw - 20px)); }
    .wos-information-overlay { padding:8px;align-items:end; }
    .wos-information-dialog { max-height:94dvh;border-radius:24px 24px 14px 14px; }
    .wos-information-content { max-height:calc(94dvh - 78px);padding:16px; }
    .wos-product-card { align-items:flex-start; }
    .wos-product-mark { width:54px;height:54px;border-radius:15px;font-size:14px; }
    .wos-product-card h2 { font-size:19px; }
    .wos-facts,.wos-settings-facts { grid-template-columns:1fr; }
    .wos-settings-facts .span-2 { grid-column:auto; }
    .wos-settings-heading { align-items:stretch;flex-direction:column; }
    .wos-settings-heading .lm-btn { justify-content:center; }
    .lm-content { padding-top: 12px; }
    .lm-card { border-radius: 18px; }
    .lm-form-row { gap: 12px; }
    .lm-table th, .lm-table td { padding: 10px 12px; }
    .dash-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow-strip { overflow-x: auto; padding-bottom: 3px; white-space: nowrap; scrollbar-width: none; }
    .flow-strip::-webkit-scrollbar { display: none; }
    .settings-brand-card { grid-template-columns: 1fr; gap: 20px; }
    .settings-brand-preview-wrap { grid-row: 1; justify-self: start; }
    .settings-brand-preview { width: 90px; height: 90px; border-radius: 23px; }
    .settings-brand-actions { display: grid; grid-template-columns: 1fr; }
    .settings-brand-actions .lm-btn { width: 100%; justify-content: center; }
    .settings-theme-grid { grid-template-columns: 1fr; }
    .settings-theme-choice { min-height: 66px; }
    .setting-row { gap: 14px; align-items: flex-start; }
    .setting-row > :first-child { min-width: 0; }
}

@media (max-width: 390px) {
    .pwa-bottom-nav { left: 6px; right: 6px; bottom: max(5px, env(safe-area-inset-bottom)); border-radius: 19px; }
    .pwa-bottom-nav button { font-size: 9px; }
    .pwa-bottom-nav .app-icon { width: 20px; height: 20px; }
    .lm-header-actions { gap: 3px; }
    .lm-header-logout-btn { padding-inline: 5px; }
    .app-grid { gap: 8px; }
    .app-tile { min-height: 124px; }
}

@media (max-height: 520px) and (orientation: landscape) {
    .pwa-bottom-nav { left: 50%; right: auto; width: min(520px, calc(100% - 24px)); transform: translateX(-50%); }
    .pwa-menu-sheet { max-height: 92dvh; }
    body.has-pwa-bottom-nav { padding-bottom: 82px; }
}

@media (min-width: 901px) {
    body.has-pwa-bottom-nav { padding-bottom: 96px; }
    body.pwa-menu-open { overflow: hidden; }
    .pwa-bottom-nav {
        position: fixed;
        left: 50%;
        bottom: 14px;
        z-index: 1800;
        display: grid;
        width: min(520px, calc(100% - 32px));
        min-height: 68px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        padding: 7px;
        border: 1px solid rgba(203,213,225,.88);
        border-radius: 22px;
        background: rgba(255,255,255,.94);
        box-shadow: 0 18px 48px rgba(3,14,29,.2);
        backdrop-filter: blur(20px) saturate(1.35);
        transform: translateX(-50%);
    }
    .pwa-bottom-nav button { display: grid; min-width: 0; min-height: 52px; place-items: center; align-content: center; gap: 2px; padding: 4px; border: 0; border-radius: 15px; color: #52657C; background: transparent; font: inherit; font-size: 10px; font-weight: 900; cursor: pointer; }
    .pwa-bottom-nav button:hover { color: #0B1F3A; background: #EAF2FF; }
    .pwa-bottom-nav .app-icon { width: 21px; height: 21px; }
    .pwa-existing-bottom-nav { display: grid !important; }
    html[data-theme="dark"] .pwa-bottom-nav { border-color: #344A62; background: rgba(10,23,38,.95); }
    html[data-theme="dark"] .pwa-bottom-nav button { color: #C7D6E7; }
    html[data-theme="contrast"] .pwa-bottom-nav { border: 2px solid #fff; background: #000; box-shadow: none; }
    html[data-theme="contrast"] .pwa-bottom-nav button { color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
    .pwa-bottom-nav, .pwa-menu-sheet, .pwa-menu-backdrop, .app-bottom-nav, .app-menu-sheet, .app-menu-backdrop { display: none !important; }
    body { padding-bottom: 0 !important; }
}
