* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #1f2937;
    min-height: 100vh;
    padding-bottom: 96px;
}

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

.sidebar {
    width: 240px;
    background-color: #111827;
    color: white;
    padding: 24px 16px;
}

.brand h2 {
    margin-bottom: 4px;
    color: #f9fafb;
}

.brand p {
    color: #9ca3af;
    margin-bottom: 24px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
}

.menu a:hover {
    background-color: #1f2937;
}

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

.topbar {
    background: white;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta {
    color: #6b7280;
    font-size: 14px;
}

.logout-btn {
    text-decoration: none;
    color: white;
    background-color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
}

.logout-btn:hover {
    background-color: #991b1b;
}

.page-content {
    padding: 24px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow-x: auto;
}

/* ===== Estilos base para módulos ===== */

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.user-module-card {
    font-size: 0.90rem;
}

.user-module-card .table-basic {
    font-size: 0.88rem;
}

.user-module-card .table-basic th,
.user-module-card .table-basic td {
    padding: 6px 8px;
}

.user-module-card .btn-primary {
    padding: 5px 10px;
    font-size: 0.80rem;
    margin-left: 4px !important;
}

.user-module-card a.btn-primary {
    display: inline-block;
}

.user-search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.user-search-container .form-control {
    width: 350px;
    max-width: 100%;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.table-basic {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: auto;
    min-width: 1020px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 12px;
}

.table-basic thead {
    background: #f1f1f1;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-basic th,
.table-basic td {
    padding: 7px 11px;
    font-size: 13px;
    line-height: 1.25;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.table-basic th {
    white-space: nowrap;
    text-align: center;
}

.form-control {
    width: 320px;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
}

.form-control:focus {
    border-color: #2d7ef7;
}

.btn-primary {
    background: #2d7ef7;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1b5fcc;
}

.link-primary {
    color: #2d7ef7;
    text-decoration: none;
}

.link-primary:hover {
    text-decoration: underline;
}

.alert-success {
    color: green;
    margin-bottom: 12px;
}

.alert-error {
    color: red;
    margin-bottom: 12px;
}

.btn-primary{
    background:#2d7ef7;
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:6px;
    cursor:pointer;
    text-decoration:none;
    display:inline-block;
}

.btn-primary:hover{
    background:#1b5fcc;
}

.menu a.active {
    background-color: #1f2937;
    color: #ffffff;
    font-weight: bold;
}

.menu a {
    transition: all 0.2s ease;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* ===== EDI Upload ===== */

.page-title-center {
    text-align: center;
    margin-bottom: 30px;
    color: #0b3b70;
}

.edi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.edi-card {
    width: 300px;
    text-align: center;
}

.edi-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0b3b70;
}

.edi-card p {
    margin-bottom: 20px;
}

.btn-secondary {
    background: #8b8b8b;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #6f6f6f;
}

.table-basic tbody tr:hover {
    background-color: #f3f4f6;
    transition: background-color 0.2s ease;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-align: center;
    min-width: 96px;
}

.badge-pending {
    background: #dc3545;
}

.badge-draft {
    background: #dc2626;
}

.badge-released {
    background: #ff7f50;
    color: #fff;
}

.badge-allocated {
    background: #ffd54f;
    color: #1f2937;
}

.badge-allocated-short {
    background: #f97316;
    color: #fff;
}

.badge-picking {
    background: #facc15;
    color: #1f2937;
}

.badge-packed {
    background: #84cc16;
    color: #fff;
}

.badge-complete {
    background: #a7d46f;
    color: #1f2937;
}

.badge-ready {
    background: #16a34a;
}

.badge-shipped {
    background: #0f172a;
}

.badge-cancelled {
    background: #111111;
}

.badge-in-progress {
    background: #f4b400;
    color: #1f2937;
}

.badge-ok {
    background: #28a745;
}

.badge-error {
    background: #dc2626;
}

.badge-warning {
    background: #f4b400;
    color: #1f2937;
}

.badge-received {
    background: #28a745;
}

.badge-unknown {
    background: #6b7280;
}

.table-compact {
    font-size: 13px;
}

.table-compact th,
.table-compact td {
    padding: 6px;
}

/* ===== WMSLOGIS V1 ===== */

body {
    background: #f4f6f8;
}

/* HEADER */
.topbar-v1 {
    background: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ff6a00;
}

.logo {
    font-size: 20px;
    color: #0b3b70;
}

.user-info {
    color: #0b3b70;
}

/* MAIN */
.main-v1 {
    padding: 28px 24px 48px;
    width: 100%;
    margin: 0;
    text-align: left;
}

.app-shell {
    width: 100%;
    max-width: 1720px;
    margin: 0 auto;
}

.dashboard-shell {
    max-width: none;
    margin: 0;
}

.dashboard-title {
    margin: 0 0 18px;
}

.dashboard-actions {
    margin-top: 24px;
}

/* FOOTER */
.footer-v1 {
    background: #0b3b70;
    color: white;
    text-align: center;
    padding: 15px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* ===== CARDS MENU ===== */

.menu-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.menu-card {
    width: 180px;
    height: 140px;
    background: #0b3b70;
    color: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 16px;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.menu-card i {
    font-size: 32px;
    margin-bottom: 10px;
}

.menu-card:hover {
    background: #ff6a00;
    transform: translateY(-5px);
}

/* BOTONES */
.btn-orange {
    background: #ff6a00;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
}

.btn-orange:hover {
    background: #e55a00;
}

.btn-back {
    display: block;
    width: fit-content;
    margin: 20px auto 0;
    background: #ff6a00;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
}

.menu-screen {
    text-align: center;
}

.menu-screen h2 {
    margin: 0;
    color: #0b3b70;
}

.menu-screen .btn-back {
    margin-top: 26px;
}

.menu-screen-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 8px auto 0;
    max-width: 660px;
    line-height: 1.5;
}

.menu-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
    margin: 36px 0 0;
    display: block;
}

/* Page intro header */
.page-intro-card {
    background: linear-gradient(135deg, #0b3b70 0%, #1a5ca8 100%);
    border-radius: 12px;
    padding: 20px 28px;
    margin-bottom: 24px;
    color: white;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    box-shadow: 0 4px 14px rgba(11, 59, 112, 0.18);
}

.page-intro-card .page-intro-path {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.65;
    margin: 0 0 6px;
}

.page-intro-card h2 {
    margin: 0 0 6px;
    color: white;
    font-size: 20px;
}

.page-intro-card p {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
    max-width: 760px;
    line-height: 1.5;
}

.page-intro-card .page-intro-back {
    margin-left: auto;
    white-space: nowrap;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.page-intro-card .page-intro-back:hover {
    background: rgba(255,255,255,0.28);
}

.operation-home {
    max-width: 680px;
    margin: 0 auto;
}

.operation-home h2 {
    text-align: center;
    color: #0b3b70;
    margin-bottom: 18px;
}

.operation-home form {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.operation-home form label {
    flex-basis: 100%;
    margin: 0;
    font-weight: 600;
}

.operation-home form input {
    flex: 1 1 340px;
    min-width: 240px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.operation-home form button {
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    background: #2d7ef7;
    color: #fff;
    cursor: pointer;
}

.operation-home .home-back {
    text-align: center;
    margin-top: 18px;
}

.module-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.module-header h2 {
    grid-column: 2;
    margin: 0;
    text-align: center;
    color: #0b3b70;
}

.module-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-actions .btn-primary {
    white-space: nowrap;
}

.module-back {
    margin-top: 20px;
    text-align: center;
}

.module-back .btn-back {
    margin-top: 0;
}

/* ===== OPERATIONS DASHBOARD ===== */

.ops-dashboard {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ops-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ops-header h2 {
    margin: 0;
    color: #0b3b70;
}

.ops-header p {
    margin-top: 8px;
    color: #4b5563;
    max-width: 760px;
}

.ops-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ops-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr));
    gap: 12px;
}

.ops-kpi {
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #d1d5db;
}

.ops-kpi p {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
}

.ops-kpi h3 {
    margin: 6px 0;
    color: #111827;
    font-size: 24px;
}

.ops-kpi small {
    color: #6b7280;
}

.ops-kpi.ok {
    border-top-color: #16a34a;
}

.ops-kpi.warning {
    border-top-color: #f59e0b;
}

.ops-kpi.critical {
    border-top-color: #dc2626;
}

.ops-grid {
    display: grid;
    gap: 14px;
}

.ops-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-section-title {
    margin-bottom: 12px;
}

.ops-section-title h3 {
    margin: 0;
    color: #0b3b70;
}

.ops-chart-wrap {
    position: relative;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    overflow: hidden;
}

.ops-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.ops-mini-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.ops-mini-kpis div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}

.ops-mini-kpis span {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.ops-mini-kpis strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 18px;
}

.ops-note {
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

.mt-3 {
    margin-top: 12px;
}

@media (max-width: 1400px) {
    .ops-kpi-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 980px) {
    .ops-grid.two-col {
        grid-template-columns: 1fr;
    }

    .ops-kpi-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 640px) {
    .ops-kpi-grid {
        grid-template-columns: 1fr;
    }

    .ops-mini-kpis {
        grid-template-columns: 1fr;
    }
}

/* ===== LOGIN WMSLOGIS V1 ===== */

/* ===== LOGIN WMSLOGIS V1 ===== */

.login-body {
    margin: 0;
    min-height: 100vh;
    background: #f3f3f3;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 78px;
}

.login-split-bg {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    z-index: 0;
}

.login-bg-left {
    background: #ff6600;
}

.login-bg-right {
    background: #0b3b70;
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 78px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.login-panel {
    width: 100%;
    max-width: 1120px;
    min-height: 610px;
    background: #fafafa;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 6px 1fr;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.login-left,
.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: #fafafa;
}

.login-left {
    text-align: center;
}

.login-right {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.login-divider {
    background: #ff6600;
    width: 100%;
    height: 100%;
}

.login-logo {
    max-width: 460px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.login-title {
    width: 100%;
    text-align: center;
    color: #0b3b70;
    font-size: 28px;
    margin-bottom: 28px;
}

.login-form {
    width: 100%;
    max-width: 360px;
}

.login-form label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #2f2f2f;
    margin-bottom: 8px;
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 20px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    background: #ffffff;
    font-size: 16px;
}

.login-form input:focus {
    outline: none;
    border-color: #ff6600;
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.12);
}

.login-form button {
    width: 100%;
    border: none;
    border-radius: 6px;
    background: #ff6600;
    color: white;
    padding: 12px 16px;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s ease;
}

.login-form button:hover {
    background: #e85d00;
}

.login-message {
    width: 100%;
    max-width: 360px;
    text-align: center;
    color: red;
    margin-bottom: 16px;
    font-size: 16px;
}

.login-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0b3b70;
    color: white;
    text-align: center;
    padding: 16px 10px;
    font-size: 16px;
    z-index: 2;
    letter-spacing: 0.3px;
    font-weight: 500;
}

@media (max-width: 980px) {
    .login-panel {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-divider {
        display: none;
    }

    .login-left,
    .login-right {
        padding: 28px;
    }

    .login-right {
        align-items: center;
    }

    .login-title {
        text-align: center;
    }

    .login-logo {
        max-width: 320px;
    }
}

@media (max-width: 640px) {
    .login-shell {
        padding: 14px;
    }

    .login-left,
    .login-right {
        padding: 22px;
    }

    .login-logo {
        max-width: 240px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-form label {
        font-size: 15px;
    }

    .login-form button {
        font-size: 16px;
    }
}

/* ===== SCALE LOGIN ===== */

.login-shell {
    transform: scale(0.88);
    transform-origin: center;
}

/* Ajuste para que no quede muy abajo */
@media (min-width: 981px) {
    .login-shell {
        margin-top: -20px;
    }
}

.btn-small {
    padding: 6px 14px;
    font-size: 14px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.logo-link:hover {
    opacity: 0.8;
}

/* ===== Outbound Maintenance / Shorts – shared styles ===== */

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    margin-right: 6px;
    cursor: pointer;
    color: #fff;
}

.btn-action-edit { background: #3b82f6; }
.btn-action-primary { background: #0b3b70; }
.btn-action-cancel { background: #111111; }
.btn-action-delete { background: #dc2626; }

.btn-action-disabled {
    background: #d1d5db;
    color: #4b5563;
    cursor: not-allowed;
    opacity: 1;
}

.btn-action:hover,
.btn-action:focus {
    opacity: 0.9;
    color: #fff;
}

.btn-action-disabled:hover,
.btn-action-disabled:focus {
    color: #4b5563;
    opacity: 1;
}

.maint-row.is-selected { background: #eff6ff; }

/* --- Tabla con scroll (override base .table-container) --- */
.table-scroll {
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.table-scroll .table-basic { margin: 0; }

.table-scroll .table-basic thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    box-shadow: 0 1px 0 #e2e8f0;
}

/* --- Toolbar --- */
.maint-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.maint-toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.maint-toolbar-right {
    color: #475569;
    font-size: 13px;
}

.maint-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    min-height: 40px;
    box-sizing: border-box;
}

/* --- Filtros --- */
.maint-filters {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.maint-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-input,
.filter-select {
    height: 32px;
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.filter-input-sm { width: 130px; }
.filter-select { min-width: 140px; }
.filter-search { width: 220px; }

.filter-group-btn {
    justify-content: flex-end;
}

.btn-primary:disabled {
    background: #cbd5e1;
    color: #475569;
    cursor: not-allowed;
}