:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --bg-color: #f1f5f9;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}


::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6);
}
::-webkit-scrollbar-corner {
    background: transparent;
}
::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

.hidden {
    display: none !important;
}


.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.login-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 1.1rem;
}

.login-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.login-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-card .btn-primary {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
}


.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 10;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
    min-height: 68px;
}

.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.72rem;
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
    user-select: none;
}
.logo .highlight {
    color: var(--primary-color);
}
.logo .logo-icon {
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


.sidebar-brand-logo-area {
    position: relative;
    max-width: calc(100% - 38px);
    overflow: hidden;
    cursor: default;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    padding: 3px 6px;
    margin: -3px -6px;
}
.sidebar-brand-logo-area.can-upload {
    cursor: pointer;
}
.sidebar-brand-logo-area.can-upload:hover {
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-brand-logo-area.can-upload:hover::after {
    content: '📷';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    opacity: 0.85;
    pointer-events: none;
}
.sidebar-brand-logo {
    max-height: 38px;
    max-width: 155px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    transition: transform 0.2s ease, max-width 0.2s ease;
}
.sidebar-brand-logo-area.has-wide-logo .logo-text {
    display: none !important;
}
.sidebar-brand-logo-area.has-wide-logo .sidebar-brand-logo {
    max-width: 175px;
    max-height: 42px;
}
.sidebar-brand-logo-area .logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 135px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.side-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.side-nav::-webkit-scrollbar {
    width: 4px;
}
.side-nav::-webkit-scrollbar-track {
    background: transparent;
}
.side-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 9999px;
    transition: background 0.2s ease;
}
.side-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
}
.side-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.7);
}
.side-nav::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.nav-item {
    width: 100%;
    background: none;
    border: none;
    color: var(--sidebar-text);
    padding: 0.85rem 1.35rem;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.06);
    color: white;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
    border-right: 4px solid white;
}


.nav-group {
    margin-bottom: 0.25rem;
    transition: all 0.25s ease;
}

.nav-group-header {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.65rem 1.15rem 0.45rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: #94a3b8;
    user-select: none;
    transition: color 0.2s ease, background 0.2s ease;
    border-radius: 6px;
    font-family: inherit;
    text-align: left;
}

.nav-group-header:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.nav-group-icon {
    font-size: 0.88rem;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.nav-svg-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.2s ease;
}

.nav-item .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover .nav-svg-icon {
    transform: scale(1.12);
}

.nav-group-icon .nav-svg-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

.logo-icon .nav-svg-icon {
    width: 22px;
    height: 22px;
    stroke: #38bdf8;
    stroke-width: 2.2;
}

.sidebar.collapsed .nav-item .nav-svg-icon {
    width: 20px;
    height: 20px;
}

.nav-group-chevron {
    font-size: 0.72rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.65;
    display: inline-block;
}

.nav-group.open .nav-group-chevron {
    transform: rotate(0deg);
}

.nav-group:not(.open) .nav-group-chevron {
    transform: rotate(-90deg);
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.nav-group.open .nav-group-items {
    max-height: 520px;
    opacity: 1;
}

.nav-group:not(.open) .nav-group-items {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.nav-group .nav-item {
    padding-left: 1.6rem;
    font-size: 0.90rem;
}

.nav-divider {
    padding: 1rem 1.35rem 0.45rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.8px;
    user-select: none;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-export {
    width: 100%;
    background-color: #10b981;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.btn-export:hover {
    background-color: #059669;
}
.btn-export:disabled, .btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    filter: grayscale(20%);
    pointer-events: none;
}


.sidebar.collapsed {
    width: 70px;
}
.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.25rem 0.4rem;
}
.sidebar.collapsed .logo {
    justify-content: center;
    gap: 0;
}
.sidebar.collapsed .logo-text {
    display: none !important;
}
.sidebar.collapsed .sidebar-brand-logo-area {
    justify-content: center;
    max-width: 100%;
    padding: 0;
    margin: 0;
}
.sidebar.collapsed .sidebar-brand-logo {
    max-width: 44px;
    max-height: 34px;
    object-fit: contain;
}
.sidebar.collapsed .sidebar-brand-logo-area.can-upload:hover::after {
    display: none;
}
.sidebar.collapsed .sidebar-collapse-btn {
    position: absolute;
    right: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0f172a;
    border: 1px solid #334155;
    color: #38bdf8;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.sidebar.collapsed .sidebar-collapse-btn:hover {
    background: #1e293b;
    color: #ffffff;
    border-color: #38bdf8;
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.85rem 0;
    width: 100%;
    gap: 0;
}
.sidebar.collapsed .nav-item .icon {
    font-size: 1.25rem;
    margin: 0;
}
.sidebar.collapsed .nav-text {
    display: none;
}
.sidebar.collapsed .nav-group-header {
    display: none;
}
.sidebar.collapsed .nav-group {
    margin-bottom: 0;
}
.sidebar.collapsed .nav-group-items {
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
.sidebar.collapsed .nav-group .nav-item {
    padding-left: 0;
}
.sidebar.collapsed .nav-divider {
    font-size: 0;
    height: 1px;
    padding: 0;
    margin: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    text-indent: -9999px;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-footer {
    padding: 0.75rem 0.4rem;
    text-align: center;
}
.sidebar.collapsed .sidebar-footer .btn-import,
.sidebar.collapsed .sidebar-footer .btn-export {
    padding: 0.75rem 0;
    justify-content: center;
    border-radius: 8px;
}
.sidebar.collapsed .sidebar-footer .btn-text,
.sidebar.collapsed .sidebar-footer .sidebar-dev-credit {
    display: none;
}
.sidebar.collapsed .nav-item.active {
    border-right: 3px solid #38bdf8;
    background: rgba(56, 189, 248, 0.18);
}


.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.top-header {
    background-color: var(--card-bg);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 5;
    min-width: 0;
    width: 100%;
    gap: 12px;
}

.desktop-sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--card-bg, #ffffff);
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 1rem;
}
.desktop-sidebar-toggle-btn:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--primary, #0284c7);
    border-color: #cbd5e1;
}
.desktop-sidebar-toggle-btn.active {
    background: rgba(2, 132, 199, 0.1);
    color: var(--primary, #0284c7);
    border-color: rgba(2, 132, 199, 0.3);
}

.btn-scan-qr-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #334155;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.btn-scan-qr-compact:hover {
    background: #1e293b;
    border-color: #38bdf8;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}


.user-menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px 3px 4px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-main, #1e293b);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
    background: var(--bg-hover, rgba(15, 23, 42, 0.08));
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-avatar-wrap {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.user-avatar-wrap .avatar {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
}

.user-live-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--card-bg, #ffffff);
    background-color: #10b981;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    transition: background-color 0.25s ease;
}
.user-live-status-dot.connected {
    background-color: #10b981;
}
.user-live-status-dot.reconnecting {
    background-color: #f59e0b;
}
.user-live-status-dot.disconnected {
    background-color: #ef4444;
}

.user-trigger-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.user-trigger-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main, #0f172a);
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-trigger-plan-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.user-trigger-plan-tag.plan-tag-custom,
.user-trigger-plan-tag.plan-tag-enterprise {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.user-trigger-plan-tag.plan-tag-trial {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.user-trigger-arrow {
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
    transition: transform 0.2s ease;
    margin-left: -2px;
}
.user-menu-trigger[aria-expanded="true"] .user-trigger-arrow {
    transform: rotate(180deg);
}

.user-menu-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 12px 35px -6px rgba(15, 23, 42, 0.18), 0 0 1px 1px rgba(15, 23, 42, 0.06);
    padding: 0;
    z-index: 100;
    overflow: hidden;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popover-profile-header {
    padding: 1.15rem 1.25rem;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.07), rgba(99, 102, 241, 0.05));
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 12px;
}
.popover-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3);
    flex-shrink: 0;
}
.popover-user-details {
    flex: 1;
    min-width: 0;
}
.popover-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.popover-user-sub {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 4px;
}
.popover-badge-wrap .badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    letter-spacing: 0.03em;
    font-weight: 700;
}

.popover-section-block {
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
}
.popover-section-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 6px;
}

.user-menu-popover .unified-status-badge,
.user-menu-popover .subscription-header-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-hover, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}
.user-menu-popover .unified-status-badge:hover,
.user-menu-popover .subscription-header-badge:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.status-item-left,
.sub-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.status-item-text,
.sub-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}
.status-subtext,
.sub-item-subtext {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    line-height: 1.2;
}
.sub-item-plan-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
}
.sub-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.popover-action-icon {
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
    flex-shrink: 0;
}

.popover-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-main, #334155);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}
.popover-menu-item:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--primary, #0284c7);
    transform: translateX(2px);
}
.popover-menu-item .item-icon {
    font-size: 0.95rem;
}

.popover-footer {
    padding: 0.75rem 1.15rem;
    background: var(--bg-hover, #f8fafc);
}
.popover-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
}
.popover-logout-btn:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25);
}

.avatar {
    width: 34px;
    height: 34px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.section {
    display: none;
}
.section.active {
    display: block;
    max-width: 100%;
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}


.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.02);
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    min-width: 0;
}

.flex-header > div:first-child {
    min-width: 0;
}

.flex-header > div:last-child,
.flex-header .actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hidden-form {
    display: none;
}


.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    overflow-x: auto;
    border: 1px solid var(--border-color, rgba(0,0,0,0.02));
    position: relative;
    max-height: calc(100vh - 215px);
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 1rem 1.35rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--card-bg, #ffffff);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border-color);
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: var(--table-hover-bg, #f8fafc);
}


.text-right, th.text-right, td.text-right {
    text-align: right !important;
}

.text-center, th.text-center, td.text-center {
    text-align: center !important;
}

.tabular-nums, td.text-right, .font-tabular {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}


.code-badge, .sku-pill {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary, #0284c7);
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: 6px;
    padding: 2px 7px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    white-space: nowrap;
}

.badge-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    flex-shrink: 0;
    vertical-align: middle;
}


.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

@media (max-width: 992px) {
    .form-row-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .form-row, .form-row-3, .form-row-4 {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.85rem;
    }
}

.modal-body .form-group {
    margin-bottom: 0.95rem;
}

