:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #e6fbf3;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-white: #ffffff;
    --font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --blue: #3b82f6;
    --blue-hover: #2563eb;
    --orange: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Viewport chính - luôn hiển thị */
.desktop-view {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   GIAO DIỆN DESKTOP (PC) - THIẾT KẾ LIGHT MODE CAO CẤP
   ========================================================================== */
.desktop-view-layout {
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 50%);
}

    /* Sticky Header */
    .pc-header {
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        z-index: 100;
        width: 100%;
    }

    .pc-header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1240px;
        margin: 0 auto;
        padding: 16px 20px;
    }

    .pc-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: var(--text-main);
    }

    .pc-brand-title {
        font-size: 1.35rem;
        font-weight: 800;
        letter-spacing: 0.5px;
    }

    .pc-brand-title span {
        color: var(--primary-dark);
    }

    .pc-nav {
        display: flex;
        gap: 28px;
        align-items: center;
    }

    .pc-nav-link {
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.9rem;
        font-weight: 600;
        transition: all 0.25s;
        position: relative;
    }

    .pc-nav-link:hover {
        color: var(--text-main);
    }

    .pc-nav-link.active {
        color: var(--primary-dark);
    }

    .pc-nav-link.active::after {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 0;
        width: 18px;
        height: 3px;
        background-color: var(--primary);
        border-radius: 2px;
    }

    .btn-pc-login {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: white;
        border: none;
        padding: 10px 24px;
        border-radius: 12px;
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
        transition: all 0.25s;
    }

    .btn-pc-login:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
    }

    /* Main Layout Content */
    .pc-container {
        max-width: 1240px;
        width: 100%;
        margin: 0 auto;
        padding: 30px 20px;
        flex-grow: 1;
    }

    /* Hero Grid Section */
    .hero-section {
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        gap: 40px;
        align-items: center;
        margin-bottom: 50px;
    }

    .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background-color: var(--primary-light);
        color: var(--primary-dark);
        padding: 6px 14px;
        border-radius: 30px;
        font-size: 0.78rem;
        font-weight: 700;
        margin-bottom: 16px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .hero-content h1 {
        font-size: 2.6rem;
        font-weight: 800;
        line-height: 1.25;
        margin-bottom: 18px;
        color: var(--text-main);
        letter-spacing: -0.5px;
    }

    .hero-content p {
        font-size: 0.98rem;
        color: var(--text-muted);
        line-height: 1.6;
        margin-bottom: 28px;
    }

    .hero-buttons {
        display: flex;
        gap: 16px;
    }

    .btn-pc-primary {
        background: var(--primary-dark);
        color: white;
        border: none;
        padding: 14px 28px;
        border-radius: 12px;
        font-size: 0.92rem;
        font-weight: 700;
        cursor: pointer;
        text-decoration: none;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
    }

    .btn-pc-primary:hover {
        background: #047857;
        transform: translateY(-1px);
    }

    .btn-pc-secondary {
        background: #ffffff;
        color: var(--text-muted);
        border: 1px solid var(--border);
        padding: 14px 28px;
        border-radius: 12px;
        font-size: 0.92rem;
        font-weight: 700;
        cursor: pointer;
        text-decoration: none;
        transition: all 0.2s;
    }

    .btn-pc-secondary:hover {
        background: #f8fafc;
        border-color: #cbd5e1;
        color: var(--text-main);
    }

    /* Premium Glassmorphic Telemetry Card */
    .mock-dashboard {
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 24px;
        padding: 24px;
        box-shadow: var(--card-shadow);
        position: relative;
    }

    .mock-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    .mock-header span {
        font-weight: 800;
        font-size: 0.85rem;
        color: var(--text-main);
    }

    .pulse-dot {
        width: 8px;
        height: 8px;
        background-color: var(--primary);
        border-radius: 50%;
        display: inline-block;
        margin-right: 6px;
        position: relative;
    }

    .pulse-dot::after {
        content: '';
        position: absolute;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background-color: rgba(16, 185, 129, 0.3);
        top: -5px;
        left: -5px;
        animation: pulse 1.6s infinite;
    }

    @keyframes pulse {
        0% { transform: scale(0.6); opacity: 1; }
        100% { transform: scale(1.6); opacity: 0; }
    }

    .mock-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mock-box {
        background: #f8fafc;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px 16px;
    }

    .mock-box-lbl {
        font-size: 0.72rem;
        color: var(--text-muted);
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }

    .mock-box-val {
        font-size: 1.15rem;
        font-weight: 800;
        color: var(--text-main);
    }

    /* Integrated Map Dashboard Section */
    .map-dashboard-section {
        margin-bottom: 50px;
    }

    .map-section-title {
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--text-main);
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .map-grid-container {
        display: grid;
        grid-template-columns: 360px 1fr;
        gap: 20px;
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 24px;
        overflow: hidden;
        box-shadow: var(--card-shadow);
    }

    /* CRM Showcase Carousel CSS */
    .carousel-container {
        position: relative;
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 28px;
        box-shadow: var(--card-shadow);
        overflow: hidden;
        width: 100%;
        margin-top: 20px;
        display: block;
    }

    .slides-wrapper {
        display: flex;
        width: 500%;
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .showcase-slide {
        width: 20%;
        flex-shrink: 0;
        padding: 40px 80px;
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        gap: 40px;
        align-items: center;
    }

    .carousel-nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid var(--border);
        width: 46px;
        height: 46px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        color: var(--text-main);
        transition: all 0.2s;
    }

    .carousel-nav-btn:hover {
        background: #ffffff;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        color: var(--primary-dark);
    }

    .carousel-nav-btn.prev-btn {
        left: 20px;
    }

    .carousel-nav-btn.next-btn {
        right: 20px;
    }

    /* Footer */
    .pc-footer {
        border-top: 1px solid var(--border);
        padding: 24px 20px;
        text-align: center;
        color: var(--text-muted);
        font-size: 0.8rem;
    }


