
      :root {
        /* Colors */
        --primary-50: #f0f9ff;
        --primary-100: #e0f2fe;
        --primary-500: #0ea5e9;
        --primary-600: #0284c7;
        --primary-700: #0369a1;
        --secondary-50: #f0fdf4;
        --secondary-100: #dcfce7;
        --secondary-500: #22c55e;
        --secondary-600: #16a34a;
        --secondary-700: #15803d;
        --neutral-0: #ffffff;
        --neutral-50: #fafafa;
        --neutral-100: #f5f5f5;
        --neutral-200: #e5e5e5;
        --neutral-300: #d4d4d4;
        --neutral-400: #a3a3a3;
        --neutral-500: #737373;
        --neutral-600: #525252;
        --neutral-700: #404040;
        --neutral-800: #262626;
        --neutral-900: #171717;
        --error-50: #fef2f2;
        --error-500: #ef4444;
        --error-600: #dc2626;
        --warning-50: #fffbeb;
        --warning-500: #f59e0b;
        --warning-600: #d97706;
        --success-50: #f0fdf4;
        --success-500: #22c55e;
        --success-600: #16a34a;

        /* Typography */
        --font-family:
          "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          sans-serif;
        --font-size-xs: 0.75rem;
        --font-size-sm: 0.875rem;
        --font-size-base: 1rem;
        --font-size-lg: 1.125rem;
        --font-size-xl: 1.25rem;
        --font-size-2xl: 1.5rem;

        /* Spacing */
        --space-1: 0.25rem;
        --space-2: 0.5rem;
        --space-3: 0.75rem;
        --space-4: 1rem;
        --space-5: 1.25rem;
        --space-6: 1.5rem;
        --space-8: 2rem;
        --space-10: 2.5rem;
        --space-12: 3rem;

        /* Border Radius */
        --radius-sm: 0.25rem;
        --radius-md: 0.375rem;
        --radius-lg: 0.5rem;
        --radius-xl: 0.75rem;

        /* Shadows */
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        --shadow-md:
          0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
        --shadow-lg:
          0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

        /* Transitions */
        --transition-fast: 150ms ease-in-out;
        --transition-normal: 250ms ease-in-out;

        /* ===================================================================
         * PHẦN 2: CẤU TRÚC LAYOUT MỚI (Theo yêu cầu)
         * =================================================================== */

        /* Kích thước mới */
        --header-height: 50px;
        --footer-height: 30px;
        --main-sidebar-width: 60px;
        --side-panel-width: 320px;
        --content-padding: 30px;

        /* Màu sắc mới */
        --color-bg-page: #f4f7fa;
        --color-bg-white: #ffffff;
        --color-border: #e0e0e0;
        --color-upgrade: #f59e0b;
      }

      /* Reset & Base */
      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      body {
        font-family: var(--font-family);
        background-color: var(--color-bg-page);
        color: var(--neutral-700);
        font-size: var(--font-size-sm);
        line-height: 1.5;
        overflow: hidden;
      }

      /* Cấu trúc GRID 3 HÀNG (Header, Body, Footer) */
      .app-container {
        display: grid;
        grid-template-rows: var(--header-height) 1fr var(--footer-height);
        height: 100vh;
      }

      .app-body {
        display: flex;
        overflow: hidden;
      }

      /* 1. HEADER (Thanh trên cùng) */
      .app-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 var(--content-padding);
        background-color: var(--color-bg-white);
        border-bottom: 1px solid var(--color-border);
        z-index: 10;
      }

      .header-logo {
        font-weight: 700;
        font-size: 18px;
        color: var(--primary-600);
      }

      .header-actions {
        display: flex;
        align-items: center;
        gap: 16px;
      }

      .btn-upgrade {
        background-color: var(--color-upgrade);
        color: white;
        padding: 6px 12px;
        border-radius: var(--radius-md);
        font-weight: 500;
        font-size: 13px;
        border: none;
        cursor: pointer;
      }

      .user-menu {
        position: relative;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        color: var(--primary-700);
        font-size: 1.2rem;
      }

      .user-menu i {
        font-size: 18px;
        color: #555;
      }

      /* 2. LEFT SIDEBAR */
      .main-sidebar {
        width: var(--main-sidebar-width);
        flex-shrink: 0;
        background-color: var(--color-bg-white);
        border-right: 1px solid var(--color-border);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 12px 0;
        z-index: 5;
      }

      .main-sidebar-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
      }

      .icon-button {
        width: 40px;
        height: 40px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: var(--neutral-500);
        cursor: pointer;
        transition: all 0.2s ease;
      }

      .icon-button:hover {
        background-color: var(--color-bg-page);
      }

      .icon-button.active {
        background-color: var(--primary-50);
        color: var(--primary-600);
      }

      /* 2B. SUB SIDEBAR */
      .sub-sidebar {
        width: var(--side-panel-width);
        flex-shrink: 0;
        background-color: var(--color-bg-white);
        border-right: 1px solid var(--color-border);
        height: 100%;
        overflow-y: auto;
        position: relative;
      }

      .sub-sidebar .card-body {
        padding: var(--space-4);
      }

      .sub-sidebar .card {
        margin-bottom: var(--space-4);
        box-shadow: none !important;
        border: 1px solid var(--color-border);
      }

      /* 3. MAIN CONTAINER */
      .main-container-wrapper {
        flex-grow: 1;
        display: flex;
        height: 100%;
        /* overflow: hidden; */
        overflow-x: auto;
        padding: var(--content-padding);
        background-color: var(--color-bg-page);
      }

      /* 3A. KHUNG LỚN */
      .main-content-area {
        flex-grow: 1;
        height: 100%;
        overflow-y: auto;
      }

      /* Cần style cho bảng dữ liệu bên trong */
      .main-content-area #data-table {
        width: 100%;
        border-collapse: collapse;
        background-color: var(--color-bg-white);
        border-radius: var(--radius-lg);
        overflow: hidden;
        box-shadow: var(--shadow-md);
      }

      .main-content-area #data-table th,
      .main-content-area #data-table td {
        border: 1px solid var(--color-border);
        padding: 12px;
        text-align: left;
      }

      .main-content-area #data-table thead {
        background-color: var(--neutral-50);
        color: var(--neutral-800);
      }

      .main-content-area #data-table tbody tr:hover {
        background-color: var(--neutral-50);
      }

      /* Styles cho Dashboard Layout Mới */
      .dashboard-layout {
        display: grid;
        grid-template-columns: 4fr 1fr;
        gap: 20px;
        height: 100%;
      }

      .dashboard-main-col {
        display: flex;
        flex-direction: column;
        gap: 20px;
        overflow-y: auto;
      }

      .dashboard-right-col {
        display: flex;
        flex-direction: column;
        gap: 20px;
        min-width: 0;
        /*overflow-y: auto;*/
      }

      .dashboard-greeting {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--neutral-800);
        margin-bottom: 5px;
      }

      /* Stats Cards */
      .stats-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 20px;
      }

      .stat-card {
        background: white;
        padding: 15px;
        border-radius: var(--radius-lg);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-sm);
        display: flex;
        flex-direction: column;
      }

      .stat-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary-600);
      }

      .stat-label {
        font-size: 0.8rem;
        color: var(--neutral-500);
      }

      /* Account Info Section with Image */
      .account-overview-container {
        display: flex;
        background: white;
        border-radius: var(--radius-lg);
        border: 1px solid var(--color-border);
        /* overflow: hidden; */
        margin-bottom: 20px;
      }

      .account-info-left {
        padding: 20px;
        flex: 1;
      }

      .account-image-right {
        width: 250px;
        /*background-color: var(--primary-50);*/
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
      }

      .account-image-right img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
      }

      /* 3B. KHUNG PHẢI */
      .main-docs-sidebar {
        flex-shrink: 0;
        width: var(--side-panel-width);
        height: 100%;
        overflow-y: auto;
        background-color: var(--color-bg-white);
        border-left: 1px solid var(--color-border);
        padding: 10px;
        transition:
          width 0.3s ease,
          padding 0.3s ease;
        position: relative;
      }

      .main-docs-sidebar.collapsed {
        width: 10px;
        padding: 0px;
        overflow: hidden;
        border-left: none;
      }

      .main-docs-sidebar.collapsed > *:not(.docs-toggle-button) {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.1s ease;
      }

      .docs-toggle-button {
        position: absolute;
        top: 20px;
        left: -15px;
        width: 30px;
        height: 30px;
        background-color: var(--color-bg-white);
        border: 1px solid var(--color-border);
        border-right-color: var(--primary-600);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 15;
        box-shadow: -2px 0px 5px rgba(0, 0, 0, 0.05);
        color: var(--primary-600);
      }

      .docs-toggle-button:hover {
        background-color: var(--primary-50);
      }

      iframe {
        width: 100%;
        height: 100%;
        border: none;
      }

      /* 4. FOOTER */
      .app-footer {
        height: var(--footer-height);
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--color-bg-white);
        border-top: 1px solid var(--color-border);
        font-size: 12px;
        color: var(--neutral-500);
        z-index: 10;
      }
      /* ----- CSS COMPONENTS GỐC (Giữ nguyên) ----- */
      .usage-progress-bar-bg {
        background-color: var(--neutral-200);
        border-radius: var(--radius-sm);
        overflow: hidden;
        margin-bottom: var(--space-2);
      }

      .usage-progress-bar-fg {
        width: 0%;
        height: 8px;
        background-color: var(--success-500);
        transition: width 0.5s ease;
      }

      .user-message,
      .bot-message {
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-lg);
        max-width: 95%;
        line-height: 1.5;
        word-wrap: break-word;
      }

      .user-message {
        background-color: var(--primary-500);
        color: white;
        align-self: flex-end;
        border-bottom-right-radius: var(--radius-sm);
      }

      .bot-message {
        background-color: var(--neutral-0);
        color: var(--neutral-800);
        align-self: flex-start;
        border: 1px solid var(--neutral-200);
        border-bottom-left-radius: var(--radius-sm);
        font-size: var(--font-size-sm);
      }

      .bot-message.thinking {
        font-style: italic;
        color: var(--neutral-500);
      }

      .bot-message table {
        width: 100%;
        border-collapse: collapse;
        margin: var(--space-3) 0;
        font-size: var(--font-size-xs);
      }

      .bot-message th,
      .bot-message td {
        border: 1px solid var(--neutral-300);
        padding: var(--space-2);
        text-align: left;
      }

      .bot-message th {
        background-color: var(--neutral-100);
        font-weight: 600;
      }

      .tooltip-container {
        height: 60px;
      }

      .tooltip-text {
        height: 44px;
        visibility: visible;
        background-color: #555;
        color: #fff;
        text-align: center;
        border-radius: 6px;
        padding: 5px 8px;
        font-size: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        opacity: 1;
        transition: opacity 0.3s;
      }

      .tooltip-text::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: #555 transparent transparent transparent;
      }

      .tooltip-container:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
      }

      .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-4) !important;
        border: 1px solid transparent;
        border-radius: var(--radius-md);
        font-family: var(--font-family);
        font-size: 12px !important;
        font-weight: 500;
        text-decoration: none;
        cursor: pointer;
        transition: all var(--transition-fast);
        user-select: none;
      }

      .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }

      .btn-primary {
        background-color: var(--primary-500);
        color: var(--neutral-0);
        border-color: var(--primary-500);
      }

      .btn-primary:hover:not(:disabled) {
        background-color: var(--primary-600);
        border-color: var(--primary-600);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
      }

      .btn-secondary {
        background-color: var(--secondary-500);
        color: var(--neutral-0);
        border-color: var(--secondary-500);
      }

      .btn-secondary:hover:not(:disabled) {
        background-color: var(--secondary-600);
        border-color: var(--secondary-600);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
      }

      .btn-outline {
        background-color: var(--neutral-0);
        color: var(--neutral-700);
        border-color: var(--neutral-300);
      }

      .btn-outline:hover:not(:disabled) {
        background-color: var(--neutral-50);
        border-color: var(--neutral-400);
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
      }

      .btn-ghost {
        background-color: transparent;
        color: var(--neutral-600);
        border-color: transparent;
      }

      .btn-ghost:hover:not(:disabled) {
        background-color: var(--neutral-100);
        color: var(--neutral-700);
      }

      .btn-full {
        width: 100%;
      }

      .action-group {
        display: flex;
        gap: var(--space-2);
      }

      .card {
        background-color: var(--neutral-0);
        /* Ghi đè: Bỏ radius và shadow mặc định trong sub-sidebar */
        /* overflow: hidden; */
      }

      .card-header {
        padding: var(--space-3) var(--space-4);
        background-color: var(--neutral-50);
        border-bottom: 1px solid var(--neutral-200);
        display: flex;
        align-items: center;
        justify-content: space-between;
      }

      .card-title {
        font-size: var(--font-size-base);
        font-weight: 600;
        color: var(--neutral-800);
        display: flex;
        align-items: center;
        gap: var(--space-2);
      }

      .card-body {
        padding: var(--space-4);
      }

      .card-footer {
        padding: var(--space-3) var(--space-4);
        background-color: var(--neutral-50);
        border-top: 1px solid var(--neutral-200);
      }

      .form-group {
        margin-bottom: var(--space-4);
      }

      .form-label {
        display: block;
        margin-bottom: var(--space-2);
        font-size: var(--font-size-sm);
        font-weight: 500;
        color: var(--neutral-700);
      }

      .form-input {
        width: 100%;
        padding: var(--space-2) var(--space-3);
        border: 1px solid var(--neutral-300);
        border-radius: var(--radius-md);
        font-family: var(--font-family);
        font-size: var(--font-size-sm);
        background-color: var(--neutral-0);
        transition: all var(--transition-fast);
      }

      .form-select {
        width: 100%;
        padding: var(--space-2) var(--space-3);
        border: 1px solid var(--neutral-300);
        border-radius: var(--radius-md);
        font-family: var(--font-family);
        font-size: var(--font-size-sm);
        background-color: var(--neutral-0);
        transition: all var(--transition-fast);
      }

      .form-input:focus,
      .form-select:focus {
        outline: none;
        border-color: var(--primary-500);
        box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
      }

      .form-select[multiple] {
        min-height: 120px;
        padding: var(--space-2);
      }

      .status-message {
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-md);
        border: 1px solid;
        font-size: var(--font-size-sm);
        margin-top: var(--space-3);
        display: none;
      }

      .status-message.success {
        background-color: var(--success-50);
        border-color: var(--success-500);
        color: var(--success-600);
        display: block;
      }

      .status-message.error {
        background-color: var(--error-50);
        border-color: var(--error-500);
        color: var(--error-600);
        display: block;
        margin: 15px;
      }

      .status-message.loading,
      .status-message.info {
        background-color: var(--primary-50);
        border-color: var(--primary-500);
        color: var(--primary-600);
        display: block;
      }

      .icon-circle {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--neutral-0);
        font-size: var(--font-size-base);
        flex-shrink: 0;
      }

      .icon-facebook {
        background: linear-gradient(135deg, #1877f2, #42a5f5);
      }

      .icon-google {
        background: linear-gradient(135deg, #4285f4, #34a853);
      }

      .icon-tiktok {
        background: linear-gradient(47deg, #ff0050, #6e7777, #000000);
      }

      .icon-billing {
        background: linear-gradient(135deg, #34a853, #7cb342);
      }

      .list {
        list-style: none;
      }

      .list-item {
        display: flex;
        align-items: center;
        padding: var(--space-2) var(--space-3);
        border-top: 1px solid var(--neutral-200);
        cursor: pointer;
        transition: all var(--transition-fast);
        gap: var(--space-3);
      }

      .list-item:first-child {
        border-top: none;
      }

      .list-item:hover {
        background-color: var(--neutral-100);
      }

      /* Sửa lại màu hover */
      .list-item-content {
        flex: 1;
        font-size: 12.5px;
        font-weight: 500;
        color: var(--neutral-700);
      }

      .list-item-action {
        color: var(--neutral-400);
      }

      .hidden {
        display: none !important;
      }

      .date-range-container {
        display: flex;
        gap: 5px !important;
      }

      .date-input-group {
        flex: 1;
      }

      .fields-container-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--space-2);
      }

      .check-all-btn {
        font-size: var(--font-size-xs);
        color: var(--primary-500);
        text-decoration: none;
        cursor: pointer;
      }

      .fields-container {
        border: 1px solid var(--neutral-300);
        border-radius: var(--radius-md);
        padding: var(--space-3);
        background-color: var(--neutral-0);
        min-height: 150px;
        max-height: 250px;
        overflow-y: auto;
      }

      .field-category-title {
        font-weight: 600;
        font-size: var(--font-size-sm);
        color: var(--neutral-800);
        margin-top: var(--space-3);
        margin-bottom: var(--space-2);
        padding-bottom: var(--space-1);
        border-bottom: 1px solid var(--neutral-200);
      }

      .field-category-title:first-child {
        margin-top: 0;
      }

      .field-checkbox-item {
        display: flex;
        align-items: center;
        margin-bottom: var(--space-2);
        font-size: var(--font-size-sm);
      }

      .field-checkbox-item input {
        margin-right: var(--space-2);
      }

      .field-checkbox-item label {
        margin-bottom: 0;
        font-weight: 400;
      }

      .credential-display {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: var(--neutral-100);
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-md);
        font-size: var(--font-size-sm);
        color: var(--neutral-800);
        border: 1px solid var(--neutral-300);
        margin-top: 10px;
      }

      .credential-display span {
        font-family: monospace;
      }

      .clear-cred-btn {
        cursor: pointer;
        font-weight: bold;
        color: var(--neutral-500);
        padding: 0 5px;
      }

      .token-status-line {
        font-size: var(--font-size-xs);
        color: var(--neutral-800);
        margin: 0 0 var(--space-3) 0;
        padding: var(--space-2);
        background-color: var(--success-50);
        border-radius: var(--radius-md);
        text-align: center;
      }

      .token-status-line .active {
        font-weight: bold;
        color: var(--success-700);
      }

      .text-muted {
        color: var(--neutral-500);
      }

      .font-medium {
        font-weight: 500;
      }

      .mt-2 {
        margin-top: var(--space-2);
      }

      .mb-2 {
        margin-bottom: var(--space-2);
      }

      .date-input-group .form-input {
        min-width: 0px;
        font-size: 12px !important;
        padding: 8px 5px 8px 5px !important;
      }

      .form-select[multiple] option {
        padding: 2px 0px 4px 0px !important;
        border-bottom: 1px solid var(--neutral-200);
        font-size: 13px !important;
      }

      .form-select[multiple] option:last-child {
        border-bottom: none;
      }

      .collapsible-header {
        cursor: pointer;
        user-select: none;
      }

      .collapsible-toggle {
        font-size: var(--font-size-sm);
        transition: transform var(--transition-fast);
      }

      .collapsible-content {
        max-height: 0;
        overflow: hidden;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border-top: none !important;
        transition: max-height 0.3s ease-in-out;
      }

      .collapsible-content.open {
        max-height: 2000px;
        border-top: 1px solid var(--neutral-200) !important;
      }

      .view {
        display: none;
      }

      .view.active {
        display: block;
      }

      /* Task Manager Panel (Giữ nguyên) */
      #task-manager-panel {
        position: fixed;
        margin-left: var(--main-sidebar-width);
        left: 0;
        width: var(--side-panel-width);
        /* Sửa: Cho nó nằm trên footer */
        bottom: var(--footer-height);
        background-color: var(--neutral-800);
        color: var(--neutral-0);
        padding: var(--space-2) var(--space-4);
        /* display: block !important; */
        gap: var(--space-4);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
        z-index: 100;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
      }

      #task-manager-panel:not(.hidden) {
        transform: translateY(0);
      }

      #task-info {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        font-size: var(--font-size-xs);
      }

      #task-status-text {
        font-weight: 500;
      }

      #task-timer {
        font-family: monospace;
        background-color: var(--neutral-700);
        padding: 2px 6px;
        border-radius: var(--radius-sm);
      }

      #task-controls {
        display: flex;
        gap: var(--space-2);
      }

      .task-control-btn {
        background: transparent;
        border: 1px solid var(--neutral-500);
        color: var(--neutral-200);
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0 !important;
      }

      .task-control-btn:hover {
        background-color: var(--neutral-700);
      }

      .task-progress-bar-bg {
        background-color: var(--neutral-600);
        border-radius: var(--radius-sm);
        overflow: hidden;
      }

      .task-progress-bar-fg {
        width: 0%;
        height: 8px;
        background-color: var(--primary-500);
        transition: width 0.3s ease;
      }

      #task-detail-message {
        font-size: var(--font-size-xs);
        margin: var(--space-1) 0 0 0;
        text-align: center;
        color: var(--neutral-300);
      }

      /* Schedule & History Card (Giữ nguyên) */
      .schedule-view .card-body {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
      }

      .schedule-card,
      .history-card {
        display: flex;
        align-items: flex-start;
        gap: 0px !important;
        padding: var(--space-3);
        background-color: var(--neutral-0);
        border-bottom: 1px solid var(--neutral-200);
        transition: all var(--transition-fast);
      }

      .schedule-card:hover {
        border-color: var(--primary-500);
        box-shadow: var(--shadow-sm);
      }

      .schedule-card-main {
        flex: 1;
        min-width: 0;
      }

      .schedule-card-title {
        font-weight: 600;
        color: var(--neutral-800);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .schedule-card-info {
        font-size: var(--font-size-xs);
        color: var(--neutral-500);
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-3);
        margin-top: var(--space-1);
      }

      .schedule-card-actions {
        display: flex;
        align-items: center;
        gap: var(--space-4);
      }

      .history-card-icon {
        font-size: 14px;
        color: var(--neutral-400);
        width: 14px;
        text-align: center;
        margin-top: var(--space-1);
      }

      .history-card-main {
        flex: 1;
        min-width: 0;
      }

      .history-card-title {
        font-weight: 600;
        color: var(--neutral-800);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: var(--space-1);
      }

      .history-card-info {
        font-size: var(--font-size-xs);
        color: var(--neutral-500);
        font-family: monospace;
        display: flex;
        flex-direction: column;
      }

      .history-card-status {
        margin-left: auto;
      }

      .status-badge {
        padding: var(--space-1) var(--space-2);
        border-radius: var(--radius-md);
        font-weight: 500;
        font-size: var(--font-size-xs);
        color: var(--neutral-0);
        white-space: nowrap;
      }

      .status-badge.success {
        background-color: var(--success-500);
      }

      .status-badge.error {
        background-color: var(--error-600);
      }

      /* Modal (Giữ nguyên) */
      .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition:
          opacity 0.3s ease,
          visibility 0s 0.3s;
      }

      .modal-overlay.visible {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease;
      }

      .modal-content {
        background-color: var(--neutral-0);
        padding: var(--space-6);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        width: 90%;
        max-width: 340px;
        transform: scale(0.95);
        transition: transform 0.3s ease;
      }

      .modal-overlay.visible .modal-content {
        transform: scale(1);
      }

      .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--space-4);
      }

      .modal-title {
        font-size: var(--font-size-lg);
        font-weight: 600;
      }

      .modal-close-btn {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--neutral-400);
        line-height: 1;
      }

      .modal-body .list {
        border-top: 1px solid var(--neutral-200);
      }

      /* Status Dot (Giữ nguyên) */
      .status-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
      }

      .status-dot.success {
        background-color: var(--success-500);
      }

      .status-dot.error {
        background-color: var(--error-600);
      }

      .status-dot.warning {
        background-color: var(--warning-500);
      }

      .status-dot.neutral {
        background-color: var(--neutral-400);
      }

      .history-card {
        align-items: flex-start;
      }

      .history-card.collapsible {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        border: 1px solid var(--neutral-200);
        border-radius: var(--radius-md);
        background-color: var(--neutral-0);
      }

      .history-card-header {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3);
        cursor: pointer;
      }

      .history-card-toggle {
        color: var(--neutral-400);
        margin-left: auto;
      }

      .history-card-toggle i {
        transition: transform 0.3s ease;
      }

      .history-card-toggle i.rotated {
        transform: rotate(180deg);
      }

      .history-card-details {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        padding: 0 var(--space-3);
      }

      .history-card-details.expanded {
        max-height: 150px;
        padding: var(--space-3);
        border-top: 1px solid var(--neutral-200);
      }

      .history-card-result {
        font-weight: 500;
        color: var(--neutral-800);
      }

      /* ===== BẮT ĐẦU: CSS CHO CHATBOT (Bản cập nhật) ===== */

      .chatbot-body-container {
        padding: var(--space-3);
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-y: auto;
        /* Thêm thanh cuộn khi nội dung dài */
      }

      /* ----- Giao diện cài đặt (MỚI) ----- */

      /* Kiểu chung cho các nút trên header */
      .header-btn {
        background: none;
        border: none;
        color: #666;
        cursor: pointer;
        font-size: 16px;
        padding: 5px;
        margin-left: 8px;
        /* Tạo khoảng cách giữa các nút */
      }

      .header-btn:hover {
        color: #000;
      }

      .input-with-button {
        display: flex;
        gap: var(--space-2);
        align-items: center;
      }

      .input-with-button .form-input {
        flex-grow: 1;
      }

      .input-with-button .btn {
        flex-shrink: 0;
        padding: var(--space-2) var(--space-3) !important;
      }

      #chatbot-column-checkboxes .field-checkbox-item {
        display: flex;
        align-items: center;
        margin-bottom: var(--space-2);
        font-size: var(--font-size-sm);
      }

      #chatbot-column-checkboxes .field-checkbox-item input {
        margin-right: var(--space-2);
        width: 14px;
        height: 14px;
      }

      #chatbot-column-checkboxes .field-checkbox-item label {
        margin-bottom: 0;
        font-weight: 400;
        color: var(--neutral-700);
      }

      /* ----- Giao diện chat ----- */
      #chatbot-confirmation-area {
        background-color: #f9f9f9;
        margin-top: 0px;
        text-align: center;
      }

      .confirmation-text {
        margin: 0 0 10px 0;
        font-size: 14px;
        color: #333;
        line-height: 1.5;
      }

      .confirmation-buttons {
        display: flex;
        gap: 10px;
        /* Tạo khoảng cách giữa 2 nút */
        justify-content: center;
      }

      /* Kiểu cho nút Hủy, bạn có thể tùy chỉnh */
      .confirmation-buttons .btn-secondary {
        background-color: #6c757d;
        color: white;
      }

      .confirmation-buttons .btn-secondary:hover {
        background-color: #5a6268;
      }

      #chatbot-chat-view {
        display: flex;
        flex-direction: column;
        height: 100%;
      }

      #chatbot-header button {
        background: none;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        line-height: 1;
      }

      #chatbot-messages {
        flex-grow: 1;
        padding: var(--space-3);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
      }

      #chatbot-input-container {
        display: flex;
        align-items: center;
        padding: var(--space-2);
        border-top: 1px solid var(--neutral-200);
        background-color: var(--neutral-0);
        flex-shrink: 0;
      }

      #chatbot-input {
        flex-grow: 1;
        border: 1px solid transparent;
        padding: var(--space-2);
        border-radius: var(--radius-md);
        outline: none;
        font-size: var(--font-size-sm);
        background-color: var(--neutral-100);
        transition: all var(--transition-fast);
      }

      #chatbot-input:focus {
        background-color: var(--neutral-0);
        border-color: var(--primary-500);
      }

      #chatbot-send-btn {
        background: none;
        border: none;
        color: var(--neutral-400);
        font-size: var(--font-size-base);
        cursor: pointer;
        padding: var(--space-2);
        margin-left: var(--space-2);
        transition: color var(--transition-fast);
      }

      .bot-message strong {
        color: var(--primary-700);
      }

      .bot-message ul {
        padding-left: 20px;
        margin-top: 5px;
      }

      .bot-message li {
        margin-bottom: 4px;
      }

      html,
      body {
        height: 100%;
        overflow: hidden;
      }

      #app-container {
        flex: 1;
        overflow-y: auto;
        padding: 0px !important;
        /* Thêm padding cho nội dung chính */
      }

      /* === [FIXED] MAIN HEADER STYLES === */
      .main-header {
        width: auto;
        justify-content: flex-start !important;
        background: linear-gradient(
          135deg,
          var(--primary-500),
          var(--primary-600)
        );
        color: var(--neutral-0);
        padding: var(--space-2) var(--space-4);
        display: flex;
        align-items: center;
        box-shadow: var(--shadow-md);
        position: sticky;
        top: 0;
        z-index: 20;
        flex-shrink: 0;
      }

      .header-title {
        flex: 0 0 500px !important;
        /* Không co, không giãn, kích thước 600px */
        min-width: 500px !important;
        /* Bắt buộc 600px */
        font-weight: 600;
        font-size: var(--font-size-base);
        white-space: nowrap;
        /* [FIX] Thêm các thuộc tính sau để tiêu đề tự co giãn */
        overflow: hidden;
        /* Ẩn phần chữ thừa */
        text-overflow: ellipsis;
        /* Hiển thị dấu "..." */
        display: flex;
        align-items: center;
        gap: var(--space-2);
      }

      .header-nav {
        display: flex;
        align-items: center;
        gap: var(--space-3);
      }

      /* === COMPONENT SYSTEM === */
      .footer {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
      }

      .footer img {
        width: 120px;
        height: auto;
        margin-right: 15px;
        /* Thêm khoảng trống bên phải ảnh */
      }

      .footer i {
        font-size: 12px;
        /* Kích thước icon */
        color: #000000;
        /* Màu icon */
        margin: 0 0px;
        /* Khoảng cách giữa các icon */
      }

      .foot-button {
        width: 20px;
        height: 20px;
        border: none;
        background-color: #f2f2f2;
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
        margin: 0 5px;
      }

      .foot-button:hover {
        transform: translateY(-2px);
      }

      .foot-button:active {
        transform: translateY(0);
      }

      .nav-button {
        width: 28px;
        height: 28px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--neutral-0);
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all var(--transition-fast);
      }

      .nav-button:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-1px);
      }

      #task-progress-bar {
        flex: 1;
        height: 8px;
        background-color: var(--neutral-600);
        border-radius: var(--radius-sm);
        overflow: hidden;
      }

      #task-progress-fill {
        width: 0%;
        height: 100%;
        background-color: var(--primary-500);
        transition: width 0.2s linear;
      }

      /* ===== BẮT ĐẦU: CSS CHO MENU DROPDOWN MỚI ===== */

      .dropdown-menu {
        position: absolute;
        top: 120%;
        right: 0;
        background: white;
        border: 1px solid var(--neutral-200);
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        display: none;
        /* Ẩn mặc định */
        flex-direction: column;
        min-width: 150px;
        z-index: 1000;
      }

      /* Hiển thị menu khi có class 'show' */
      .dropdown-menu.show {
        display: flex;
      }

      /* Item trong menu */
      .dropdown-item {
        padding: 10px 14px;
        text-align: left;
        background: white;
        border: none;
        outline: none;
        cursor: pointer;
        font-size: 14px;
      }

      .dropdown-item:hover {
        background-color: var(--neutral-100);
      }

      table {
        width: 100%;
        border-collapse: collapse;
        /* Gộp viền */
        margin-top: 20px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        background-color: #fff;
      }

      th,
      td {
        border: 1px solid #ddd;
        /* Viền ô */
        padding: 12px;
        text-align: left;
      }

      thead {
        background-color: #007bff;
        /* Màu nền tiêu đề */
        color: white;
        /* Màu chữ tiêu đề */
      }

      /* Thêm hiệu ứng cho hàng khi hover */
      tbody tr:hover {
        background-color: #f1f1f1;
      }

      /* ===== KẾT THÚC: CSS CHO MENU DROPDOWN MỚI ===== */
      /* 1. Sắp xếp cột */
      #explorer-table th {
        cursor: pointer;
        /* Con trỏ tay để biết là bấm được */
        position: relative;
        user-select: none;
        /* Không bôi đen text khi click nhanh */
        background-color: var(--neutral-100);
        transition: background-color 0.2s;
      }

      #explorer-table th:hover {
        background-color: var(--neutral-200);
      }

      /* Icon sắp xếp (mặc định ẩn hoặc mờ) */
      #explorer-table th::after {
        content: "\f0dc";
        /* FontAwesome sort icon (cả 2 chiều) */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        opacity: 0.3;
        margin-left: 5px;
        font-size: 10px;
        float: right;
      }

      /* Icon khi đang sort tăng dần */
      #explorer-table th.sort-asc::after {
        content: "\f0de";
        /* sort-up */
        opacity: 1;
        color: var(--primary-600);
      }

      /* Icon khi đang sort giảm dần */
      #explorer-table th.sort-desc::after {
        content: "\f0dd";
        /* sort-down */
        opacity: 1;
        color: var(--primary-600);
      }

      /* 2. Thanh công cụ Zoom */
      .table-toolbar {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        padding: 5px 10px;
        background-color: var(--neutral-50);
        border-bottom: 1px solid var(--neutral-200);
        border-radius: 4px 4px 0 0;
      }

      .zoom-control {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 12px;
      }

      .zoom-slider {
        width: 100px;
        cursor: pointer;
      }

      .sortable-header {
        cursor: pointer;
        /* Con trỏ hình bàn tay */
        user-select: none;
        /* Chống bôi đen text khi click liên tục */
        position: relative;
        /* Để căn vị trí icon tuyệt đối */
        padding-right: 25px !important;
        /* Chừa chỗ cho icon bên phải */
        transition: background-color 0.2s ease;
        color: black;
      }

      /* Hiệu ứng hover nền */
      .sortable-header:hover {
        background-color: var(--neutral-200) !important;
      }

      /* 2. Icon mặc định (2 chiều mờ mờ) */
      .sortable-header::after {
        content: "\f0dc";
        /* Mã icon fa-sort (2 chiều) */
        font-family: "Font Awesome 6 Free";
        /* FontAwesome 6 */
        font-weight: 900;
        /* Bắt buộc với bản Free */
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 11px;
        color: var(--neutral-400);
        opacity: 0.3;
        /* Mặc định mờ đi */
        transition: all 0.2s ease;
      }

      /* Khi hover thì icon hiện rõ hơn xíu */
      .sortable-header:hover::after {
        opacity: 0.6;
      }

      /* 3. Trạng thái đang Sort Tăng dần (ASC) */
      .sortable-header.sort-asc {
        background-color: var(--primary-50) !important;
        /* Nền xanh nhạt */
        color: var(--primary-700);
      }

      .sortable-header.sort-asc::after {
        content: "\f0de";
        /* Mã icon fa-sort-up */
        color: var(--primary-600);
        opacity: 1;
        /* Hiện rõ 100% */
      }

      /* 4. Trạng thái đang Sort Giảm dần (DESC) */
      .sortable-header.sort-desc {
        background-color: var(--primary-50) !important;
        color: var(--primary-700);
      }

      .sortable-header.sort-desc::after {
        content: "\f0dd";
        /* Mã icon fa-sort-down */
        color: var(--primary-600);
        opacity: 1;
      }

      /* Tabulator overrides
      .tabulator {
        font-size: 12px;
        border: none;
      }
      .tabulator-header {
        background-color: var(--neutral-50);
        color: var(--neutral-800);
        border-bottom: 1px solid var(--color-border);
      }
      .tabulator-row {
        border-bottom: 1px solid var(--neutral-100);
      } */
      /* Tabulator overrides */
      .tabulator {
        font-size: 11px;
        /* Giảm font chữ một chút cho gọn */
        border: none;
      }

      .tabulator-header {
        background-color: var(--neutral-50);
        color: var(--neutral-800);
        border-bottom: 1px solid var(--color-border);
      }

      .tabulator-header .tabulator-col {
        background-color: var(--neutral-50);
        border-right: 1px solid var(--color-border);
        /* Thêm đường kẻ dọc */
      }

      .tabulator-header .tabulator-col-content {
        padding: 2px 4px;
        /* Padding nhỏ để vừa cột 50px */
      }

      .tabulator-row {
        border-bottom: 1px solid var(--neutral-100);
        min-height: 24px;
        /* Dòng gọn hơn */
      }

      .tabulator-row .tabulator-cell {
        padding: 2px 4px;
        /* Padding nhỏ cho dữ liệu */
        border-right: 1px solid var(--neutral-100);
        height: 24px;
        line-height: 20px;
      }