.modal-body label {
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-body input, .modal-body select, .modal-body textarea {
    padding: 0.65rem 0.85rem;
    font-size: 0.92rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input, select, textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #f8fafc;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}


.btn-primary, .btn-secondary {
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-primary .icon,
.btn-secondary .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    margin-right: 6px;
    flex-shrink: 0;
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1.5rem;
}


.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    bottom: -100px;
    right: 30px;
    background-color: var(--sidebar-bg);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999999 !important;
    max-width: 500px;
    font-size: 0.95rem;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.toast.show {
    bottom: 30px;
}

.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.loader-overlay.hidden {
    display: none;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg);
    border-radius: 12px 12px 0 0;
}

.table-search {
    flex: 1;
    max-width: 300px;
}

.table-search input {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    justify-content: flex-end;
}

.page-btn {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border-color);
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--bg-color);
    border-color: #cbd5e1;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-card {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-card h2 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}


.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.25s ease;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    border-color: #cbd5e1;
}

.dash-card.dash-clickable {
    cursor: pointer;
    border-left: 4px solid var(--danger-color);
}

.dash-card.dash-clickable:hover {
    background-color: #fff1f2;
}

.dash-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.bg-blue { background-color: #eff6ff; color: #2563eb; }
.bg-purple { background-color: #f5f3ff; color: #7c3aed; }
.bg-red { background-color: #fef2f2; color: #dc2626; }
.bg-emerald { background-color: #ecfdf5; color: #059669; }
.bg-amber { background-color: #fffbeb; color: #d97706; }

.dash-icon-svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    display: block;
}

.dash-info h3 {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dash-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.text-danger { color: #dc2626 !important; }
.text-emerald { color: #059669 !important; }
.text-primary { color: #2563eb !important; }
.font-bold { font-weight: 600; }


.inventory-toolbar, .inventory-toolbar-expanded {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.inventory-toolbar-expanded {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
}

.search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 450px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 2.2rem 0.65rem 2.4rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-box input:focus {
    background-color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 50%;
}

.clear-btn:hover {
    color: var(--text-main);
    background-color: #e2e8f0;
}

.toolbar-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.filter-select-group select {
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    font-size: 0.85rem;
    cursor: pointer;
}

.view-toggle-group {
    display: flex;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
}

.toggle-btn {
    background: none;
    border: none;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    white-space: nowrap;
}

.badge-dot.pulse {
    animation: badgePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}


.badge-success, .badge-stock-ok {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.badge-warning, .badge-stock-low {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-danger, .badge-stock-empty {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.badge-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-neutral {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.badge-purple {
    background-color: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.badge-cyan {
    background-color: #ecfeff;
    color: #0891b2;
    border: 1px solid #a5f3fc;
}

.badge-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 600;
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.badge-inactive {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 600;
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.badge-loc {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
}


.badge-role-superadmin {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(168, 85, 247, 0.25));
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.4);
    font-weight: 700;
}
.badge-role-owner {
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.35);
    font-weight: 700;
}
.badge-role-admin {
    background: rgba(14, 165, 233, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
    font-weight: 600;
}
.badge-role-supervisor {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-weight: 600;
}
.badge-role-warehouse {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 600;
}
.badge-role-tech {
    background: rgba(6, 182, 212, 0.16);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-weight: 600;
}
.badge-role-seller {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 600;
}
.badge-role-viewer {
    background: rgba(148, 163, 184, 0.16);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
    font-weight: 500;
}

@keyframes pulseAlert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}


.action-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn-action-adjust,
.btn-action-move {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-action-adjust .btn-action-icon,
.btn-action-move .btn-action-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.btn-action-adjust {
    background-color: var(--card-bg, #f8fafc);
    border: 1px solid var(--border-color, #cbd5e1);
    color: var(--text-main, #334155);
}

.btn-action-adjust:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: translateY(-1px);
}

.btn-action-move {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.btn-action-move:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
    transform: translateY(-1px);
}


.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.inv-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.inv-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.inv-card.low-stock-card {
    border-left: 4px solid var(--danger-color);
}

.inv-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.inv-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.inv-card-sku {
    display: inline-block;
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.inv-card-body {
    margin: 1rem 0;
}

.inv-card-loc {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.inv-card-stock-display {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.inv-card-qty {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}

.inv-card-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.stock-progress-bar {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.stock-progress-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.stock-progress-fill.fill-danger {
    background-color: var(--danger-color);
}

.inv-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.85rem;
    margin-top: 0.5rem;
}

.inv-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}


.modal-sm { max-width: 480px !important; }
.modal-md { max-width: 640px !important; }
.modal-lg { max-width: 840px !important; }
.modal-xl { max-width: 1020px !important; }


.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
    z-index: 9990;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.32);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-sizing: border-box;
    margin: auto;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.15rem 1.6rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.15s;
}

.modal-close:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    box-sizing: border-box;
    width: 100%;
}

.modal-body * {
    box-sizing: border-box;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.item-summary-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 0.25rem 0;
}

.summary-label {
    color: var(--text-muted);
}

.quantity-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-stepper input {
    flex: 1;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.step-btn {
    width: 44px;
    height: 44px;
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s;
}

.step-btn:hover {
    background-color: #e2e8f0;
}

.alert-box-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 0.82rem;
    color: #92400e;
    margin-top: 1rem;
    line-height: 1.4;
}

.mt-3 {
    margin-top: 1rem;
}


.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.empty-state h4 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.empty-state p {
    font-size: 0.9rem;
}


.btn-import {
    width: 100%;
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.btn-import:hover {
    background-color: #2563eb;
}
.mb-2 { margin-bottom: 0.5rem; }

.bg-amber { background-color: #fffbeb; }
.text-amber { color: #d97706 !important; }


.qr-label-card {
    background: white;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    max-width: 320px;
    margin: 0 auto;
}

.qr-label-brand {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.qr-code-canvas-container {
    background: white;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.qr-label-sku {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.qr-label-name {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.25rem;
}

.qr-label-cat {
    font-size: 0.8rem;
    color: #64748b;
}



.file-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
    background-color: #eff6ff;
    border-color: #3b82f6;
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.drop-text {
    font-size: 0.95rem;
    color: #475569;
}

.import-status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
}

.import-status.success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.import-status.error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}




.badge-eq-operativo {
    background-color: #dcfce7;
    color: #15803d;
}
.badge-eq-taller {
    background-color: #fef3c7;
    color: #b45309;
}
.badge-eq-danado {
    background-color: #fee2e2;
    color: #b91c1c;
}
.badge-eq-almacen {
    background-color: #f1f5f9;
    color: #475569;
}


.scanner-video-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 240px;
    margin: 0 auto;
    background-color: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #334155;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-target-box {
    position: absolute;
    width: 180px;
    height: 180px;
    border: 2px solid rgba(59, 130, 246, 0.8);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
    pointer-events: none;
}

.laser-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    box-shadow: 0 0 8px #ef4444;
    animation: laserScan 2s ease-in-out infinite;
}

@keyframes laserScan {
    0%, 100% { top: 10%; }
    50% { top: 90%; }
}


.request-items-container {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
}

.request-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.request-item-row select {
    flex: 3;
    min-width: 0 !important;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.request-item-row input {
    flex: 1;
    min-width: 70px;
    max-width: 140px;
}

.request-item-row button {
    flex-shrink: 0;
}

.request-item-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}


.dispatch-receipt-doc {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.receipt-brand h2 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.receipt-brand p {
    font-size: 0.8rem;
    color: #64748b;
}

.receipt-number {
    text-align: right;
}

.receipt-number span {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1px;
}

.receipt-number h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.receipt-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    font-size: 0.85rem;
    background-color: #f8fafc;
    padding: 0.85rem;
    border-radius: 8px;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.receipt-table th {
    background-color: #f1f5f9;
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
    font-weight: 700;
}

.receipt-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
}

.receipt-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1rem;
}

.signature-box {
    width: 45%;
    text-align: center;
}

.sig-line {
    border-bottom: 1px solid #0f172a;
    margin-bottom: 0.5rem;
}

.sig-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}


.doc-items-container {
    width: 100%;
    margin: 0.5rem 0 1rem 0;
}

.doc-table-styled {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.92rem;
    background: #ffffff;
}

.doc-table-styled th {
    background-color: #f1f5f9;
    color: #0f172a;
    border: 1.5px solid #cbd5e1;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.doc-table-styled td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    color: #1e293b;
    vertical-align: middle;
}

.sig-role-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

.sig-space {
    height: 52px;
}


.doc-qr-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 6px;
    background: #ffffff;
}

.doc-qr-badge svg {
    display: block;
}

.doc-qr-badge-caption {
    font-size: 0.60rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-align: center;
}

@media print {
    @page {
        size: letter portrait;
        margin: 0;
    }
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box !important;
        animation: none !important;
        transition: none !important;
    }
    html, body {
        display: block !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    
    #app-main-layout,
    .app-layout,
    .sidebar,
    .main-content,
    .top-header,
    .content-area,
    .login-overlay,
    .modal-overlay.hidden,
    .modal-header,
    .form-actions,
    .modal-close,
    #toast,
    #loader,
    nav,
    header,
    aside,
    footer,
    button {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        visibility: hidden !important;
    }

    
    .modal-overlay:not(.hidden) {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        overflow: visible !important;
        backdrop-filter: none !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }

    .modal-overlay:not(.hidden) .modal-card {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .modal-overlay:not(.hidden) .modal-body {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    
    .dispatch-receipt-doc {
        display: flex !important;
        flex-direction: column !important;
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        min-height: 268mm !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 12mm 15mm 10mm 15mm !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
    }

    .dispatch-receipt-doc p,
    .dispatch-receipt-doc div,
    .dispatch-receipt-doc strong,
    .dispatch-receipt-doc span,
    .dispatch-receipt-doc h2,
    .dispatch-receipt-doc h3 {
        color: #000000 !important;
    }

    .dispatch-receipt-doc p {
        line-height: 1.65 !important;
        font-size: 0.98rem !important;
        margin-bottom: 0.9rem !important;
    }

    .dispatch-receipt-doc .receipt-header {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 2px solid #000000 !important;
        padding-bottom: 0.6rem !important;
        margin-bottom: 1rem !important;
        flex-shrink: 0 !important;
    }

    .dispatch-receipt-doc .doc-items-container {
        width: 100% !important;
        margin: 0.5rem 0 1rem 0 !important;
        flex-shrink: 0 !important;
    }

    .dispatch-receipt-doc .doc-table-styled {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 0 !important;
        font-size: 0.92rem !important;
    }

    .dispatch-receipt-doc .doc-table-styled th {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
        border: 1.5px solid #000000 !important;
        padding: 6px 10px !important;
        font-weight: 800 !important;
        font-size: 0.82rem !important;
        letter-spacing: 0.5px !important;
        text-transform: uppercase !important;
    }

    .dispatch-receipt-doc .doc-table-styled td {
        border: 1px solid #64748b !important;
        padding: 7px 10px !important;
        color: #000000 !important;
        vertical-align: middle !important;
    }

    .dispatch-receipt-doc .receipt-signatures,
    .receipt-signatures {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-top: auto !important; 
        margin-bottom: 1rem !important;
        padding: 0 1.5rem !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    .dispatch-receipt-doc .signature-box,
    .signature-box {
        display: block !important;
        width: 42% !important;
        max-width: 45% !important;
        flex: 0 0 42% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .dispatch-receipt-doc .sig-role-title {
        font-weight: 700 !important;
        font-size: 0.95rem !important;
        color: #000000 !important;
    }

    .dispatch-receipt-doc .sig-space {
        height: 52px !important;
    }

    .dispatch-receipt-doc .sig-line {
        border-bottom: 1.5px solid #000000 !important;
        margin-bottom: 0.4rem !important;
    }

    .dispatch-receipt-doc .receipt-footer-official {
        display: block !important;
        width: 100% !important;
        margin-top: 0 !important;
        padding-top: 0.6rem !important;
        border-top: 1px solid #cbd5e1 !important;
        text-align: center !important;
        font-size: 0.78rem !important;
        color: #475569 !important;
        line-height: 1.35 !important;
        flex-shrink: 0 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .receipt-table {
        width: 100% !important;
        break-inside: auto;
    }
    .receipt-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    
    #printable-qr-label {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        padding: 1.5rem !important;
        background: #ffffff !important;
    }
}



.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
}


.audit-input-qty {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}

.audit-diff-positive {
    color: #15803d;
    font-weight: 700;
}

.audit-diff-negative {
    color: #b91c1c;
    font-weight: 700;
}


.badge-active {
    background-color: #dcfce7;
    color: #15803d;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-inactive {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-received {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-draft {
    background-color: #fef3c7;
    color: #b45309;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-main);
    transition: all 0.15s ease;
}

.btn-icon-action:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.has-attachment {
    border-color: #3b82f6;
    color: #1d4ed8;
    background: #eff6ff;
}



body[data-user-role="owner"] .role-superadmin-only,
body[data-user-role="admin"] .role-superadmin-only,
body[data-user-role="supervisor"] .role-superadmin-only,
body[data-user-role="warehouse_manager"] .role-superadmin-only,
body[data-user-role="technician"] .role-superadmin-only,
body[data-user-role="seller"] .role-superadmin-only,
body[data-user-role="viewer"] .role-superadmin-only {
    display: none !important;
}


body[data-user-role="supervisor"] .role-admin-only,
body[data-user-role="warehouse_manager"] .role-admin-only,
body[data-user-role="technician"] .role-admin-only,
body[data-user-role="seller"] .role-admin-only,
body[data-user-role="viewer"] .role-admin-only {
    display: none !important;
}


body[data-user-role="warehouse_manager"] .role-supervisor-only,
body[data-user-role="technician"] .role-supervisor-only,
body[data-user-role="seller"] .role-supervisor-only,
body[data-user-role="viewer"] .role-supervisor-only {
    display: none !important;
}


body[data-user-role="technician"] .role-warehouse-only,
body[data-user-role="seller"] .role-warehouse-only,
body[data-user-role="viewer"] .role-warehouse-only {
    display: none !important;
}


body[data-user-role="warehouse_manager"] .role-financial-only,
body[data-user-role="technician"] .role-financial-only,
body[data-user-role="seller"] .role-financial-only,
body[data-user-role="viewer"] .role-financial-only {
    display: none !important;
}


body[data-user-role="technician"] .btn-action-adjust,
body[data-user-role="technician"] .btn-action-move,
body[data-user-role="technician"] .btn-action-delete,
body[data-user-role="technician"] .btn-action-edit,
body[data-user-role="technician"] .btn-import,
body[data-user-role="seller"] .btn-action-adjust,
body[data-user-role="seller"] .btn-action-move,
body[data-user-role="seller"] .btn-action-delete,
body[data-user-role="seller"] .btn-action-edit,
body[data-user-role="seller"] .btn-import,
body[data-user-role="viewer"] .role-hide-viewer,
body[data-user-role="viewer"] .btn-action-delete,
body[data-user-role="viewer"] .btn-action-edit,
body[data-user-role="viewer"] .btn-action-adjust,
body[data-user-role="viewer"] .btn-action-move,
body[data-user-role="viewer"] .btn-import,
body[data-user-role="viewer"] #nav-users {
    display: none !important;
}


.company-settings-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .btn-scan-qr .scan-label {
        display: none;
    }
    .btn-scan-qr {
        padding: 6px 10px;
    }
    .tenant-selector-pill {
        max-width: 180px;
    }
    .tenant-dropdown-select {
        max-width: 120px;
    }
    .top-header {
        padding: 0.8rem 1.25rem;
    }
}

@media (max-width: 1024px) {
    .company-settings-grid {
        grid-template-columns: 1fr;
    }
    .header-right {
        gap: 8px;
    }
    #subscription-badge-wrap #sub-badge-text {
        display: none;
    }
    .subscription-header-badge {
        padding: 5px 8px;
    }
    .user-info-text {
        display: none;
    }
    .tenant-selector-pill {
        max-width: 140px;
    }
    .tenant-dropdown-select {
        max-width: 90px;
    }
    .search-row {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}




.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.header-left h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    min-width: 0;
}


.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background-color: rgba(0,0,0,0.05);
}

.hamburger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-main);
    position: relative;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-main);
    position: absolute;
    left: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-icon::before { top: -7px; }
.hamburger-icon::after  { top: 7px; }


.sidebar.mobile-open ~ .main-content .hamburger-icon {
    background-color: transparent;
}
.sidebar.mobile-open ~ .main-content .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}
.sidebar.mobile-open ~ .main-content .hamburger-icon::after {
    transform: rotate(-45deg);
    top: 0;
}


.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 49;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 769px) {
    .sidebar-backdrop,
    .sidebar-backdrop.active {
        display: none !important;
        pointer-events: none !important;
    }
}


@media (max-width: 768px) {

    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    
    .sidebar-backdrop {
        display: block;
    }

    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 50;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    
    .sidebar.collapsed {
        width: 280px !important;
    }
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .sidebar-footer .btn-text,
    .sidebar.collapsed .sidebar-dev-credit {
        display: inline !important;
    }
    .sidebar.collapsed .nav-divider {
        font-size: 0.72rem !important;
        height: auto !important;
        padding: 1rem 1.35rem 0.45rem !important;
        margin: 0 !important;
        background: none !important;
        text-indent: 0 !important;
        overflow: visible !important;
    }
    .sidebar.collapsed .nav-item {
        justify-content: flex-start !important;
        padding: 0.85rem 1.35rem !important;
        gap: 12px !important;
    }
    .sidebar-collapse-btn,
    .desktop-sidebar-toggle-btn {
        display: none !important;
    }

    .btn-scan-qr-compact {
        padding: 5px 8px !important;
        font-size: 0.82rem !important;
    }
    .btn-scan-qr-compact .scan-label {
        display: none !important;
    }

    
    .user-menu-popover {
        position: fixed !important;
        top: 58px !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        max-width: 360px !important;
        margin-left: auto !important;
    }
    .user-trigger-info {
        display: none !important;
    }
    .user-menu-trigger {
        padding: 3px 6px 3px 3px !important;
    }

    
    .main-content {
        width: 100%;
    }

    
    .top-header {
        padding: 0.65rem 0.85rem;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .header-left {
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .header-left h1 {
        font-size: 1.05rem;
        min-width: 0;
    }

    .header-right {
        gap: 6px;
        flex-shrink: 0;
    }

    
    .scan-label {
        display: none !important;
    }

    .btn-scan-qr {
        padding: 5px 8px !important;
        font-size: 0.82rem !important;
    }

    
    .unified-status-badge .status-label,
    .unified-status-badge .ws-status-text,
    .offline-indicator .offline-label,
    .offline-indicator .ws-status-text {
        display: none !important;
    }

    .unified-status-badge,
    .offline-indicator {
        padding: 5px 8px;
        gap: 4px;
    }

    
    .user-info-text {
        display: none !important;
    }

    .btn-logout .logout-text {
        display: none !important;
    }

    .btn-logout {
        font-size: 0.82rem !important;
        padding: 5px 8px !important;
        margin-left: 2px !important;
    }

    .tenant-selector-pill {
        max-width: 115px;
        padding: 4px 6px;
        gap: 4px;
    }

    .tenant-dropdown-select {
        max-width: 70px;
        font-size: 0.76rem;
    }

    .tenant-badge-static {
        max-width: 105px;
        font-size: 0.76rem;
        padding: 4px 6px;
    }

    .subscription-header-badge {
        padding: 4px 8px;
    }

    #subscription-badge-wrap #sub-badge-text {
        display: none !important;
    }

    .avatar {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }

    .subscription-alert-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        text-align: center;
        padding: 8px 12px;
    }

    .subscription-alert-banner button {
        width: 100%;
    }

    
    .content-area {
        padding: 1rem;
    }

    
    .card {
        padding: 1.25rem;
    }

    
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.8rem;
    }

    .dash-card {
        padding: 1rem;
        gap: 0.8rem;
    }

    .dash-icon {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .dash-value {
        font-size: 1.5rem;
    }

    
    .flex-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    
    .inventory-toolbar,
    .inventory-toolbar-expanded {
        padding: 0.75rem 1rem;
    }

    .search-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-box,
    .search-box.expanded-search {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .view-toggle-group {
        width: 100%;
        justify-content: center;
    }

    .filters-row {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.65rem;
        width: 100%;
    }

    .filter-select-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
    }

    .filter-select-group label {
        font-size: 0.78rem;
    }

    .filter-select-group select {
        width: 100%;
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
    }

    
    .table-container {
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 580px;
    }

    th, td {
        padding: 0.7rem 0.8rem;
        font-size: 0.82rem;
    }

    
    td {
        white-space: normal;
        word-break: break-word;
    }

    th {
        white-space: nowrap;
    }

    
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-card {
        max-width: 100% !important;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        margin: 0;
        animation: slideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUpMobile {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .modal-body {
        padding: 1.25rem 1rem;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    
    .inventory-grid {
        grid-template-columns: 1fr;
    }

    
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    

    
    .receipt-meta-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .receipt-signatures {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        width: 100% !important;
        gap: 1rem !important;
    }

    .signature-box {
        width: 45% !important;
        flex: 0 0 45% !important;
        text-align: center !important;
    }

    
    .request-item-row {
        flex-wrap: wrap;
    }

    .request-item-row select {
        flex: 1 1 100%;
    }

    .request-item-row input {
        flex: 1 1 80px;
        max-width: none;
    }

    
    .table-pagination {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    
    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    
    .toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    .toast.show {
        bottom: 1rem;
    }

    
    .scanner-video-container {
        max-width: 100%;
        height: 220px;
    }

    
    .qr-label-card {
        max-width: 100%;
    }
}



@media (max-width: 480px) {

    
    .top-header {
        padding: 0.45rem 0.55rem;
    }

    .header-left {
        gap: 5px;
        max-width: 32%;
        flex-shrink: 1;
    }

    .header-left h1 {
        font-size: 0.88rem;
    }

    .header-right {
        gap: 4px;
    }

    .btn-scan-qr {
        padding: 4px 6px !important;
        font-size: 0.78rem !important;
    }

    .btn-notifications-bell {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .tenant-selector-pill {
        max-width: 82px;
        padding: 3px 4px;
        gap: 2px;
    }

    .tenant-dropdown-select {
        max-width: 46px;
        font-size: 0.68rem;
        padding-right: 0;
    }

    .tenant-pill-icon {
        font-size: 0.75rem;
    }

    .tenant-pill-arrow {
        display: none !important;
    }

    .tenant-badge-static {
        max-width: 78px;
        font-size: 0.68rem;
        padding: 3px 4px;
    }

    .avatar {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .btn-logout {
        padding: 4px 6px !important;
        font-size: 0.78rem !important;
        margin-left: 0 !important;
    }

    .subscription-header-badge {
        padding: 3px 6px;
    }

    
    .content-area {
        padding: 0.75rem;
    }

    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .dash-value {
        font-size: 1.3rem;
    }

    
    .btn-primary, .btn-secondary {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    
    .form-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }

    
    .modal-card {
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .modal-overlay {
        align-items: stretch;
    }

    
    .card {
        padding: 1rem;
        border-radius: 10px;
    }

    
    .sidebar {
        width: 260px;
    }

    
    .action-btn-group {
        flex-direction: column;
        gap: 4px;
    }
}



@media print {
    .mobile-menu-btn,
    .sidebar-backdrop,
    .hamburger-icon,
    .table-toolbar-top,
    .btn-table-cols {
        display: none !important;
    }

    .sidebar {
        transform: none !important;
        position: static !important;
    }
}


table.hide-col-1 th:nth-child(1), table.hide-col-1 td:nth-child(1),
table.hide-col-2 th:nth-child(2), table.hide-col-2 td:nth-child(2),
table.hide-col-3 th:nth-child(3), table.hide-col-3 td:nth-child(3),
table.hide-col-4 th:nth-child(4), table.hide-col-4 td:nth-child(4),
table.hide-col-5 th:nth-child(5), table.hide-col-5 td:nth-child(5),
table.hide-col-6 th:nth-child(6), table.hide-col-6 td:nth-child(6),
table.hide-col-7 th:nth-child(7), table.hide-col-7 td:nth-child(7),
table.hide-col-8 th:nth-child(8), table.hide-col-8 td:nth-child(8),
table.hide-col-9 th:nth-child(9), table.hide-col-9 td:nth-child(9),
table.hide-col-10 th:nth-child(10), table.hide-col-10 td:nth-child(10),
table.hide-col-11 th:nth-child(11), table.hide-col-11 td:nth-child(11),
table.hide-col-12 th:nth-child(12), table.hide-col-12 td:nth-child(12),
table.hide-col-13 th:nth-child(13), table.hide-col-13 td:nth-child(13),
table.hide-col-14 th:nth-child(14), table.hide-col-14 td:nth-child(14),
table.hide-col-15 th:nth-child(15), table.hide-col-15 td:nth-child(15),
table.hide-col-16 th:nth-child(16), table.hide-col-16 td:nth-child(16) {
    display: none !important;
}


table[class*="hide-col-"] td[colspan] {
    display: table-cell !important;
}


.table-toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-color, #334155);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: #94a3b8;
    backdrop-filter: blur(6px);
}

.table-toolbar-top + .table-container {
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.table-toolbar-top .table-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #94a3b8;
}

.btn-table-cols {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color, #334155);
    color: #e2e8f0;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.btn-table-cols:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: #3b82f6;
    color: #ffffff;
}

.badge-col-count {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn .badge-col-count {
    margin-left: 5px;
}


.modal-columns-config {
    max-width: 440px;
    width: 92%;
    padding: 1.5rem;
    border-radius: 14px;
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
}

.columns-quick-actions {
    display: flex;
    gap: 6px;
    margin: 14px 0;
    flex-wrap: wrap;
}

.btn-quick-col {
    flex: 1;
    min-width: 95px;
    padding: 7px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #334155;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.btn-quick-col:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.btn-quick-col.highlight {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.btn-quick-col.highlight:hover {
    background: rgba(59, 130, 246, 0.28);
    color: #93c5fd;
}

.columns-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 12px;
}

.columns-checkbox-list::-webkit-scrollbar {
    width: 6px;
}
.columns-checkbox-list::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.column-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.column-toggle-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: #475569;
}

.column-toggle-item.is-hidden {
    opacity: 0.55;
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(51, 65, 85, 0.4);
}

.column-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #e2e8f0;
}

.col-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

.column-toggle-switch {
    position: relative;
    width: 38px;
    height: 22px;
    background: #475569;
    border-radius: 11px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.column-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.column-toggle-item.is-visible .column-toggle-switch {
    background: #10b981;
}

.column-toggle-item.is-visible .column-toggle-switch::after {
    transform: translateX(16px);
}

@media (max-width: 768px) {
    .table-toolbar-top {
        padding: 6px 10px;
        margin-top: 0.75rem;
    }
    .table-toolbar-top .hint-text {
        font-size: 0.72rem;
    }
    .modal-columns-config {
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
        padding: 1.25rem;
    }
}


.searchable-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.searchable-select-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
}

.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 6px 12px;
    background: #0f172a;
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
}

.searchable-select-trigger:hover {
    border-color: #3b82f6;
    background: #1e293b;
}

.searchable-select-trigger:focus,
.searchable-select-trigger.active {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.searchable-select-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.searchable-select-arrow {
    color: #94a3b8;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}


.searchable-portal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000000;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(2px);
    display: flex;
}

.searchable-portal-backdrop.hidden {
    display: none !important;
}

.searchable-portal-menu {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    max-height: 420px;
    z-index: 1000001;
    overflow: hidden;
    animation: portalFadeIn 0.15s ease-out;
}

@keyframes portalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.searchable-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.4);
}

.portal-header-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-header-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
}

.portal-header-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.searchable-portal-search-bar {
    position: relative;
    padding: 10px 14px 6px 14px;
    background: #1e293b;
}

.portal-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #94a3b8;
    pointer-events: none;
}

.searchable-portal-search-bar input {
    width: 100%;
    padding: 9px 34px 9px 34px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.searchable-portal-search-bar input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.portal-clear-btn {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: #334155;
    border: none;
    color: #e2e8f0;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-clear-btn:hover {
    background: #475569;
}

.searchable-portal-status {
    padding: 4px 14px 8px 14px;
    font-size: 0.75rem;
    color: #94a3b8;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.searchable-portal-options {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
}

.searchable-portal-options::-webkit-scrollbar {
    width: 6px;
}
.searchable-portal-options::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.portal-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.portal-option-item:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

.portal-option-item.selected {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

.portal-option-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.portal-option-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: #f1f5f9;
    word-break: break-word;
}

.portal-option-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.portal-badge-sku {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.72rem;
}

.portal-badge-stock {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.72rem;
}

.portal-check-icon {
    color: #10b981;
    font-weight: 700;
    font-size: 1rem;
    margin-left: 8px;
}

.portal-no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: #cbd5e1;
    font-size: 0.88rem;
}


@media (max-width: 768px) {
    .searchable-portal-backdrop {
        background: rgba(15, 23, 42, 0.75);
        align-items: flex-end;
    }

    .searchable-portal-menu {
        width: 100% !important;
        max-height: 82vh !important;
        border-radius: 16px 16px 0 0 !important;
        border-bottom: none !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8) !important;
        animation: portalSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes portalSlideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .searchable-portal-header {
        padding: 12px 16px;
    }

    .portal-header-title {
        font-size: 0.95rem;
    }

    .searchable-portal-search-bar input {
        padding: 11px 36px 11px 36px;
        font-size: 0.92rem;
    }

    .portal-option-item {
        padding: 12px 14px;
    }

    .portal-option-title {
        font-size: 0.92rem;
    }
}




[data-theme="light"] {
    --bg-color: #f8fafc;
    --bg-surface: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-text: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-bg: #f8fafc;
    --input-focus-bg: #ffffff;
    --btn-sec-bg: #ffffff;
    --btn-sec-text: #0f172a;
    --btn-sec-border: #cbd5e1;
    --btn-sec-hover: #f1f5f9;
    --modal-header-bg: #f8fafc;
    --container-sub-bg: #f8fafc;
    --table-hover-bg: #f8fafc;
}

[data-theme="dark"] {
    --bg-color: #0b1120;
    --bg-surface: #151f32;
    --sidebar-bg: #070d18;
    --sidebar-text: #f1f5f9;
    --card-bg: #151f32;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #27354f;
    --input-bg: #0d1527;
    --input-focus-bg: #111b30;
    --btn-sec-bg: #1e293b;
    --btn-sec-text: #f1f5f9;
    --btn-sec-border: #334155;
    --btn-sec-hover: #29384e;
    --modal-header-bg: #111a2c;
    --container-sub-bg: #0d1527;
    --table-hover-bg: rgba(59, 130, 246, 0.08);
}

[data-theme="oled"] {
    --bg-color: #000000;
    --bg-surface: #09090b;
    --sidebar-bg: #000000;
    --sidebar-text: #f8fafc;
    --card-bg: #09090b;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --border-color: #222226;
    --input-bg: #040405;
    --input-focus-bg: #0e0e11;
    --btn-sec-bg: #141416;
    --btn-sec-text: #f8fafc;
    --btn-sec-border: #27272a;
    --btn-sec-hover: #1f1f23;
    --modal-header-bg: #050506;
    --container-sub-bg: #040405;
    --table-hover-bg: rgba(255, 255, 255, 0.04);
}




[data-theme="dark"] .btn-secondary,
[data-theme="oled"] .btn-secondary {
    background-color: var(--btn-sec-bg) !important;
    color: var(--btn-sec-text) !important;
    border: 1px solid var(--btn-sec-border) !important;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="oled"] .btn-secondary:hover {
    background-color: var(--btn-sec-hover) !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-danger,
[data-theme="oled"] .btn-danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #b91c1c !important;
}

[data-theme="dark"] .btn-danger:hover,
[data-theme="oled"] .btn-danger:hover {
    background-color: #ef4444 !important;
}

[data-theme="dark"] .btn-action-adjust,
[data-theme="oled"] .btn-action-adjust {
    background-color: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .btn-action-adjust:hover,
[data-theme="oled"] .btn-action-adjust:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
}

[data-theme="dark"] .btn-action-move,
[data-theme="oled"] .btn-action-move {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .btn-action-move:hover,
[data-theme="oled"] .btn-action-move:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .bg-amber,
[data-theme="oled"] .bg-amber {
    background-color: rgba(217, 119, 6, 0.18) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .btn-icon-action,
[data-theme="oled"] .btn-icon-action {
    background-color: var(--btn-sec-bg) !important;
    border: 1px solid var(--btn-sec-border) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-icon-action:hover,
[data-theme="oled"] .btn-icon-action:hover {
    background-color: var(--btn-sec-hover) !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-icon-action.has-attachment,
[data-theme="oled"] .btn-icon-action.has-attachment {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .btn-table-cols,
[data-theme="oled"] .btn-table-cols {
    background-color: var(--btn-sec-bg) !important;
    border: 1px solid var(--btn-sec-border) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-table-cols:hover,
[data-theme="oled"] .btn-table-cols:hover {
    background-color: var(--btn-sec-hover) !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-quick-col,
[data-theme="oled"] .btn-quick-col {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .btn-quick-col:hover,
[data-theme="oled"] .btn-quick-col:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .page-btn,
[data-theme="oled"] .page-btn {
    background-color: var(--btn-sec-bg) !important;
    border: 1px solid var(--btn-sec-border) !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .page-btn:hover:not(:disabled),
[data-theme="oled"] .page-btn:hover:not(:disabled) {
    background-color: var(--btn-sec-hover) !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .page-btn:disabled,
[data-theme="oled"] .page-btn:disabled {
    opacity: 0.3 !important;
    background-color: transparent !important;
}

[data-theme="dark"] .toggle-btn,
[data-theme="oled"] .toggle-btn {
    color: #94a3b8;
}

[data-theme="dark"] .toggle-btn.active,
[data-theme="oled"] .toggle-btn.active {
    background-color: var(--card-bg) !important;
    color: #60a5fa !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .step-btn,
[data-theme="oled"] .step-btn {
    background-color: var(--btn-sec-bg) !important;
    border: 1px solid var(--btn-sec-border) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .step-btn:hover,
[data-theme="oled"] .step-btn:hover {
    background-color: var(--btn-sec-hover) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .view-toggle-group,
[data-theme="oled"] .view-toggle-group {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
}


[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--input-bg) !important;
    color: #f8fafc !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    background-color: var(--input-focus-bg) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

[data-theme="oled"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="oled"] select,
[data-theme="oled"] textarea {
    background-color: var(--input-bg) !important;
    color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="oled"] input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="oled"] select:focus,
[data-theme="oled"] textarea:focus {
    background-color: var(--input-focus-bg) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="oled"] input::placeholder,
[data-theme="oled"] textarea::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .search-bar input,
[data-theme="dark"] .search-box input,
[data-theme="oled"] .search-bar input,
[data-theme="oled"] .search-box input {
    background-color: var(--input-bg) !important;
    color: #f8fafc !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .search-bar input:focus,
[data-theme="dark"] .search-box input:focus,
[data-theme="oled"] .search-bar input:focus,
[data-theme="oled"] .search-box input:focus {
    background-color: var(--input-focus-bg) !important;
}


[data-theme="dark"] .modal-card,
[data-theme="oled"] .modal-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="oled"] .modal-header {
    background-color: var(--modal-header-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .modal-header h3,
[data-theme="oled"] .modal-header h3 {
    color: var(--text-main) !important;
}

[data-theme="dark"] .modal-close,
[data-theme="oled"] .modal-close {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .modal-close:hover,
[data-theme="oled"] .modal-close:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .login-card,
[data-theme="oled"] .login-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .inv-card,
[data-theme="oled"] .inv-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .inv-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="oled"] .inv-card:hover {
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .card,
[data-theme="oled"] .card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .stat-card,
[data-theme="oled"] .stat-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .item-summary-card,
[data-theme="dark"] .request-items-container,
[data-theme="oled"] .item-summary-card,
[data-theme="oled"] .request-items-container {
    background-color: var(--container-sub-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .file-drop-zone,
[data-theme="oled"] .file-drop-zone {
    background-color: var(--container-sub-bg) !important;
    border: 2px dashed var(--border-color) !important;
    color: var(--text-muted) !important;
}


[data-theme="dark"] .data-table,
[data-theme="oled"] .data-table {
    color: var(--text-main) !important;
}

[data-theme="dark"] .data-table th,
[data-theme="oled"] .data-table th,
[data-theme="dark"] table th,
[data-theme="oled"] table th,
[data-theme="dark"] th,
[data-theme="oled"] th {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 1px 0 var(--border-color) !important;
}

[data-theme="dark"] .code-badge, 
[data-theme="dark"] .sku-pill {
    background: rgba(56, 189, 248, 0.12) !important;
    border-color: rgba(56, 189, 248, 0.28) !important;
    color: #38bdf8 !important;
}

[data-theme="oled"] .code-badge, 
[data-theme="oled"] .sku-pill {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
    color: #38bdf8 !important;
}

[data-theme="dark"] .data-table td,
[data-theme="oled"] .data-table td {
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .data-table tbody tr:hover,
[data-theme="oled"] .data-table tbody tr:hover,
[data-theme="dark"] tbody tr:hover,
[data-theme="oled"] tbody tr:hover {
    background-color: var(--table-hover-bg) !important;
}

[data-theme="dark"] .table-pagination,
[data-theme="oled"] .table-pagination {
    border-top: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
}


[data-theme="dark"] .badge-loc,
[data-theme="dark"] .badge-eq-almacen,
[data-theme="oled"] .badge-loc,
[data-theme="oled"] .badge-eq-almacen {
    background-color: var(--btn-sec-bg) !important;
    color: #94a3b8 !important;
    border: 1px solid var(--border-color) !important;
}


[data-theme="dark"] .badge-success,
[data-theme="oled"] .badge-success {
    background-color: rgba(16, 185, 129, 0.16) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .badge-warning,
[data-theme="oled"] .badge-warning {
    background-color: rgba(245, 158, 11, 0.16) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-theme="dark"] .badge-danger,
[data-theme="oled"] .badge-danger {
    background-color: rgba(239, 68, 68, 0.16) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

[data-theme="dark"] .badge-info,
[data-theme="oled"] .badge-info {
    background-color: rgba(59, 130, 246, 0.16) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
}

[data-theme="dark"] .badge-neutral,
[data-theme="oled"] .badge-neutral {
    background-color: rgba(148, 163, 184, 0.12) !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

[data-theme="dark"] .badge-purple,
[data-theme="oled"] .badge-purple {
    background-color: rgba(168, 85, 247, 0.16) !important;
    color: #c084fc !important;
    border-color: rgba(168, 85, 247, 0.35) !important;
}

[data-theme="dark"] .badge-cyan,
[data-theme="oled"] .badge-cyan {
    background-color: rgba(6, 182, 212, 0.16) !important;
    color: #22d3ee !important;
    border-color: rgba(6, 182, 212, 0.35) !important;
}


[data-theme="dark"] span.badge[style*="#fef3c7"],
[data-theme="oled"] span.badge[style*="#fef3c7"] {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

[data-theme="dark"] span.badge[style*="#dcfce7"],
[data-theme="oled"] span.badge[style*="#dcfce7"] {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] span.badge[style*="#fee2e2"],
[data-theme="oled"] span.badge[style*="#fee2e2"] {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}


[data-theme="dark"] .options-tabs-container,
[data-theme="oled"] .options-tabs-container {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .options-tab-btn:hover,
[data-theme="oled"] .options-tab-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .options-kpi-card,
[data-theme="oled"] .options-kpi-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .options-action-card,
[data-theme="oled"] .options-action-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .options-action-card:hover,
[data-theme="oled"] .options-action-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .columns-checkbox-list,
[data-theme="oled"] .columns-checkbox-list {
    background: var(--container-sub-bg) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .column-item,
[data-theme="oled"] .column-item {
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .column-item:hover,
[data-theme="oled"] .column-item:hover {
    background: rgba(59, 130, 246, 0.08) !important;
}


[data-theme="dark"] #system-dialog-modal .modal-card,
[data-theme="oled"] #system-dialog-modal .modal-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] #system-dialog-modal #system-dialog-message,
[data-theme="oled"] #system-dialog-modal #system-dialog-message {
    color: #f8fafc !important;
}


.dispatch-receipt-doc,
.waybill-doc,
.receipt-table,
.doc-table-styled,
.doc-qr-badge,
.qr-label-card,
.qr-code-canvas-container,
#printable-qr-label {
    background: #ffffff !important;
    color: #0f172a !important;
}
.dispatch-receipt-doc *,
.waybill-doc * {
    color: #0f172a !important;
}


[data-theme="dark"] .desktop-sidebar-toggle-btn,
[data-theme="oled"] .desktop-sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .desktop-sidebar-toggle-btn:hover,
[data-theme="oled"] .desktop-sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}

[data-theme="dark"] .user-menu-trigger,
[data-theme="oled"] .user-menu-trigger {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] .user-menu-trigger:hover,
[data-theme="oled"] .user-menu-trigger:hover,
[data-theme="dark"] .user-menu-trigger[aria-expanded="true"],
[data-theme="oled"] .user-menu-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
}
[data-theme="dark"] .user-trigger-name,
[data-theme="oled"] .user-trigger-name {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .user-live-status-dot,
[data-theme="oled"] .user-live-status-dot {
    border-color: #1e293b !important;
}

[data-theme="dark"] .user-menu-popover,
[data-theme="oled"] .user-menu-popover {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] .popover-profile-header,
[data-theme="oled"] .popover-profile-header {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.16), rgba(99, 102, 241, 0.12)) !important;
    border-bottom-color: #334155 !important;
}
[data-theme="dark"] .popover-user-name,
[data-theme="oled"] .popover-user-name {
    color: #f8fafc !important;
}
[data-theme="dark"] .popover-section-block,
[data-theme="oled"] .popover-section-block {
    border-bottom-color: #1e293b !important;
}
[data-theme="dark"] .user-menu-popover .unified-status-badge,
[data-theme="dark"] .user-menu-popover .subscription-header-badge,
[data-theme="oled"] .user-menu-popover .unified-status-badge,
[data-theme="oled"] .user-menu-popover .subscription-header-badge {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .user-menu-popover .unified-status-badge:hover,
[data-theme="dark"] .user-menu-popover .subscription-header-badge:hover,
[data-theme="oled"] .user-menu-popover .unified-status-badge:hover,
[data-theme="oled"] .user-menu-popover .subscription-header-badge:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: #475569 !important;
}
[data-theme="dark"] .sub-item-plan-name,
[data-theme="oled"] .sub-item-plan-name {
    color: #f8fafc !important;
}
[data-theme="dark"] .popover-menu-item,
[data-theme="oled"] .popover-menu-item {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .popover-menu-item:hover,
[data-theme="oled"] .popover-menu-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #38bdf8 !important;
}
[data-theme="dark"] .popover-footer,
[data-theme="oled"] .popover-footer {
    background: #090d16 !important;
}


[data-density="compact"] .data-table th {
    padding: 6px 8px !important;
    font-size: 0.76rem !important;
}
[data-density="compact"] .data-table td {
    padding: 5px 8px !important;
    font-size: 0.8rem !important;
}

[data-density="comfortable"] .data-table th {
    padding: 13px 16px !important;
    font-size: 0.88rem !important;
}
[data-density="comfortable"] .data-table td {
    padding: 12px 16px !important;
    font-size: 0.94rem !important;
}


[data-font-size="medium"] body {
    font-size: 15px;
}
[data-font-size="large"] body {
    font-size: 16px;
}


[data-animations="disabled"] *,
[data-animations="disabled"] *::before,
[data-animations="disabled"] *::after {
    transition: none !important;
    animation: none !important;
}


.options-tabs-container {
    display: flex;
    gap: 8px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.options-tabs-container::-webkit-scrollbar {
    display: none;
}

.options-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.options-tab-btn:hover {
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.06);
}

.options-tab-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.4);
}

.options-tab-content {
    display: none;
}

.options-tab-content.active {
    display: block;
}


.options-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.options-kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.options-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.options-kpi-card.kpi-accent-green::before {
    background: #10b981;
}

.options-kpi-card.kpi-accent-purple::before {
    background: #8b5cf6;
}

.options-kpi-card.kpi-accent-amber::before {
    background: #f59e0b;
}

.options-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.options-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.options-kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}


.options-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.options-action-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.options-action-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.08);
}

.action-card-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.action-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.action-card-icon.icon-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.action-card-icon.icon-emerald {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.action-card-icon.icon-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.action-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.action-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.options-terminal-log {
    background: #090d16;
    color: #38bdf8;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    max-height: 240px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 1rem;
}

.options-danger-zone {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.03);
    border-radius: 14px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}


.notifications-container {
    position: relative;
    display: inline-block;
    margin-right: 6px;
}

.btn-notifications-bell {
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    position: relative;
    transition: all 0.2s ease;
}

.btn-notifications-bell:hover {
    background: #1e293b;
    border-color: #0284c7;
    color: #38bdf8;
}


.btn-theme-quick-toggle {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.btn-theme-quick-toggle:hover {
    background: #1e293b;
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}
[data-theme="dark"] .btn-theme-quick-toggle,
[data-theme="oled"] .btn-theme-quick-toggle {
    background: var(--btn-sec-bg, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-main, #f8fafc);
}
[data-theme="dark"] .btn-theme-quick-toggle:hover,
[data-theme="oled"] .btn-theme-quick-toggle:hover {
    background: var(--btn-sec-hover, #29384e);
    border-color: var(--primary, #38bdf8);
    color: var(--primary, #38bdf8);
}


.appearance-theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 1.25rem;
}
@media (max-width: 600px) {
    .appearance-theme-grid {
        grid-template-columns: 1fr;
    }
}
.theme-preview-card {
    position: relative;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 14px 10px;
    cursor: pointer;
    background: var(--card-bg, #ffffff);
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}
.theme-preview-card:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.theme-preview-card.active {
    border-color: #0284c7;
    background: rgba(2, 132, 199, 0.06);
    box-shadow: 0 0 0 1px #0284c7, 0 4px 12px rgba(2, 132, 199, 0.15);
}
.theme-check-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}
.theme-preview-card.active .theme-check-badge {
    display: flex;
}
.theme-preview-swatch {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.swatch-light {
    background: linear-gradient(135deg, #ffffff 50%, #f1f5f9 50%);
    color: #0f172a;
}
.swatch-dark {
    background: linear-gradient(135deg, #0b1120 50%, #1e293b 50%);
    color: #38bdf8;
    border-color: #334155;
}
.swatch-oled {
    background: #000000;
    color: #ffffff;
    border-color: #27272a;
}
.theme-card-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main, #0f172a);
    margin-bottom: 2px;
}
.theme-card-desc {
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
    line-height: 1.3;
}
[data-theme="dark"] .theme-preview-card,
[data-theme="oled"] .theme-preview-card {
    background: var(--card-bg, #151f32);
    border-color: var(--border-color, #27354f);
}
[data-theme="dark"] .theme-preview-card.active,
[data-theme="oled"] .theme-preview-card.active {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.notifications-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.45);
    border: 1.5px solid #0f172a;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    z-index: 100010;
    overflow: hidden;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-color, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.notifications-list {
    max-height: 380px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    cursor: pointer;
    transition: background-color 0.15s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item:hover {
    background-color: var(--hover-bg, #f8fafc);
}

.notification-item.unread {
    background-color: rgba(2, 132, 199, 0.07);
    border-left: 3px solid #0284c7;
}

.notification-icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin-bottom: 3px;
}

.notification-msg {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
    word-break: break-word;
}

.notification-time {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 4px;
}


.unified-status-badge,
.offline-indicator,
.ws-indicator-wrap {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    user-select: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

body.dark-mode .unified-status-badge,
[data-theme="dark"] .unified-status-badge,
[data-theme="oled"] .unified-status-badge,
body.dark-mode .offline-indicator,
[data-theme="dark"] .offline-indicator,
[data-theme="oled"] .offline-indicator,
body.dark-mode .ws-indicator-wrap {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.unified-status-badge:hover,
.offline-indicator:hover,
.ws-indicator-wrap:hover {
    background: var(--bg-hover, rgba(15, 23, 42, 0.08));
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.unified-status-badge.online.ws-connected,
.offline-indicator.online.ws-connected {
    color: #059669;
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.06);
}

body.dark-mode .unified-status-badge.online.ws-connected,
[data-theme="dark"] .unified-status-badge.online.ws-connected,
[data-theme="oled"] .unified-status-badge.online.ws-connected,
body.dark-mode .offline-indicator.online.ws-connected {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.unified-status-badge.offline,
.offline-indicator.offline {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.status-dot,
.ws-status-dot,
.offline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.connected,
.ws-status-dot.connected,
.offline-indicator.online .offline-dot {
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: ws-pulse-green 2.2s infinite;
}

.status-dot.reconnecting,
.ws-status-dot.reconnecting,
.offline-indicator.offline .offline-dot {
    background-color: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: ws-pulse-yellow 1.4s infinite;
}

.status-dot.disconnected,
.ws-status-dot.disconnected {
    background-color: #94a3b8;
}

.status-dot.error,
.ws-status-dot.error {
    background-color: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: ws-pulse-red 1.6s infinite;
}

.status-label,
.ws-status-text,
.offline-label {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    line-height: 1;
}

.offline-badge {
    background: #f59e0b;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    margin-left: 2px;
    line-height: 1.2;
}

@keyframes ws-pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.75);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes ws-pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes ws-pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes offline-pulse-amber {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}


.table-container {
    contain: layout paint;
}

tr.vs-spacer {
    pointer-events: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

tr.vs-spacer td {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    line-height: 0 !important;
    font-size: 0 !important;
    height: inherit;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg);
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
}

.table-page-size-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.table-page-size-select {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.table-page-size-select:focus {
    border-color: var(--primary-color);
}


#inventory-cards-container {
    content-visibility: auto;
    contain-intrinsic-size: 400px;
}

.cards-sentinel {
    grid-column: 1 / -1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: 8px;
    padding: 12px;
}

.cards-sentinel-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.lazy-media {
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
}

.lazy-media.lazy-loaded {
    opacity: 1;
}



.tenant-selector-container {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.tenant-selector-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 5px 14px 5px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
    max-width: 260px;
}

.tenant-selector-pill:hover {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.18);
}

.tenant-pill-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.tenant-dropdown-select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 190px;
}

.tenant-dropdown-select option {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 8px;
}

.tenant-pill-arrow {
    font-size: 0.62rem;
    color: var(--text-muted);
    pointer-events: none;
    margin-left: -10px;
    line-height: 1;
    transition: transform 0.2s;
}

.tenant-selector-pill:hover .tenant-pill-arrow {
    color: var(--primary-color, #2563eb);
}

.tenant-badge-static {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 9999px;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #2563eb;
    max-width: 240px;
}

.tenant-badge-static .tenant-static-name {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}


[data-theme="light"] .tenant-selector-pill {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .tenant-badge-static {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.18);
    color: #1d4ed8;
}


[data-theme="dark"] .tenant-badge-static,
[data-theme="oled"] .tenant-badge-static {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

[data-theme="dark"] .tenant-selector-pill:hover,
[data-theme="oled"] .tenant-selector-pill:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

[data-theme="dark"] .tenant-pill-arrow:hover,
[data-theme="oled"] .tenant-selector-pill:hover .tenant-pill-arrow {
    color: #38bdf8;
}

@media (max-width: 768px) {
    .tenant-selector-pill {
        max-width: 150px;
        padding: 4px 8px;
    }
    .tenant-dropdown-select {
        max-width: 100px;
        font-size: 0.78rem;
    }
    .tenant-badge-static {
        max-width: 140px;
        font-size: 0.78rem;
        padding: 4px 8px;
    }
}


.forecast-container {
    position: relative;
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.forecast-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color, #0f172a);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

[data-theme="dark"] .forecast-title,
[data-theme="oled"] .forecast-title {
    color: #f8fafc;
}

.forecast-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forecast-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    align-items: end;
}


.badge-risk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-risk-out_of_stock {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.badge-risk-critical {
    background: #ffe4e6;
    color: #be123c;
    border: 1px solid #fda4af;
}

.badge-risk-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-risk-attention {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.badge-risk-healthy {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

[data-theme="dark"] .badge-risk-out_of_stock,
[data-theme="oled"] .badge-risk-out_of_stock {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .badge-risk-critical,
[data-theme="oled"] .badge-risk-critical {
    background: rgba(244, 63, 94, 0.2);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.5);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
}

[data-theme="dark"] .badge-risk-warning,
[data-theme="oled"] .badge-risk-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .badge-risk-attention,
[data-theme="oled"] .badge-risk-attention {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .badge-risk-healthy,
[data-theme="oled"] .badge-risk-healthy {
    background: rgba(16, 185, 129, 0.2);
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.5);
}


.burn-rate-pill {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-color, #1e293b);
}

[data-theme="dark"] .burn-rate-pill,
[data-theme="oled"] .burn-rate-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}


.forecast-batch-bar {
    position: sticky;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--primary-color, #3b82f6);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1rem;
    animation: slideUpFade 0.25s ease-out;
}

[data-theme="dark"] .forecast-batch-bar,
[data-theme="oled"] .forecast-batch-bar {
    background: #0f172a;
    border-color: #3b82f6;
    box-shadow: 0 14px 35px -4px rgba(0, 0, 0, 0.6);
}

.forecast-batch-info {
    display: flex;
    align-items: center;
    font-size: 0.92rem;
}

.forecast-batch-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    padding: 3px 10px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.85rem;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.sale-item-row {
    transition: all 0.2s ease;
}

[data-theme="dark"] .sale-item-row,
[data-theme="oled"] .sale-item-row {
    background: rgba(30, 41, 59, 0.5) !important;
    border-color: #334155 !important;
}

.sale-item-row:hover {
    border-color: var(--primary-color, #2563eb) !important;
}

.badge-sale-venta {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-sale-instalacion {
    background: rgba(147, 51, 234, 0.15);
    color: #9333ea;
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.badge-sale-comodato {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-sale-garantia {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}


.subscription-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.subscription-header-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.sub-badge-trial {
    background: rgba(14, 165, 233, 0.15);
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.3);
}
.sub-badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}
.sub-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.35);
    animation: pulse-warn 2s infinite;
}
.sub-badge-expired {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
}

@keyframes pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.subscription-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.subscription-alert-banner.expired {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
}
.subscription-alert-banner a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 700;
}

.quota-bar-wrapper {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}
[data-theme="dark"] .quota-bar-wrapper,
[data-theme="oled"] .quota-bar-wrapper {
    background: rgba(255, 255, 255, 0.1);
}
.quota-bar-fill {
    height: 100%;
    background: #0284c7;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.quota-bar-fill.warning { background: #f59e0b; }
.quota-bar-fill.danger { background: #ef4444; }

.plan-pill {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-pill-trial { background: rgba(56, 189, 248, 0.15); color: #0284c7; border: 1px solid rgba(56, 189, 248, 0.3); }
.plan-pill-starter { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.plan-pill-pro { background: rgba(147, 51, 234, 0.15); color: #9333ea; border: 1px solid rgba(147, 51, 234, 0.3); }
.plan-pill-enterprise { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }


.onboarding-wizard-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.08);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.onboarding-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.onboarding-badge-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.3);
    margin-bottom: 6px;
}
.onboarding-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin: 0;
}
.onboarding-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin: 4px 0 0 0;
}
.onboarding-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.onboarding-progress-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.25);
    white-space: nowrap;
}
.onboarding-progress-badge.completed {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #059669 !important;
}
.btn-wizard-dismiss {
    background: transparent;
    border: 1px solid var(--border-color, #cbd5e1);
    color: var(--text-muted, #64748b);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-wizard-dismiss:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main, #0f172a);
    border-color: #94a3b8;
}
.onboarding-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(2, 132, 199, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.onboarding-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #10b981);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.onboarding-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.onboarding-step-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}
.onboarding-step-card:hover {
    border-color: rgba(2, 132, 199, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.1);
}
.onboarding-step-card.completed {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.05);
}
.step-card-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 700;
}
.onboarding-step-card.completed .step-num {
    background: #10b981;
    color: #ffffff;
}
.step-status-icon {
    font-size: 0.9rem;
}
.step-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin: 0 0 4px 0;
}
.step-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
    margin: 0 0 12px 0;
}
.btn-step-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #0284c7;
    color: #ffffff;
    border: none;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    width: 100%;
}
.btn-step-action:hover {
    background: #0369a1;
}
.btn-step-secondary {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.35);
    flex: 1;
}
.btn-step-secondary:hover {
    background: rgba(2, 132, 199, 0.16);
}
.onboarding-step-card.completed .btn-step-action {
    background: transparent;
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.onboarding-step-card.completed .btn-step-action:hover {
    background: rgba(16, 185, 129, 0.1);
}


[data-theme="dark"] .onboarding-wizard-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    border: 1px solid rgba(56, 189, 248, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .onboarding-badge-pill {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}
[data-theme="dark"] .onboarding-title {
    color: #f8fafc;
}
[data-theme="dark"] .onboarding-subtitle {
    color: #94a3b8;
}
[data-theme="dark"] .onboarding-progress-badge {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-color: rgba(2, 132, 199, 0.35);
}
[data-theme="dark"] .onboarding-progress-badge.completed {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #10b981 !important;
}
[data-theme="dark"] .btn-wizard-dismiss {
    border-color: rgba(255, 255, 255, 0.15);
    color: #94a3b8;
}
[data-theme="dark"] .btn-wizard-dismiss:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .onboarding-progress-track {
    background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .onboarding-step-card {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}
[data-theme="dark"] .onboarding-step-card:hover {
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .onboarding-step-card.completed {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}
[data-theme="dark"] .step-num {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
[data-theme="dark"] .onboarding-step-card.completed .step-num {
    background: #10b981;
    color: #0f172a;
}
[data-theme="dark"] .step-card-title {
    color: #f1f5f9;
}
[data-theme="dark"] .step-card-desc {
    color: #94a3b8;
}
[data-theme="dark"] .btn-step-secondary {
    background: transparent;
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}
[data-theme="dark"] .btn-step-secondary:hover {
    background: rgba(56, 189, 248, 0.1);
}
[data-theme="dark"] .onboarding-step-card.completed .btn-step-action {
    background: transparent;
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}


[data-theme="oled"] .onboarding-wizard-card {
    background: #09090b;
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}
[data-theme="oled"] .onboarding-badge-pill {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}
[data-theme="oled"] .onboarding-title {
    color: #ffffff;
}
[data-theme="oled"] .onboarding-subtitle {
    color: #a1a1aa;
}
[data-theme="oled"] .onboarding-progress-badge {
    background: rgba(2, 132, 199, 0.15);
    color: #38bdf8;
    border-color: rgba(2, 132, 199, 0.3);
}
[data-theme="oled"] .onboarding-progress-badge.completed {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #10b981 !important;
}
[data-theme="oled"] .btn-wizard-dismiss {
    border-color: #27272a;
    color: #a1a1aa;
}
[data-theme="oled"] .btn-wizard-dismiss:hover {
    background: #18181b;
    color: #ffffff;
    border-color: #3f3f46;
}
[data-theme="oled"] .onboarding-progress-track {
    background: #18181b;
}
[data-theme="oled"] .onboarding-step-card {
    background: #040405;
    border-color: #222226;
    box-shadow: none;
}
[data-theme="oled"] .onboarding-step-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
[data-theme="oled"] .onboarding-step-card.completed {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.08);
}
[data-theme="oled"] .step-num {
    background: #141416;
    color: #f8fafc;
}
[data-theme="oled"] .onboarding-step-card.completed .step-num {
    background: #10b981;
    color: #000000;
}
[data-theme="oled"] .step-card-title {
    color: #ffffff;
}
[data-theme="oled"] .step-card-desc {
    color: #a1a1aa;
}
[data-theme="oled"] .btn-step-secondary {
    background: transparent;
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}
[data-theme="oled"] .btn-step-secondary:hover {
    background: rgba(56, 189, 248, 0.12);
}
[data-theme="oled"] .onboarding-step-card.completed .btn-step-action {
    background: transparent;
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}


.reel-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}
.reel-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.reel-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.reel-progress-fill.status-good {
    background: linear-gradient(90deg, #10b981, #059669);
}
.reel-progress-fill.status-warn {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}
.reel-progress-fill.status-danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}
.reel-progress-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}
.reel-actions-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.reel-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.reel-btn:hover:not(:disabled) {
    background: var(--bg-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}
.reel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.reel-btn-cut {
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.3);
}
.reel-btn-cut:hover:not(:disabled) {
    background: rgba(2, 132, 199, 0.1);
}
.reel-btn-move {
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.3);
}
.reel-btn-move:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.1);
}
.reel-btn-edit {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}
.reel-btn-edit:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.1);
}
.reel-btn-qr {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}
.reel-btn-qr:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.1);
}
.reel-btn-delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}
.reel-btn-delete:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}
.reel-qr-card {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    background: var(--card-bg);
    margin: 1rem 0;
}
.reel-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(148, 163, 184, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}




.node-equip-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-color, #2563eb);
    transition: all 0.18s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.node-equip-badge-btn:hover {
    background: var(--primary-color, #2563eb);
    color: #ffffff;
    border-color: var(--primary-color, #2563eb);
    transform: translateY(-1px);
}


.node-actions-group {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.node-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 30px;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--card-bg, #ffffff);
    color: var(--text-main);
    transition: all 0.18s ease;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.node-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.node-action-manage {
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.06);
}

.node-action-manage:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.node-action-edit {
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.25);
    background: rgba(217, 119, 6, 0.06);
}

.node-action-edit:hover {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
}

.node-action-delete {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.06);
}

.node-action-delete:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}


.btn-gps-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(2, 132, 199, 0.3);
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
    transition: all 0.18s ease;
}

.btn-gps-action:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

.btn-ip-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    transition: all 0.18s ease;
}

.btn-ip-action:hover {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-main);
    border-color: var(--border-color);
}


.node-equipment-modal-card {
    max-width: 1120px !important;
    width: 95vw !important;
    border-radius: 16px;
    overflow: hidden;
}

.node-eq-table-wrapper {
    max-height: 440px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg, #ffffff);
}

.node-eq-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

@media (max-width: 900px) {
    .node-equipment-modal-card {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0;
    }
    .node-eq-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .node-eq-table {
        min-width: 680px;
        table-layout: auto;
    }
}

@media (max-width: 480px) {
    .node-equipment-modal-card {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}


.node-coords-wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
}

@media (max-width: 600px) {
    .node-coords-wrapper {
        flex-wrap: wrap;
    }
    .node-coords-wrapper input {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    .node-coords-wrapper .btn-gps-action,
    .node-coords-wrapper .btn-ip-action {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }
}


.inline-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

@media (max-width: 1024px) {
    .inline-filter-group {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .inline-filter-group {
        margin-left: 0 !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
        gap: 8px !important;
    }
    .inline-filter-group > div {
        width: 100% !important;
    }
    .inline-filter-group select {
        width: 100% !important;
    }
    .inline-filter-group button {
        grid-column: 1 / -1;
        width: 100% !important;
        justify-content: center;
    }
}


.receipt-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.receipt-grid-customer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 8px;
}
.receipt-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}
@media (max-width: 768px) {
    .receipt-grid-3,
    .receipt-grid-customer,
    .receipt-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
}

.node-eq-table th {
    position: sticky;
    top: 0;
    background: var(--table-header-bg, #f8fafc);
    z-index: 2;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.node-eq-table td {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.node-eq-table tr:hover td {
    background-color: var(--table-hover-bg, rgba(0, 0, 0, 0.02));
}


[data-theme="dark"] .node-equip-badge-btn,
[data-theme="oled"] .node-equip-badge-btn {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
    color: #60a5fa;
}

[data-theme="dark"] .node-action-btn,
[data-theme="oled"] .node-action-btn {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .node-action-manage,
[data-theme="oled"] .node-action-manage {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .node-action-edit,
[data-theme="oled"] .node-action-edit {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .node-action-delete,
[data-theme="oled"] .node-action-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .node-eq-table th,
[data-theme="oled"] .node-eq-table th {
    background: var(--bg-dark, #0f172a);
}



.map-controls-panel {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.map-filters-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.map-layers-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.map-control-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.map-layer-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-color, #f8fafc);
    border: 1px solid var(--border-color, #cbd5e1);
    color: var(--text-muted, #64748b);
    transition: all 0.2s ease;
}

.map-layer-pill .pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.map-layer-pill .node-dot { background: #10b981; }
.map-layer-pill .inst-dot { background: #3b82f6; }
.map-layer-pill .crew-dot { background: #f59e0b; }

.map-layer-pill .pill-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.74rem;
}

.map-layer-pill.active {
    background: #ffffff;
    color: var(--text-main, #0f172a);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

#layer-btn-nodes.active {
    border-color: #10b981;
    color: #059669;
    background: rgba(16, 185, 129, 0.08);
}

#layer-btn-installations.active {
    border-color: #3b82f6;
    color: #2563eb;
    background: rgba(59, 130, 246, 0.08);
}

#layer-btn-crews.active {
    border-color: #f59e0b;
    color: #d97706;
    background: rgba(245, 158, 11, 0.08);
}

.map-basemap-selector-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-select-sm {
    padding: 5px 10px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--card-bg, #ffffff);
    color: var(--text-main, #0f172a);
}

.map-search-box-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 240px;
    flex-grow: 1;
    max-width: 320px;
}

.map-search-box-wrap input {
    width: 100%;
    padding: 6px 28px 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--bg-color, #f8fafc);
    color: var(--text-main, #0f172a);
}

.map-search-box-wrap .btn-clear-search {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.map-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #f1f5f9);
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    flex-wrap: wrap;
    gap: 8px;
}

.map-live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}


.map-viewport-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 290px);
    min-height: 520px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.map-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    border: none !important;
}

.telecom-leaflet-map {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
}


.telecom-div-marker-wrap {
    background: transparent;
    border: none;
}

.map-marker-pin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border-radius: 20px;
    padding: 3px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border: 2px solid #3b82f6;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.map-marker-pin:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    z-index: 9999 !important;
}

.node-pin.pin-activo {
    border-color: #10b981;
    background: #f0fdf4;
    color: #065f46;
}

.node-pin.pin-mantenimiento {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.node-pin.pin-inactivo {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.inst-pin.pin-fiber {
    border-color: #0284c7;
    background: #f0f9ff;
    padding: 2px 5px;
    border-radius: 50%;
}

.inst-pin.pin-wireless {
    border-color: #8b5cf6;
    background: #f5f3ff;
    padding: 2px 5px;
    border-radius: 50%;
}

.crew-pin {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #78350f;
}


.telecom-map-popup .leaflet-popup-content-wrapper {
    background: var(--card-bg, #ffffff);
    color: var(--text-main, #0f172a);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    padding: 6px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.telecom-map-popup .leaflet-popup-tip {
    background: var(--card-bg, #ffffff);
}

.map-popup-card {
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1.4;
}

.map-popup-card .popup-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main, #0f172a);
    margin-bottom: 2px;
}

.map-popup-card .popup-sub {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 6px;
}

.map-popup-card .popup-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.map-popup-card .popup-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding-top: 6px;
}

.btn-popup-action {
    flex: 1;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--primary-color, #3b82f6);
    background: var(--primary-color, #3b82f6);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-popup-link {
    flex: 1;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--card-bg, #ffffff);
    color: var(--text-main, #0f172a);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}


.map-detail-drawer {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 350px;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: drawerSlideIn 0.25s ease-out;
}

@keyframes drawerSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.map-detail-drawer .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-surface, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.map-detail-drawer .drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-detail-drawer .drawer-icon {
    font-size: 1.4rem;
}

.map-detail-drawer .drawer-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
}

.map-detail-drawer .drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
}

.map-detail-drawer .drawer-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.map-detail-drawer .drawer-body {
    padding: 14px;
    overflow-y: auto;
    font-size: 0.84rem;
    flex: 1;
}

.drawer-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg-color, #f8fafc);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #f1f5f9);
}

.drawer-info-grid .info-item .lbl {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
}

.drawer-address {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    background: var(--bg-color, #f8fafc);
    padding: 8px;
    border-radius: 6px;
}

.drawer-coords {
    font-size: 0.78rem;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 6px 10px;
    border-radius: 6px;
    color: #1d4ed8;
}

.drawer-section-title {
    font-weight: 700;
    font-size: 0.84rem;
    margin-bottom: 6px;
    color: var(--text-main, #0f172a);
}

.drawer-equipment-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-eq-item {
    background: var(--bg-color, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    padding: 6px 10px;
}

.drawer-eq-item .eq-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.drawer-eq-item .eq-sub {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}

.map-detail-drawer .drawer-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-surface, #f8fafc);
}


.map-floating-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    font-size: 0.78rem;
    overflow: hidden;
    min-width: 170px;
}

.map-floating-legend .legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-surface, #f8fafc);
    cursor: pointer;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.map-floating-legend .legend-body {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-floating-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}


.unlocated-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.unlocated-item {
    background: var(--bg-color, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 10px;
}

.unlocated-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.unlocated-icon {
    font-size: 1.2rem;
}


.user-gps-pulse-marker {
    position: relative;
}

.user-pulse-ring {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.35);
    border: 2px solid #3b82f6;
    animation: userGpsPulse 1.8s infinite;
    top: -1px;
    left: -1px;
}

.user-pulse-center {
    position: relative;
    font-size: 1.2rem;
    z-index: 2;
}

@keyframes userGpsPulse {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}


[data-theme="dark"] .map-controls-panel,
[data-theme="oled"] .map-controls-panel,
[data-theme="dark"] .map-detail-drawer,
[data-theme="oled"] .map-detail-drawer,
[data-theme="dark"] .map-floating-legend,
[data-theme="oled"] .map-floating-legend {
    background: var(--card-bg, #151f32);
    border-color: var(--border-color, #27354f);
}

[data-theme="dark"] .drawer-info-grid,
[data-theme="oled"] .drawer-info-grid,
[data-theme="dark"] .drawer-address,
[data-theme="oled"] .drawer-address,
[data-theme="dark"] .drawer-eq-item,
[data-theme="oled"] .drawer-eq-item,
[data-theme="dark"] .unlocated-item,
[data-theme="oled"] .unlocated-item {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--border-color, #27354f);
}

[data-theme="dark"] .drawer-coords,
[data-theme="oled"] .drawer-coords {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

[data-theme="dark"] .map-marker-pin,
[data-theme="oled"] .map-marker-pin {
    background: #1e293b;
    color: #f8fafc;
    border-color: #60a5fa;
}

[data-theme="dark"] .node-pin.pin-activo,
[data-theme="oled"] .node-pin.pin-activo {
    background: rgba(6, 78, 59, 0.8);
    border-color: #34d399;
    color: #a7f3d0;
}

[data-theme="dark"] .map-layer-pill,
[data-theme="oled"] .map-layer-pill {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .map-layer-pill.active,
[data-theme="oled"] .map-layer-pill.active {
    background: #0f172a;
    color: #f8fafc;
}

[data-theme="dark"] .map-status-bar,
[data-theme="oled"] .map-status-bar {
    border-top-color: #27354f;
}




