:root { --blue: #064b93; --blue-dark: #04366c; --red: #d82027; --ink: #12263f; --muted: #64748b; --line: #dce6ef; --bg: #f3f7fa; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: "Be Vietnam Pro", system-ui, sans-serif; line-height: 1.55; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.admin-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px clamp(18px, 4vw, 58px); color: #fff; background: var(--blue-dark); border-bottom: 4px solid var(--red); }
.admin-brand { display: flex; align-items: center; gap: 11px; line-height: 1.1; }
.admin-brand img { width: 58px; height: 48px; object-fit: contain; padding: 3px; background: #fff; }
.admin-brand span { display: grid; gap: 6px; }
.admin-brand strong { letter-spacing: .06em; }
.admin-brand small { color: #caddf0; }
.header-actions { display: flex; align-items: center; gap: 14px; font-size: .8rem; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 17px; border: 1px solid transparent; border-radius: 3px; font-weight: 700; cursor: pointer; }
.button:disabled { opacity: .65; cursor: wait; }
.button-primary { width: 100%; color: #fff; background: var(--blue); }
.button-light { color: var(--blue-dark); background: #fff; }
.button-export { color: #fff; background: var(--blue); }
.button-refresh { color: var(--blue); border-color: #bdd0e1; background: #fff; }
.login-view { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 40px 18px; }
.login-card { width: min(470px, 100%); padding: clamp(27px, 5vw, 46px); border-top: 5px solid var(--red); background: #fff; box-shadow: 0 24px 70px rgba(7,48,92,.14); }
.eyebrow { color: var(--red); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.login-card h1, .dashboard-heading h1 { margin: 8px 0 10px; color: var(--blue-dark); line-height: 1.15; }
.login-card > p { margin: 0 0 25px; color: var(--muted); font-size: .9rem; }
.login-card label { display: grid; gap: 7px; margin-bottom: 16px; color: #344a62; font-size: .8rem; font-weight: 600; }
.login-card input, .toolbar input, .toolbar select, .lead-status { min-height: 46px; width: 100%; padding: 10px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; background: #fff; outline: none; }
.login-card input:focus, .toolbar input:focus, .toolbar select:focus, .lead-status:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(6,75,147,.12); }
.auth-status { margin-top: 14px; color: #a32228; font-size: .78rem; text-align: center; }
.back-link { display: block; margin-top: 20px; color: var(--blue); font-size: .78rem; text-align: center; }
.setup-warning { margin: 18px 0; padding: 12px; color: #745200; border: 1px solid #e7ce83; background: #fff8df; font-size: .78rem; }
.dashboard { width: min(1420px, calc(100% - 36px)); margin: 0 auto; padding: 44px 0 60px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.dashboard-heading h1 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-grid article { padding: 20px; border-left: 4px solid var(--blue); background: #fff; box-shadow: 0 8px 24px rgba(7,48,92,.06); }
.stat-grid article:nth-child(2) { border-left-color: var(--red); }
.stat-grid span { display: block; color: var(--muted); font-size: .76rem; }
.stat-grid strong { display: block; margin-top: 4px; color: var(--blue-dark); font-size: 2rem; line-height: 1.1; }
.toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) 220px auto; gap: 10px; margin-bottom: 14px; }
.table-card { min-height: 240px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
th { padding: 13px 14px; color: #fff; background: var(--blue-dark); text-align: left; white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #f8fbfd; }
.lead-time { min-width: 125px; color: var(--muted); }
.lead-name { display: block; min-width: 150px; }
.lead-phone { display: inline-block; margin-top: 5px; color: var(--blue); font-weight: 700; }
.lead-market { min-width: 130px; }
.lead-message { min-width: 210px; max-width: 390px; color: #516275; }
.lead-zalo { white-space: nowrap; }
.lead-zalo .sent { color: #087444; }
.lead-zalo .pending { color: #826000; }
.lead-status { min-height: 36px; min-width: 140px; padding: 6px 9px; font-size: .76rem; }
.loading-state, .empty-state { padding: 80px 20px; color: var(--muted); text-align: center; }
.dashboard-note { color: var(--muted); font-size: .7rem; }
@media (max-width: 820px) {
  .admin-header { align-items: flex-start; }
  #admin-email { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .admin-brand strong { font-size: .82rem; }
  .admin-brand small { font-size: .62rem; }
  .admin-brand img { width: 48px; height: 40px; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-grid article { padding: 14px; }
  .toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
}
