/* ═══ Vera Group Admin ═══ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2563eb; --blue-dark: #1d4ed8; --blue-light: #eff6ff;
  --bg: #f4f6fb; --card: #ffffff; --border: #e5e9f2;
  --text: #1e293b; --muted: #64748b;
  --green: #16a34a; --green-bg: #dcfce7;
  --orange: #d97706; --orange-bg: #fef3c7;
  --red: #dc2626; --red-bg: #fee2e2;
  --purple: #7c3aed; --purple-bg: #f3e8ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* ── Đăng nhập ── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 40px; width: 100%; max-width: 420px; text-align: center; }
.login-logo { font-size: 48px; }
.login-card h1 { font-size: 26px; margin: 8px 0 4px; }
.login-sub { color: var(--muted); margin-bottom: 24px; }
.login-card form { text-align: left; }
.login-card label { display: block; font-weight: 600; margin: 14px 0 6px; }
.req { color: var(--red); }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.error-msg { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 8px; margin-top: 14px; }

/* ── Layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--border); }
.brand-logo { font-size: 28px; }
.brand b { font-size: 16px; display: block; }
.brand small { color: var(--muted); }
.sidebar nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav-item { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--border); }
.me b { display: block; }
.me small { color: var(--muted); }
.main { flex: 1; padding: 28px 32px; max-width: 1200px; }
.view { display: none; }
.view.active { display: block; }
.view h2 { font-size: 22px; margin-bottom: 20px; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.view-head h2 { margin: 0; }

/* ── Cards & stats ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 16px; }
.link { color: var(--blue); text-decoration: none; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-icon.blue { background: var(--blue-light); } .stat-icon.purple { background: var(--purple-bg); }
.stat-icon.orange { background: var(--orange-bg); } .stat-icon.green { background: var(--green-bg); }
.stat-icon.teal { background: #ccfbf1; }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-label { color: var(--muted); }

/* ── Bảng ── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--bg); }
.empty { text-align: center; color: var(--muted); padding: 32px; }

/* ── Badge trạng thái ── */
.badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.pending { background: var(--orange-bg); color: var(--orange); }
.badge.approved { background: var(--green-bg); color: var(--green); }
.badge.rejected { background: var(--red-bg); color: var(--red); }
.badge.cancelled { background: var(--border); color: var(--muted); }
.badge.role-admin { background: var(--purple-bg); color: var(--purple); }
.badge.role-manager { background: var(--blue-light); color: var(--blue); }
.badge.role-employee { background: var(--border); color: var(--muted); }
.badge.tg-linked { background: var(--green-bg); color: var(--green); }
.badge.tg-none { background: var(--border); color: var(--muted); }
.badge.inactive { background: var(--red-bg); color: var(--red); }

/* ── Buttons ── */
.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-block { width: 100%; margin-top: 18px; padding: 13px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--muted); font-size: 18px; }
.btn-ghost:hover { color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-approve { background: var(--green); color: #fff; }
.btn-reject { background: var(--red-bg); color: var(--red); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.actions { display: flex; gap: 8px; }

/* ── Filters ── */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select { padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--card); font-family: inherit; }
.filters input { flex: 1; min-width: 220px; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 22px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-body label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { outline: none; border-color: var(--blue); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.detail-row b { text-align: right; }
.log-item { padding: 8px 0; border-bottom: 1px dashed var(--border); color: var(--muted); font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Kanban công việc ── */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding: 2px 4px 12px; }
.kanban-count { background: var(--bg); border-radius: 99px; padding: 2px 10px; font-size: 12px; color: var(--muted); }
.task-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.task-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.task-title { font-weight: 600; margin-bottom: 6px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.task-meta .badge { font-size: 11px; padding: 2px 8px; }
.badge.prio-high { background: var(--red-bg); color: var(--red); }
.badge.prio-medium { background: var(--orange-bg); color: var(--orange); }
.badge.prio-low { background: var(--green-bg); color: var(--green); }
.badge.overdue { background: var(--red); color: #fff; }
.task-actions { display: flex; gap: 6px; margin-top: 10px; }
.kanban-empty { color: var(--muted); text-align: center; padding: 14px 0; font-size: 13px; }
@media (max-width: 1000px) { .kanban { grid-template-columns: 1fr; } }

/* ── Hướng dẫn ── */
.guide-list { padding-left: 20px; line-height: 1.9; }
.guide-list li { margin-bottom: 6px; }
.view code, .modal-body code { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 13px; }
.view .card h3 { margin-bottom: 10px; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 13px 20px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); z-index: 200; }
.toast.error { background: var(--red); }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
}
