/* Legion Page Master Pro - Faithful Desktop Shell & WinForms/Bunifu Controls Theme */
:root {
    --lpm-orange-tl: #FE522A;
    --lpm-orange-tr: #FD6C2D;
    --lpm-orange-bl: #FEA429;
    --lpm-orange-active: #E15E11;
    --lpm-canvas: #f8fafc;
    --lpm-grid-header: #1E90FF;
    --lpm-grid-alt: #F8FBFF;
    --lpm-grid-select: #B3DFFF;
    --lpm-grid-border: #DDEEFF;
    --lpm-start-green: #71BE42;
    --lpm-acc-green: #00C000;
    --lpm-schedule-orange: #FF8000;
    --lpm-font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--lpm-font);
    font-size: 13px;
    color: #0f172a;
    background: #1e293b;
    overflow: hidden;
    user-select: none;
}

/* Desktop Studio Backdrop + Faithful 1475x861 Window Frame (fluid on viewports) */
.desktop-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: radial-gradient(circle at 20% 20%, #334155 0%, #0f172a 100%);
}

.desktop-stage.is-maximized {
    padding: 0;
}

.app-window {
    width: min(1475px, 100%);
    height: min(895px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--lpm-canvas);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.52);
    overflow: hidden;
    position: relative;
}

.desktop-stage.is-maximized .app-window {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
}

/* Windows Titlebar (34px) */
.win-titlebar {
    height: 34px;
    min-height: 34px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 0 10px;
    gap: 10px;
    z-index: 30;
}

.win-titlebar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.win-titlebar-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.win-titlebar-text {
    font-size: 12.5px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.win-demo-badge {
    background: rgba(254, 82, 42, 0.1);
    color: #c2410c;
    border: 1px solid rgba(254, 82, 42, 0.28);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.win-titlebar-right {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 6px;
}

.demo-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
}

.btn-tour-launch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 10px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #FE522A, #F97316);
    color: #ffffff;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(254, 82, 42, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn-tour-launch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(254, 82, 42, 0.45);
}

.btn-reset-demo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.btn-reset-demo:hover {
    background: #e2e8f0;
}

.win-caption-btns {
    display: flex;
    height: 100%;
}

.win-cap-btn {
    width: 42px;
    height: 100%;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}

.win-cap-btn:hover {
    background: #e2e8f0;
}

.win-cap-btn.close:hover {
    background: #e81123;
    color: #ffffff;
}

/* Main App Body (Sidebar 236px <-> 56px + panelMain) */
.frm-main-body {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

.panel-menu {
    width: 236px;
    min-width: 236px;
    background: linear-gradient(155deg, #FE522A 0%, #FD6C2D 45%, #FEA429 88%, #FE522A 100%);
    display: flex;
    flex-direction: column;
    padding: 12px 10px 10px 10px;
    transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1), min-width 220ms cubic-bezier(0.22, 1, 0.36, 1), padding 220ms ease;
    position: relative;
    z-index: 15;
    flex-shrink: 0;
}

.panel-menu.collapsed {
    width: 56px;
    min-width: 56px;
    padding: 12px 6px 10px 6px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.sidebar-logo {
    height: 42px;
    max-width: 168px;
    object-fit: contain;
    transition: opacity 0.15s ease, width 0.2s ease;
}

.panel-menu.collapsed .sidebar-logo {
    opacity: 0;
    width: 0;
    pointer-events: none;
    overflow: hidden;
}

.btn-hamburger {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-hamburger:hover {
    background: rgba(255, 255, 255, 0.18);
}

.panel-menu.collapsed .btn-hamburger {
    margin: 0 auto;
}

.btn-hamburger img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 1px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 4px;
}

.nav-item-btn {
    height: 42px;
    min-height: 42px;
    width: 100%;
    border: none;
    background: transparent;
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
    white-space: nowrap;
}

.nav-item-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.nav-item-btn img.nav-icon {
    width: 21px;
    height: 21px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.nav-item-btn .nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item-btn.active {
    background: #ffffff;
    color: var(--lpm-orange-active);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(180, 50, 10, 0.24);
}

.nav-item-btn.active img.nav-icon {
    /* Tint active icon to match #E15E11 */
    filter: invert(39%) sepia(93%) saturate(1975%) hue-rotate(4deg) brightness(93%) contrast(94%);
}

.nav-item-btn.active::after {
    content: "";
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background: var(--lpm-orange-active);
    flex-shrink: 0;
}

.panel-menu.collapsed .nav-item-btn {
    padding: 0;
    justify-content: center;
}

.panel-menu.collapsed .nav-item-btn .nav-label,
.panel-menu.collapsed .nav-item-btn.active::after {
    display: none;
}

.sidebar-footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.32);
    margin: 8px 2px 10px 2px;
}

.sidebar-footer {
    display: flex;
    gap: 8px;
}

.panel-menu.collapsed .sidebar-footer {
    flex-direction: column;
    gap: 6px;
}

.footer-btn {
    flex: 1;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.26);
}