/* ===== KẾT THÚC: CSS CHO MENU DROPDOWN MỚI ===== */

/* ===== CSS cho template Gallery Module ===== */
.tg-main-wrapper {
  /* Xóa padding dư — parent .main-container-wrapper đã có padding 30px */
  padding: 0;
  height: 100%;
  overflow-y: auto;
  background-color: transparent; /* kế thừa --color-bg-page */
  box-sizing: border-box;
}

/* Header + bộ lọc */
.tg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.tg-title {
  font-size: var(--font-size-xl);   /* đồng bộ scale chữ */
  font-weight: 700;
  color: var(--neutral-800);
  margin: 0;
}

/* Bộ lọc — dùng lại hình dáng .form-select / .form-input gốc */
.tg-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tg-filter-select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  background: var(--neutral-0);
  cursor: pointer;
  color: var(--neutral-700);
  transition: border-color var(--transition-fast);
}
.tg-filter-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}

.tg-search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.tg-search-box:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}
.tg-search-box input {
  border: none;
  outline: none;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  width: 180px;
  background: transparent;
  color: var(--neutral-700);
}
.tg-search-box button {
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  color: var(--neutral-400);
  transition: color var(--transition-fast);
}
.tg-search-box button:hover { color: var(--primary-600); }

.tg-sort-btn {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  cursor: pointer;
  color: var(--neutral-700);
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.tg-sort-btn:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-400);
}

