/* Đăng nhập (MH07), quản lý người dùng (MH08), đổi mật khẩu (MH09), lịch sử tải file (MH10), menu tài khoản (C06) */

/* ---------- Menu tài khoản trên thanh trên (C06) ---------- */
.topbar-account-toggle { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--studio-text); font-size: 13px; font-weight: 600; }
.topbar-account-toggle:hover,
.topbar-account-toggle[aria-expanded="true"] { background: var(--studio-surface-hover); }
.topbar-account .topbar-avatar { display: grid; }
.topbar-account-name { display: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account-menu { min-width: 230px; padding: 6px; border: 1px solid var(--studio-line); border-radius: 10px; box-shadow: 0 12px 30px rgb(38 43 40 / 12%); }
.topbar-account-summary { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--studio-line-soft); margin-bottom: 4px; }
.topbar-account-summary strong { color: var(--studio-ink); font-size: 14px; }
.topbar-account-summary span { color: var(--studio-muted); font-size: 12px; }
.topbar-account-menu .dropdown-item { min-height: 40px; display: flex; align-items: center; gap: 10px; border-radius: 7px; color: var(--studio-text); font-size: 14px; }
.topbar-account-menu .dropdown-item:hover { background: var(--studio-green-soft); color: var(--studio-ink); }
a.sidebar-bottom { color: inherit; text-decoration: none; }
a.sidebar-bottom:hover .user-copy strong { color: var(--studio-ink); }

/* ---------- Đăng nhập (MH07) ---------- */
.login-page-body { min-height: 100vh; background: var(--studio-paper); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 24px 20px; border: 1px solid var(--studio-line); border-radius: 14px; background: var(--studio-surface); box-shadow: 0 18px 40px rgb(38 43 40 / 8%); }
.login-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.login-card-top .brand { text-decoration: none; }
.login-title { margin: 0; color: var(--studio-ink); font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.login-subtitle { margin: 6px 0 20px; color: var(--studio-muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-remember,
.account-switch { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; color: var(--studio-text); font-size: 14px; cursor: pointer; }
.login-remember .form-check-input,
.account-switch .form-check-input { width: 18px; height: 18px; margin: 0; }
.login-submit { width: 100%; }

/* ---------- Trang tài khoản chung ---------- */
.account-page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.account-card { max-width: 480px; display: flex; flex-direction: column; gap: 16px; padding: 20px 16px; border: 1px solid var(--studio-line); border-radius: 12px; background: var(--studio-surface); }
.account-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.account-toolbar .studio-field { flex: 1 1 200px; max-width: 360px; }
.account-empty { padding: 28px 16px; border: 1px dashed var(--studio-line); border-radius: 10px; color: var(--studio-muted); text-align: center; }
.account-table-wrap { overflow-x: auto; border: 1px solid var(--studio-line); border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
.account-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
.account-table th { padding: 10px 12px; border-bottom: 1px solid var(--studio-line); background: #fafaf7; color: var(--studio-muted); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.account-table td { padding: 10px 12px; border-bottom: 1px solid var(--studio-line-soft); color: var(--studio-text); vertical-align: middle; }
.account-table tr:last-child td { border-bottom: 0; }
.account-table tr.is-locked td { background: #f7f7f4; color: var(--studio-muted); }
.account-table .is-numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-name-cell { display: inline-flex; align-items: center; gap: 10px; }
.account-name-cell strong { color: var(--studio-ink); }
.account-avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e9dfd1; color: #74614b; font-size: 11px; font-weight: 700; }
.account-login-name { padding: 2px 6px; border-radius: 5px; background: #f3f4ef; color: var(--studio-ink); font-size: 13px; }
.account-badge { display: inline-flex; padding: 1px 7px; border-radius: 999px; background: #ecece8; color: var(--studio-muted); font-size: 10px; font-weight: 600; line-height: 16px; }
.account-role,
.account-status { display: inline-flex; padding: 2px 9px; border-radius: 999px; background: #f0f1ec; color: var(--studio-text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.account-role.is-admin { background: var(--studio-green); color: #fff; }
.account-status { background: var(--studio-green-soft); color: var(--studio-green-dark); }
.account-status.is-locked { background: var(--studio-danger-soft); color: var(--studio-danger); }
.account-actions { white-space: nowrap; text-align: right; }
.account-actions .icon-action-button + .icon-action-button { margin-left: 6px; }
.account-pagination { display: flex; justify-content: center; margin-top: 14px; }
.account-pagination .pagination { flex-wrap: wrap; margin: 0; }
.account-modal-subtitle { margin: -6px 0 14px; color: var(--studio-muted); font-size: 14px; }

/* ---------- Lịch sử tải file (MH10) ---------- */
.upload-history-filters .studio-field { flex: 1 1 160px; }
.upload-history-filters .upload-history-search-field { flex: 2 1 220px; }
.upload-history-time { color: var(--studio-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.upload-history-action { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.upload-history-action.is-tai_len { background: var(--studio-green-soft); color: var(--studio-green-dark); }
.upload-history-action.is-xoa { background: var(--studio-danger-soft); color: var(--studio-danger); }
.upload-history-location { min-width: 160px; color: var(--studio-muted); }
.upload-history-file { min-width: 180px; word-break: break-word; }

@media (min-width: 768px) {
    .topbar-account-name { display: inline; }
    .login-card { padding: 32px 30px; }
    .account-card { padding: 24px; }
}

/* ---------- Danh mục khách hàng / nhà máy (MH12) ---------- */
.reference-list-toolbar { justify-content: space-between; }
.reference-list-add-form { display: flex; min-width: 0; flex: 1 1 320px; align-items: flex-end; gap: 8px; }
.reference-list-add-form .studio-field { flex: 1 1 auto; max-width: none; }
.reference-list-toolbar .reference-list-search-field { flex: 0 1 260px; }
.reference-list-table { min-width: 480px; }
.reference-entry-name { color: var(--studio-ink); font-weight: 600; overflow-wrap: anywhere; }
.reference-entry-rename-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reference-entry-rename-form:not([hidden]) { display: flex; }
.reference-entry-rename-form[hidden] { display: none; }
.reference-entry-rename-form .studio-field { flex: 1 1 200px; margin: 0; }
