/* ============================================================
   HMI AUTOMATION CONTROL PANEL — MASTER STYLESHEET
   Responsive: Desktop 3-col | Tablet 2-col | Mobile 1-col
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
    --bg:               #070a12;
    --card-bg:          #111726;
    --card-bg-hover:    #182033;
    --card-inner:       #0b0f1a;
    --accent-blue:      #38bdf8;
    --accent-cyan:      #06b6d4;
    --accent-green:     #10b981;
    --accent-yellow:    #f59e0b;
    --accent-red:       #ef4444;
    --accent-purple:    #a855f7;
    --border:           #1e293b;
    --border-hi:        #334155;
    --text-hi:          #f8fafc;
    --text-mid:         #cbd5e1;
    --text-low:         #94a3b8;
    --text-mute:        #64748b;
    --glass:            rgba(17, 23, 38, 0.88);
    --shadow:           0 10px 32px -4px rgba(0,0,0,.65), 0 0 24px rgba(56,189,248,.04);
    --radius-lg:        16px;
    --radius-md:        12px;
    --radius-sm:        8px;

    /* Layout breakpoints */
    --bp-tablet:        900px;
    --bp-mobile:        600px;
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* ---- Body / Background ---- */
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(56,189,248,.07) 0%, transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(16,185,129,.05) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-hi);
    min-height: 100dvh;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ---- App Shell ---- */
.app-container {
    width: 100%;
    max-width: 1560px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100dvh;
    /* bottom padding for mobile nav */
    padding-bottom: 16px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 10px;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #0284c7, var(--accent-green));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 16px rgba(56,189,248,.4);
    flex-shrink: 0;
}

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header .title {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: .5px;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.1;
}

.header .subtitle {
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-blue);
    text-transform: uppercase;
}

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

/* ---- Tab Bar (desktop) ---- */
.hmi-tab-bar {
    display: flex;
    background: var(--card-inner);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    gap: 4px;
}

.hmi-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: .84rem;
    font-weight: 800;
    color: var(--text-low);
    cursor: pointer;
    background: none;
    border: none;
    transition: all .2s ease;
    white-space: nowrap;
}

.hmi-tab-btn.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 10px rgba(56,189,248,.4);
}

.hmi-tab-btn:hover:not(.active) {
    color: #fff;
    background: rgba(255,255,255,.05);
}

/* ---- BLE Connect Button ---- */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.04);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-low);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all .25s ease;
    white-space: nowrap;
}

.connection-status:hover {
    background: rgba(56,189,248,.1);
    border-color: var(--accent-blue);
    color: #fff;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-red);
    box-shadow: 0 0 8px rgba(239,68,68,.6);
    flex-shrink: 0;
}

.status-dot.online {
    background-color: var(--accent-green);
    box-shadow: 0 0 12px rgba(16,185,129,.9);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 8px rgba(16,185,129,.7); }
    50%       { box-shadow: 0 0 20px rgba(16,185,129,1); }
}

/* ============================================================
   MAIN CONTENT AREA — HMI PANEL GRID
   ============================================================ */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

/* Tab content panel — each is a grid row of cards */
.tab-panel {
    display: grid;
    gap: 16px;
    width: 100%;
    /* Default desktop: 2/3 + 1/3 split */
    grid-template-columns: 1fr;
}

.tab-panel.hidden {
    display: none !important;
}

/* Desktop: side-by-side panels */
.tab-panel.two-col {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

/* "Both" mode: all 3 columns */
.tab-panel.three-col {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}

/* ============================================================
   HMI CARDS
   ============================================================ */
.hmi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color .25s ease;
    min-width: 0;   /* prevent overflow in grid */
}

.hmi-card:hover {
    border-color: var(--border-hi);
}