/* Section label (Nổi bật / Khám phá) */
.tg-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: 14px;
  margin-top: var(--space-2);
}
.tg-section-title i { color: var(--warning-500); }

/* ---------------------------------------------------------------
 * 2. CARD GRID
 * --------------------------------------------------------------- */
.tg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* Card wrapper — dùng lại `.card` shape của hệ thống */
.tg-card {
  background: var(--neutral-0);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
  position: relative;
}
.tg-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ---- Mini preview ---- */
.tg-card-preview {
  height: 144px;
  position: relative;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}
.tg-mini-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 5px;
}
.tg-mini-stat-box {
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius-sm);
  padding: 4px 5px;
}
.tg-mini-stat-val {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 9px;
  line-height: 1.2;
}
.tg-mini-stat-lbl {
  font-size: 7px;
  color: var(--neutral-500);
  line-height: 1;
}
.tg-mini-charts-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 4px;
  height: 76px;
}
.tg-mini-bars {
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  padding: 5px 5px 3px;
  gap: 3px;
  overflow: hidden;
}
.tg-mini-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-width: 5px;
}
.tg-mini-donut-wrap {
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Badge HOT / NEW — dùng màu hệ thống */
.tg-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tg-badge-hot { background: var(--error-50);   color: var(--error-600); }
.tg-badge-new { background: var(--warning-50); color: var(--warning-600); }

/* ---- Card body ---- */
.tg-card-body { padding: 12px 14px 14px; }

.tg-card-channel {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-400);
  margin-bottom: var(--space-1);
}
.tg-card-name {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--neutral-800);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-card-desc {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-500);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-2);
  min-height: 34px;
}
.tg-card-stars {
  color: var(--warning-500);
  font-size: var(--font-size-xs);
  margin-bottom: var(--space-1);
}
.tg-card-meta {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-400);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.tg-card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.tg-price-now {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--neutral-800);
}
.tg-price-old {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-300);
  text-decoration: line-through;
}

