/* VietSCI - giao diện cổng: đăng nhập, đăng ký, đặt hàng, khách hàng, nhân viên, affiliate */
:root {
	--ae-brand: #1800ad;
	--ae-brand-700: #13008c;
	--ae-brand-900: #0c0561;
	--ae-brand-50: #f1efff;
	--ae-brand-100: #e3dfff;
	--ae-accent: #ff6600;
	--ae-accent-d: #e85a00;
	--ae-accent-50: #fff3ea;
	--ae-ink: #16133d;
	--ae-text: #2b2a3d;
	--ae-muted: #6b6a80;
	--ae-line: #e6e5f0;
	--ae-input: #d3d1e3;
	--ae-bg: #f7f7fc;
	--ae-card: #fff;
	--ae-green: #14804a;
	--ae-blue: #2563eb;
	--ae-red: #c02626;
	--ae-radius: 14px;
	--ae-shadow: 0 1px 3px rgba(22,19,61,.06), 0 8px 24px rgba(22,19,61,.06);
}

.ae-portal, .ae-auth-wrap, .ae-order-form, .ae-aff-landing, .ae-quick-calc { color: var(--ae-text); font-size: 15px; line-height: 1.6; }
.ae-portal *, .ae-auth-wrap *, .ae-order-form *, .ae-quick-calc * { box-sizing: border-box; }
.ae-portal h1, .ae-portal h2, .ae-portal h3, .ae-auth-wrap h1, .ae-order-form h3 { color: var(--ae-ink); letter-spacing: -.01em; }

/* ---------- Nút ---------- */
.ae-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid var(--ae-line); background: #fff; color: var(--ae-ink); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; line-height: 1.2; font-family: inherit; white-space: nowrap; }
.ae-btn:hover { border-color: var(--ae-brand); color: var(--ae-brand); }
.ae-btn:active { transform: translateY(1px); }
.ae-btn:focus-visible { outline: 3px solid rgba(255,102,0,.5); outline-offset: 2px; }
.ae-btn--primary { background: var(--ae-accent); border-color: var(--ae-accent); color: #fff; }
.ae-btn--primary:hover { background: var(--ae-accent-d); border-color: var(--ae-accent-d); color: #fff; box-shadow: 0 8px 18px rgba(255,102,0,.25); }
.ae-btn--primary[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.ae-btn--ghost { background: #fff; }
.ae-btn--block { width: 100%; }
.ae-btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* ---------- Form ---------- */
.ae-form p { margin: 0 0 16px; }
.ae-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ae-ink); }
.ae-form input:not([type]), .ae-form input[type=text], .ae-form input[type=email], .ae-form input[type=password], .ae-form input[type=tel], .ae-form input[type=number], .ae-form input[type=url], .ae-form input[type=date], .ae-form select, .ae-form textarea,
.ae-quick-calc input, .ae-quick-calc select, .ae-copy-field input, .ae-link-gen input, .ae-link-gen select {
	width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--ae-input); border-radius: 10px; font: inherit; font-size: 15px; background: #fff; color: var(--ae-text); transition: border-color .15s, box-shadow .15s;
}
.ae-form textarea { min-height: 96px; resize: vertical; }
.ae-form input[type=file] { width: 100%; padding: 12px; border: 1.5px dashed var(--ae-input); border-radius: 10px; background: var(--ae-bg); font: inherit; font-size: 14px; cursor: pointer; }
.ae-form input[type=file]::file-selector-button { margin-right: 12px; border: 0; background: var(--ae-brand); color: #fff; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.ae-form input:focus, .ae-form select:focus, .ae-form textarea:focus, .ae-quick-calc input:focus, .ae-quick-calc select:focus { outline: none; border-color: var(--ae-brand); box-shadow: 0 0 0 3px rgba(24,0,173,.14); }
.ae-form fieldset { border: 1px solid var(--ae-line); border-radius: var(--ae-radius); padding: 22px 22px 8px; margin: 0 0 22px; background: #fff; box-shadow: 0 1px 2px rgba(22,19,61,.04); min-width: 0; }
.ae-form legend { font-weight: 700; font-size: 17px; padding: 0 8px; margin-left: -8px; color: var(--ae-ink); display: flex; align-items: center; gap: 10px; }
.ae-check { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-weight: 400 !important; font-size: 14.5px; line-height: 1.55; color: var(--ae-text) !important; cursor: pointer; margin: 0 !important; }
.ae-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ae-brand); cursor: pointer; }
.ae-check a { font-weight: 600; }
.ae-consents { background: var(--ae-bg); border: 1px solid var(--ae-line); border-radius: 12px; padding: 14px 16px; margin: 4px 0 18px; }
.ae-consents p { margin: 0 0 10px !important; }
.ae-consents p:last-child { margin-bottom: 0 !important; }
.ae-hp { position: absolute !important; left: -9999px; }
.ae-row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ae-row-between .ae-check { display: inline-grid !important; }
.ae-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.ae-step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ae-brand); color: #fff; font-size: 14px; font-weight: 700; flex: none; }