/* ==========================================================================
   MODALS & DIALOGS (LIGHT THEME)
   ========================================================================== */
/* QR Connector Mock Input Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    color: var(--text-main);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    transform: scale(0.9);
    transition: transform 0.2s;
    border: 1px solid var(--border);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
    color: var(--text-main);
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: monospace;
    text-align: center;
    margin-bottom: 16px;
    outline: none;
    background: #ffffff;
    color: var(--text-main);
}

.modal-input:focus {
    border-color: var(--primary);
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-align: center;
}

.modal-btn-cancel {
    background: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
}

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

/* Unified switchable login sheet */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.login-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-modal-card {
    background: #ffffff;
    color: var(--text-main);
    width: 100%;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding: 24px 20px 34px 20px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid #cbd5e1;
    border-bottom: none;
}

.login-modal-overlay.active .login-modal-card {
    transform: translateY(0);
}

.login-modal-close-bar {
    width: 36px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 0 auto 16px auto;
    cursor: pointer;
}

.login-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
    text-align: center;
}

.login-modal-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
}

/* switchable role tabs */
.login-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.login-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.login-tab-btn.active {
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.login-form-group {
    margin-bottom: 16px;
    text-align: left;
}

.login-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font-family);
}

.login-input-wrapper input:focus {
    border-color: var(--primary);
}

.login-input-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    pointer-events: none;
}

.login-btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

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

.login-error-alert {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 6px;
}

/* Desktop Modal Dialog Style overrides */
@media (min-width: 801px) {
    .login-modal-overlay {
        align-items: center;
    }
    .login-modal-card {
        max-width: 380px;
        border-radius: 24px;
        transform: scale(0.9) translateY(0);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        margin: 0 auto;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    }
    .login-modal-overlay.active .login-modal-card {
        transform: scale(1) translateY(0);
    }
    .login-modal-close-bar {
        display: none;
    }
}


/* ==========================================================================
   MOBILE RESPONSIVE STYLES (UNDER 800PX)
   ========================================================================== */
@media (max-width: 800px) {
    .pc-header-container {
        padding: 12px 16px;
    }
    
    .pc-nav-link {
        display: none !important;
    }

    .pc-nav {
        gap: 12px;
    }

    .btn-pc-login {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .pc-container {
        padding: 20px 16px;
    }

    /* Hero Section chuyển thành cột dọc */
    .hero-section {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
        margin-bottom: 30px;
    }

    .hero-badge {
        font-size: 0.72rem;
        padding: 4px 10px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .hero-content p {
        font-size: 0.88rem;
        margin-bottom: 20px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .btn-pc-primary, .btn-pc-secondary {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.88rem;
    }

    .promo-banner-card {
        min-height: auto !important;
        padding: 20px !important;
    }

    .promo-banner-card i {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 12px !important;
    }

    .promo-banner-card h3 {
        font-size: 1.1rem !important;
    }

    .promo-banner-card p {
        font-size: 0.8rem !important;
        margin-bottom: 16px !important;
    }

    /* Showcase Slideshow chuyển thành cột dọc */
    .crm-showcase-section h2 {
        font-size: 1.4rem !important;
        margin-bottom: 24px !important;
    }

    .carousel-container {
        border-radius: 20px;
    }

    .showcase-slide {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 16px;
    }

    .slide-text {
        text-align: center;
    }

    .slide-text h3 {
        font-size: 1.3rem !important;
        margin-bottom: 12px;
    }

    .slide-text p {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .slide-text ul {
        grid-template-columns: 1fr !important;
        text-align: left;
        gap: 8px;
    }

    .slide-visual {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .slide-visual > div {
        max-width: 100% !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .carousel-nav-btn {
        width: 34px;
        height: 34px;
    }

    .carousel-nav-btn.prev-btn {
        left: 8px;
    }

    .carousel-nav-btn.next-btn {
        right: 8px;
    }

    .pc-footer {
        padding: 16px 12px;
        font-size: 0.75rem;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