/* Card actions — dùng lại hình dáng .btn của hệ thống */
.tg-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tg-btn-detail {
  /* kế thừa shape .btn-outline */
  padding: 7px var(--space-2) !important;
  font-family: var(--font-family);
  font-size: var(--font-size-xs) !important;
  font-weight: 500;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-700);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}
.tg-btn-detail:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-400);
}
.tg-btn-activate {
  /* kế thừa shape .btn-secondary (success green) */
  padding: 7px var(--space-2) !important;
  font-family: var(--font-family);
  font-size: var(--font-size-xs) !important;
  font-weight: 600;
  background: var(--secondary-500);
  color: var(--neutral-0);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: background var(--transition-fast);
}
.tg-btn-activate:hover { background: var(--secondary-600); }

/* Empty state */
.tg-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--neutral-400);
}
.tg-empty-state i { font-size: 2.2rem; display: block; margin-bottom: 12px; }
.tg-empty-state p {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
}

/* ---------------------------------------------------------------
 * 3. SUB-SIDEBAR (cột 2) — đồng bộ với .list-item gốc
 *    .sub-sidebar KHÔNG thêm padding, mọi khoảng cách dùng .card
 * --------------------------------------------------------------- */

/* Label nhóm nhỏ trong sidebar */
.tg-sidebar-group-label {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-400);
  padding: 14px var(--space-4) 8px;
}

