:root {
    /* UPLOADED PALETTE */
    --primary-color: #252f45;
    --secondary-color: #7294b7;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --border-color: #dfe6ed;
    --text-color: #252f45;
    --muted-color: #8898aa;

    /* HEADER PALETTE */
    --header-bg: #1e3343;
    --header-text: #ffffff;
    --header-height: 80px;
}

/* GLOBAL FONT: Nunito (Smooth & Soft) */
body {
    font-family: 'Nunito', sans-serif;

    /* UPDATED: Background Image Logic */
    background-color: var(--bg-color);
    /* Keep original brightness, add vignette with a slight cool tint */
    background-image:
        radial-gradient(ellipse at center, rgba(13, 18, 28, 0) 55%, rgba(13, 18, 28, 0.22) 100%),
        linear-gradient(180deg, rgba(37, 47, 69, 0.05) 0%, rgba(37, 47, 69, 0) 40%, rgba(37, 47, 69, 0.12) 100%),
        url("/background.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;

    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* Ensure all form elements also use the smooth font */
button,
input,
select,
textarea {
    font-family: 'Nunito', sans-serif;
}

/* --- AUTH STYLES --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: safe center;
    min-height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.auth-bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    padding: 18px 28px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(37, 47, 69, 0.15);
    width: 100%;
    max-width: 370px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    margin: auto;
}

.auth-card .form-group {
    margin-bottom: 8px;
}

.auth-card .form-group label {
    margin-bottom: 2px;
    font-size: 0.82rem;
}

.auth-card .form-group input,
.auth-card .form-group select {
    padding: 7px 10px;
    font-size: 14px;
}

.auth-card .btn-primary {
    padding: 9px;
    margin-top: 3px;
}

.auth-card .login-logo-wrap img {
    max-width: 100px !important;
}

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.auth-card .auth-switch {
    margin-top: 8px;
    font-size: 0.82rem;
}

.auth-error-msg {
    text-align: center;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
}

.auth-success-msg {
    text-align: center;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.08);
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
}

.auth-card .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Social Login Buttons */
.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-color);
    font-size: 0.92rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-social:hover {
    background: #f8f9fa;
    border-color: #b0bec5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-social:active {
    transform: scale(0.98);
}

.btn-social svg {
    flex-shrink: 0;
}

body.dark-mode .btn-social {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e0e0e0;
}

body.dark-mode .btn-social:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 0.82rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .auth-divider::before,
body.dark-mode .auth-divider::after {
    background: rgba(255, 255, 255, 0.1);
}

.auth-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

body.dark-mode .auth-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
}



.auth-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.auth-switch a:hover {
    color: var(--primary-color);
}

.login-logo-wrap {
    position: relative;
    display: inline-block;
    overflow: hidden;
    background: transparent;
    border: none;
}

