/* ===== Design system — Feelex =====
   Phong cách dashboard SaaS: sidebar trắng, nền xám nhạt, card bo tròn lớn,
   màu chủ đạo = xanh navy logo Feelex, nút hành động chính = pill đậm. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #1a4b9c;          /* xanh Feelex */
  --brand-dark: #123a7d;
  --brand-soft: #e8eefb;
  --ink: #16233b;            /* chữ chính */
  --muted: #697588;          /* chữ phụ */
  --bg: #f2f4f8;             /* nền ngoài */
  --card: #ffffff;
  --border: #e6e9f0;
  --green: #0f9d58;  --green-soft: #e3f4ea;
  --amber: #b8860b;  --amber-soft: #fdf3dd;
  --red: #d93025;    --red-soft: #fdeceb;
  --gray-soft: #eceef2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(22,35,59,.05), 0 8px 24px rgba(22,35,59,.06);
}
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ===== Đăng nhập ===== */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0e2d60 0%, #1a4b9c 60%, #2f6ccb 100%);
}
.login-card {
  background: #fff; border-radius: 24px; padding: 48px 56px;
  text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.35);
  max-width: 430px;
}
.login-logo { height: 72px; margin-bottom: 20px; }
.login-card h1 { font-size: 20px; margin-bottom: 8px; }
.login-card p { color: var(--muted); margin-bottom: 26px; }

/* ===== Khung layout ===== */
.layout { display: flex; min-height: 100vh; }

/* ----- Sidebar ----- */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.side-logo { padding: 2px 10px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.side-logo img { width: 130px; display: block; }
.side-section {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px 6px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.tab, .side-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; border: none; background: transparent;
  color: var(--ink); font-size: 14px; font-weight: 600;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  text-decoration: none;
}
.tab:hover, .side-link:hover { background: var(--bg); }
.tab.active { background: var(--brand-soft); color: var(--brand); }
.nav-ico { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.ext { margin-left: auto; color: var(--muted); font-weight: 400; }
.side-user {
  margin-top: auto; border-top: 1px solid var(--border);
  padding: 14px 6px 2px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.side-user-info { min-width: 0; }
.side-user-name {
  font-weight: 700; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-badge {
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 20px; padding: 1px 8px;
}
.icon-btn {
  margin-left: auto; border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 6px; border-radius: 8px;
}
.icon-btn:hover { background: var(--red-soft); color: var(--red); }

/* ----- Main ----- */
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; max-width: 1240px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.greet { color: var(--muted); font-size: 13px; }
.greet-name { font-size: 22px; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ===== Nút ===== */
.btn {
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--bg); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--brand); border-color: var(--brand); }
.btn-ghost { border: none; background: transparent; color: var(--muted); font-size: 16px; }
.btn-lg { padding: 13px 30px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-approve { background: var(--green); border-color: var(--green); color: #fff; }
.btn-approve:hover { background: #0c7d46; }
.btn-reject { background: var(--card); border-color: var(--red); color: var(--red); }
.btn-reject:hover { background: var(--red-soft); }

/* ===== Ô số liệu ===== */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px;
}
.stat-num { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ===== Card ===== */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card-head { margin-bottom: 14px; }
.card-head h2 { font-size: 16px; font-weight: 800; }

/* ===== Toolbar ===== */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="search"] {
  flex: 1; min-width: 220px;
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--bg);
}
.toolbar input[type="search"]:focus { outline: 2px solid var(--brand-soft); background: #fff; }
.toolbar select, .modal select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff;
}
.chk { color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; }

/* ===== Bảng ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .5px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafd; }
.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.sku { font-family: Consolas, monospace; font-size: 13px; font-weight: 600; }
.sku-first td { border-top: 2px solid var(--border); }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }
.price-up { color: var(--red); }
.price-down { color: var(--green); }

/* ===== Badge / trạng thái (luôn kèm chữ, không chỉ màu) ===== */
.badge {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: var(--brand-soft); color: var(--brand);
}
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.status-approved { background: var(--green-soft); color: var(--green); }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-pending2 { background: var(--brand-soft); color: var(--brand); }
.status-rejected { background: var(--red-soft); color: var(--red); }
.lot-dangban { background: var(--green-soft); color: var(--green); }
.lot-hethang { background: var(--amber-soft); color: var(--amber); }
.lot-ngungban { background: var(--gray-soft); color: var(--muted); text-decoration: line-through; }
.pill {
  background: var(--red); color: #fff; border-radius: 20px;
  font-size: 11px; padding: 1px 7px; margin-left: auto;
}
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* ===== Nhập nhanh ===== */
.import-help {
  background: var(--brand-soft); border: 1px solid #d5e2f8; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px; line-height: 1.6;
}
.import-help code { background: #fff; padding: 2px 8px; border-radius: 6px; }
#import-text {
  width: 100%; font-family: Consolas, monospace; font-size: 13px;
  border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  margin-bottom: 12px; resize: vertical; background: var(--bg);
}
#import-text:focus { outline: 2px solid var(--brand-soft); background: #fff; }
.import-result {
  margin-top: 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--green-soft); color: var(--green); font-weight: 600;
}
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.tag-new { background: var(--green-soft); color: var(--green); }
.tag-update { background: var(--brand-soft); color: var(--brand); }
.tag-error { background: var(--red-soft); color: var(--red); }

/* ===== Banner setup ===== */
.setup-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--amber-soft); border: 1px solid #f0d9a0; border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 18px; line-height: 1.5;
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(14,25,46,.5);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: 20px; padding: 26px 30px;
  width: 450px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.modal h2 { font-size: 17px; margin-bottom: 16px; }
.modal label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.modal input {
  width: 100%; margin-top: 4px; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--bg);
}
.modal input:focus { outline: 2px solid var(--brand-soft); background: #fff; }
.modal input:disabled { background: var(--gray-soft); color: var(--muted); }
.modal select { width: 100%; margin-top: 4px; }
.req { color: var(--red); }
.sku-info { font-size: 12px; font-weight: 400; margin-top: 3px; min-height: 16px; }
.sku-info.ok { color: var(--green); }
.sku-info.warn { color: var(--amber); }
.hint { color: var(--amber); font-size: 12.5px; min-height: 18px; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  max-width: 90vw;
}
.toast.error { background: var(--red); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 12px; }
  .side-logo { border: none; margin: 0; padding: 0 8px 0 0; }
  .side-logo img { width: 96px; }
  .side-section { display: none; }
  .side-nav { flex-direction: row; }
  .side-user { margin: 0 0 0 auto; border: none; padding: 0; }
  .side-user-info { display: none; }
  .main { padding: 16px; }
  .stats { grid-template-columns: 1fr; }
}