.footer-btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.panel-menu.collapsed .footer-btn span {
    display: none;
}

/* Main Child Content Viewport */
.panel-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: var(--lpm-canvas);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.view-container {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    background: var(--lpm-canvas);
    overflow: hidden;
}

.view-container.active {
    display: flex;
}

.webui-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* Loading Overlay (matching frmMain LoadingOverlay) */
.lpm-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(2px);
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: opacity 0.22s ease;
}

.lpm-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.lpm-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #fed7aa;
    border-top-color: #FE522A;
    border-radius: 50%;
    animation: lpm-spin 0.8s linear infinite;
}

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

/* ===================================================
   Authentic WinForms & Bunifu UI Components
=================================================== */
.wf-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
    background: #ffffff;
}

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

.wf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: filter 0.14s ease, transform 0.1s ease;
    white-space: nowrap;
}

.wf-btn:hover {
    filter: brightness(1.06);
}
.wf-btn:active {
    transform: translateY(1px);
}

.wf-btn-blue { background: #1E90FF; }
.wf-btn-green { background: #00C000; }
.wf-btn-start { background: #71BE42; min-width: 110px; height: 38px; font-size: 13.5px; }
.wf-btn-stop { background: #ef4444; min-width: 110px; height: 38px; font-size: 13.5px; }
.wf-btn-orange { background: #FF8000; height: 36px; }
.wf-btn-gray { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.wf-btn-red { background: #ef4444; }
.wf-btn-outline { background: #ffffff; color: #334155; border: 1px solid #cbd5e1; }

.wf-btn img {
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.wf-btn.btn-white-icon img {
    filter: brightness(0) invert(1);
}

.wf-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.wf-icon-btn:hover {
    background: #f1f5f9;
}

.wf-icon-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.wf-groupbox {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 12px 10px 12px;
    position: relative;
    background: #ffffff;
}

.wf-groupbox-title {
    position: absolute;
    top: -9px;
    left: 12px;
    background: #ffffff;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}

.wf-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.wf-input, .wf-select, .wf-textarea {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 5px 8px;
    font-family: inherit;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
}

.wf-input:focus, .wf-select:focus, .wf-textarea:focus {
    border-color: #1E90FF;
    box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.14);
}

.wf-input-sm {
    height: 29px;
}

.wf-select {
    height: 29px;
}

/* Status bar indicator inside forms (Không Hoạt Động / Đang Hoạt Động) */
.wf-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
}

.wf-status-indicator img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.wf-status-idle { color: #ef4444; }
.wf-status-running { color: #16a34a; }

/* Stats Pills in ManageAccount */
.acc-stats-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
}

.acc-stat-live { color: #16a34a; }
.acc-stat-die { color: #ef4444; }
.acc-stat-total { color: #1e293b; }

/* BunifuDataGridView Exact Look */
.wf-split-area {
    flex: 1;
    display: flex;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.wf-grid-wrap {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: auto;
    background: #ffffff;
    position: relative;
    min-width: 0;
}

.wf-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    user-select: text;
}

.wf-grid thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #1E90FF;
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: 7px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
    white-space: nowrap;
    font-size: 12px;
}

.wf-grid thead th.center, .wf-grid tbody td.center {
    text-align: center;
}

.wf-grid tbody tr {
    background: #ffffff;
    border-bottom: 1px solid #DDEEFF;
    transition: background 0.1s ease;
    cursor: default;
}

.wf-grid tbody tr:nth-child(even) {
    background: #F8FBFF;
}

.wf-grid tbody tr:hover {
    background: #ebf5ff;
}

.wf-grid tbody tr.selected {
    background: #B3DFFF !important;
}

.wf-grid tbody td {
    padding: 5px 8px;
    border-right: 1px solid #eef4fb;
    white-space: nowrap;
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Status cell exact color mappings from C# forms */
.cell-status-box {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11.5px;
    min-width: 92px;
    text-align: center;
}

.st-0 { background: #FFFF00; color: #111827; border: 1px solid #eab308; } /* Chưa Render */
.st-1 { background: #FFFFFF; color: #1e293b; border: 1px solid #cbd5e1; } /* Chờ Đăng / Chờ Comment / Chờ Render */
.st-2 { background: #1E90FF; color: #FFFFFF; } /* Đang Đăng / Đang Comment / Đang Render */
.st-3 { background: #90EE90; color: #111827; } /* Hoàn Tất */
.st-rendered { background: #16a34a; color: #ffffff; } /* Đã Render */
.st-err { background: #FFCDD2; color: #991b1b; } /* Lỗi / Page Error / File Video Error / Chrome Error */
.st-render-ok { background: #00BE00; color: #FFFFFF; }
.st-render-err { background: #EF4444; color: #FFFFFF; }

.acc-live { color: #16a34a; font-weight: 700; }
.acc-die { color: #ef4444; font-weight: 700; }
.acc-cp { color: #d97706; font-weight: 700; }

.grid-action-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}
.grid-action-btn.edit:hover { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }
.grid-action-btn.del:hover { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }

/* Right Mini Browser Preview Panel (flpBrowserView / SplitContainer Panel2) */
.wf-browser-side {
    width: 340px;
    min-width: 300px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.wf-browser-side.hidden {
    display: none;
}

.wf-browser-side-header {
    background: #1e293b;
    color: #e2e8f0;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #334155;
}

.wf-browser-grid {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
}

.mini-chrome-card {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #334155;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-chrome-top {
    background: #dee1e6;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #334155;
    font-weight: 600;
}

.mini-chrome-url {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 99px;
    padding: 1px 8px;
    font-size: 10.5px;
    color: #475569;
    margin: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-chrome-viewport {
    padding: 8px 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11.5px;
}

.mini-chrome-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1E90FF;
    flex-shrink: 0;
}

.mini-chrome-step {
    font-size: 11px;
    color: #1d4ed8;
    font-weight: 600;
    margin-top: 2px;
}

.mini-chrome-idle {
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
    padding: 28px 14px;
    line-height: 1.5;
}

/* Split Bottom Subgrid in ManageAccount (Fanpages of Account) */
.wf-vertical-split {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.acc-lower-panel {
    height: 225px;
    min-height: 165px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

.acc-lower-header {
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Multi-select Category Dropdown (ucAccountCategoryDropdown) */
.cat-dropdown-wrap {
    position: relative;
}

.cat-dropdown-btn {
    height: 34px;
    min-width: 195px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
}

.cat-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    padding: 6px;
    z-index: 60;
    display: none;
}

.cat-dropdown-menu.open {
    display: block;
}

.cat-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12.5px;
}

.cat-dropdown-item:hover {
    background: #f1f5f9;
}

/* CreatePage Two-Column Layout (Faithful frmCreatePage: 365px left config / right ucAccountBrowserPanel) */
.cp-layout {
    flex: 1;
    display: flex;
    gap: 10px;
    min-height: 0;
}

.cp-left-config {
    width: 365px;
    min-width: 348px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cp-main-group {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-color: #f97316;
    padding: 13px 9px 7px 9px;
}

.cp-main-group > .wf-groupbox-title {
    color: #f97316;
    font-weight: 600;
}

.cp-left-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cp-sub-box {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 7px 8px;
    background: #ffffff;
    transition: opacity 0.15s ease;
}

.cp-sub-box.is-disabled {
    opacity: 0.55;
    background: #f8fafc;
}

.cp-top-num-row {
    display: grid;
    grid-template-columns: 1fr 78px 34px;
    align-items: center;
    gap: 6px;
}

.cp-lbl-blue {
    font-size: 12px;
    color: #1478dc;
    font-weight: 500;
}

.cp-lbl-title {
    font-size: 12px;
    color: #1e90ff;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
}

.cp-input-orange {
    border-color: #f97316 !important;
}

.cp-input-orange:focus {
    border-color: #ea580c !important;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.16) !important;
}

.cp-input-blue {
    border-color: #1e90ff !important;
}

.cp-switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 1px;
}

.cp-info-row {
    display: grid;
    grid-template-columns: 102px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.cp-info-row:last-child {
    margin-bottom: 0;
}

.cp-chk-lbl {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #1478dc;
    cursor: pointer;
    white-space: nowrap;
}

.cp-chk-lbl.is-disabled-lbl {
    opacity: 0.5;
    cursor: not-allowed;
}

.cp-av-grid {
    display: grid;
    grid-template-columns: 106px 70px 1fr;
    align-items: center;
    gap: 5px 6px;
}

.cp-btn-pill {
    height: 24px;
    padding: 0 10px;
    border-radius: 99px;
    background: #1e90ff;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid #1e90ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.14s ease, opacity 0.14s ease;
}

.cp-btn-pill:hover:not(:disabled) {
    filter: brightness(1.08);
}

.cp-btn-pill:disabled {
    background: #cbd5e1;
    border-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

.cp-note-footer {
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px dashed #e2e8f0;
    font-size: 11.5px;
    color: #cc0028;
    line-height: 1.28;
    flex-shrink: 0;
}

.cp-right-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    min-height: 0;
}

.cp-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.cp-toolbar .cat-dropdown-btn {
    height: 30px;
    min-width: 190px;
}

.cp-toolbar #btnCpStart {
    min-width: 100px;
}

.cp-status-pill {
    min-width: 112px;
}

.cp-right-stats {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.cp-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.cp-form-row label.lbl {
    width: 118px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #1478dc;
}

/* Toggle Switch inside WinForms modals */
.wf-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 19px;
    flex-shrink: 0;
}

.wf-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wf-switch-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 99px;
    cursor: pointer;
    transition: 0.2s;
}

.wf-switch-slider::before {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.2s;
}

.wf-switch input:checked + .wf-switch-slider {
    background: #1E90FF;
}

.wf-switch input:checked + .wf-switch-slider::before {
    transform: translateX(17px);
}

/* Context Menu (right-click grid rows) */
.lpm-context-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
    padding: 5px;
    min-width: 195px;
    z-index: 2500;
    display: none;
}

.lpm-context-menu.open {
    display: block;
}

.lpm-ctx-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: none;
    background: transparent;
    padding: 7px 10px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 12.5px;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
}

.lpm-ctx-item:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.lpm-ctx-item.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.lpm-ctx-item img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.lpm-ctx-sep {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* Modal Backdrop & WinForms Dialog */
.lpm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 16px;
}

.lpm-modal-backdrop.open {
    display: flex;
}

.lpm-modal-window {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    border: 1px solid #cbd5e1;
    max-width: 96vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.16s ease-out;
}

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

.lpm-modal-header {
    padding: 11px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lpm-modal-header.orange {
    background: linear-gradient(135deg, #FE522A, #F97316);
    color: #ffffff;
    border-bottom: none;
}

.lpm-modal-header.dark {
    background: #0f172a;
    color: #f8fafc;
    border-bottom: 1px solid #1e293b;
}

.lpm-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.16);
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.lpm-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
}

.lpm-modal-body {
    flex: 1;
    overflow: auto;
    padding: 14px 16px;
}

.lpm-modal-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Render Video Single Dark/Modern Card Layout */
.rv-single-grid {
    display: grid;
    grid-template-columns: 1fr 315px;
    gap: 14px;
    background: #f1f5f9;
    padding: 14px;
}

.rv-cards-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rv-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 12px 14px;
}

.rv-card-hdr {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid #f1f5f9;
}

.rv-card-hdr strong { font-size: 13.5px; color: #0f172a; }
.rv-card-hdr span { font-size: 11.5px; color: #64748b; }

.rv-preview-col {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rv-canvas-box {
    width: 240px;
    height: 426px;
    background: #020617;
    border-radius: 12px;
    border: 2px solid #334155;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Telegram Chat Preview Box in frmTestTelegram */
.tg-split {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 14px;
}

.tg-chat-preview {
    background: linear-gradient(165deg, #0e1621 0%, #17212b 100%);
    color: #f5f5f5;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 360px;
}

.tg-bubble {
    background: #182533;
    border: 1px solid #243447;
    border-radius: 10px 10px 10px 2px;
    padding: 11px 13px;
    font-size: 12.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.tg-bubble a { color: #6ab2f2; }
.tg-bubble code {
    background: rgba(106, 178, 242, 0.14);
    padding: 1px 4px;
    border-radius: 4px;
    font-family: monospace;
    color: #93c5fd;
}

/* Global Toast Stack */
.lpm-toast-container {
    position: fixed;
    bottom: 22px;
    right: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 3000;
    pointer-events: none;
}

.lpm-toast {
    background: #1e293b;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    border-left: 4px solid #FE522A;
    animation: toastIn 0.2s ease-out;
}

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

/* ===================================================
   Guided Feature Tour Overlay (Tour Tính Năng Chính)
=================================================== */
.tour-spotlight-ring {
    position: fixed;
    border-radius: 10px;
    border: 3px solid #FE522A;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.56), 0 0 24px rgba(254, 82, 42, 0.65);
    z-index: 2100;
    pointer-events: none;
    transition: all 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    display: none;
}

.tour-spotlight-ring.active {
    display: block;
}

.tour-popover {
    position: fixed;
    width: 390px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #fed7aa;
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.42);
    z-index: 2200;
    overflow: hidden;
    display: none;
    animation: modalPop 0.2s ease-out;
}

.tour-popover.active {
    display: block;
}

.tour-pop-hdr {
    background: linear-gradient(135deg, #FE522A, #F97316);
    color: #ffffff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-pop-body {
    padding: 13px 15px;
    font-size: 13px;
    line-height: 1.55;
    color: #334155;
}

.tour-pop-footer {
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tab-btn-strip {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 12px;
    gap: 4px;
}

.tab-btn-strip button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn-strip button.active {
    color: #FE522A;
    border-bottom-color: #FE522A;
}

.helper-scroll-table {
    max-height: 280px;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.helper-scroll-table.tall {
    max-height: 410px;
}

/* ===================================================
   Faithful Bottom Filter + Config Dock (Story/Reels/Post/RealTime/Render)
=================================================== */
.wf-bottom-dock {
    display: grid;
    grid-template-columns: 516fr 673fr;
    gap: 8px;
    flex-shrink: 0;
    align-items: stretch;
}

.wf-bottom-dock.render-dock {
    grid-template-columns: 310fr 760fr;
}

.wf-filter-box,
.wf-config-box {
    padding: 12px 9px 7px 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.wf-filter-inner {
    display: flex;
    align-items: stretch;
    gap: 5px;
}

.wf-filter-fields {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(72px, 1fr) auto minmax(72px, 1fr);
    gap: 4px 5px;
    align-items: center;
}

.wf-filter-fields .wf-field-label {
    font-size: 11.5px;
}

.wf-filter-fields .wf-select,
.wf-filter-fields .wf-input {
    font-size: 11.5px;
    min-width: 0;
}

.wf-filter-icons {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    flex-shrink: 0;
}

.wf-icon-btn-sm {
    width: 26px;
    height: 26px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.wf-icon-btn-sm:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.wf-icon-btn-sm img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.wf-config-inner {
    display: flex;
    align-items: stretch;
    gap: 7px;
}

.wf-config-col-btns {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 154px;
    flex-shrink: 0;
}

.wf-config-col-btns .wf-btn {
    width: 100%;
    height: 38px;
    font-size: 12px;
    padding: 0 7px;
}

.wf-config-divider {
    width: 2px;
    background: #e2e8f0;
    margin: 2px 0;
    flex-shrink: 0;
}

.wf-config-col-fields {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.wf-cfg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
}

.wf-cfg-row .wf-field-label {
    font-size: 11.5px;
    flex: 1;
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
}

.wf-cfg-row.delay-pair .wf-field-label {
    flex: 0 1 auto;
    white-space: nowrap;
}

.wf-cfg-num {
    width: 60px;
    flex-shrink: 0;
}

.wf-cfg-num-sm {
    width: 50px;
    flex-shrink: 0;
}

.wf-cfg-row .wf-input-sm {
    height: 25px;
    padding: 2px 4px;
    text-align: center;
}

.wf-config-col-run {
    width: 138px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
}

.rv-col-actions { width: 184px; }
.rv-col-run { width: 174px; }
.rv-col-status {
    flex: 1;
    width: auto;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.wf-status-top {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    padding: 0 2px;
}

.wf-status-top img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.wf-status-top span {
    font-size: 12px;
    line-height: 1.15;
}

.wf-config-col-run .wf-btn-start,
.wf-config-col-run .wf-btn-stop {
    width: 100%;
    height: 38px;
}

/* Single & Bulk Schedule Modal Two-Column Layout (Left=Form+ActionBtn, Right=Fanpage Picker) */
.sched-modal-grid {
    display: grid;
    grid-template-columns: 453fr 439fr;
    gap: 12px;
    align-items: stretch;
}

.sched-left-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sched-right-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sched-fanpage-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
}

.wf-btn-save-full {
    margin-top: auto;
    width: 100%;
    height: 44px;
    background: #00C000;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 6px;
}

.wf-btn-save-full:hover {
    background: #00a800;
}

.bulk-modal-grid {
    display: grid;
    grid-template-columns: 380fr 440fr;
    gap: 14px;
    align-items: stretch;
}

.bulk-left-col {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-top: 2px;
}

.bulk-right-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wf-btn-bulk-add {
    width: 100%;
    height: 38px;
    background: #27AE60;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

@media (max-width: 1200px) {
    .wf-bottom-dock {
        grid-template-columns: 42fr 58fr;
        gap: 6px;
    }
    .wf-bottom-dock.render-dock {
        grid-template-columns: 32fr 68fr;
    }
    .wf-filter-box, .wf-config-box {
        padding: 10px 6px 6px 6px;
    }
    .wf-config-inner {
        gap: 5px;
    }
    .wf-config-divider {
        width: 1px;
    }
    .wf-config-col-btns {
        width: 134px;
    }
    .wf-config-col-btns .wf-btn {
        font-size: 10.8px;
        height: 34px;
        padding: 0 4px;
        gap: 4px;
    }
    .wf-config-col-btns .wf-btn img {
        width: 14px;
        height: 14px;
    }
    .wf-config-col-run {
        width: 94px;
    }
    .wf-status-top {
        gap: 4px;
        min-height: 30px;
    }
    .wf-status-top img {
        width: 22px;
        height: 22px;
    }
    .wf-status-top span {
        font-size: 10.5px;
    }
    .wf-config-col-run .wf-btn-start,
    .wf-config-col-run .wf-btn-stop {
        min-width: 0;
        height: 34px;
        font-size: 12px;
    }
    .wf-cfg-row {
        gap: 3px;
    }
    .wf-filter-fields .wf-field-label,
    .wf-cfg-row .wf-field-label {
        font-size: 10.5px;
    }
    .wf-cfg-num {
        width: 44px;
        height: 23px;
        font-size: 11.5px;
    }
    .wf-cfg-num-sm {
        width: 34px;
        height: 23px;
        font-size: 11.5px;
    }
    .rv-col-actions,
    .rv-col-run {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }
    .rv-col-status {
        width: 118px;
        flex: 0 0 118px;
    }
    .cp-left-config {
        width: 342px;
        min-width: 332px;
    }
    .cp-av-grid {
        grid-template-columns: 98px 58px 1fr;
        gap: 4px 5px;
    }
    .cp-chk-lbl {
        font-size: 11px;
    }
    .cp-toolbar {
        flex-wrap: nowrap;
        gap: 3px;
    }
    .cp-toolbar .cat-dropdown-btn {
        min-width: 84px;
        max-width: 96px;
        height: 28px;
        padding: 0 5px;
        font-size: 11px;
        overflow: hidden;
    }
    .cp-toolbar .cat-dropdown-btn span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .cp-toolbar .wf-btn {
        height: 28px;
        padding: 0 6px;
        font-size: 11px;
    }
    .cp-toolbar #btnCpStart {
        min-width: 50px;
    }
    .cp-toolbar .wf-icon-btn {
        width: 26px !important;
        height: 26px !important;
    }
    .cp-right-stats {
        font-size: 10.5px;
        gap: 3px;
    }
    .cp-grid thead th,
    .cp-grid tbody td {
        padding: 5px 5px;
        font-size: 11.5px;
    }
    .cp-grid tbody td:nth-child(3) {
        max-width: 104px;
    }
    .cp-grid tbody td:nth-child(4) {
        max-width: 84px;
        font-size: 10.8px;
    }
    .cp-status-pill {
        min-width: 72px;
        padding: 2px 5px;
        font-size: 10.8px;
    }
}

@media (max-width: 780px) {
    .wf-bottom-dock,
    .wf-bottom-dock.render-dock {
        grid-template-columns: 1fr;
    }
    .sched-modal-grid,
    .bulk-modal-grid {
        grid-template-columns: 1fr;
    }
    .cp-layout {
        flex-direction: column;
    }
    .cp-left-config {
        width: 100%;
        min-width: 0;
        max-height: 360px;
    }
}