.login-logo {
    display: block;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.login-logo-wrap::after {
    content: "";
    position: absolute;
    top: -30%;
    left: -70%;
    width: 50%;
    height: 160%;
    background: linear-gradient(75deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 48%, rgba(255, 255, 255, 0) 100%);
    transform: translate(-170%, -10%) skewX(-12deg);
    animation: loginLogoShine 4.2s ease-in-out infinite;
    pointer-events: none;
    mix-blend-mode: screen;
    -webkit-mask-image: url("/login-logo.png");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-image: url("/login-logo.png");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 100% 100%;
    opacity: 0.95;
}

@keyframes loginLogoShine {

    0%,
    55% {
        transform: translate(-170%, -10%) skewX(-12deg);
        opacity: 0;
    }

    60% {
        opacity: 1;
    }

    100% {
        transform: translate(240%, 12%) skewX(-12deg);
        opacity: 0;
    }
}

/* --- HEADER --- */
.app-header {
    background: linear-gradient(90deg, #1b2c3f 0%, #23354a 50%, #1b2c3f 100%);
    color: var(--header-text);
    width: 100%;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 30px;
    box-sizing: border-box;
    border-bottom: 4px solid var(--secondary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ── Session Countdown Timer ── */
.session-timer {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Nunito', monospace;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.session-timer-warning {
    color: #fff;
    background: rgba(231, 76, 60, 0.7);
    border-color: rgba(231, 76, 60, 0.9);
    animation: timerPulse 1s ease-in-out infinite alternate;
}

@keyframes timerPulse {
    from { opacity: 1; }
    to { opacity: 0.6; }
}

.nav-center {
    flex-grow: 1;
    text-align: center;
}

.nav-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* NEW: Override for top-right logo to show original colors */
.nav-logo-right {
    filter: none;
    animation: navLogoSpinY 20s linear infinite;
    animation-delay: 20s;
    transform-origin: center;
    transform-style: preserve-3d;
    backface-visibility: visible;
    will-change: transform;
}

.nav-right>a {
    display: inline-block;
    perspective: 800px;
    transition: transform 0.2s;
}

.nav-right>a:hover {
    transform: scale(1.05);
}

@keyframes navLogoSpinY {
    0% {
        transform: rotateY(0deg);
    }

    4.5% {
        transform: rotateY(360deg);
    }

    100% {
        transform: rotateY(360deg);
    }
}

.nav-center h1 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--header-text);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- HEADER AVATAR (Gradient Blue) --- */
.header-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    /* Blue gradient */
    background: linear-gradient(135deg,
            #77abfa 0%,
            #2a5bb6 100%);

    /* Depth & glow */
    box-shadow:
        0 3px 8px rgba(47, 111, 228, 0.45),
        inset 0 1px 2px rgba(255, 255, 255, 0.35);

    color: #ffffff;
    font-weight: 700;
    font-size: 14px;

    cursor: pointer;
    flex-shrink: 0;

    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Hover effect */
.header-avatar:hover {
    transform: translateY(-1px);
    box-shadow:
        0 5px 12px rgba(47, 111, 228, 0.55),
        inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

body.dark-mode .header-avatar {
    background: linear-gradient(135deg,
            #5d8dff 0%,
            #304aa0 100%);

    box-shadow:
        0 3px 10px rgba(93, 141, 255, 0.55),
        inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

h1 {
    color: var(--primary-color);
}

h2 {
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: var(--text-color);
    opacity: 0.7;
}

.section {
    margin-bottom: 40px;
    position: relative;
}

.section+.section::before {
    content: "";
    display: block;
    height: 1px;
    margin: 8px 0 26px;
    background: linear-gradient(90deg, transparent, rgba(114, 148, 183, 0.45), transparent);
}

/* UPDATED: Floating Panel / Glassmorphism Effect */
.card {
    /* Semi-transparent white background */
    background: rgba(255, 255, 255, 0.95);

    /* Increased padding and rounded corners */
    padding: 40px;
    border-radius: 16px;

    /* Deep 3D shadow */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 10px 40px rgba(37, 47, 69, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.05);

    margin-bottom: 20px;

    /* Subtle border for definition */
    border: 1px solid rgba(255, 255, 255, 0.6);

    /* Blur background behind the card */
    backdrop-filter: blur(8px);
    transition: box-shadow 0.18s ease;
}

.card:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 14px 46px rgba(37, 47, 69, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.06);
}

.product-item,
.plot-item {
    background: #fbfcfe;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    position: relative;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.product-item:hover,
.plot-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 47, 69, 0.08);
    border-color: rgba(114, 148, 183, 0.5);
}

.plot-item {
    border-left: 4px solid var(--secondary-color);
}

/* GRID SYSTEMS */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

/* RESPONSIVE MEDIA QUERIES */

/* Tablet / Small Laptop */
@media (max-width: 1000px) {
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile / Vertical Screens */
@media (max-width: 768px) {

    /* Stack Grids to single column */
    .grid-2,
    .grid-5 {
        grid-template-columns: 1fr;
    }

    /* Adjust Header */
    .app-header {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .nav-center {
        order: 2;
        width: 100%;
        margin-bottom: 5px;
    }

    .nav-left {
        order: 1;
        align-self: flex-start;
    }

    .nav-right {
        order: 1;
        align-self: flex-end;
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .nav-center h1 {
        font-size: 1.2rem;
    }

    /* Adjust Card Padding */
    .card {
        padding: 25px;
    }

    /* Slightly reduced on mobile */
    .container {
        margin: 15px auto;
        padding: 0 15px;
    }

    /* Auth Card */
    .auth-container {
        padding: 16px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 20px;
        max-width: 360px;
        margin: auto;
    }

    .auth-card .login-logo-wrap img {
        max-width: 100px !important;
    }

    .auth-card h2 {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .auth-card #authSubtitle {
        font-size: 0.82rem;
        margin-bottom: 14px !important;
    }

    .auth-card .form-group {
        margin-bottom: 8px;
    }

    .auth-card .form-group label {
        font-size: 0.78rem;
    }

    .auth-card .form-group input,
    .auth-card .form-group select {
        padding: 7px 9px;
        font-size: 13px;
    }

    .auth-card .btn-primary {
        padding: 9px;
        font-size: 0.92rem;
    }

    .btn-social {
        padding: 9px 14px;
        font-size: 0.85rem;
    }

    .auth-divider {
        margin: 10px 0;
    }

    .auth-card .auth-switch {
        margin-top: 8px;
        font-size: 0.78rem;
    }

    /* Keep video fully covering tall mobile viewports */
    .auth-bg-video {
        width: 100vw;
        height: 100vh;
    }

    /* Plot Item Button Position */
    .btn-remove {
        top: 5px;
        right: 5px;
        padding: 10px;
        /* Larger touch area */
    }

    .app-badge {
        width: 30px;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.required-star {
    color: #e74c3c;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 10px;
    /* Slightly larger padding for touch */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #ffffff;
    font-size: 16px;
    /* Prevents zooming on iPhone inputs */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(109, 149, 189, 0.2);
}

/* ── Operator field (highlighted) ── */
.operator-field {
    background: linear-gradient(135deg, rgba(47, 111, 228, 0.06) 0%, rgba(47, 111, 228, 0.02) 100%);
    border: 1.5px solid rgba(47, 111, 228, 0.25);
    border-radius: 10px;
    padding: 14px 16px 10px;
    margin-top: 4px;
}

.operator-field label {
    color: #2f6fe4 !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.02em;
}

.operator-field select {
    border-color: rgba(47, 111, 228, 0.35);
    font-weight: 600;
}

.operator-field select:focus {
    border-color: #2f6fe4;
    box-shadow: 0 0 0 3px rgba(47, 111, 228, 0.15);
}

body.dark-mode .operator-field {
    background: linear-gradient(135deg, rgba(59, 125, 221, 0.1) 0%, rgba(59, 125, 221, 0.04) 100%);
    border-color: rgba(59, 125, 221, 0.3);
}

body.dark-mode .operator-field label {
    color: #5b9bff !important;
}

body.dark-mode .operator-field select {
    border-color: rgba(59, 125, 221, 0.4);
}

/* Custom dropdown (HS/product) */
.native-select-hidden {
    display: none !important;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-toggle {
    width: 100%;
    text-align: left;
    padding: 12px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(37, 47, 69, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.custom-select-toggle::after {
    content: "▾";
    font-size: 12px;
    color: var(--primary-color);
    margin-left: auto;
}

.custom-select.open .custom-select-toggle {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(114, 148, 183, 0.18);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(37, 47, 69, 0.18);
    z-index: 1500;
    display: none;
}

/* --- NEW: Specific override for Plot Dropdowns to be wider --- */
.plot-item .custom-select-menu {
    width: max-content;
    /* Allow it to be wider than the column */
    min-width: 100%;
    /* But at least as wide as the column */
    max-width: 1082px;
    /* Cap it so it doesn't overflow the overall card */
}

/* ------------------------------------------------------------- */

.custom-select.open .custom-select-menu {
    display: block;
}

.custom-select-option {
    padding: 10px 12px;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    color: var(--text-color);
    transition: background-color 0.12s ease;
}

.custom-select-option:hover {
    background: rgba(114, 148, 183, 0.12);
}

.custom-select-option.selected {
    background: rgba(37, 47, 69, 0.1);
    font-weight: 600;
}

/* Native select in Step 3 (Plots) should stay compact and truncate long HS text */
.plot-item .plot-product-select {
    max-width: 260px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Premium calendar icon to match dropdown look */
.plot-date-from,
.plot-date-to {
    padding-right: 42px;
}

.plot-date-from::-webkit-calendar-picker-indicator,
.plot-date-to::-webkit-calendar-picker-indicator {
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 6px;
    cursor: pointer;
    border-radius: 10px;
    background-color: rgba(114, 148, 183, 0.18);
    box-shadow: inset 0 0 0 1px rgba(114, 148, 183, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237294b7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='4' ry='4'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cpath d='M8 14h2v2H8zM14 14h2v2h-2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.plot-date-from::-moz-calendar-picker-indicator,
.plot-date-to::-moz-calendar-picker-indicator {
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 6px;
    cursor: pointer;
    border-radius: 10px;
    background-color: rgba(114, 148, 183, 0.18);
    box-shadow: inset 0 0 0 1px rgba(114, 148, 183, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237294b7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='4' ry='4'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cpath d='M8 14h2v2H8zM14 14h2v2h-2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.plot-date-from::-webkit-calendar-picker-indicator:hover,
.plot-date-to::-webkit-calendar-picker-indicator:hover,
.plot-date-from::-moz-calendar-picker-indicator:hover,
.plot-date-to::-moz-calendar-picker-indicator:hover {
    box-shadow: inset 0 0 0 1px rgba(114, 148, 183, 0.45), 0 3px 8px rgba(114, 148, 183, 0.25);
    transform: translateY(-1px);
}

body.dark-mode .plot-date-from::-webkit-calendar-picker-indicator,
body.dark-mode .plot-date-to::-webkit-calendar-picker-indicator,
body.dark-mode .plot-date-from::-moz-calendar-picker-indicator,
body.dark-mode .plot-date-to::-moz-calendar-picker-indicator {
    background-color: rgba(91, 160, 111, 0.2);
    box-shadow: inset 0 0 0 1px rgba(91, 160, 111, 0.4);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235ba06f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='4' ry='4'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cpath d='M8 14h2v2H8zM14 14h2v2h-2z'/%3E%3C/svg%3E");
}

/* --- COUNTRY & EMOJI FIXES --- */
.custom-select-toggle,
.custom-select-option {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    cursor: pointer;
    background-color: white;
}

/* 2. Specific Override for COUNTRY Dropdowns (Needs Emoji Font) */
/* This brings back the flags only where they are needed */
.country-dropdown .custom-select-toggle,
.country-dropdown .custom-select-option {
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Nunito', sans-serif;
}

/* Native selects fallback */
#supCountry,
.plot-country {
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Nunito', sans-serif;
}

/* Ensure HS/product selects wrap text and don't force dropdown wider than the field */
.product-select,
.plot-product-select,
.plot-lot-select {
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.product-select option,
.plot-product-select option,
.plot-lot-select option {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    font-size: 1.1rem;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

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

/* ── Profile Nudge (incomplete profile) ── */
#step-1.profile-blur > .card {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
    opacity: 0.4;
    transition: filter 0.4s, opacity 0.4s;
}

#step-1.profile-blur {
    position: relative;
}

.profile-nudge-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: nudgeFadeIn 0.5s ease;
}

.profile-nudge-overlay .nudge-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2f6fe4 0%, #1a4faa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: nudgePulse 2s ease-in-out infinite;
}

.profile-nudge-overlay .nudge-icon svg {
    stroke: #fff;
}

.profile-nudge-overlay .nudge-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a2233;
    margin-bottom: 6px;
}

.profile-nudge-overlay .nudge-desc {
    font-size: 0.88rem;
    color: #5a6a7e;
    margin-bottom: 18px;
    text-align: center;
    max-width: 340px;
    line-height: 1.5;
}

.profile-nudge-overlay .nudge-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2f6fe4 0%, #1a4faa 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(47, 111, 228, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.profile-nudge-overlay .nudge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 111, 228, 0.4);
}

.profile-nudge-overlay .nudge-btn .nudge-arrow {
    font-size: 1.1rem;
    animation: nudgeBounceX 1s ease-in-out infinite;
}

@keyframes nudgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

@keyframes nudgeBounceX {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(4px); }
}

@keyframes nudgeFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.dark-mode .profile-nudge-overlay .nudge-title {
    color: #e2e8f0;
}

body.dark-mode .profile-nudge-overlay .nudge-desc {
    color: #94a3b8;
}

body.dark-mode .profile-nudge-overlay .nudge-icon {
    background: linear-gradient(135deg, #3b7ddd 0%, #2558a8 100%);
}

body.dark-mode .profile-nudge-overlay .nudge-btn {
    background: linear-gradient(135deg, #3b7ddd 0%, #2558a8 100%);
}

.shine-btn {
    position: relative;
    overflow: hidden;
}

.shine-btn::after {
    content: "";
    position: absolute;
    top: -20%;
    left: -60%;
    width: 40%;
    height: 140%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%);
    transform: translateX(-160%);
    animation: buttonShine 5s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
    pointer-events: none;
}

@keyframes buttonShine {

    0%,
    60% {
        transform: translateX(-160%);
        opacity: 0;
    }

    70% {
        opacity: 1;
    }

    100% {
        transform: translateX(220%);
        opacity: 0;
    }
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    background: #9faec0;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.btn-small:hover {
    background: #3a5068;
    color: #fff;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    color: #e74c3c;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.hint {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.55;
    margin-bottom: 15px;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(37, 47, 69, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: 20% auto;
    padding: 30px;
    border: none;
    width: 85%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    border-top: 6px solid var(--secondary-color);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 28px;
    color: #ccc;
}

/* Link to Operator Modal */
.link-operator-card {
    background: rgba(255, 255, 255, 0.97);
    margin: auto;
    padding: 36px 34px 30px;
    width: 90%;
    max-width: 420px;
    border-radius: 18px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 16px 48px rgba(37, 47, 69, 0.22),
        0 2px 6px rgba(0, 0, 0, 0.06);
    text-align: center;
    position: relative;
    animation: linkModalIn 0.25s ease-out;
}

@keyframes linkModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.link-operator-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--secondary-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.link-operator-close:hover {
    background: rgba(114, 148, 183, 0.12);
    color: var(--primary-color);
}

.link-operator-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(114, 148, 183, 0.12), rgba(114, 148, 183, 0.06));
    border: 1px solid rgba(114, 148, 183, 0.18);
}

.link-operator-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.link-operator-subtitle {
    font-size: 0.85rem;
    color: var(--secondary-color);
    line-height: 1.5;
    margin-bottom: 22px;
}

.link-operator-field {
    text-align: left;
    margin-bottom: 18px;
}

.link-operator-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.link-operator-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.92rem;
    letter-spacing: 1.2px;
    color: var(--primary-color);
    background: rgba(245, 248, 252, 0.6);
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

.link-operator-field input::placeholder {
    color: #b0bec5;
    letter-spacing: 0.8px;
}

.link-operator-field input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(114, 148, 183, 0.15);
}

.link-operator-msg {
    font-size: 0.83rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: none;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: left;
}

.link-operator-error {
    color: #c62828;
    background: #fdecea;
}

.link-operator-success {
    color: #1b5e20;
    background: #e8f5e9;
}

.link-operator-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.link-operator-btn:hover {
    background: #1a2233;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 47, 69, 0.25);
}

.link-operator-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Dark mode – Link to Operator */
body.dark-mode .link-operator-card {
    background: linear-gradient(145deg, rgba(21, 27, 38, 0.98), rgba(30, 36, 48, 0.95));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 16px 48px rgba(0, 0, 0, 0.5);
}

body.dark-mode .link-operator-icon {
    background: linear-gradient(135deg, rgba(114, 148, 183, 0.15), rgba(114, 148, 183, 0.06));
    border-color: rgba(114, 148, 183, 0.2);
}

body.dark-mode .link-operator-title {
    color: #e4eaf0;
}

body.dark-mode .link-operator-field label {
    color: #c0cad6;
}

body.dark-mode .link-operator-field input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e4eaf0;
}

body.dark-mode .link-operator-field input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(114, 148, 183, 0.2);
}

body.dark-mode .link-operator-btn {
    background: var(--secondary-color);
}

body.dark-mode .link-operator-btn:hover {
    background: #8ba8c4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .link-operator-close {
    color: #8a95a5;
}

body.dark-mode .link-operator-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4eaf0;
}

/* Dropdown */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background: linear-gradient(145deg, #ffffff 0%, #f6f8fb 100%);
    min-width: 240px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    border-radius: 14px;
    z-index: 200;
    border: 1px solid #e6edf5;
    padding: 10px 0;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.show-dropdown {
    display: block;
    animation: fadeIn 0.2s;
}

.dropdown-header {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(90deg, rgba(114, 148, 183, 0.08), rgba(37, 47, 69, 0.04));
}

.dropdown-email {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dropdown-subtext {
    font-size: 0.8rem;
    color: #7a8aa2;
    letter-spacing: 0.02em;
}

.dropdown-divider {
    height: 1px;
    background: #e4ebf3;
    margin: 8px 14px;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    color: var(--primary-color);
    align-items: center;
    gap: 12px;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.dropdown-item:hover {
    background-color: #eef3f9;
    transform: translateY(-1px);
}

.menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--secondary-color);
    background: rgba(114, 148, 183, 0.15);
    border-radius: 8px;
}

.menu-icon svg {
    width: 18px;
    height: 18px;
}

#themeIcon .icon-sun {
    display: none;
}

#themeIcon[data-theme="dark"] .icon-sun {
    display: block;
}

#themeIcon[data-theme="dark"] .icon-moon {
    display: none;
}

#themeIcon[data-theme="light"] .icon-moon {
    display: block;
}

#themeIcon[data-theme="light"] .icon-sun {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- PLOT GEOMETRY ACTIONS --- */
.plot-geo-actions {
    margin-top: 4px;
}

.plot-geo-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 5px 12px;
    border-radius: 16px;
}

.plot-upload-geojson-label {
    font-size: 0.82rem;
    font-family: inherit;
}

.plot-draw-map {
    font-size: 0.82rem;
}

.plot-clear-geo {
    font-size: 0.82rem;
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.plot-clear-geo:hover {
    opacity: 0.85;
}

/* --- SUPPLIER MAP --- */
.map-section {
    margin: 28px 0 12px;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(37, 47, 69, 0.07);
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.map-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

.map-header-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.map-header-title svg {
    color: var(--secondary-color);
    flex-shrink: 0;
}

.map-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-hint {
    font-size: 0.82rem;
    color: var(--muted-color);
    margin: 6px 20px 0;
    line-height: 1.5;
}

.map-hint strong {
    color: var(--secondary-color);
}

.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.map-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.map-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    background: var(--card-bg);
    color: var(--text-color);
    white-space: nowrap;
}

.map-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(37, 47, 69, 0.12);
}

.map-btn-draw {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.map-btn-draw:hover {
    background: #5a84a5;
    border-color: #5a84a5;
}

.map-btn-complete {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    padding: 8px 18px;
    animation: completeGlow 1.8s ease-in-out infinite alternate;
}

.map-btn-complete:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(46, 204, 113, 0.45);
}

.map-btn-clear {
    background: transparent;
    color: var(--muted-color);
    border-color: transparent;
    font-weight: 500;
}

.map-btn-clear:hover {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.25);
}

.map-area-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    background: rgba(114, 148, 183, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.map-point-badge {
    font-size: 0.78rem;
    color: var(--muted-color);
    font-weight: 500;
}

.map-canvas-wrap {
    padding: 0 20px 20px;
}

.map-canvas {
    position: relative;
    width: 100%;
    height: 460px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

@keyframes completeGlow {
    0%   { box-shadow: 0 0 8px rgba(46, 204, 113, 0.25); }
    100% { box-shadow: 0 0 18px rgba(46, 204, 113, 0.55); }
}

/* --- DARK MODE OVERRIDES --- */
body.dark-mode {
    --bg-color: #0d121c;
    --card-bg: #151b26;
    --text-color: #ecf0f1;
    --border-color: #2c3e50;
    --primary-color: #ecf0f1;
    --secondary-color: #5ba06f;
    --muted-color: #a0aec0;
}

body.dark-mode .app-header {
    background: linear-gradient(90deg, #182a1e 0%, #233529 50%, #182a1e 100%);
    border-bottom-color: #5ba06f;
}

/* UPDATED: Dark mode card uses semi-transparent dark background */
body.dark-mode .card {
    background-color: rgba(21, 27, 38, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .section+.section::before {
    background: linear-gradient(90deg, transparent, rgba(91, 160, 111, 0.5), transparent);
}

body.dark-mode .modal-content,
body.dark-mode .dropdown-content {
    background: linear-gradient(145deg, rgba(21, 27, 38, 0.98) 0%, rgba(30, 36, 48, 0.94) 100%);
    border-color: var(--border-color);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .auth-container {
    background: linear-gradient(135deg, #0f1623 0%, #0a1019 100%);
}

body.dark-mode .auth-card {
    background: rgba(21, 28, 41, 0.92);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

body.dark-mode .dropdown-header {
    background: linear-gradient(90deg, rgba(91, 160, 111, 0.12), rgba(255, 255, 255, 0.02));
}

body.dark-mode .dropdown-subtext {
    color: #a6d3b4;
}

body.dark-mode .dropdown-divider {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .dropdown-item:hover {
    background-color: rgba(91, 160, 111, 0.14);
}

body.dark-mode .menu-icon {
    background: rgba(91, 160, 111, 0.22);
    color: var(--secondary-color);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #1b2433;
    color: white;
    border-color: #2c3e50;
}

body.dark-mode .product-item,
body.dark-mode .plot-item {
    background: #1a212e;
    border-color: #2c3b50;
}

body.dark-mode .map-section {
    background: #151b26;
    border-color: #2c3b50;
}

body.dark-mode .map-btn {
    background: #1a212e;
    color: #ecf0f1;
    border-color: #2c3b50;
}

body.dark-mode .map-btn:hover {
    background: #5ba06f;
    border-color: #5ba06f;
}

body.dark-mode .map-btn-draw {
    background: #5ba06f;
    border-color: #5ba06f;
}

body.dark-mode .map-canvas {
    border-color: #2c3b50;
}

body.dark-mode .nav-center h1 {
    color: white;
}

body.dark-mode #supCountry,
body.dark-mode .plot-country {
    background-color: #1b2433;
    color: white;
}

body.dark-mode #supCountry option,
body.dark-mode .plot-country option {
    background-color: #1f2a38;
    color: #e6f0e8;
}

body.dark-mode .history-table th {
    background-color: #1b2433;
    color: #ecf0f1;
}

body.dark-mode .custom-select-toggle {
    background: #1b2433;
    color: #ecf0f1;
    border-color: #2c3e50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .custom-select.open .custom-select-toggle {
    border-color: #5ba06f;
    box-shadow: 0 4px 14px rgba(91, 160, 111, 0.25);
}

body.dark-mode .custom-select-toggle::after {
    color: #76c089;
}

body.dark-mode .custom-select-menu {
    background: #0f1623;
    border-color: #2c3e50;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

body.dark-mode .custom-select-option {
    color: #e6f0e8;
}

body.dark-mode .custom-select-option:hover {
    background: rgba(91, 160, 111, 0.18);
}

body.dark-mode .custom-select-option.selected {
    background: rgba(91, 160, 111, 0.28);
    color: #ffffff;
}

/* --- HISTORY TABLE STYLES --- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.history-table th,
.history-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.history-table th {
    background-color: #f8f9fa;
    color: var(--primary-color);
    font-weight: 600;
}

/* --- HAMBURGER MENU --- */
.hamburger-menu {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    margin-right: 15px;
    border-radius: 8px;
    transition: background-color 0.25s ease, transform 0.15s ease;
}

.hamburger-menu .bar {
    width: 22px;
    height: 2.5px;
    background-color: var(--header-text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Hover: subtle expansion */
.hamburger-menu:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.hamburger-menu:hover .bar:nth-child(1) {
    transform: translateY(-1px);
}

.hamburger-menu:hover .bar:nth-child(3) {
    transform: translateY(1px);
}

/* Active (click feedback) */
.hamburger-menu:active {
    transform: scale(0.96);
}


/* --- CHAT DRAWER & OVERLAY --- */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 47, 69, 0.55);
    backdrop-filter: blur(3px);
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.chat-overlay.active {
    opacity: 1;
    visibility: visible;
}

.chat-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 380px;
    background: linear-gradient(180deg, #f7f9fb 0%, #ffffff 45%, #f4f6f8 100%);
    border-right: 1px solid var(--border-color);
    box-shadow: 6px 0 28px rgba(37, 47, 69, 0.2);
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.45s ease;
    display: flex;
    flex-direction: column;
    font-family: 'Nunito', sans-serif;
    z-index: 5000;
}

.chat-drawer.open {
    transform: translateX(0);
    opacity: 1;
}

/* Header */
.chat-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(120deg, var(--primary-color) 0%, #1f2c42 100%);
    color: #ffffff;
    border-bottom: 3px solid var(--secondary-color);
    box-shadow: 0 10px 25px rgba(37, 47, 69, 0.22);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
}

.chat-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7294b7 0%, #1e3343 100%);
    box-shadow: 0 6px 15px rgba(30, 51, 67, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.chat-badge img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.chat-title-group {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.chat-title-main {
    font-weight: 800;
    letter-spacing: 0.03em;
    font-size: 1rem;
}

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

.chat-icon-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.chat-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.chat-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    color: #ffffff;
    font-size: 24px;
    line-height: 20px;
    padding: 8px 12px;
    margin: 0;
    display: flex;
    align-items: center;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: linear-gradient(180deg, #f6f8fb 0%, #ffffff 55%, #eef2f7 100%);
}

.chat-intro {
    text-align: center;
    color: #4b5566;
    margin-top: 35px;
}

.chat-intro h3 {
    background: linear-gradient(90deg, #7294b7, #1e3343);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 100%;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.chat-message.bot .message-avatar {
    background: linear-gradient(135deg, #dde6f2 0%, #cddae9 100%);
    color: var(--primary-color);
    border-color: #d1ddeb;
}

.chat-message.user .message-avatar {
    background: linear-gradient(135deg, #252f45 0%, #36425c 100%);
    color: #ffffff;
    border-color: #1b2435;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
    max-width: 100%;
    box-shadow: 0 10px 22px rgba(37, 47, 69, 0.08);
}

.chat-message.user .message-bubble {
    border-radius: 12px 12px 4px 12px;
}

.chat-message.bot .message-bubble {
    border-radius: 12px 12px 12px 4px;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #252f45 0%, #1c2437 100%);
    color: #ffffff;
    border: 1px solid #1b2c3f;
    box-shadow: 0 10px 24px rgba(37, 47, 69, 0.25);
}

.chat-message.bot .message-bubble {
    background: rgba(114, 148, 183, 0.12);
    color: var(--primary-color);
    border: 1px solid rgba(114, 148, 183, 0.3);
}

/* Input Area */
.chat-input-area {
    padding: 18px;
    background: linear-gradient(180deg, #f7f9fb 0%, #ffffff 100%);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 24px rgba(37, 47, 69, 0.08);
}

.chat-input-wrapper {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 6px 12px;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 12px 26px rgba(37, 47, 69, 0.08);
}

.chat-input-wrapper:focus-within {
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(37, 47, 69, 0.16);
    border-color: var(--secondary-color);
}

#chatInput {
    border: none;
    background: transparent;
    flex: 1;
    padding: 10px;
    font-size: 1rem;
    color: var(--text-color);
}

#chatInput:focus {
    outline: none;
}

.chat-send-btn {
    background: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    cursor: pointer;
    color: #ffffff;
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 18px rgba(114, 148, 183, 0.35);
}

.chat-send-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(37, 47, 69, 0.35);
    transform: translateY(-1px);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

.chat-footer-text {
    font-size: 0.75rem;
    text-align: center;
    color: #5b6577;
    margin-top: 10px;
}

/* Typing indicator */
.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: chatBounce 1s infinite ease-in-out;
    opacity: 0.6;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Dark Mode Support for Chat */
body.dark-mode .chat-drawer {
    background: linear-gradient(180deg, #0f1623 0%, #111827 100%);
    border-right: 1px solid #2c3b50;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.4);
}

body.dark-mode .chat-header {
    background: linear-gradient(120deg, #182520 0%, #233529 100%);
    border-bottom-color: #5ba06f;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

body.dark-mode .chat-header-title {
    color: #ecf0f1;
}

body.dark-mode .chat-badge {
    background: linear-gradient(135deg, #5ba06f 0%, #2b3f2f 100%);
    color: #f4f9f5;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.dark-mode .chat-icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ecf0f1;
}

body.dark-mode .chat-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

body.dark-mode .chat-close-btn {
    border-color: rgba(255, 255, 255, 0.18);
    color: #ecf0f1;
}

body.dark-mode .chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

body.dark-mode .chat-messages {
    background: #0f1623;
}

body.dark-mode .chat-intro {
    color: #c5d5c7;
}

body.dark-mode .chat-message.bot .message-avatar {
    background: linear-gradient(135deg, #1f2a38 0%, #243246 100%);
    color: #d8e4dc;
    border-color: #2c3b50;
}

body.dark-mode .chat-message.user .message-avatar {
    background: linear-gradient(135deg, #1a222f 0%, #111725 100%);
    color: #f0f4f8;
    border-color: #30415a;
}

body.dark-mode .chat-message.bot .message-bubble {
    background: rgba(91, 160, 111, 0.08);
    color: #e6f0e8;
    border-color: rgba(91, 160, 111, 0.3);
}

body.dark-mode .chat-message.user .message-bubble {
    background: linear-gradient(135deg, #1a222f 0%, #111725 100%);
    color: #ecf0f1;
    border-color: #30415a;
}

body.dark-mode .chat-input-area {
    background: #0f1623;
    border-top-color: #2c3b50;
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.5);
}

body.dark-mode .chat-input-wrapper {
    background: #151c29;
    border-color: #2c3b50;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
}

body.dark-mode #chatInput {
    color: #ecf0f1;
}

body.dark-mode .chat-send-btn {
    background: #5ba06f;
    border-color: #5ba06f;
    box-shadow: 0 8px 18px rgba(91, 160, 111, 0.35);
}

body.dark-mode .chat-send-btn:hover {
    background: #76c089;
    border-color: #76c089;
    box-shadow: 0 10px 22px rgba(91, 160, 111, 0.45);
}

body.dark-mode .chat-footer-text {
    color: #9bb6a6;
}

/* Footer rights text (app only) */
.app-rights {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 18px 24px;
    margin-top: 40px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.03em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.12) 100%);
}

.app-rights .app-rights-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.app-footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.72rem;
}
.app-footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}
.app-footer-links .footer-divider {
    color: rgba(255,255,255,0.3);
    font-size: 0.6rem;
}

.app-rights sup {
    font-size: 0.6em;
    vertical-align: text-top;
}

.app-badge {
    width: 36px;
    height: auto;
    opacity: 0.85;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.25));
}

body.dark-mode .app-rights {
    color: rgba(200, 215, 230, 0.55);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

/* Remove number spinners for latitude, longitude, TARIC, and size inputs */
.plot-lat::-webkit-outer-spin-button,
.plot-lat::-webkit-inner-spin-button,
.plot-lon::-webkit-outer-spin-button,
.plot-lon::-webkit-inner-spin-button,
.plot-taric::-webkit-outer-spin-button,
.plot-taric::-webkit-inner-spin-button,
.plot-size::-webkit-outer-spin-button,
.plot-size::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.plot-lat,
.plot-lon,
.plot-taric,
.plot-size {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 2 STYLES: Operator Wizard, Matching Cards, Questionnaire
   (Stepper styles are in operator-react.css — only shared
    components like SME grid, matching cards remain here)
   ═══════════════════════════════════════════════════════════════ */

/* ── OPERATOR SECTION TITLE ── */
.op-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-section-icon {
    font-size: 1.3rem;
}

/* ── SME CRITERIA GRID ── */
.sme-grid {
    display: grid;
    grid-template-columns: 180px 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 25px;
}

.sme-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(114, 148, 183, 0.2);
}

.sme-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary-color);
    padding-right: 10px;
}

.sme-grid .form-group {
    margin-bottom: 0;
}

.sme-grid input {
    text-align: center;
}

@media (max-width: 768px) {
    .sme-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .sme-label {
        grid-column: 1 / -1;
        padding: 8px 0 2px;
        border-top: 1px solid #eee;
    }

    .sme-header:first-child {
        display: none;
    }

    .op-stepper {
        gap: 0;
    }

    .op-step-label {
        font-size: 0.65rem;
    }

    .op-step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* ── OPERATOR PRODUCT CARDS (Step B) ── */
.op-product-card {
    background: #fbfcfe;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary-color);
    padding: 22px;
    border-radius: 10px;
    margin-bottom: 18px;
    position: relative;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.op-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 47, 69, 0.1);
    border-color: rgba(114, 148, 183, 0.5);
}

.op-product-card-header {
    margin-bottom: 15px;
}

.op-card-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3b7a57, #5ba06f);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── MATCHING CARDS (Step C) ── */
.op-matching-card {
    background: #fbfcfe;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.op-matching-card:hover {
    box-shadow: 0 8px 25px rgba(37, 47, 69, 0.08);
}

.op-matching-card-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef2f7;
}

.op-matching-product-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.op-matching-product-name {
    margin: 8px 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
}

.op-matching-product-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted-color);
    font-style: italic;
}

.op-matching-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
}

.op-matching-card-body {
    padding-top: 4px;
}

.op-matching-validation-msg {
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(231, 76, 60, 0.08);
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

/* ── PLOT MULTI-SELECT DROPDOWN ── */
.op-plot-multi-select {
    position: relative;
    margin-bottom: 10px;
}

.op-plot-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--muted-color);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.op-plot-dropdown-toggle:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(114, 148, 183, 0.15);
}

.op-plot-dropdown-text {
    flex: 1;
    text-align: left;
}

.op-plot-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(37, 47, 69, 0.18);
    z-index: 1500;
}

.op-plot-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background-color 0.12s ease;
    border-bottom: 1px solid #f4f6f8;
}

.op-plot-dropdown-item:last-child {
    border-bottom: none;
}

.op-plot-dropdown-item:hover {
    background: rgba(114, 148, 183, 0.08);
}

.op-plot-dropdown-item.selected {
    background: rgba(59, 122, 87, 0.08);
}

.op-plot-dropdown-empty {
    color: var(--muted-color);
    font-style: italic;
    cursor: default;
    text-align: center;
}

.op-plot-checkbox {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.op-plot-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.88rem;
    color: var(--text-color);
}

.op-plot-info small {
    color: var(--muted-color);
    font-size: 0.78rem;
}

/* ── SELECTED PLOT CHIPS ── */
.op-selected-plots-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.plot-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(59, 122, 87, 0.12), rgba(91, 160, 111, 0.15));
    color: #2d6a4f;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(59, 122, 87, 0.2);
    transition: all 0.15s ease;
}

.plot-chip:hover {
    background: linear-gradient(135deg, rgba(59, 122, 87, 0.18), rgba(91, 160, 111, 0.22));
    box-shadow: 0 2px 8px rgba(59, 122, 87, 0.15);
}

.plot-chip-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    transition: transform 0.15s ease;
}

.plot-chip-remove:hover {
    transform: scale(1.3);
}

/* ── ACCESS CODE GENERATOR ── */
.op-code-generator {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 15px;
}

.generated-code-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f0faf4, #e8f5ee);
    border: 1px solid rgba(59, 122, 87, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
}

.code-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b7a57;
    white-space: nowrap;
}

.access-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.08em;
    flex: 1;
    word-break: break-all;
}

.btn-copy {
    background: rgba(59, 122, 87, 0.15);
    border: 1px solid rgba(59, 122, 87, 0.25);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #3b7a57;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy:hover {
    background: rgba(59, 122, 87, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(59, 122, 87, 0.2);
}

.empty-state-text {
    text-align: center;
    color: var(--muted-color);
    font-style: italic;
    padding: 25px;
    font-size: 0.9rem;
}

/* ── SUPPLIER QUESTIONNAIRE ── */
.questionnaire-group {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fbfd;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    transition: box-shadow 0.18s ease;
}

.questionnaire-group:hover {
    box-shadow: 0 4px 15px rgba(37, 47, 69, 0.06);
}

.questionnaire-group label {
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.q-number {
    font-weight: 700;
    color: var(--secondary-color);
    margin-right: 4px;
}

.questionnaire-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 70px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.questionnaire-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(114, 148, 183, 0.15);
}

/* ── DARK MODE: Phase 2 Components ── */

body.dark-mode .op-product-card,
body.dark-mode .op-matching-card {
    background: #1a212e;
    border-color: #2c3b50;
}

body.dark-mode .op-matching-card-header {
    border-bottom-color: #2c3e50;
}

body.dark-mode .op-plot-dropdown-toggle {
    background: #1b2433;
    border-color: #2c3e50;
    color: #a0b0c0;
}

body.dark-mode .op-plot-dropdown-menu {
    background: #151b26;
    border-color: #2c3e50;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

body.dark-mode .op-plot-dropdown-item {
    border-bottom-color: #1e2a38;
}

body.dark-mode .op-plot-dropdown-item:hover {
    background: rgba(91, 160, 111, 0.12);
}

body.dark-mode .op-plot-dropdown-item.selected {
    background: rgba(91, 160, 111, 0.18);
}

body.dark-mode .plot-chip {
    background: linear-gradient(135deg, rgba(91, 160, 111, 0.2), rgba(59, 122, 87, 0.25));
    color: #7dc89a;
    border-color: rgba(91, 160, 111, 0.3);
}

body.dark-mode .generated-code-box {
    background: linear-gradient(135deg, rgba(59, 122, 87, 0.12), rgba(91, 160, 111, 0.08));
    border-color: rgba(91, 160, 111, 0.25);
}

body.dark-mode .access-code {
    color: #7dc89a;
}

body.dark-mode .questionnaire-group {
    background: #1a212e;
    border-left-color: #5ba06f;
}

body.dark-mode .questionnaire-input {
    background: #1b2433;
    border-color: #2c3e50;
    color: #ecf0f1;
}

body.dark-mode .sme-header {
    border-bottom-color: rgba(91, 160, 111, 0.3);
    color: #5ba06f;
}

body.dark-mode .op-card-badge {
    background: linear-gradient(135deg, #3b7a57, #4a9966);
}

body.dark-mode .op-matching-product-desc {
    color: #6d8090;
}







/* --- SUPPLIER STEPPER --- */
.sup-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 20px;
}

.sup-stepper .op-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.sup-stepper .op-step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
    position: relative;
}

.sup-stepper .op-step-circle.inactive {
    background: var(--border-color);
    color: var(--muted-color);
}

.sup-stepper .op-step-circle.active {
    background: linear-gradient(135deg, #3b7a57, #5ba06f);
    color: white;
    border-color: rgba(91, 160, 111, 0.4);
    box-shadow: 0 4px 20px rgba(91, 160, 111, 0.35);
    transform: scale(1.12);
}

.sup-stepper .op-step-circle.completed {
    background: linear-gradient(135deg, var(--primary-color), #3a4a66);
    color: white;
    box-shadow: 0 3px 12px rgba(37, 47, 69, 0.2);
}

.sup-stepper .op-step-circle.completed::after {
    content: '\2713';
    position: absolute;
    font-size: 1.1rem;
}

.sup-stepper .op-step-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease;
    white-space: nowrap;
}

.sup-stepper .op-step-item.active .op-step-label {
    color: #ffffff;
}

.sup-stepper .op-step-item.completed .op-step-label {
    color: #ffffff;
}

.sup-stepper .op-step-connector {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    min-width: 30px;
    max-width: 120px;
    border-radius: 2px;
    margin: 0 12px;
    margin-bottom: 28px;
    transition: background 0.3s ease;
}

.sup-stepper .op-step-connector.done {
    background: linear-gradient(90deg, var(--primary-color), #3b7a57);
}

/* Dark mode stepper */
body.dark-mode .sup-stepper .op-step-circle.inactive {
    background: #2c3e50;
    color: #8899aa;
}

body.dark-mode .sup-stepper .op-step-circle.completed {
    background: linear-gradient(135deg, #2a3a50, #3a4a66);
}

body.dark-mode .sup-stepper .op-step-connector {
    background: #2c3e50;
}

body.dark-mode .sup-stepper .op-step-item.active .op-step-label {
    color: #ffffff;
}

@media (max-width: 480px) {
    .sup-stepper {
        padding: 0 8px;
    }
    .sup-stepper .op-step-circle {
        width: 38px;
        height: 38px;
        font-size: 0.8rem;
    }
    .sup-stepper .op-step-connector {
        min-width: 16px;
        margin: 0 6px;
        margin-bottom: 28px;
    }
    .sup-stepper .op-step-label {
        font-size: 0.6rem;
    }
}

/* --- CHATBOT FLOATING ACTION BUTTON --- */
.chat-floating-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b7a57, #5ba06f);
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 15px rgba(59, 122, 87, 0.3);
    color: white;
    cursor: pointer;
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 122, 87, 0.4);
}

.chat-floating-btn:active {
    transform: scale(0.95);
}

/* --- CHAT POPUP (exact copy of operator/admin) --- */
.op-chat-popup {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 500px;
    max-height: calc(100vh - 140px);
    background: linear-gradient(180deg, #f7f9fb 0%, #ffffff 45%, #f4f6f8 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(26, 35, 50, 0.22);
    display: flex;
    flex-direction: column;
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.op-chat-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.op-chat-popup-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(120deg, #3b7a57 0%, #2a5c3f 100%);
    color: #ffffff;
    border-bottom: 2px solid #5ba06f;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.op-chat-popup-header .chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
}

.op-chat-popup-header .chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-chat-popup-header .chat-icon-btn,
.op-chat-popup-header .chat-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.op-chat-popup-header .chat-icon-btn:hover,
.op-chat-popup-header .chat-close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.op-chat-popup-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(180deg, #f6f8fb 0%, #ffffff 55%, #eef2f7 100%);
}

.op-chat-popup-messages .chat-intro {
    text-align: center;
    color: #4b5566;
    margin-top: 30px;
}

.op-chat-popup-messages .chat-intro h3 {
    background: linear-gradient(90deg, #3b7a57, #5ba06f);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.op-chat-popup-input {
    padding: 12px 14px;
    background: linear-gradient(180deg, #f7f9fb 0%, #ffffff 100%);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}

.op-chat-popup-input .chat-input-wrapper {
    background: #ffffff;
    border-radius: 24px;
    border: 2px solid #3b7a57;
    display: flex;
    align-items: center;
    padding: 4px 6px 4px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(59, 122, 87, 0.08);
}

.op-chat-popup-input .chat-input-wrapper:focus-within {
    border-color: #5ba06f;
    box-shadow: 0 2px 12px rgba(59, 122, 87, 0.18);
}

.op-chat-popup-input .chat-input-wrapper input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 8px 4px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
}

.op-chat-popup-input .chat-input-wrapper input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.op-chat-popup-input .chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b7a57 0%, #5ba06f 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(59, 122, 87, 0.3);
}

.op-chat-popup-input .chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 122, 87, 0.4);
}

.op-chat-popup-input .chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat message bubbles inside popup */
.op-chat-popup-messages .chat-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.op-chat-popup-messages .chat-message.user {
    flex-direction: row-reverse;
}

.op-chat-popup-messages .chat-message .message-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.op-chat-popup-messages .chat-message .message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.op-chat-popup-messages .chat-message.bot .message-bubble {
    background: #e8ecf1;
    color: #1e2031;
    border-bottom-left-radius: 4px;
}

.op-chat-popup-messages .chat-message.user .message-bubble {
    background: linear-gradient(135deg, #3b7a57 0%, #5ba06f 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Dark mode for chat popup */
body.dark-mode .op-chat-popup {
    background: linear-gradient(180deg, #0f1623 0%, #111827 100%);
    border-color: #2c3b50;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

body.dark-mode .op-chat-popup-header {
    background: linear-gradient(120deg, #182520 0%, #233529 100%);
    border-bottom-color: #5ba06f;
}

body.dark-mode .op-chat-popup-messages {
    background: linear-gradient(180deg, #0f1825 0%, #111827 55%, #0d1420 100%);
}

body.dark-mode .op-chat-popup-messages .chat-intro {
    color: #8899aa;
}

body.dark-mode .op-chat-popup-messages .chat-message.bot .message-bubble {
    background: #1a2332;
    color: #e2e8f0;
}

body.dark-mode .op-chat-popup-input {
    background: linear-gradient(180deg, #111827 0%, #0f1623 100%);
    border-top-color: #2c3b50;
}

body.dark-mode .op-chat-popup-input .chat-input-wrapper {
    background: #1a2332;
    border-color: #2c5a3f;
}

body.dark-mode .op-chat-popup-input .chat-input-wrapper input {
    color: #e2e8f0;
}

body.dark-mode .op-chat-popup-input .chat-input-wrapper input::placeholder {
    color: #8899aa;
}

@media (max-width: 480px) {
    .op-chat-popup {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
        height: 60vh;
    }
}

/* --- CHAT LOGO --- */
.chat-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}

/* --- UTILITY CLASSES (extracted from inline styles) --- */
.btn-full {
    width: 100%;
}

.btn-modal-ok {
    width: auto;
    padding: 10px 30px;
}

.btn-back-nav {
    width: auto;
}

.btn-add-item {
    margin-bottom: 20px;
}

.back-btn-wrap {
    margin-bottom: 15px;
}

.step-actions {
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.welcome-banner {
    margin-bottom: 25px;
}

.welcome-text {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.7;
}

.welcome-user {
    font-weight: bold;
    color: var(--secondary-color);
}

/* --- MAP TOOLBAR BUTTONS (legacy compat, now uses .map-btn) --- */
.map-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* --- PLOT GEO TOOLBAR --- */
.plot-geo-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.geo-action-btn {
    cursor: pointer;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    box-sizing: border-box;
    line-height: 1.4;
}

.btn-geo-view {
    background: #27ae60;
    color: #fff;
}

.btn-geo-view:hover {
    background: #219a52;
}

.btn-geo-clear {
    background: #e74c3c;
    color: #fff;
}

.btn-geo-clear:hover {
    background: #c0392b;
}

/* --- GRID-5 RESPONSIVE ADJUSTMENT --- */
@media (max-width: 1200px) and (min-width: 1001px) {
    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* --- AUTH RESPONSIVE: Very small phones (≤ 400px) --- */
@media (max-width: 400px) {
    .auth-container {
        padding: 10px;
    }

    .auth-card {
        padding: 16px;
        max-width: 100%;
        border-radius: 8px;
    }

    .auth-card .login-logo-wrap img {
        max-width: 80px !important;
    }

    .auth-card h2 {
        font-size: 1rem;
        margin-top: 0;
        margin-bottom: 4px;
    }

    .auth-card #authSubtitle {
        font-size: 0.78rem;
        margin-bottom: 10px !important;
    }

    .auth-card .form-group {
        margin-bottom: 6px;
    }

    .auth-card .form-group input,
    .auth-card .form-group select {
        padding: 6px 8px;
        font-size: 13px;
    }

    .auth-card .btn-primary {
        padding: 8px;
        font-size: 0.88rem;
    }

    .btn-social {
        padding: 8px 12px;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    .social-login-buttons {
        gap: 7px;
    }

    .auth-divider {
        margin: 8px 0;
    }

    .auth-error-msg,
    .auth-success-msg {
        padding: 8px 10px;
        margin-bottom: 10px;
        font-size: 0.82rem;
    }
}

/* --- AUTH RESPONSIVE: Short viewports (small laptops, landscape phones) --- */
@media (max-height: 750px) {
    .auth-container {
        align-items: flex-start;
    }

    .auth-card {
        padding: 16px 24px 18px;
        margin: 10px auto;
    }

    .auth-card .login-logo-wrap img {
        max-width: 90px !important;
    }

    .auth-card h2 {
        font-size: 1.05rem;
        margin-top: 0;
        margin-bottom: 4px;
    }

    .auth-card #authSubtitle {
        font-size: 0.8rem;
        margin-bottom: 12px !important;
    }

    .auth-card .form-group {
        margin-bottom: 6px;
    }

    .auth-card .form-group input,
    .auth-card .form-group select {
        padding: 6px 9px;
    }

    .auth-card .btn-primary {
        padding: 8px;
        margin-top: 2px;
    }

    .btn-social {
        padding: 8px 14px;
    }

    .social-login-buttons {
        gap: 6px;
    }

    .auth-divider {
        margin: 8px 0;
    }
}

/* --- AUTH RESPONSIVE: Very short viewports (landscape phones) --- */
@media (max-height: 500px) {
    .auth-card {
        padding: 12px 20px 14px;
    }

    .auth-card .login-logo-wrap img {
        max-width: 60px !important;
    }

    .auth-card h2 {
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    .auth-card #authSubtitle {
        font-size: 0.75rem;
        margin-bottom: 8px !important;
    }

    .auth-card .form-group {
        margin-bottom: 4px;
    }

    .auth-card .form-group label {
        font-size: 0.72rem;
        margin-bottom: 1px;
    }

    .auth-card .form-group input {
        padding: 5px 8px;
        font-size: 12px;
    }

    .auth-card .btn-primary {
        padding: 6px;
        font-size: 0.85rem;
    }

    .btn-social {
        padding: 6px 10px;
        font-size: 0.78rem;
        gap: 6px;
    }

    .btn-social svg {
        width: 14px;
        height: 14px;
    }

    .social-login-buttons {
        gap: 4px;
    }

    .auth-divider {
        margin: 6px 0;
    }

    .auth-card .auth-switch {
        margin-top: 4px;
    }
}