/* =========================================================================
 * Legacy page-scoped CSS extracted from inline <style> blocks.
 * Auto-loaded by the global layout so the visual stays identical while we
 * refactor each rule into core.css / components.css / modules/*.css.
 *
 * Generic body { ... } overrides were stripped — the new design-token
 * theme owns global colors. Page-specific selectors survive verbatim.
 * ========================================================================= */

/* --- from add.php --- */
.card { border-radius: 18px; border: none; box-shadow: 0 12px 30px rgba(0,0,0,0.07); }
        .form-control, .form-select { border-radius: 12px; padding: 12px 14px; }
        .analysis-report-preview { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.5; white-space: pre-wrap; }

/* --- from analysis_agent_models.php --- */
.page-shell { max-width:960px; margin:0 auto; padding:24px 16px 60px; }
        .panel { background:#fff; border:1px solid #e7edf5; border-radius:12px; box-shadow:0 8px 22px rgba(20,35,60,.06); }
        .panel-header { padding:14px 18px; border-bottom:1px solid #edf1f6; display:flex; align-items:center; gap:10px; }
        .panel-body { padding:20px; }
        .section-title { font-size:.78rem; font-weight:800; color:#506074; text-transform:uppercase; letter-spacing:.04em; margin:0 0 12px; }
        .form-label { font-size:.86rem; font-weight:700; color:#243047; }
        .form-control, .form-select { border-radius:8px; border-color:#dce3ec; }
        .form-control:focus, .form-select:focus { border-color:#87a9ef; box-shadow:0 0 0 .18rem rgba(13,110,253,.12); }
        .agent-table th { white-space:nowrap; font-size:.82rem; color:#475569; }
        .agent-table td { vertical-align:middle; }
        .agent-role { min-width:200px; }
        .help-note { font-size:.83rem; color:#6b778a; background:#f8fafc; border-left:3px solid #c7d6ea; padding:8px 12px; border-radius:0 6px 6px 0; }

/* --- from analysis_assistant.php --- */
.panel { background: #fff; border: 1px solid #e6edf2; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.05); }
        .panel-header { padding: 14px 18px; border-bottom: 1px solid #e6edf2; }
        .panel-body { padding: 18px; }
        .form-control, .form-select { border-radius: 10px; }
        pre { white-space: pre-wrap; word-break: break-word; }

/* --- from analysis_chat.php --- */
.panel { background: #fff; border: 1px solid #e6edf2; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.05); }
        .panel-header { padding: 14px 18px; border-bottom: 1px solid #e6edf2; }
        .panel-body { padding: 18px; }
        .message { border: 1px solid #e8eef3; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; white-space: pre-wrap; }
        .message-user { background: #eef6ff; }
        .message-assistant { background: #fbfcfd; }
        .thread-list { max-height: 680px; overflow: auto; }
        textarea { min-height: 108px; }

/* --- from analysis_fiscal_calendars.php --- */
.panel { background:#fff; border:1px solid #e6edf2; border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.05); }
        .panel-header { padding:14px 18px; border-bottom:1px solid #e6edf2; }
        .panel-body { padding:18px; }
        .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
        textarea { min-height: 92px; }

/* --- from analysis_graph.php --- */
.panel { background: #fff; border: 1px solid #e6edf2; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.05); }
        .panel-header { padding: 14px 18px; border-bottom: 1px solid #e6edf2; }
        .panel-body { padding: 18px; }
        .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* --- from analysis_performance.php --- */
.panel { background: #fff; border: 1px solid #e6edf2; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.05); }
        .panel-header { padding: 14px 18px; border-bottom: 1px solid #e6edf2; }
        .panel-body { padding: 18px; }

/* --- from analysis_provider_settings.php --- */
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 2px 8px rgba(15, 23, 42, .04); }
        .panel-header { padding: 14px 18px; border-bottom: 1px solid #e5e7eb; }
        .panel-body { padding: 18px; }
        .status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; border: 1px solid #d1d5db; background: #f9fafb; }
        .status-pill.ok { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
        .status-pill.warn { color: #92400e; border-color: #fed7aa; background: #fffbeb; }
        pre { max-height: 420px; overflow: auto; font-size: 12px; }

/* --- from analysis_quota_admin.php --- */
.tbl th { white-space: nowrap; }
.stat-box { border-radius: 8px; padding: 14px 18px; color: #fff; }

/* --- from analysis_zalo.php --- */
.panel { background: #fff; border: 1px solid #e6edf2; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.05); }
        .panel-header { padding: 14px 18px; border-bottom: 1px solid #e6edf2; }
        .panel-body { padding: 18px; }
        pre { white-space: pre-wrap; word-break: break-word; }

/* --- from api_settings.php --- */
.page-shell { max-width:1320px; }
        .topbar { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
        .topbar h2 { letter-spacing:0; }
        .panel { background:#fff; border:1px solid #e7edf5; border-radius:12px; box-shadow:0 8px 22px rgba(20,35,60,.06); }
        .panel-header { padding:14px 16px; border-bottom:1px solid #edf1f6; display:flex; align-items:center; justify-content:space-between; gap:10px; }
        .panel-body { padding:16px; }
        .section-title { font-size:.78rem; font-weight:800; color:#506074; text-transform:uppercase; letter-spacing:.04em; margin:4px 0 12px; }
        .form-label { font-size:.86rem; font-weight:700; color:#243047; margin-bottom:6px; }
        .form-control, .form-select { border-radius:8px; border-color:#dce3ec; padding:9px 11px; }
        .form-control:focus, .form-select:focus { border-color:#87a9ef; box-shadow:0 0 0 .18rem rgba(13,110,253,.12); }
        .form-text { color:#6b778a; }
        .compact-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
        .user-list { max-height:420px; overflow:auto; }
        .user-list .list-group-item { border-color:#edf1f6; padding:9px 11px; font-size:.92rem; }
        .status-box { background:#f8fafc; border:1px solid #e6edf5; border-radius:10px; padding:12px; height:100%; }
        .asset-preview { max-width:150px; max-height:110px; border-radius:10px; border:1px solid #dfe6ee; background:#101828; padding:7px; object-fit:contain; }
        .asset-preview.tall { max-height:180px; background:#fff; padding:0; }
        .sticky-actions { position:sticky; bottom:0; z-index:5; margin:18px -16px -16px; padding:12px 16px; background:rgba(255,255,255,.96); border-top:1px solid #edf1f6; backdrop-filter:blur(8px); }
        .help-note { background:#eef6ff; border:1px solid #d8eaff; border-radius:10px; color:#35506e; padding:10px 12px; font-size:.9rem; }
        .agent-policy-table th { white-space:nowrap; font-size:.82rem; color:#475569; }
        .agent-policy-table td { vertical-align:middle; }
        .agent-policy-table .agent-role { min-width:210px; }
        code { color:#334155; }
        @media (max-width: 991.98px) {
            .topbar { flex-direction:column; }
            .compact-grid { grid-template-columns:1fr; }
        }

/* --- from approve.php --- */
.main-card { max-width: 980px; margin: 40px auto; border-radius: 16px; border: none; box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
        .section-card { background: #f8fbfd; border: 1px solid #e6edf2; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
        .section-card h6 { margin-bottom: 10px; font-weight: 700; color: #143754; }
        textarea.form-control { min-height: 180px; }
        .thumbnail-choice-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); gap:10px; margin-top:10px; }
        .thumbnail-choice { position:relative; cursor:pointer; margin:0; }
        .thumbnail-choice input { position:absolute; top:8px; left:8px; z-index:2; }
        .thumbnail-choice img { width:100%; aspect-ratio:9/16; object-fit:cover; border-radius:10px; border:2px solid #d8e1ea; background:#eef3f8; }
        .thumbnail-choice input:checked + img { border-color:#0d6efd; box-shadow:0 0 0 3px rgba(13,110,253,.18); }
        .thumbnail-choice span { display:block; font-size:11px; color:#5f6b78; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .background-scene-row { display:grid; grid-template-columns:72px minmax(0,1fr); gap:12px; padding:12px 0; border-top:1px solid #e6edf2; }
        .background-scene-row:first-child { border-top:0; padding-top:0; }
        .background-preview { width:72px; aspect-ratio:9/16; object-fit:cover; border-radius:8px; border:1px solid #d8e1ea; background:#eef3f8; }
        .scene-summary { font-size:12px; color:#64748b; max-height:38px; overflow:hidden; }
        .scene-voice { font-size:12px; line-height:1.45; color:#263647; background:#fff; border:1px solid #e1e8f0; border-radius:8px; padding:8px 10px; min-height:76px; max-height:92px; overflow:auto; }
        .background-controls { display:grid; grid-template-columns:minmax(0,1fr) minmax(190px,260px); gap:8px; align-items:start; }
        .selected-background-name { display:block; font-size:12px; color:#526173; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .background-picker-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.58); z-index:1050; display:none; align-items:center; justify-content:center; padding:18px; }
        .background-picker-backdrop.is-open { display:flex; }
        .background-picker-dialog { width:min(980px, 100%); max-height:min(760px, 92vh); background:#fff; border-radius:10px; border:1px solid #d8e1ea; box-shadow:0 24px 70px rgba(15,23,42,.32); display:flex; flex-direction:column; overflow:hidden; }
        .background-picker-head { padding:12px 14px; border-bottom:1px solid #e6edf2; display:flex; align-items:center; justify-content:space-between; gap:12px; }
        .background-picker-grid { padding:14px; overflow:auto; display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:12px; }
        .background-pick-card { border:2px solid #d8e1ea; border-radius:9px; padding:6px; background:#f8fafc; cursor:pointer; text-align:left; }
        .background-pick-card.is-selected { border-color:#0d6efd; box-shadow:0 0 0 3px rgba(13,110,253,.16); background:#fff; }
        .background-pick-card img { width:100%; aspect-ratio:9/16; object-fit:cover; border-radius:6px; background:#eef3f8; display:block; }
        .background-pick-card span { display:block; font-size:11px; color:#526173; margin-top:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        @media (max-width: 768px) {
            .background-controls { grid-template-columns:1fr; }
        }

/* --- from data_deletion.php --- */
.page { max-width: 900px; margin: 40px auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 32px; }
        h1 { font-size: 28px; }
        h2 { font-size: 18px; margin-top: 28px; }
        p, li { line-height: 1.65; }

/* --- from facebook_token_tool.php --- */
.card { border-radius: 18px; border: none; box-shadow: 0 12px 30px rgba(0,0,0,0.07); }
        .form-control, .form-select { border-radius: 12px; padding: 12px 14px; }
        textarea.token-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; min-height: 88px; }
        .page-token { min-height: 120px; }

/* --- from media_library.php --- */
.main-card { border:none; border-radius:12px; box-shadow:0 8px 22px rgba(0,0,0,.07); }
        .hint { font-size:12px; color:#6b7280; }
        .compact-label { font-size:12px; margin-bottom:4px; }
        .clip-table { font-size:13px; }
        .clip-table code { display:block; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .clip-title { max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .clip-tags { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .action-cell { min-width:178px; }
        code { background:#eef2ff; padding:2px 6px; border-radius:6px; }

/* --- from media_splitter.php --- */
.main-card { border:none; border-radius:16px; box-shadow:0 12px 30px rgba(0,0,0,.08); }
        .hint { font-size:13px; color:#6b7280; }
        code { background:#eef2ff; padding:2px 6px; border-radius:6px; }

/* --- from privacy.php --- */
.page { max-width: 900px; margin: 40px auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 32px; }
        h1 { font-size: 28px; }
        h2 { font-size: 18px; margin-top: 28px; }
        p, li { line-height: 1.65; }

/* --- from render_background_library.php --- */
.page-shell { max-width:1480px; margin:0 auto; }
        .top-bar { background:#fff; border:1px solid #e4eaf2; border-radius:8px; padding:12px 14px; }
        .panel { background:#fff; border:1px solid #e4eaf2; border-radius:8px; }
        .panel-head { padding:10px 12px; border-bottom:1px solid #edf1f6; }
        .panel-body { padding:12px; }
        .thumb { width:56px; aspect-ratio:9/16; object-fit:cover; border-radius:6px; background:#eef2f7; border:1px solid #d7dee8; }
        .muted-small { font-size:12px; color:#6b7280; }
        .stat-chip { display:inline-flex; align-items:center; gap:5px; border:1px solid #dbe3ee; background:#f9fbfe; border-radius:6px; padding:4px 8px; font-size:12px; white-space:nowrap; }
        .stat-chip strong { color:#172033; }
        .stat-row { max-height:66px; overflow:auto; }
        .compact-form .form-label { margin-bottom:3px; }
        .compact-form .form-control,
        .compact-form .form-select,
        .compact-form .btn { min-height:34px; font-size:13px; }
        .asset-table { font-size:13px; margin-bottom:0; }
        .asset-table th { color:#64748b; font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:.02em; background:#f8fafc; }
        .asset-table td { padding-top:7px; padding-bottom:7px; }
        .file-path { max-width:620px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .action-row { display:flex; justify-content:flex-end; gap:6px; }
        @media (max-width: 768px) {
            .stat-row { max-height:none; }
            .file-path { max-width:240px; }
            .action-row { justify-content:flex-start; }
        }

/* --- from scripts.php --- */
.box { background: #fff; border: 1px solid #e6edf2; border-radius: 12px; padding: 16px; margin-bottom: 14px; }

/* --- from terms.php --- */
.page { max-width: 900px; margin: 40px auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 32px; }
        h1 { font-size: 28px; }
        h2 { font-size: 18px; margin-top: 28px; }
        p, li { line-height: 1.65; }

/* --- from thumbnail_library.php --- */
.main-card { border:none; border-radius:12px; box-shadow:0 8px 22px rgba(0,0,0,.07); }
        .thumb { width:86px; aspect-ratio:9/16; object-fit:cover; border-radius:8px; background:#eef2f7; border:1px solid #d7dee8; }
        .muted-small { font-size:12px; color:#6b7280; }

/* --- from user_management.php --- */
.page-shell { max-width:1200px; }
        .panel { background:#fff; border:1px solid #e7edf5; border-radius:12px; box-shadow:0 8px 22px rgba(20,35,60,.06); }
        .panel-header { padding:14px 18px; border-bottom:1px solid #edf1f6; display:flex; align-items:center; justify-content:space-between; gap:10px; }
        .panel-body { padding:18px; }
        .section-title { font-size:.78rem; font-weight:800; color:#506074; text-transform:uppercase; letter-spacing:.04em; margin:0 0 12px; }
        .form-label { font-size:.86rem; font-weight:700; color:#243047; margin-bottom:5px; }
        .form-control, .form-select { border-radius:8px; border-color:#dce3ec; padding:8px 11px; }
        .form-control:focus, .form-select:focus { border-color:#87a9ef; box-shadow:0 0 0 .18rem rgba(13,110,253,.12); }
        .user-table th { font-size:.8rem; font-weight:700; color:#506074; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
        .user-table td { vertical-align:middle; font-size:.93rem; }
        .badge-id { background:#eef2ff; color:#4361ee; font-weight:700; font-size:.8rem; padding:3px 8px; border-radius:6px; }
        .edit-row { background:#f0f5ff; }
        .compact-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px 16px; }
        @media(max-width:767px) { .compact-grid { grid-template-columns:1fr; } }

/* --- from user_settings.php --- */
.page-shell { max-width:1120px; }
        .panel { background:#fff; border:1px solid #e7edf5; border-radius:12px; box-shadow:0 8px 22px rgba(20,35,60,.06); }
        .panel-header { padding:14px 16px; border-bottom:1px solid #edf1f6; }
        .panel-body { padding:16px; }
        .section-title { font-size:.78rem; font-weight:800; color:#506074; text-transform:uppercase; letter-spacing:.04em; margin:4px 0 12px; }
        .form-label { font-size:.86rem; font-weight:700; color:#243047; margin-bottom:6px; }
        .form-control, .form-select { border-radius:8px; border-color:#dce3ec; padding:9px 11px; }
        .compact-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
        .status-box { background:#f8fafc; border:1px solid #e6edf5; border-radius:10px; padding:12px; height:100%; }
        .asset-preview { max-width:150px; max-height:110px; border-radius:10px; border:1px solid #dfe6ee; background:#101828; padding:7px; object-fit:contain; }
        .asset-preview.tall { max-height:180px; background:#fff; padding:0; }
        @media (max-width: 768px) { .compact-grid { grid-template-columns:1fr; } }

/* --- from zalo_sale_tickers.php --- */
.main-card { border-radius: 14px; border: none; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
        .ticker-code { font-family: Consolas, monospace; font-weight: 800; letter-spacing: .03em; }
        textarea.form-control { font-family: Consolas, monospace; }

