:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #667085;
    --border: #e1e5eb;
    --primary: #2b6de5;
    --primary-soft: #eaf2ff;
    --orange: #ff6b00;
    --blue: #0091ff;
    --green: #22c55e;
    --red: #e53955;
    --sidebar-width: 232px;
    --shadow: 0 5px 18px rgba(32, 55, 89, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: 13px; line-height: 1.5; }
button, input, select { font: inherit; }
button { border: 0; }
[hidden] { display: none !important; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; width: var(--sidebar-width); flex-direction: column; border-right: 1px solid var(--border); background: #fff; box-shadow: 4px 0 16px rgba(41,64,99,.035); transition: width .2s ease; }
.brand-row { display: flex; height: 62px; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #edf0f4; }
.brand-symbol { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #2176ee, #5a56e9); color: #fff; font-family: Manrope, sans-serif; font-size: 17px; font-weight: 800; }
.brand-copy { min-width: 0; flex: 1; }
.brand-copy strong, .brand-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy strong { color: #1d3557; font-family: Manrope, sans-serif; font-size: 12px; }
.brand-copy span { color: #8b97a8; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.collapse-button { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 7px; background: #f2f5f9; color: #637287; cursor: pointer; font-size: 17px; }
.module-nav { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.module-item { display: flex; width: 100%; min-height: 37px; align-items: center; gap: 10px; margin-bottom: 2px; padding: 7px 10px; border-radius: 7px; background: transparent; color: #506078; cursor: pointer; font-size: 10px; font-weight: 600; text-align: left; transition: .15s ease; }
.module-item i { display: grid; width: 21px; flex: 0 0 auto; place-items: center; color: #72839a; font-size: 14px; font-style: normal; }
.module-item:hover { background: #f3f6fa; color: #213a5e; }
.module-item.active { background: var(--primary-soft); color: var(--primary); }
.module-item.active i { color: var(--primary); }
.sidebar-status { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-top: 1px solid #edf0f4; color: #7b899c; font-size: 8px; }
.sidebar-status b { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px rgba(34,197,94,.5); }

.app-shell.sidebar-collapsed { --sidebar-width: 68px; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .module-item span, .sidebar-collapsed .sidebar-status span { display: none; }
.sidebar-collapsed .brand-row { justify-content: center; flex-wrap: wrap; height: 92px; padding: 8px; }
.sidebar-collapsed .collapse-button { width: 36px; }
.sidebar-collapsed .module-item { justify-content: center; padding-inline: 7px; }

.main-area { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin .2s ease; }
.topbar { display: flex; height: 62px; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 24px; border-bottom: 1px solid var(--border); background: #fff; }
.breadcrumb { color: #8a96a7; font-size: 8px; }
.breadcrumb span { color: var(--primary); }
.topbar h1 { margin-top: 1px; font-family: Manrope, sans-serif; font-size: 18px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-action { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #64748b; cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.user-chip > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #e9f2ff; color: var(--primary); font-size: 10px; font-weight: 700; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 9px; }
.user-chip small { color: #8c98a8; font-size: 7px; }

.module-page { display: none; padding: 18px 22px 42px; animation: page-in .18s ease; }
.module-page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
.content-card { border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }

.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.overview-grid article { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.overview-grid span, .overview-grid small { display: block; color: var(--muted); font-size: 8px; }
.overview-grid strong { display: block; margin: 7px 0 3px; font-family: Manrope, sans-serif; font-size: 18px; }
.overview-card { padding: 18px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.section-kicker { color: var(--primary); font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.section-title h2, .data-card h2 { margin-top: 2px; font-size: 14px; }
.text-button { background: transparent; color: var(--primary); cursor: pointer; font-size: 9px; font-weight: 700; }
.recent-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.recent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid #edf0f4; border-radius: 7px; background: #fbfcfe; }
.recent-row strong, .recent-row span, .recent-row small { display: block; }
.recent-row strong { font-size: 9px; }
.recent-row span, .recent-row small { color: var(--muted); font-size: 7px; }
.recent-row > strong { flex: 0 0 auto; font-family: Manrope, sans-serif; font-size: 11px; }

.subtabs { display: flex; gap: 26px; height: 39px; padding: 0 6px; border-bottom: 1px solid var(--border); background: #fff; }
.subtabs button { height: 39px; border-bottom: 2px solid transparent; background: transparent; color: #68778c; cursor: pointer; font-size: 9px; font-weight: 600; }
.subtabs button.active { border-color: var(--primary); color: var(--primary); }

.summary-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 14px 0; }
.summary-metrics article { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.summary-metrics article::before { width: 3px; align-self: stretch; border-radius: 5px; background: var(--metric-color); content: ""; }
.metric-orange { --metric-color: var(--orange); border: 1px solid #ffe1cc; }
.metric-blue { --metric-color: var(--blue); border: 1px solid #cdeaff; }
.metric-green { --metric-color: var(--green); border: 1px solid #d0f4dd; }
.metric-marker { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--metric-color) 11%, white); color: var(--metric-color); font-size: 16px; font-weight: 700; }
.summary-metrics span, .summary-metrics strong { display: block; }
.summary-metrics span { margin-bottom: 4px; color: #78879b; font-size: 7px; font-weight: 700; }
.summary-metrics strong { color: var(--metric-color); font-family: Manrope, sans-serif; font-size: 17px; }

.ledger-card { overflow: hidden; }
.ledger-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--border); }
.toolbar-group { display: flex; align-items: center; gap: 7px; }
.button { display: inline-flex; min-height: 33px; align-items: center; justify-content: center; padding: 7px 12px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 700; white-space: nowrap; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 5px 12px rgba(43,109,229,.18); }
.button-outline { border-color: #d9e0e9; background: #fff; color: #53637a; }
.button-ghost { background: transparent; color: var(--primary); }
.button-receipt { background: var(--orange); color: #fff; }
.button-payment { background: var(--blue); color: #fff; }
.button-danger { border-color: #ffcbd4; background: #fff1f4; color: var(--red); }
.search-field { position: relative; width: min(220px, 24vw); }
.search-field span { position: absolute; left: 9px; top: 50%; color: #9aa5b4; transform: translateY(-50%); }
.search-field input { width: 100%; padding-left: 28px; }
input, select { min-height: 34px; padding: 7px 9px; border: 1px solid #d8dfe8; border-radius: 6px; outline: 0; background: #fff; color: var(--text); font-size: 13px; }
input:focus, select:focus { border-color: #82aff5; box-shadow: 0 0 0 3px rgba(43,109,229,.08); }
input[readonly] { background: #f1f4f8; color: #35506f; font-weight: 700; cursor: not-allowed; }
.filter-panel { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; padding: 10px 13px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.filter-panel label, #voucher-form label { display: flex; flex-direction: column; gap: 4px; color: #5c6c82; font-size: 12px; font-weight: 600; }

.table-scroll { overflow-x: auto; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ledger-table th { padding: 9px 10px; border-bottom: 1px solid #dce2ea; background: #f6f8fb; color: #66768b; font-size: 10px; letter-spacing: .025em; text-align: left; white-space: nowrap; }
.ledger-table td { padding: 9px 10px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.ledger-table tbody tr:hover { background: #f7fbff; }
.ledger-table th:first-child, .ledger-table td:first-child { width: 35px; text-align: center; }
.ledger-table input[type="checkbox"] { width: 13px; height: 13px; min-height: 0; accent-color: var(--primary); }
.voucher-no { color: var(--primary); font-weight: 700; }
.voucher-kind { display: block; margin-top: 2px; color: #8a96a7; font-size: 8px; }
.description-cell { min-width: 220px; max-width: 340px; }
.amount-cell { color: #2b405d; font-family: Manrope, sans-serif; font-size: 13px; font-weight: 700; white-space: nowrap; }
.object-cell { min-width: 145px; max-width: 220px; }
.empty-row { padding: 30px !important; color: var(--muted); text-align: center; }
.ledger-footer { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; border-top: 1px solid var(--border); background: #fafbfd; }
.ledger-footer div { display: flex; gap: 18px; color: var(--muted); font-size: 11px; }
.ledger-footer strong { color: #34465e; }
.ledger-footer select { min-height: 29px; }

.report-card { overflow: hidden; }
.report-heading { padding: 18px; text-align: center; }
.report-heading h2 { margin: 2px 0 8px; font-size: 16px; }
.balance-status { display: inline-flex; padding: 5px 10px; border-radius: 20px; font-size: 7px; font-weight: 700; }
.balance-ok { border: 1px solid #c3ecd2; background: #edfbf2; color: #169a4c; }
.balance-error { border: 1px solid #ffc7d0; background: #fff1f4; color: var(--red); }
.trial-table td:nth-child(n+3), .trial-table tfoot td { text-align: right; white-space: nowrap; }
.trial-table tfoot td { border-top: 2px solid #aecdff; background: #f0f6ff; font-weight: 700; }

.data-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.data-card { padding: 18px; }
.data-card > p:not(.section-kicker) { margin-top: 7px; color: var(--muted); font-size: 9px; }
.data-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 15px; }
.data-actions > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 7px; }
.data-actions strong, .data-actions small { display: block; }
.data-actions strong { font-size: 9px; }
.data-actions small { color: var(--muted); font-size: 7px; }
.danger-row { border-color: #ffd0d8 !important; }
.file-button input { display: none; }
.account-catalog { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-top: 13px; }
.catalog-item { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fbfcfe; }
.catalog-item code, .catalog-item span { display: block; }
.catalog-item code { color: var(--primary); font-family: Manrope, monospace; font-size: 8px; font-weight: 700; }
.catalog-item span { margin-top: 1px; color: var(--muted); font-size: 6px; }

.placeholder-card { display: grid; min-height: 420px; place-items: center; align-content: center; gap: 10px; border: 1px dashed #ccd5e2; border-radius: 10px; background: #fff; text-align: center; }
.placeholder-card > div { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 15px; background: var(--primary-soft); color: var(--primary); font-size: 25px; }
.placeholder-card h2 { font-size: 17px; }
.placeholder-card p { max-width: 420px; color: var(--muted); font-size: 9px; }

.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; padding: 16px; place-items: center; background: rgba(22,35,55,.52); opacity: 0; pointer-events: none; backdrop-filter: blur(4px); transition: .18s ease; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.voucher-modal { width: min(850px,100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 10px; background: #fff; box-shadow: 0 28px 80px rgba(22,41,70,.25); transform: translateY(7px) scale(.992); transition: .18s ease; }
.modal-overlay.active .voucher-modal { transform: none; }
.modal-header { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--border); background: #f9fbfe; }
.model-badge { display: inline-flex; margin-bottom: 4px; padding: 2px 6px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 7px; font-weight: 700; }
.modal-header h2 { font-family: Manrope, sans-serif; font-size: 19px; }
.modal-header p { color: var(--muted); font-size: 8px; }
.modal-amount { align-self: center; padding-right: 30px; text-align: right; }
.modal-amount span, .modal-amount strong { display: block; }
.modal-amount span { color: var(--muted); font-size: 7px; font-weight: 700; }
.modal-amount strong { margin-top: 2px; color: var(--primary); font-family: Manrope, sans-serif; font-size: 32px; line-height: 1.15; }
.close-button { position: absolute; top: 10px; right: 10px; width: 29px; height: 29px; border-radius: 7px; background: #eef2f7; color: #66758b; cursor: pointer; font-size: 18px; }
#voucher-form { display: flex; flex-direction: column; gap: 11px; padding: 17px 20px 19px; }
.form-grid { display: grid; gap: 11px; }
.two-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
.three-columns { grid-template-columns: repeat(3,minmax(0,1fr)); }
#voucher-form input, #voucher-form select { width: 100%; }
.amount-entry { display: grid; grid-template-columns: .4fr .6fr; gap: 12px; padding: 12px; border: 1px solid #cfe0fb; border-radius: 8px; background: #f5f9ff; }
.amount-entry input { color: var(--primary); font-family: Manrope, sans-serif; font-size: 18px; font-weight: 700; }
.amount-entry > div { display: flex; flex-direction: column; justify-content: center; }
.amount-entry span { color: var(--muted); font-size: 7px; font-weight: 700; text-transform: uppercase; }
.amount-entry strong { margin-top: 4px; color: #293c57; font-size: 10px; line-height: 1.55; }
.modal-actions { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 3px; }
.modal-actions > label { width: 110px; }
.modal-actions > div { display: flex; gap: 7px; }
.toast-container { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 7px; }
.toast { max-width: 370px; padding: 10px 13px; border: 1px solid #d6deea; border-radius: 7px; background: #fff; box-shadow: var(--shadow); color: #34465e; font-size: 9px; font-weight: 600; animation: toast-in .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } }
.negative { color: var(--red) !important; }
.empty-state { padding: 22px; color: var(--muted); font-size: 8px; text-align: center; }

/* Phiếu Thu/Chi dạng workspace theo giao diện MISA tham chiếu */
.modal-overlay:has(.misa-voucher-modal) { padding: 18px; place-items: center; background: rgba(17, 35, 55, .46); }
.misa-voucher-modal { width: 100%; max-width: 1180px; max-height: calc(100vh - 36px); border-radius: 10px; box-shadow: 0 26px 80px rgba(20, 41, 63, .28); }
.misa-voucher-modal #voucher-form { min-height: 0; gap: 0; padding: 0; background: #fff; }
.misa-form-header { padding: 14px 16px 12px; background: #b2ebf2; }
.misa-title-row { display: grid; grid-template-columns: auto minmax(320px, 430px) 1fr; align-items: center; gap: 20px; margin-bottom: 14px; }
.misa-voucher-title { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.misa-voucher-title h2 { font-family: Manrope, sans-serif; font-size: 22px; }
.misa-voucher-title strong { font-family: Manrope, sans-serif; font-size: 22px; }
.history-icon { color: #65768a; font-size: 20px; }
.category-select select { width: 100%; min-height: 34px; border-color: #21a5b8; border-radius: 2px; color: #17566d; font-size: 13px; font-weight: 600; }
.misa-header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.guide-button { min-height: 30px; padding: 5px 12px; border: 1px solid #a8bdc4; border-radius: 18px; background: transparent; color: #314d58; cursor: pointer; font-size: 12px; }
.header-tool { width: 29px; height: 29px; background: transparent; color: #607381; cursor: pointer; font-size: 18px; }
.close-large { font-size: 23px; }
.misa-info-layout { display: grid; grid-template-columns: minmax(600px, 1fr) 180px 150px; align-items: start; gap: 22px; }
.misa-party-fields { display: grid; grid-template-columns: 235px minmax(280px, 1fr); gap: 7px 12px; }
.misa-party-fields label, .misa-date-fields label { gap: 3px !important; color: #243a47 !important; font-size: 13px !important; font-weight: 700 !important; }
.misa-party-fields input, .misa-date-fields input { width: 100%; min-height: 34px !important; padding: 6px 10px !important; border-color: #b8c7ce; border-radius: 2px; background: #fff; font-size: 13px; }
.input-with-add { display: grid; grid-template-columns: 1fr 28px; }
.input-with-add button { border: 1px solid #b8c7ce; border-left: 0; background: #fff; color: #0797aa; cursor: pointer; font-size: 17px; }
.reference-field { grid-column: 1; }
.source-doc-field { grid-column: 2; }
.source-doc-field > div { display: flex; align-items: center; gap: 8px; }
.source-doc-field input { width: 110px; }
.source-doc-field span { font-size: 12px; font-weight: 400; }
.misa-date-fields { display: flex; flex-direction: column; gap: 7px; }
.misa-total-box { margin-right: 20px; padding-top: 4px; text-align: right; }
.misa-total-box span, .misa-total-box strong, .misa-total-box small { display: block; }
.misa-total-box span { color: #394d59; font-size: 12px; }
.misa-total-box strong { margin-top: 4px; font-family: Manrope, sans-serif; font-size: 32px; line-height: 1; white-space: nowrap; }
.misa-total-box small { margin-top: 3px; color: #71818b; font-size: 10px; }

.accounting-section { padding: 0 13px 20px; background: #fff; }
.accounting-heading { display: flex; height: 43px; align-items: center; justify-content: space-between; }
.accounting-heading h3 { font-size: 15px; }
.accounting-heading > div { display: flex; align-items: center; gap: 14px; }
.accounting-heading label { display: flex !important; flex-direction: row !important; align-items: center; gap: 7px !important; color: #374b5b !important; font-size: 12px !important; }
.accounting-heading select { width: 105px; min-height: 27px; border-radius: 0; }
.suggest-button { background: transparent; color: #0878d1; cursor: pointer; font-size: 12px; }
.accounting-table-wrap { overflow-x: auto; }
.accounting-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 13px; }
.accounting-table th { height: 34px; padding: 7px 9px; border-right: 1px solid #b8d8dc; border-bottom: 1px solid #178fa0; background: #b2ebf2; color: #213742; font-size: 13px; text-align: left; }
.accounting-table th:first-child, .accounting-table td:first-child { width: 34px; text-align: center; }
.accounting-table th:nth-child(3), .accounting-table th:nth-child(4) { width: 105px; }
.accounting-table th:nth-child(5) { width: 150px; text-align: right; }
.accounting-table th:last-child { width: 35px; }
.accounting-table td { height: 35px; padding: 0; border-right: 1px dotted #c9d2da; border-bottom: 1px solid #d3d9df; }
.accounting-table input, .accounting-table select { width: 100%; min-height: 34px; border: 0; border-radius: 0; background: transparent; font-size: 13px; }
.accounting-table input:focus, .accounting-table select:focus { box-shadow: inset 0 0 0 1px #1798ad; }
.accounting-table .line-fixed-account { padding: 7px 9px; color: #263d4d; font-weight: 600; }
.accounting-table .line-amount { text-align: right; }
.accounting-table .delete-line-button { width: 100%; height: 34px; background: transparent; color: #7a8792; cursor: pointer; font-size: 14px; }
.accounting-table tfoot td { height: 25px; background: #e7e9ed; font-weight: 700; }
.accounting-table tfoot td:nth-child(2) { padding-right: 10px; text-align: right; }
.accounting-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; color: #435567; font-size: 12px; }
.accounting-summary strong { color: #20384b; }
.line-actions { display: flex; gap: 8px; }
.mini-button { min-height: 29px; padding: 5px 11px; border: 1px solid #9ca9b5; border-radius: 2px; background: #fff; color: #263949; cursor: pointer; font-size: 12px; font-weight: 600; }
.attachment-area { width: 340px; margin-top: 24px; }
.attachment-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #3f5362; font-size: 12px; }
.attachment-title span { color: #8a969f; }
.attachment-dropzone { display: grid !important; height: 52px; place-items: center; border: 1px solid #9baab5; color: #a1a9b0 !important; cursor: pointer; font-size: 12px !important; font-style: italic; font-weight: 400 !important; }
.attachment-dropzone input { display: none; }
#attachment-file-names { display: block; overflow: hidden; margin-top: 5px; color: #7e8b95; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.misa-modal-actions { position: sticky; right: 0; bottom: 0; left: 0; z-index: 4; display: flex; height: 52px; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid #d4d9df; background: #f8fafc; box-shadow: 0 -5px 16px rgba(37, 58, 82, .07); }
.misa-modal-actions > label { display: flex !important; width: 150px; flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 12px !important; }
.misa-modal-actions select { min-height: 30px; }
.misa-modal-actions > div { display: flex; gap: 7px; }
.payment-mode .misa-form-header { background: #f3f4f6; }
.payment-mode .accounting-table th { border-color: #c9cdd3; background: #f3f4f6; }
.payment-mode .category-select select { border-color: #9da8b3; color: #384a59; }

@media (max-width: 1000px) {
    .misa-title-row { grid-template-columns: auto 1fr auto; }
    .misa-info-layout { grid-template-columns: minmax(480px, 1fr) 170px; }
    .misa-total-box { grid-column: 1 / -1; text-align: left; }
    .misa-total-box strong { font-size: 22px; }
}

@media (max-width: 720px) {
    .misa-form-header { padding: 10px; }
    .misa-title-row { grid-template-columns: 1fr auto; gap: 8px; }
    .misa-voucher-title { grid-column: 1; }
    .category-select { grid-column: 1 / -1; grid-row: 2; }
    .guide-button { display: none; }
    .misa-info-layout { grid-template-columns: 1fr; gap: 10px; }
    .misa-party-fields { grid-template-columns: 1fr; }
    .reference-field, .source-doc-field { grid-column: 1; }
    .misa-date-fields { display: grid; grid-template-columns: 1fr; }
    .accounting-section { padding-inline: 8px; }
    .accounting-heading { align-items: flex-start; height: auto; flex-direction: column; gap: 6px; padding: 9px 0; }
    .accounting-summary { align-items: flex-start; flex-direction: column; }
    .attachment-area { width: 100%; }
    .misa-modal-actions { height: auto; align-items: stretch; flex-direction: column; }
    .misa-modal-actions > label, .misa-modal-actions > div { width: 100%; }
    .misa-modal-actions .button { flex: 1; }
    .misa-voucher-modal #voucher-form { padding-bottom: 0; }
    .misa-total-box { margin-right: 0; }
}

/* V6 · Danh mục Master Data và thao tác 1-click */
.nav-secondary { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e7ebf0; }
.nav-secondary .module-item { color: #40576b; }
.nav-secondary .module-item i { color: #24928e; }

.catalog-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; padding: 3px 2px; }
.catalog-page-heading h2 { margin: 3px 0 2px; color: #20364b; font: 800 21px/1.25 Manrope, sans-serif; }
.catalog-page-heading > div > p:last-child { color: #748394; font-size: 11px; }
.catalog-search { display: flex; width: min(330px, 100%); height: 36px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #cfd8e1; border-radius: 5px; background: #fff; }
.catalog-search input { width: 100%; min-height: 0; padding: 0; border: 0; box-shadow: none; background: transparent; font-size: 12px; }
.catalog-master-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.master-data-card { overflow: hidden; border: 1px solid #dfe5eb; border-radius: 7px; background: #fff; box-shadow: 0 4px 15px rgba(32, 55, 82, .045); }
.master-data-card > header { display: flex; min-height: 62px; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid #e8edf1; background: linear-gradient(105deg, #f3fbfb, #fff); }
.master-data-card > header > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; background: #e3f5f4; font-size: 20px; }
.master-data-card small { color: #19928f; font-size: 8px; font-weight: 800; letter-spacing: .09em; }
.master-data-card h3 { color: #263d50; font-size: 14px; }
.master-data-card > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.master-data-card > div button { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 13px; border-right: 1px solid #edf0f3; border-bottom: 1px solid #edf0f3; background: #fff; color: #456074; cursor: pointer; font-size: 11px; text-align: left; }
.master-data-card > div button:hover { background: #eff9fa; color: #14798a; }
.master-data-card > div button b { color: #22a0a7; font-size: 17px; }
.catalog-no-results { grid-column: 1 / -1; padding: 50px; border: 1px dashed #cbd4dd; border-radius: 8px; background: #fff; color: #798998; text-align: center; }

.voucher-icon-actions { display: flex; min-width: 132px; align-items: center; gap: 4px; }
.voucher-icon-actions button { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 13px; transition: .15s ease; }
.voucher-icon-actions button:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(36, 57, 80, .12); }
.voucher-action-view { border-color: #b8d8fb !important; background: #edf6ff; color: #1976d2; }
.voucher-action-edit { border-color: #f5cfaa !important; background: #fff6e9; color: #e97718; }
.voucher-action-print { border-color: #d2d8df !important; background: #f5f7f9; color: #596976; }
.voucher-action-delete { border-color: #f2bdc3 !important; background: #fff0f2; color: #d9384f; }

.catalog-detail-modal, .voucher-view-dialog { width: min(880px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 8px; background: #fff; box-shadow: 0 25px 75px rgba(21, 42, 64, .28); }
.catalog-detail-modal > header, .voucher-view-dialog > header { display: flex; min-height: 70px; align-items: center; justify-content: space-between; padding: 12px 17px; border-bottom: 1px solid #dce3e8; background: #eff9fa; }
.catalog-detail-modal > header p, .voucher-view-dialog > header p { color: #178d96; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.catalog-detail-modal > header h2, .voucher-view-dialog > header h2 { margin-top: 2px; color: #263e4d; font-size: 19px; }
.catalog-detail-modal > header button, .voucher-view-dialog > header button { width: 32px; height: 32px; background: transparent; color: #657884; cursor: pointer; font-size: 23px; }
.catalog-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #e1e6ea; }
.catalog-detail-toolbar label { display: flex; width: min(340px, 100%); height: 34px; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid #c5d0d7; border-radius: 4px; }
.catalog-detail-toolbar input { width: 100%; min-height: 0; padding: 0; border: 0; box-shadow: none; font-size: 12px; }
.catalog-detail-table-wrap, .voucher-view-table-wrap { overflow: auto; }
.catalog-detail-table, .voucher-view-table-wrap table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 12px; }
.catalog-detail-table th, .voucher-view-table-wrap th { padding: 9px 11px; border-bottom: 1px solid #a8cdd1; background: #ccebed; color: #2a4351; font-size: 10px; text-align: left; }
.catalog-detail-table td, .voucher-view-table-wrap td { padding: 10px 11px; border-bottom: 1px solid #e5e9ed; }
.catalog-status { display: inline-flex; padding: 3px 8px; border-radius: 12px; background: #e7f7ee; color: #25824e; font-size: 10px; font-weight: 700; }
.catalog-detail-empty { padding: 30px !important; color: #81909c; text-align: center; }
.catalog-detail-modal > footer, .voucher-view-dialog > footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid #dce3e8; background: #f8fafb; }
.catalog-detail-modal > footer { justify-content: space-between; color: #627381; font-size: 11px; }

.voucher-view-content { padding: 15px; }
.voucher-view-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.voucher-view-summary > div { padding: 10px; border: 1px solid #dce4e9; border-radius: 5px; background: #f8fafb; }
.voucher-view-summary span, .voucher-view-summary strong { display: block; }
.voucher-view-summary span { color: #70808d; font-size: 10px; }
.voucher-view-summary strong { margin-top: 3px; color: #263e4d; font-size: 12px; }
.voucher-view-party { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; margin-bottom: 13px; padding: 11px 12px; border: 1px solid #dfe6ea; }
.voucher-view-party p { display: flex; gap: 6px; color: #586d7b; font-size: 11px; }
.voucher-view-party strong { color: #273f4e; }
.voucher-view-table-wrap { border: 1px solid #b7ccd1; }
.voucher-view-table-wrap th:last-child, .voucher-view-table-wrap td:last-child { text-align: right; }
.voucher-view-words { margin-top: 10px; padding: 10px 12px; background: #edf7f8; color: #49606d; font-size: 11px; }

@media (max-width: 800px) {
    .catalog-master-grid { grid-template-columns: 1fr; }
    .catalog-page-heading { align-items: stretch; flex-direction: column; }
    .voucher-view-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .master-data-card > div { grid-template-columns: 1fr; }
    .catalog-detail-toolbar, .voucher-view-dialog > footer { align-items: stretch; flex-direction: column; }
    .catalog-detail-toolbar label { width: 100%; }
    .voucher-view-summary, .voucher-view-party { grid-template-columns: 1fr; }
}

/* V6 · Sổ kế toán chi tiết quỹ tiền mặt */
#page-cash-report { padding: 0 0 36px; background: #f3f5f7; }
.cash-report-subtabs { padding-inline: 22px; }
.cash-report-workspace { margin: 14px 18px 0; border: 1px solid #d9e0e5; border-radius: 3px; background: #fff; box-shadow: 0 3px 12px rgba(27, 52, 78, .06); }
.cash-report-page-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 18px; border-bottom: 1px solid #dfe4e8; }
.cash-report-page-header h2 { margin-top: 4px; color: #1f3647; font: 700 20px/1.2 Manrope, sans-serif; }
.report-links { display: flex; align-items: center; gap: 8px; }
.report-links button { background: transparent; color: #1775b9; cursor: pointer; font-size: 11px; }
.report-links span { color: #b0bbc3; }
.report-header-actions { display: flex; gap: 8px; }
.report-parameter-button { border-color: #249b58 !important; background: #27a95e !important; color: #fff !important; }
.report-parameter-button:hover { background: #208c4e !important; }
.cash-report-toolbar { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 13px; border-bottom: 1px solid #dfe4e8; background: #fbfcfd; }
.report-toolbar-left, .report-toolbar-right { display: flex; align-items: center; gap: 3px; }
.cash-report-toolbar button { min-height: 30px; padding: 5px 9px; border-radius: 2px; background: transparent; color: #304758; cursor: pointer; font-size: 11px; }
.cash-report-toolbar button:hover { background: #eaf2f5; }
.report-toolbar-right > button { min-width: 31px; padding-inline: 6px; font-size: 15px; }
.report-search { display: flex; width: 225px; height: 31px; align-items: center; gap: 5px; margin-right: 5px; padding: 0 8px; border: 1px solid #b7c4cb; background: #fff; }
.report-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.cash-report-paper { padding: 24px 14px 0; background: #fff; }
.cash-report-title { margin-bottom: 18px; color: #172f3f; text-align: center; }
.cash-report-title h1 { font: 800 22px/1.35 Manrope, sans-serif; letter-spacing: .025em; }
.cash-report-title p { color: #536773; font-size: 11px; }
.cash-report-table-wrap { overflow: auto; border: 1px solid #b7cbd0; }
.cash-report-table { width: 100%; min-width: 1320px; border-collapse: collapse; color: #263c49; font-size: 11px; }
.cash-report-table th { height: 34px; padding: 5px 7px; border-right: 1px solid #a8c9ce; border-bottom: 1px solid #86b9c1; background: #c7e9ec; color: #1d3845; font-size: 10px; text-align: center; vertical-align: middle; }
.cash-report-table td { height: 31px; padding: 5px 7px; border-right: 1px dotted #cbd5da; border-bottom: 1px solid #dbe1e5; vertical-align: middle; }
.cash-report-table th:nth-child(1), .cash-report-table th:nth-child(2) { width: 92px; }
.cash-report-table th:nth-child(3), .cash-report-table th:nth-child(4) { width: 105px; }
.cash-report-table th:nth-child(5) { min-width: 310px; text-align: left; }
.cash-report-table th:nth-child(6), .cash-report-table th:nth-child(7) { width: 88px; }
.cash-report-table th:nth-child(8), .cash-report-table th:nth-child(9), .cash-report-table th:nth-child(10) { width: 140px; }
.cash-report-group td { height: 32px; border-top: 1px solid #70aeb7; background: #e3f3f5; color: #15596b; font-weight: 800; }
.cash-report-opening td { background: #f7fafb; font-style: italic; font-weight: 600; }
.cash-report-subtotal td { border-top: 1px solid #9badb5; background: #e9ecef; font-weight: 800; }
.cash-report-subtotal td:first-child { text-align: right; }
.cash-report-empty td { padding: 18px; color: #81909a; text-align: center; }
.cash-report-table tfoot td { height: 34px; border-top: 2px solid #607985; background: #dfe4e7; font-weight: 900; }
.cash-report-table tfoot td:first-child { text-align: right; }
.report-number { font-variant-numeric: tabular-nums; text-align: right; }
.report-balance { color: #135f74; font-weight: 700; }
.report-voucher-link { background: transparent; color: #1688c8; cursor: pointer; font-size: 11px; font-weight: 700; text-decoration: underline; text-decoration-color: #9cd1e8; text-underline-offset: 2px; }
.cash-report-footer { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 14px; border-top: 1px solid #d9e0e5; background: #fff; color: #435966; font-size: 11px; }
.cash-report-footer > div { display: flex; align-items: center; gap: 5px; }
.cash-report-footer select, .cash-report-footer button { min-height: 30px; border: 1px solid #bcc7ce; border-radius: 2px; background: #fff; color: #344b58; font-size: 11px; }
.cash-report-footer select { padding-inline: 8px; }
.cash-report-footer button { min-width: 54px; padding: 5px 8px; cursor: pointer; }
.cash-report-footer button:disabled { cursor: not-allowed; opacity: .4; }
.cash-report-footer strong { display: grid; min-width: 30px; height: 30px; place-items: center; border: 1px solid #1b93a7; color: #167c8e; }
.cash-report-workspace.report-expanded { margin-inline: 0; border-right: 0; border-left: 0; }
.cash-report-workspace.report-compact .cash-report-table td { height: 25px; padding-block: 3px; }

.report-parameter-modal { width: min(620px, 100%); border-radius: 5px; background: #fff; box-shadow: 0 24px 70px rgba(23, 44, 66, .27); }
.report-parameter-modal form { padding: 0; }
.report-parameter-modal header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid #dce3e7; }
.report-parameter-modal header p { color: #1691a5; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.report-parameter-modal header h2 { margin-top: 3px; color: #263d4a; font-size: 18px; }
.report-parameter-modal header button { width: 32px; height: 32px; background: transparent; color: #6a7a84; cursor: pointer; font-size: 23px; }
.report-parameter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 18px; }
.report-parameter-grid label { display: flex; flex-direction: column; gap: 5px; color: #3d5260; font-size: 12px; font-weight: 700; }
.report-parameter-grid input, .report-parameter-grid select { width: 100%; min-height: 35px; border: 1px solid #b8c5cc; border-radius: 2px; background: #fff; font-size: 12px; }
.report-parameter-wide { grid-column: 1 / -1; }
.report-parameter-modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #dce3e7; background: #f7f9fa; }

@media (max-width: 900px) {
    .cash-report-page-header, .cash-report-toolbar { align-items: stretch; flex-direction: column; }
    .cash-report-toolbar { padding-block: 9px; }
    .report-toolbar-left, .report-toolbar-right { flex-wrap: wrap; }
    .report-search { width: min(100%, 320px); }
}

@media (max-width: 600px) {
    .cash-report-workspace { margin: 8px 7px 0; }
    .cash-report-page-header { padding: 10px; }
    .cash-report-page-header h2 { font-size: 17px; }
    .report-header-actions { width: 100%; }
    .report-header-actions .button { flex: 1; }
    .cash-report-paper { padding: 14px 6px 0; }
    .cash-report-title h1 { font-size: 17px; }
    .cash-report-footer { align-items: flex-start; flex-direction: column; }
    .report-parameter-grid { grid-template-columns: 1fr; }
    .report-parameter-wide { grid-column: 1; }
}

.print-sheet { display: none; color: #000; background: #fff; font-family: "Times New Roman", serif; }
.print-document { position: relative; min-height: 100%; padding: 2mm 3mm; }
.print-header-grid { display: grid; grid-template-columns: 1fr 1.3fr .8fr; align-items: start; text-align: center; }
.print-company { text-align: left; }
.print-company strong, .print-company span { display: block; }
.print-company strong { font-size: 12pt; text-transform: uppercase; }
.print-company span { font-size: 9pt; }
.print-title h1 { font-size: 20pt; letter-spacing: .06em; }
.print-title p { font-size: 10pt; font-style: italic; }
.print-model { font-size: 9pt; text-align: right; }
.print-voucher-no { margin-top: 4mm; font-size: 10pt; text-align: center; }
.print-content { margin-top: 4mm; font-size: 11pt; line-height: 1.8; }
.print-line { display: flex; border-bottom: 1px dotted #555; }
.print-line span:first-child { flex: 0 0 auto; padding-right: 4px; }
.print-line strong { padding-left: 4px; }
.print-posting { display: flex; justify-content: flex-end; gap: 16mm; margin: 3mm 0; font-size: 11pt; }
.print-amount-box { margin-top: 3mm; padding: 3mm; border: 1px solid #000; font-size: 11pt; }
.print-amount-box strong { font-size: 14pt; }
.print-signatures { display: grid; grid-template-columns: repeat(5,1fr); gap: 3mm; margin-top: 8mm; text-align: center; }
.print-signatures strong, .print-signatures span { display: block; }
.print-signatures strong { font-size: 10pt; }
.print-signatures span { font-size: 8pt; font-style: italic; }
.signature-space { height: 23mm; }

@media print {
    body { background: #fff !important; }
    .app-shell, .modal-overlay, .toast-container { display: none !important; }
    .print-sheet { display: block !important; }
}

@media print {
    @page { size: A4 landscape; margin: 8mm; }
    body.printing-cash-report .app-shell { display: block !important; }
    body.printing-cash-report .sidebar,
    body.printing-cash-report .topbar,
    body.printing-cash-report .module-page:not(#page-cash-report),
    body.printing-cash-report .cash-report-subtabs,
    body.printing-cash-report .cash-report-page-header,
    body.printing-cash-report .cash-report-toolbar,
    body.printing-cash-report .cash-report-footer,
    body.printing-cash-report .print-sheet { display: none !important; }
    body.printing-cash-report .main-area { margin: 0 !important; }
    body.printing-cash-report #page-cash-report { display: block !important; padding: 0 !important; }
    body.printing-cash-report .cash-report-workspace { margin: 0 !important; border: 0 !important; box-shadow: none !important; }
    body.printing-cash-report .cash-report-paper { padding: 0 !important; }
    body.printing-cash-report .cash-report-table-wrap { overflow: visible !important; }
    body.printing-cash-report .cash-report-table { min-width: 0 !important; font-size: 7pt !important; }
    body.printing-cash-report .cash-report-table th { font-size: 6.5pt !important; }
}

@media (max-width: 1050px) {
    .overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ledger-toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-right { justify-content: flex-end; }
    .search-field { flex: 1; width: auto; }
}

@media (max-width: 800px) {
    :root { --sidebar-width: 68px; }
    .brand-copy, .module-item span, .sidebar-status span { display: none; }
    .brand-row { justify-content: center; flex-wrap: wrap; height: 92px; padding: 8px; }
    .module-item { justify-content: center; }
    .sidebar-status { justify-content: center; }
    .summary-metrics, .data-grid { grid-template-columns: 1fr; }
    .filter-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
    body { padding-bottom: 58px; }
    .sidebar { inset: auto 0 0; width: 100%; height: 54px; }
    .brand-row, .sidebar-status { display: none; }
    .module-nav { display: flex; overflow-x: auto; padding: 4px; }
    .module-item { min-width: 46px; margin: 0; }
    .main-area { margin-left: 0; }
    .topbar { padding-inline: 13px; }
    .user-chip div { display: none; }
    .module-page { padding: 12px 10px 26px; }
    .subtabs { gap: 16px; overflow-x: auto; }
    .overview-grid, .recent-list, .filter-panel, .two-columns, .three-columns, .amount-entry { grid-template-columns: 1fr; }
    .toolbar-group { flex-wrap: wrap; }
    .toolbar-right .search-field { flex-basis: 100%; }
    .ledger-footer, .modal-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
    .ledger-footer div { flex-direction: column; gap: 2px; }
    .modal-header { grid-template-columns: 1fr; }
    .modal-amount { padding: 0; text-align: left; }
    .modal-amount strong { font-size: 24px; }
    .modal-actions > div, .modal-actions .button { width: 100%; }
    .modal-actions > div { flex-wrap: wrap; }
    .modal-actions .button { flex: 1; }
    .account-catalog { grid-template-columns: 1fr; }
}

/* Firebase Authentication & cloud sync */
.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 18%, rgba(30,136,229,.14), transparent 34%),
        radial-gradient(circle at 82% 78%, rgba(21,190,154,.12), transparent 32%),
        rgba(244,247,251,.97);
    backdrop-filter: blur(12px);
}
.auth-gate[hidden] { display: none; }
.auth-card {
    width: min(430px, 100%);
    padding: 38px;
    border: 1px solid rgba(205,215,228,.95);
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 24px 80px rgba(25,50,84,.16);
    text-align: center;
}
.auth-brand-mark {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #1976d2, #0d47a1);
    box-shadow: 0 12px 30px rgba(25,118,210,.25);
    color: #fff;
    font: 800 25px Manrope, sans-serif;
}
.auth-eyebrow { margin: 0 0 8px; color: #1976d2; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.auth-card h1 { margin: 0; color: #172235; font: 800 25px Manrope, sans-serif; }
.auth-card > p:not(.auth-eyebrow) { min-height: 44px; margin: 12px 0 18px; color: #64748b; font-size: 13px; line-height: 1.65; }
.auth-card > small { display: block; margin-top: 16px; color: #8b98aa; font-size: 10px; line-height: 1.55; }
.google-signin-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 0 20px;
    border: 1px solid #d7dde7;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(23,34,53,.07);
    color: #253044;
    cursor: pointer;
    font: 700 12px Inter, sans-serif;
}
.google-signin-button[hidden] { display: none; }
.google-signin-button:hover { border-color: #aebbd0; background: #f8fafc; }
.google-signin-button:disabled { cursor: wait; opacity: .65; }
.google-signin-button svg { width: 19px; height: 19px; }
.cloud-sync-chip {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid #dce3ec;
    border-radius: 999px;
    background: #f8fafc;
    color: #708095;
    font: 700 8px Inter, sans-serif;
}
.cloud-sync-chip b { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.cloud-sync-chip.online b,
.sidebar-status.online b { background: #22c55e; box-shadow: 0 0 7px rgba(34,197,94,.5); }
.cloud-sync-chip.syncing b,
.sidebar-status.syncing b { background: #f59e0b; animation: cloud-pulse 1s infinite alternate; }
.cloud-sync-chip.error b,
.sidebar-status.error b { background: #ef4444; box-shadow: 0 0 7px rgba(239,68,68,.35); }
.user-chip {
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.user-chip:hover strong { color: var(--primary); }
[data-requires-editor].cloud-locked { cursor: not-allowed !important; opacity: .5 !important; }
@keyframes cloud-pulse { to { opacity: .35; } }

@media (max-width: 720px) {
    .cloud-sync-chip span { display: none; }
    .auth-card { padding: 30px 22px; }
}