.hmi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.hmi-card-title {
    font-size: .95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hmi-card-badge {
    font-size: .7rem;
    font-weight: 800;
    color: var(--accent-blue);
    background: rgba(56,189,248,.12);
    border: 1px solid rgba(56,189,248,.3);
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================
   TELEMETRY TILES
   ============================================================ */
.telemetry-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.telemetry-tile {
    background: var(--card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color .2s;
}

.telemetry-tile:hover {
    border-color: var(--border-hi);
}

.telemetry-tile-label {
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.telemetry-tile-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-hi);
    letter-spacing: -.5px;
}

.telemetry-tile-sub {
    font-size: .72rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* ============================================================
   STATUS HERO BOX
   ============================================================ */
.hmi-hero-status {
    background: var(--card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-line {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-label {
    color: var(--text-low);
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.status-value {
    color: var(--accent-blue);
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.35;
    word-break: break-all;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-size: .74rem;
    font-weight: 800;
    color: var(--text-low);
    letter-spacing: .5px;
    text-transform: uppercase;
}

.progress-pct-badge {
    font-size: .85rem;
    font-weight: 900;
    color: var(--accent-green);
    background: rgba(16,185,129,.15);
    border: 1px solid rgba(16,185,129,.4);
    border-radius: 6px;
    padding: 2px 10px;
}

.progress-bar-container {
    width: 100%;
    height: 14px;
    background-color: var(--bg);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0075ff, var(--accent-green));
    box-shadow: 0 0 12px rgba(16,185,129,.5);
    transition: width .3s ease;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 800;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--radius-md);
    touch-action: manipulation;
    text-decoration: none;
    user-select: none;
    letter-spacing: .3px;
}

.btn:hover  { filter: brightness(1.1); transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); filter: brightness(.95); }

.btn-green  { background: var(--accent-green);  color: #fff; box-shadow: 0 4px 15px rgba(16,185,129,.35); }
.btn-yellow { background: var(--accent-yellow); color: #fff; box-shadow: 0 4px 15px rgba(245,158,11,.35); }
.btn-red    { background: var(--accent-red);    color: #fff; box-shadow: 0 4px 15px rgba(239,68,68,.35); }
.btn-blue   { background: #0075ff;              color: #fff; box-shadow: 0 4px 15px rgba(0,117,255,.35); }
.btn-purple { background: var(--accent-purple); color: #fff; box-shadow: 0 4px 15px rgba(168,85,247,.35); }
.btn-dark   { background: #1e293b; color: #fff; border: 1px solid var(--border); }

/* ---- Action Buttons Row ---- */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.btn-action {
    padding: 18px 8px;
    font-size: 1rem;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}

/* ---- JOG Dpad ---- */
.jog-hmi-console {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.jog-btn {
    height: 52px;
    font-size: .9rem;
}

/* ============================================================
   MECHANICAL INFO BANNER
   ============================================================ */
.mech-info-box {
    background: var(--card-inner);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mech-info-header { font-size: .78rem; font-weight: 800; color: var(--accent-yellow); text-transform: uppercase; letter-spacing: .5px; }
.mech-info-text   { font-size: .74rem; color: var(--text-low); line-height: 1.35; }
.mech-info-stat   { font-size: .74rem; font-weight: 700; color: var(--accent-green); line-height: 1.35; }

/* ============================================================
   FORM SECTIONS
   ============================================================ */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .75rem;
    font-weight: 800;
    color: var(--accent-yellow);
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 6px 10px;
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: var(--radius-sm);
}

.form-section + .form-section {
    margin-top: 4px;
}

.mobile-section-picker {
    display: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.label-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-row label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-mid);
}

.badge-current {
    font-size: .7rem;
    font-weight: 800;
    color: #34d399;
    background: rgba(16,185,129,.15);
    border: 1px solid rgba(16,185,129,.4);
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
}

.form-group input,
.form-group select {
    background: var(--card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 10px 12px;
    font-size: .9rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    width: 100%;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(56,189,248,.2);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-blue);
    font-size: .9rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.6);
    animation: toastIn .25s ease forwards;
    pointer-events: auto;
}

.toast.success { border-left-color: var(--accent-green); }
.toast.error   { border-left-color: var(--accent-red); }
.toast.warning { border-left-color: var(--accent-yellow); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   MODAL (OTA / Cloud Update)
   ============================================================ */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 10001;
}

.modal-card {
    background: var(--card-bg);
    border: 1.5px solid var(--accent-blue);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 460px;
    padding: 24px;
    display: flex; flex-direction: column; gap: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.8);
}

.modal-title { font-size: 1.1rem; font-weight: 900; color: #fff; display: flex; align-items: center; gap: 8px; }
.modal-body  { font-size: .88rem; color: var(--text-mid); line-height: 1.45; white-space: pre-line; background: var(--card-inner); padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn { flex: 1; padding: 12px; font-size: .9rem; }

/* ============================================================
   BOTTOM NAV BAR (Mobile only — hidden on desktop)
   ============================================================ */
.nav-bar { display: none; }

/* ============================================================
   ===  RESPONSIVE BREAKPOINTS  ===
   ============================================================ */

/* ---- TABLET (≤ 1024px): 2-col stays but narrower ---- */
@media (max-width: 1024px) and (min-width: 701px) {
    .tab-panel.two-col {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }
    .tab-panel.three-col {
        grid-template-columns: 1fr 1fr;
    }
    .telemetry-tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- MOBILE (≤ 700px): Single column, bottom nav ---- */
@media (max-width: 700px) {
    .app-container {
        padding: 10px 12px;
        padding-bottom: 76px;   /* space for bottom nav */
    }

    .header {
        top: 6px;
        padding: 10px 14px;
    }

    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .header-actions {
        justify-content: space-between;
    }

    .hmi-tab-bar {
        /* Hidden on mobile — replaced by bottom nav */
        display: none;
    }

    /* All panels collapse to single column */
    .tab-panel.two-col,
    .tab-panel.three-col {
        grid-template-columns: 1fr;
    }

    /* Form grid 1 column on mobile */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .desktop-only {
        display: none !important;
    }

    .header .title   { font-size: 1rem; }
    .header .subtitle { font-size: .72rem; }

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

    .action-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Bottom Navigation Bar */
    .nav-bar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 64px;
        background: rgba(7, 10, 18, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--border);
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--text-mute);
        cursor: pointer;
        border: none;
        background: none;
        font-size: .74rem;
        font-weight: 700;
        width: 50%;
        padding: 8px 0;
        transition: color .2s;
    }

    .nav-item.active { color: var(--accent-blue); }
    .nav-item svg    { width: 22px; height: 22px; fill: currentColor; }

    .toast-container {
        bottom: 76px;
        left: 50%; right: auto;
        transform: translateX(-50%);
        width: 92%;
        max-width: 92%;
    }

    .jog-hmi-console {
        max-width: 280px;
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Scan line shimmer on telemetry values when data updates */
@keyframes shimmer {
    0%   { opacity: .7; }
    50%  { opacity: 1; }
    100% { opacity: .7; }
}

.telemetry-tile-val.updating {
    animation: shimmer .4s ease-in-out;
}

/* ============================================================
   CONNECTION GATE OVERLAY (MÀN HÌNH KHÓA BLE)
   ============================================================ */
.connection-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 10, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.connection-gate.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.gate-card {
    background: #0f172a;
    border: 1px solid var(--border-light, #1e293b);
    border-radius: 24px;
    padding: 36px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: gateCardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gateCardSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gate-icon-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    background: radial-gradient(circle, rgba(56,189,248,0.2) 0%, rgba(56,189,248,0.05) 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.gate-ble-icon {
    color: #38bdf8;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
    animation: bleIconFloat 3s ease-in-out infinite alternate;
}

@keyframes bleIconFloat {
    from { transform: translateY(-2px); }
    to   { transform: translateY(2px); }
}

.gate-pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.4);
    animation: gatePulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes gatePulseRing {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.gate-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.5px;
    line-height: 1.4;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.gate-brand {
    font-size: 0.85rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 4px 14px;
    border-radius: 20px;
    display: inline-block;
}

.gate-status-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 24px;
}

.gate-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.gate-status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.gate-connect-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.4), 0 0 0 1px rgba(255,255,255,0.1) inset;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.gate-connect-btn:hover {
    background: linear-gradient(135deg, #075985 0%, #0c4a6e 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(2, 132, 199, 0.5);
}

.gate-connect-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.gate-note {
    margin-top: 20px;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

/* ============================================================
   ACTIVATION BADGE PREMIUM UX
   ============================================================ */
.activation-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.activation-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Kiểu dáng ĐÃ KÍCH HOẠT sang trọng với hiệu ứng Glow */
.activation-badge.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.12) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.activation-badge.active .activation-badge-dot {
    background: #10b981;
    box-shadow: 0 0 10px #10b981, 0 0 4px #10b981;
    animation: badgePulse 2s infinite alternate;
}

/* Kiểu dáng CHƯA KÍCH HOẠT */
.activation-badge.unactive {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(185, 28, 28, 0.1) 100%);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.activation-badge.unactive .activation-badge-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes badgePulse {
    from { opacity: 0.7; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1.15); }
}