/* ---------- Card, thông báo, nhãn ---------- */
.ae-card { background: var(--ae-card); border: 1px solid var(--ae-line); border-radius: var(--ae-radius); padding: 24px; margin-bottom: 22px; box-shadow: var(--ae-shadow); }
.ae-card h2 { font-size: 20px; margin: 0 0 16px; }
.ae-card h3 { font-size: 17px; margin: 0 0 12px; }
.ae-card--highlight { border-color: rgba(255,102,0,.45); box-shadow: 0 0 0 4px rgba(255,102,0,.08), var(--ae-shadow); }
.ae-card--success { border-color: #a7e3c0; background: #effbf4; }
.ae-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ae-card__head h2, .ae-card__head h3 { margin: 0; }
.ae-notice { padding: 12px 16px; border-radius: 10px; margin: 0 0 18px; border-left: 4px solid; font-size: 14.5px; }
.ae-notice--success { background: #effbf4; border-color: var(--ae-green); color: #0f5132; }
.ae-notice--error { background: #fef2f2; border-color: var(--ae-red); color: #7f1d1d; }
.ae-notice--info { background: var(--ae-brand-50); border-color: var(--ae-brand); color: var(--ae-brand-900); }
.ae-notice--warning { background: #fffaeb; border-color: #d97706; color: #78350f; }
.ae-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eeedf6; color: #3b3a50; white-space: nowrap; }
.ae-badge--pending, .ae-badge--requested, .ae-badge--pending_verify { background: #fff1e6; color: #9a3412; }
.ae-badge--quoted { background: #fef9c3; color: #854d0e; }
.ae-badge--confirmed, .ae-badge--in_progress { background: var(--ae-brand-50); color: var(--ae-brand); }
.ae-badge--review { background: #f3e8ff; color: #6b21a8; }
.ae-badge--completed, .ae-badge--paid, .ae-badge--approved { background: #dcfce7; color: #166534; }
.ae-badge--cancelled, .ae-badge--rejected, .ae-badge--refunded { background: #fee2e2; color: #991b1b; }
.ae-badge--unpaid { background: #f1f1f6; color: #4b4a5e; }
.ae-muted { color: var(--ae-muted); }
.ae-small { font-size: 13.5px; }
.ae-big { font-size: 24px; color: var(--ae-brand); font-weight: 800; }
.ae-center { text-align: center; }
.ae-empty { text-align: center; padding: 34px 10px; color: var(--ae-muted); }
.ae-box { background: var(--ae-bg); border-radius: 10px; padding: 12px 16px; margin-top: 14px; }
.ae-box p:last-child { margin-bottom: 0; }
.ae-pre { white-space: pre-wrap; background: var(--ae-bg); padding: 14px; border-radius: 10px; font-family: inherit; margin: 0; }
.ae-ticks { list-style: none; padding: 0; margin: 12px 0 0; }
.ae-ticks li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.ae-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ae-green); font-weight: 700; }
.ae-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.ae-dl dt { color: var(--ae-muted); }
.ae-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; color: var(--ae-ink); }
.ae-dl--tight { gap: 6px 14px; font-size: 14px; }
.ae-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ae-actions form { margin: 0; }
.ae-actions--stack { flex-direction: column; }
.ae-actions--stack .ae-btn { width: 100%; }
.ae-copy { cursor: pointer; border: 1px solid var(--ae-line); background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-family: inherit; }
.ae-copy.is-copied { background: #dcfce7; border-color: #86efac; }

/* ---------- Bảng ---------- */
.ae-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ae-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ae-table th { text-align: left; background: var(--ae-bg); color: var(--ae-muted); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--ae-line); white-space: nowrap; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.ae-table td { padding: 13px 12px; border-bottom: 1px solid var(--ae-line); vertical-align: middle; }
.ae-table tr:hover td { background: #fbfbfe; }
.ae-pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.ae-pagination a, .ae-pagination span { min-width: 38px; padding: 6px 10px; border: 1px solid var(--ae-line); border-radius: 8px; text-align: center; text-decoration: none; }
.ae-pagination .current { background: var(--ae-brand); color: #fff; border-color: var(--ae-brand); }

/* ---------- Bố cục cổng ---------- */
.ae-portal { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.ae-portal > * { min-width: 0; }
.ae-portal__side { background: linear-gradient(180deg, var(--ae-brand-900), #070339); color: #fff; border-radius: var(--ae-radius); padding: 18px 12px; position: sticky; top: 96px; box-shadow: var(--ae-shadow); }
.ae-portal__user { display: flex; gap: 12px; align-items: center; padding: 4px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px; }
.ae-portal__user img { border-radius: 50%; border: 2px solid rgba(255,255,255,.4); }
.ae-portal__user strong { display: block; line-height: 1.3; color: #fff; }
.ae-portal__user small { color: #b9b6dc; }
.ae-portal__nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: #d8d6f5; text-decoration: none; font-weight: 500; margin-bottom: 2px; }

.ae-portal__nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.ae-portal__nav a.is-active { background: var(--ae-accent); color: #fff; box-shadow: 0 6px 16px rgba(255,102,0,.3); }
.ae-portal__main { min-width: 0; }
.ae-portal__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ae-portal__head h1 { font-size: clamp(22px, 2.6vw, 28px); margin: 0; }
.ae-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.ae-stat { background: #fff; border: 1px solid var(--ae-line); border-radius: var(--ae-radius); padding: 16px 18px; position: relative; overflow: hidden; box-shadow: 0 1px 2px rgba(22,19,61,.04); }
.ae-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ae-brand); }
.ae-stat span { display: block; color: var(--ae-muted); font-size: 13px; }
.ae-stat strong { font-size: 24px; color: var(--ae-ink); line-height: 1.3; }
.ae-stat--green::before { background: var(--ae-green); }
.ae-stat--blue::before { background: var(--ae-blue); }
.ae-stat--orange::before { background: var(--ae-accent); }
.ae-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ae-filter a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ae-line); background: #fff; text-decoration: none; color: var(--ae-text); font-size: 14px; }
.ae-filter a:hover { border-color: var(--ae-brand); color: var(--ae-brand); }
.ae-filter a.is-active { background: var(--ae-brand); color: #fff; border-color: var(--ae-brand); }
.ae-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }

/* Tiến trình */
.ae-progress { display: flex; list-style: none; padding: 18px 8px; margin: 0 0 22px; overflow-x: auto; background: #fff; border: 1px solid var(--ae-line); border-radius: var(--ae-radius); }
.ae-progress li { flex: 1; min-width: 96px; text-align: center; font-size: 13px; color: var(--ae-muted); position: relative; padding-top: 40px; }
.ae-progress li span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 32px; height: 32px; border-radius: 50%; background: #e8e7f2; color: var(--ae-muted); display: grid; place-items: center; font-weight: 700; z-index: 1; }
.ae-progress li::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: #e8e7f2; }
.ae-progress li:first-child::before { display: none; }
.ae-progress li.is-done span, .ae-progress li.is-done::before, .ae-progress li.is-current::before { background: var(--ae-green); color: #fff; }
.ae-progress li.is-current span { background: var(--ae-accent); color: #fff; box-shadow: 0 0 0 5px rgba(255,102,0,.2); }
.ae-progress li.is-current { color: var(--ae-ink); font-weight: 700; }

/* Tin nhắn & tệp */
.ae-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 480px; overflow-y: auto; padding-right: 4px; }
.ae-msg { padding: 12px 14px; border-radius: 12px; background: var(--ae-bg); max-width: 86%; }
.ae-msg--customer { align-self: flex-end; background: var(--ae-accent-50); }
.ae-msg--staff { background: var(--ae-brand-50); }
.ae-msg--internal { border: 1px dashed #a78bfa; background: #f5f3ff; }
.ae-msg__meta { font-size: 12px; color: var(--ae-muted); margin-bottom: 4px; }
.ae-msg__body p { margin: 0 0 6px; }
.ae-msg__body p:last-child { margin: 0; }
.ae-files { list-style: none; padding: 0; margin: 0; }
.ae-file { padding: 11px 0; border-bottom: 1px solid var(--ae-line); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ae-file:last-child { border-bottom: 0; }
.ae-file__type { font-size: 12px; background: #eeedf6; padding: 2px 8px; border-radius: 6px; }
.ae-file--result .ae-file__type, .ae-file--certificate .ae-file__type { background: #dcfce7; color: #166534; }
.ae-locked { color: var(--ae-muted); }

/* Đánh giá */
.ae-rating { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-bottom: 10px; }
.ae-rating input { position: absolute; opacity: 0; }
.ae-rating label { font-size: 30px; color: #d1d5db; cursor: pointer; margin: 0 !important; line-height: 1; }
.ae-rating input:checked ~ label, .ae-rating label:hover, .ae-rating label:hover ~ label { color: #f59e0b; }
.ae-stars { color: #f59e0b; font-size: 22px; margin: 0; }

/* ---------- Đặt hàng ---------- */
.ae-order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 26px; align-items: start; }
.ae-order-grid > .ae-order-summary { align-self: stretch; } /* cho phép khung báo giá bám theo khi cuộn */
.ae-sticky { position: sticky; top: 96px; z-index: 5; max-height: calc(100vh - 112px); overflow-y: auto; }
.admin-bar .ae-sticky { top: 128px; max-height: calc(100vh - 144px); }
.ae-service-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ae-service-option { position: relative; display: block !important; margin: 0 !important; cursor: pointer; }
.ae-service-option input { position: absolute; opacity: 0; pointer-events: none; }
.ae-opt { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 2px solid var(--ae-line); border-radius: 12px; height: 100%; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.ae-service-option:hover .ae-opt { border-color: var(--ae-brand-100); }
.ae-opt__name { font-weight: 700; font-size: 14.5px; line-height: 1.35; color: var(--ae-ink); }
.ae-opt__price { font-size: 13.5px; color: var(--ae-muted); font-weight: 400; }
.ae-opt__price strong { color: var(--ae-brand); font-weight: 700; }
.ae-opt__price del { opacity: .6; margin-left: 4px; }
.ae-service-option input:checked + .ae-opt { border-color: var(--ae-brand); background: var(--ae-brand-50); box-shadow: 0 0 0 3px rgba(24,0,173,.08); }
.ae-service-option input:focus-visible + .ae-opt { box-shadow: 0 0 0 3px rgba(255,102,0,.35); }
.ae-pkg-field[hidden] { display: none; }
.ae-summary-title { font-size: 18px; margin: 0 0 14px; }
.ae-total { font-size: 14.5px; border-top: 1px dashed var(--ae-line); padding-top: 14px; margin: 14px 0; color: var(--ae-muted); }
.ae-total strong { display: block; font-size: 30px; color: var(--ae-accent-d); line-height: 1.2; margin-top: 2px; }

/* ---------- Đăng nhập / đăng ký ---------- */
.ae-auth-wrap { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 380px); gap: 28px; justify-content: center; align-items: stretch; margin: 8px auto 24px; }
.ae-auth-wrap > .ae-card { padding: 34px 34px 26px; margin: 0; border-top: 4px solid var(--ae-brand); }
.ae-auth__title { font-size: clamp(24px, 2.6vw, 30px); margin: 0 0 6px; }
.ae-auth-wrap > .ae-card > .ae-muted { margin: 0 0 22px; }
.ae-auth-wrap .ae-center { margin: 18px 0 0; font-size: 14.5px; }
.ae-auth-aside { align-self: start; position: sticky; top: 96px; overflow: hidden; background: linear-gradient(160deg, var(--ae-brand) 0%, var(--ae-brand-900) 100%); color: #fff; border-radius: var(--ae-radius); padding: 34px 30px; box-shadow: var(--ae-shadow); }
.ae-auth-aside::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255,102,0,.35), transparent 70%); }
.ae-auth-aside h3 { color: #fff; margin: 0 0 16px; font-size: 20px; }
.ae-auth-aside .ae-ticks li { color: #e3e1fb; margin-bottom: 12px; }
.ae-auth-aside .ae-ticks li::before { color: #ffb27a; }
.ae-switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--ae-bg); padding: 4px; border-radius: 12px; margin-bottom: 22px; border: 1px solid var(--ae-line); }
.ae-switch a { text-align: center; padding: 9px 8px; border-radius: 9px; text-decoration: none; color: var(--ae-muted); font-weight: 600; font-size: 14.5px; }
.ae-switch a.is-active { background: #fff; color: var(--ae-brand); box-shadow: 0 1px 4px rgba(22,19,61,.12); }

/* ---------- Affiliate ---------- */
.ae-copy-field { display: flex; gap: 8px; margin-bottom: 10px; }
.ae-copy-field input { flex: 1; font-family: ui-monospace, monospace; font-size: 14px; }
.ae-copy-field .ae-copy { padding: 10px 18px; font-size: 15px; border-radius: 10px; }
.ae-link-gen { display: grid; gap: 8px; margin-top: 10px; }
.ae-link-gen output { font-family: ui-monospace, monospace; background: var(--ae-bg); padding: 10px; border-radius: 8px; word-break: break-all; font-size: 13px; }
details summary { cursor: pointer; color: var(--ae-brand); font-weight: 600; }
.ae-bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.ae-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.ae-bar span { width: 100%; max-width: 32px; background: linear-gradient(var(--ae-accent), #ffa25e); border-radius: 4px 4px 0 0; min-height: 2px; }
.ae-bar small { font-size: 10px; color: var(--ae-muted); margin-top: 4px; }
.ae-banner-preview { overflow-x: auto; }
.ae-aff-hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--ae-brand), var(--ae-brand-900)); color: #fff; padding: 44px; border-radius: 16px; margin-bottom: 24px; }
.ae-aff-hero h2 { color: #fff; font-size: clamp(24px, 3vw, 32px); margin: 0 0 12px; }
.ae-aff-hero p { color: #dcdaf7; max-width: 700px; }
.ae-steps-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ae-steps-3 .ae-step-num { margin-bottom: 12px; }
.ae-job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ae-job header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; }

/* Máy tính giá nhanh */
.ae-quick-calc p { margin: 0 0 14px; }
.ae-quick-calc label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ae-ink); }

.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
	.ae-detail-grid, .ae-order-grid { grid-template-columns: minmax(0, 1fr); }
	.ae-sticky, .admin-bar .ae-sticky { position: static; max-height: none; overflow: visible; }
	.ae-auth-wrap { grid-template-columns: minmax(0, 560px); }
	.ae-auth-aside { display: none; }
}
@media (max-width: 860px) {
	.ae-portal { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.ae-portal__side { position: static; padding: 10px; }
	.ae-portal__user { display: none; }
	.ae-portal__nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
	.ae-portal__nav a { white-space: nowrap; padding: 8px 12px; margin: 0; }
	.ae-steps-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.ae-grid-2 { grid-template-columns: minmax(0, 1fr); }
	.ae-card { padding: 18px; }
	.ae-auth-wrap > .ae-card { padding: 24px 18px 20px; }
	.ae-form fieldset { padding: 18px 14px 4px; }
	.ae-aff-hero { padding: 26px 20px; }
	.ae-table thead { display: none; }
	.ae-table tr { display: block; border-bottom: 1px solid var(--ae-line); padding: 8px 0; }
	.ae-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 0; text-align: right; }
	.ae-table td[data-label]::before { content: attr(data-label); color: var(--ae-muted); font-size: 13px; text-align: left; }
	.ae-msg { max-width: 100%; }
	.ae-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
	.ae-dl dd { margin-bottom: 8px; }
	.ae-progress li { min-width: 66px; font-size: 11px; padding-top: 34px; }
	.ae-progress li span { width: 26px; height: 26px; font-size: 12px; }
	.ae-progress li::before { top: 12px; }
	.ae-copy-field { flex-direction: column; }
	.ae-service-picker { grid-template-columns: minmax(0, 1fr); }
}
.ae-detail-grid--single { grid-template-columns: minmax(0, 1fr); }

/* ==========================================================================
   Icon SVG trong cổng
   ========================================================================== */
.ae-ico { display: inline-block; vertical-align: middle; flex: none; }
.ae-btn .ae-ico { margin: -2px 0 0; }
.ae-portal__nav a { gap: 12px; }
.ae-nav-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: #c9c5f5; flex: none; transition: background .15s, color .15s; }
.ae-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-portal__nav a:hover .ae-nav-ico { background: rgba(255,255,255,.14); color: #fff; }
.ae-portal__nav a.is-active .ae-nav-ico { background: rgba(255,255,255,.22); color: #fff; }
.ae-portal__nav a.is-active { padding-top: 7px; padding-bottom: 7px; }
.ae-portal__nav a { padding-top: 7px; padding-bottom: 7px; }
.ae-portal__nav .ae-nav-logout { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); border-radius: 0 0 10px 10px; padding-top: 14px; }
.ae-portal__nav .ae-nav-logout .ae-nav-ico { color: #ffb27a; }
.ae-h-ico { display: flex; align-items: center; gap: 8px; color: #0f5132 !important; }
.ae-notice--icon { display: flex; align-items: center; gap: 10px; }
.ae-locked { display: inline-flex; align-items: center; gap: 6px; }
.ae-locked .ae-ico { color: var(--ae-accent-d); }
.ae-portal__head .ae-btn .ae-ico { margin-right: 2px; }
@media (max-width: 860px) {
	.ae-nav-ico { width: 30px; height: 30px; border-radius: 8px; }
	.ae-portal__nav .ae-nav-logout { margin-top: 0; border-top: 0; padding-top: 7px; }
	.ae-nav-label { overflow: visible; }
}

/* ==========================================================================
   Khung "Báo giá ước tính" - nền xanh đen nổi bật
   ========================================================================== */
.ae-quote { overflow-x: hidden; background: radial-gradient(420px 220px at 100% 0%, rgba(255,102,0,.28), transparent 60%), linear-gradient(165deg, #1800ad 0%, #0c0561 55%, #070339 100%); border: 0; color: #e3e1fb; padding: 26px 24px; box-shadow: 0 18px 44px rgba(12,5,97,.35); }
.ae-quote::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #ff6600, #ff572e); }
.ae-quote .ae-summary-title { color: #fff; font-size: 19px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ae-quote .ae-summary-title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #ff6600; box-shadow: 0 0 0 4px rgba(255,102,0,.25); }
.ae-quote .ae-dl { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; }
.ae-quote .ae-dl dt { color: #a9a4e3; }
.ae-quote .ae-dl dd { color: #fff; }
.ae-quote .ae-total { color: #c9c5f5; border-top: 1px dashed rgba(255,255,255,.18); }
.ae-quote .ae-total strong { color: #ffb27a; font-size: 34px; letter-spacing: -.01em; text-shadow: 0 2px 18px rgba(255,102,0,.35); }
.ae-quote label { color: #fff !important; }
.ae-quote input[type=text] { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.ae-quote input[type=text]::placeholder { color: #a9a4e3; }
.ae-quote input[type=text]:focus { border-color: #ff8a3d; box-shadow: 0 0 0 3px rgba(255,102,0,.25); background: rgba(255,255,255,.14); }
.ae-quote .ae-muted { color: #b9b6dc; }
.ae-quote .ae-btn--primary { min-height: 50px; font-size: 16px; box-shadow: 0 10px 24px rgba(255,102,0,.35); }
.ae-quote .ae-ticks li { color: #dcdaf7; }
.ae-quote .ae-ticks li::before { color: #ffb27a; }
.ae-quote a { color: #ffb27a; }

/* Nút "Sao chép" dạng nút chính (liên kết affiliate) - không để kiểu nút nhỏ .ae-copy đè màu */
.ae-btn.ae-copy { background: var(--ae-accent); border-color: var(--ae-accent); color: #fff; font-size: 15px; padding: 10px 18px; border-radius: 10px; min-height: 46px; }
.ae-btn.ae-copy:hover { background: var(--ae-accent-d); border-color: var(--ae-accent-d); color: #fff; }
.ae-btn.ae-copy.is-copied { background: var(--ae-green); border-color: var(--ae-green); color: #fff; }
/* Chú thích (tooltip) - icon "i" hiển thị khi di chuột hoặc chạm/Tab vào */
.ae-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ae-label-row label { margin: 0 !important; }
.ae-tip { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ae-muted); cursor: help; }
.ae-tip:hover, .ae-tip:focus-visible { color: var(--ae-brand); background: var(--ae-brand-50); outline: none; }
.ae-tip__box { position: absolute; z-index: 20; top: calc(100% + 8px); left: 50%; width: 250px; transform: translate(-40%, -4px); padding: 10px 12px; border-radius: 10px; background: #fff; color: var(--ae-text); font-size: 13px; font-weight: 400; line-height: 1.5; text-align: left; box-shadow: 0 12px 30px rgba(12,5,97,.25); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, transform .15s, visibility .15s; }
.ae-tip__box::before { content: ""; position: absolute; top: -6px; left: 40%; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); }
.ae-tip:hover .ae-tip__box, .ae-tip:focus .ae-tip__box, .ae-tip:focus-within .ae-tip__box { opacity: 1; visibility: visible; transform: translate(-40%, 0); }
.ae-quote .ae-tip { color: #b9b6dc; }
.ae-quote .ae-tip:hover, .ae-quote .ae-tip:focus-visible { color: #fff; background: rgba(255,255,255,.14); }
.ae-quote::before { border-radius: 14px 14px 0 0; }
/* ==========================================================================
   Bản 1.2.5 - điện thoại: menu cổng dạng lưới, biểu đồ không tràn
   ========================================================================== */
.ae-bars { gap: 4px; }
.ae-bar { min-width: 0; }
.ae-bar small { white-space: nowrap; }
@media (max-width: 860px) {
	.ae-portal__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; }
	.ae-portal__nav a { flex-direction: column; justify-content: flex-start; gap: 6px; padding: 10px 4px; text-align: center; white-space: normal; font-size: 12.5px; line-height: 1.25; }
	.ae-portal__nav a.is-active, .ae-portal__nav .ae-nav-logout { padding: 10px 4px; border-radius: 10px; }
	.ae-nav-label { white-space: normal; }
}
@media (max-width: 640px) {
	.ae-bars { gap: 3px; height: 150px; }
	.ae-bar small { font-size: 9.5px; }
	.ae-bar:nth-child(even) small { visibility: hidden; }
}

/* Dấu phân cách " · " */
.sep { display: inline-block; width: 5px; height: 5px; margin: 0 4px; border-radius: 50%; background: var(--ae-accent, #ff6600); font-size: 0; line-height: 0; vertical-align: middle; position: relative; top: -1px; opacity: .85; }

/* ==========================================================================
   Hồ sơ tài khoản (dùng chung cho khách hàng, biên tập viên, affiliate)
   ========================================================================== */
.ae-profile { padding: 0; overflow: hidden; }
.ae-profile__head { display: flex; align-items: center; gap: 16px; padding: 24px 28px; background: linear-gradient(120deg, #1800ad 0%, #2a12c9 55%, #3b1fd6 100%); color: #fff; position: relative; }
.ae-profile__head::after { content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,102,0,.35), transparent 70%); pointer-events: none; }
.ae-profile__avatar { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ae-accent); color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .02em; box-shadow: 0 0 0 4px rgba(255,255,255,.18); }
.ae-profile__who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ae-profile__who strong { font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.ae-profile__who span { font-size: 14px; color: #d8d6f5; overflow-wrap: anywhere; }
.ae-profile__form { padding: 8px 28px 26px; }
.ae-pf-section { padding: 22px 0 6px; border-bottom: 1px solid var(--ae-line); }
.ae-pf-section:last-of-type { border-bottom: 0; }
.ae-pf-title { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 0 0 16px; color: var(--ae-ink); }
.ae-pf-title .ae-ico { width: 30px; height: 30px; padding: 6px; border-radius: 8px; background: #efedff; color: var(--ae-brand); box-sizing: border-box; }
.ae-pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.ae-pf-wide { grid-column: 1 / -1; }
.ae-pf-field { margin-bottom: 18px; min-width: 0; }
.ae-pf-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; color: var(--ae-ink); }
.ae-input-ico { position: relative; }
.ae-input-ico > .ae-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8c8aa6; pointer-events: none; transition: color .15s; }
.ae-form .ae-input-ico input { padding-left: 44px; background: #fbfbfe; }
.ae-form .ae-input-ico input:focus { background: #fff; }
.ae-input-ico:focus-within > .ae-ico { color: var(--ae-brand); }
.ae-form .ae-input-ico input:disabled { background: #f1f0f7; color: var(--ae-muted); cursor: not-allowed; border-style: dashed; }
.ae-pf-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ae-muted); }
.ae-pf-actions { display: flex; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--ae-line); margin-top: 4px; }
.ae-pf-actions .ae-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 26px; }
@media (max-width: 640px) {
	.ae-profile__head { padding: 20px 18px; gap: 12px; }
	.ae-profile__avatar { width: 48px; height: 48px; font-size: 17px; }
	.ae-profile__form { padding: 4px 18px 20px; }
	.ae-pf-grid { grid-template-columns: minmax(0, 1fr); }
	.ae-pf-actions .ae-btn { width: 100%; justify-content: center; }
}