/* Item dùng lại chính xác .list-item shape */
.tg-sidebar-item {
  /* Tái sử dụng toàn bộ .list-item */
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--neutral-200);
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: var(--space-3);
  font-family: var(--font-family);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--neutral-700);
  text-decoration: none;
}
.tg-sidebar-item:first-child { border-top: none; }
.tg-sidebar-item:hover { background-color: var(--neutral-100); }
.tg-sidebar-item.active {
  background-color: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}
.tg-sidebar-item i {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  color: var(--neutral-400);
}
.tg-sidebar-item.active i { color: var(--primary-600); }

/* ---------------------------------------------------------------
 * 4. DOCS SIDEBAR (cột phải) — activation form
 *    .main-docs-sidebar đã có padding: var(--content-padding)
 *    nên form KHÔNG cần thêm padding ngoài
 * --------------------------------------------------------------- */

/* Header form — khớp với .card-header */
.tg-act-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--primary-700);
  margin-bottom: var(--space-1);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--neutral-200);
}

/* Label bước (Step 1, 2...) — tương tự .card-title nhỏ */
.tg-act-section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-600);
  margin: var(--space-4) 0 var(--space-2);
}

/* Step number badge */
.tg-step-num {
  width: 18px;
  height: 18px;
  background: var(--primary-600);
  color: var(--neutral-0);
  border-radius: 50%;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Dashboard preview strip trong form — tương tự .credential-display */
.tg-act-preview-strip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}
.tg-act-preview-icon {
  width: 36px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tg-act-preview-name {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: var(--font-size-xs);
  color: var(--neutral-800);
  line-height: 1.3;
}
.tg-act-preview-meta {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-500);
}

/* Plan grid (Monthly / Yearly) */
.tg-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.tg-plan-option {
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  background: var(--neutral-0);
}
.tg-plan-option:hover {
  border-color: var(--primary-300, #7dd3fc);
  background: var(--primary-50);
}
.tg-plan-option.selected {
  border-color: var(--primary-500);
  background: var(--primary-50);
}
.tg-plan-option i {
  display: block;
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}
.tg-plan-option-title {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--font-size-xs);
  color: var(--neutral-800);
}
.tg-plan-option-price {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-500);
  margin-top: 2px;
}
.tg-plan-option.selected .tg-plan-option-price { color: var(--primary-600); }
.tg-plan-option-discount {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--secondary-600);
  font-weight: 600;
}

/* Payment method grid */
.tg-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.tg-pay-option {
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-1);
  cursor: pointer;
  text-align: center;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-700);
  transition: all var(--transition-fast);
  background: var(--neutral-0);
}
.tg-pay-option:hover {
  border-color: var(--primary-300, #7dd3fc);
  background: var(--primary-50);
}
.tg-pay-option.selected {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}
.tg-pay-option i {
  display: block;
  font-size: var(--font-size-lg);
  margin-bottom: 3px;
}

/* Price summary — tương tự token-status-line nhưng dành cho giá */
.tg-price-summary {
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-3);
  margin: var(--space-3) 0;
}
.tg-price-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-600);
  margin-bottom: var(--space-1);
}
.tg-price-row:last-child { margin-bottom: 0; }
.tg-price-row.discount { color: var(--secondary-600); }
.tg-price-row.total {
  font-weight: 700;
  color: var(--neutral-800);
  font-size: var(--font-size-sm);
  border-top: 1px solid var(--neutral-200);
  padding-top: var(--space-2);
  margin-top: var(--space-2);
}
.tg-price-row.total .tg-price-highlight { color: var(--primary-600); }

/* Submit button — dùng lại .btn .btn-primary .btn-full */
.tg-submit-btn {
  /* Không override gì, chỉ gán class .btn .btn-primary .btn-full ở HTML */
  margin-top: var(--space-4);
  font-weight: 700 !important;
  font-size: var(--font-size-sm) !important;
  padding: var(--space-3) var(--space-4) !important;
}

/* Terms text */
.tg-terms-text {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  color: var(--neutral-400);
  text-align: center;
  margin-top: var(--space-2);
  line-height: 1.5;
}
.tg-terms-text a { color: var(--primary-600); text-decoration: none; }
.tg-terms-text a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------
 * 5. RESPONSIVE
 * --------------------------------------------------------------- */
@media (max-width: 960px) {
  .tg-grid { grid-template-columns: repeat(2, 1fr); }
  .tg-filters { gap: var(--space-1); }
  .tg-search-box input { width: 120px; }
}
@media (max-width: 600px) {
  .tg-grid { grid-template-columns: 1fr; }
  .tg-header { flex-direction: column; align-items: flex-start; }
}