/* ============================================================
   HR Recruit — editorial / warm-utility aesthetic
   Cream paper, ink navy, a single warm coral accent.
   ============================================================ */

:root {
  --paper:      #f4f1ea;
  --paper-2:    #ebe6da;
  --card:       #fffefb;
  --ink:        #20242e;
  --ink-soft:   #585e6b;
  --navy:       #1f3050;
  --coral:      #e0613e;
  --coral-soft: #f6e3da;
  --green:      #2f7d4f;
  --green-soft: #dcefe1;
  --amber:      #b07a1a;
  --amber-soft: #f3e7c8;
  --line:       #d8d2c4;
  --radius:     14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px;
  background: var(--navy);
  color: #d9dde7;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;   /* can tren, khong can giua -> chu dai khong day logo lech */
  margin-bottom: 42px;
}
.brand > div { min-width: 0; }  /* cho phep chu xuong dong gon trong sidebar hep */
.brand-mark {
  width: 42px; height: 42px;
  flex-shrink: 0;            /* logo khong bi bop khi chu dai */
  background: var(--coral);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 700; font-size: 18px;
  border-radius: 10px;
}
.brand-name {
  font-family: 'Fraunces', serif;
  font-size: 18px;           /* nho lai chut cho ten dai vua sidebar */
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  word-break: break-word;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a93a8;
  margin-top: 4px;
}

nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  color: #c2c8d6;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-apply {
  margin-top: 14px;
  background: var(--coral);
  color: #fff;
  text-align: center;
}
.nav-apply:hover { background: #c9512f; color: #fff; }

.sidebar-foot { margin-top: auto; padding-top: 18px; }
.ai-badge {
  font-size: 11.5px;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}
.ai-real { background: var(--green-soft); color: var(--green); }
.ai-mock { background: var(--amber-soft); color: var(--amber); }

/* ---------- Content ---------- */
.content { flex: 1; padding: 44px 52px; max-width: 1180px; position: relative; }

/* ---------- Account dock (goc phai tren) ---------- */
.account-dock {
  position: absolute;
  top: 16px;
  right: 40px;
  width: 218px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}
.account-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.account-id { display: flex; align-items: center; gap: 10px; }
.account-avatar {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #dde6f5;
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.account-meta { min-width: 0; }
.account-name {
  font-size: 14px; font-weight: 600; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-role {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 4px;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.account-links {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.account-link:hover { color: var(--navy); }
.account-logout { color: var(--coral); }
.account-logout:hover { color: var(--coral); opacity: .8; }
.account-cta {
  display: block;
  background: var(--coral);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: 12px;
}
.account-cta:hover { opacity: .92; }

/* Noi dung chinh chua cho cho account dock o phai */
.content-inner { padding-right: 238px; }

/* Man hinh hep: dock ve luong binh thuong, khong de */
@media (max-width: 1100px) {
  .account-dock {
    position: static;
    width: 100%;
    flex-direction: row;
    margin-bottom: 24px;
  }
  .account-card { flex: 1; }
  .account-cta {
    display: flex; align-items: center; justify-content: center;
    white-space: nowrap;
  }
  .content-inner { padding-right: 0; }
}

.page-head { margin-bottom: 32px; }
.page-head h1 {
  font-family: 'Fraunces', serif;
  font-size: 33px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -.01em;
}
.page-head p { color: var(--ink-soft); margin-top: 6px; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1.2fr 1.8fr 0.7fr; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.stat-card .stat-label {
  font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.stat-card .stat-num {
  font-family: 'Fraunces', serif;
  font-size: 38px; font-weight: 700;
  color: var(--navy); margin-top: 4px;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-size: 20px; color: var(--navy);
  margin: 36px 0 16px;
}

/* ---------- Pipeline bar ---------- */
.pipeline { display: flex; gap: 10px; flex-wrap: wrap; }
.pl-stage {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  flex: 1; min-width: 110px;
}
.pl-stage .pl-num { font-family:'Fraunces',serif; font-size: 26px; font-weight:700; }
.pl-stage .pl-name { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing:.07em; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th {
  background: var(--paper-2);
  text-align: left;
  padding: 13px 16px;
  font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf8f2; }
.row-link { text-decoration: none; color: var(--navy); font-weight: 600; }
.row-link:hover { color: var(--coral); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.b-new      { background: var(--paper-2); color: var(--ink-soft); }
.b-screening{ background: var(--amber-soft); color: var(--amber); }
.b-shortlist{ background: var(--green-soft); color: var(--green); }
.b-interview{ background: #dde6f5; color: var(--navy); }
.b-offer    { background: #dde6f5; color: var(--navy); }
.b-hired    { background: var(--green); color: #fff; }
.b-rejected { background: var(--coral-soft); color: var(--coral); }

.rec-invite { background: var(--green-soft); color: var(--green); }
.rec-review { background: var(--amber-soft); color: var(--amber); }
.rec-reject { background: var(--coral-soft); color: var(--coral); }

/* ---------- Score ---------- */
.score-pill {
  font-family: 'Fraunces', serif;
  font-weight: 700; font-size: 16px;
  padding: 3px 12px; border-radius: 8px;
  background: var(--paper-2); color: var(--navy);
}
.score-hi { background: var(--green); color: #fff; }
.score-mid{ background: var(--amber-soft); color: var(--amber); }
.score-lo { background: var(--coral-soft); color: var(--coral); }

.bar { height: 9px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--navy); border-radius: 999px; }

/* ---------- Forms ---------- */
form.stack { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
label { font-size: 13px; font-weight: 600; color: var(--ink); display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=number], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  background: var(--card);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--navy);
}
textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* ========= BUTTON STANDARD =========
   Default: xanh la nen, chu trang
   Hover:   chuyen sang do (coral)
   Apply cho ca .btn + .btn-coral (cho tat ca buttons)
   ==================================== */
.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--coral); color: #fff; }
/* btn-coral van la xanh la mac dinh (de hop ly chung) */
.btn-coral { background: var(--green); color: #fff; }
.btn-coral:hover { background: var(--coral); color: #fff; }
/* btn-ghost: vien xanh, hover chuyen do */
.btn-ghost {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-ghost:hover {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ===== GLOBAL BUTTON HOVER (cho cac nut inline style) =====
   Apply cho moi <button> + <a> co background style.
   filter: brightness 1.08 = sang hon 8% khi hover, work voi
   moi mau background. Box-shadow them feedback rõ ràng. */
button, input[type="submit"], input[type="button"] {
  transition: filter .15s ease, box-shadow .15s ease,
              transform .08s ease, opacity .15s ease;
}
button:hover:not(:disabled):not(.no-hover),
input[type="submit"]:hover:not(:disabled),
input[type="button"]:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
button:active:not(:disabled),
input[type="submit"]:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* Anchor tags styled as button: detect by inline background style.
   Apply transition de all anchor smooth hover. */
a[style*="background"]:not(.hrms-nav-item):not(.hrms-subnav-item) {
  transition: filter .15s ease, box-shadow .15s ease,
              transform .08s ease;
}
a[style*="background"]:not(.hrms-nav-item):not(.hrms-subnav-item):hover {
  filter: brightness(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.file-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  background: var(--card);
  color: var(--ink-soft);
}
.file-drop input { margin-top: 12px; }

/* ---------- Detail layout ---------- */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--ink-soft); }
.kv dd { color: var(--ink); font-weight: 500; }
.chip {
  display: inline-block; background: var(--paper-2);
  padding: 4px 10px; border-radius: 7px; font-size: 12.5px; margin: 0 5px 5px 0;
}
.note-list { list-style: none; }
.note-list li {
  padding: 8px 12px; border-radius: 8px; margin-bottom: 6px;
  font-size: 13.5px; background: var(--paper-2);
}
.note-ok { background: var(--green-soft) !important; color: var(--green); }
.note-fail { background: var(--coral-soft) !important; color: var(--coral); }

.alert {
  background: var(--coral-soft);
  border-left: 4px solid var(--coral);
  padding: 14px 18px; border-radius: 8px;
  font-size: 13.5px; margin-bottom: 18px;
}
.alert-ok { background: var(--green-soft); border-color: var(--green); }

.muted { color: var(--ink-soft); font-size: 13.5px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 14px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); background: var(--card);
}
.filter-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2, .detail-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .sidebar { width: 70px; }
  .brand-name, .brand-sub, .nav-item span, .ai-badge { display: none; }
}

/* ---------- Auth: login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px;
  width: 100%; max-width: 400px;
}
.login-brand {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 28px;
}

/* ---------- Auth: sidebar user box ---------- */
.user-box {
  background: rgba(255,255,255,.08);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.user-name { font-size: 13.5px; font-weight: 600; color: #fff; }
.user-role {
  display: inline-block;
  font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 4px;
  padding: 2px 8px; border-radius: 999px;
}
.foot-link {
  display: block;
  color: #aab2c4;
  text-decoration: none;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 7px;
}
.foot-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.foot-logout { color: #e9a48e; margin-bottom: 10px; }

/* role badges (dùng cả ở sidebar + bảng user) */
.role-admin   { background: #dde6f5; color: var(--navy); }
.role-hr      { background: var(--green-soft); color: var(--green); }
.role-manager { background: var(--amber-soft); color: var(--amber); }

/* ---------- Public careers page ---------- */
.public-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  padding: 28px 16px;
}
.public-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px;
  width: 100%; max-width: 480px;
}
.public-head { text-align: center; margin-bottom: 26px; }
.public-head .brand-mark { margin: 0 auto 16px; }
.public-head h1 {
  font-family: 'Fraunces', serif;
  font-size: 26px; color: var(--navy);
}
.public-head p {
  color: var(--ink-soft);
  font-size: 14px; margin-top: 8px;
}
/* Honeypot: an khoi mat nguoi that nhung bot van thay va dien */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Permission grid ---------- */
.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin-top: 8px;
}
.perm-item {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 500;
  padding: 8px 12px;
  background: var(--paper-2);
  border-radius: 8px;
  cursor: pointer;
}
.perm-item input { width: auto; margin: 0; cursor: pointer; }
.perm-item span { color: var(--ink); }
@media (max-width: 760px) {
  .perm-grid { grid-template-columns: 1fr; }
}

/* ---------- Logo image (khi co file logo cong ty) ---------- */
.brand-logo-img {
  width: auto;
  height: 42px;              /* mac dinh: vua o vuong, dung trong sidebar */
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
}
/* Logo trong sidebar: gioi han chieu cao co dinh cho thang hang voi chu */
.sidebar .brand-logo-img {
  height: 44px;
  width: 44px;
  background: #fff;          /* nen trang cho logo noi tren sidebar navy */
  padding: 4px;
}
/* Logo tren trang cong khai: to hon mot chut cho de nhin */
.public-lockup .brand-logo-img,
.login-brand .brand-logo-img { height: 48px; }

/* ---------- Public lockup: logo + ten App ben phai ---------- */
.public-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.public-lockup .lockup-text { text-align: left; }
.lockup-name {
  font-family: 'Fraunces', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}
.lockup-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .02em;
  margin-top: 3px;
}
/* h1 trang cong khai nho hon mot chut vi da co lockup phia tren */
.public-head h1 { font-size: 24px; }


/* ============================================================
   HRMS SHELL  (People Management System) - White sidebar
   Mau: --hrms-accent (xanh la MDS) tu theme.local.css
   ============================================================ */
.hrms { display: flex; min-height: 100vh; background: var(--hrms-bg, #f7faf9); }

.hrms-sidebar {
  width: 230px;
  background: #ffffff;
  border-right: 1px solid var(--line, #e9efed);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  flex-shrink: 0;
}
.hrms-brand {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 0 14px 20px;
}
/* Bo cuc DOC: logo o giua tren, ten app xuong dong duoi,
   tat ca can giua. Tranh vo dong xau khi ten dai. */
.hrms-brand-vertical {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 12px 22px;
  gap: 10px;
}
.hrms-brand-vertical .hrms-brand-text {
  width: 100%;
}
.hrms-brand-text { line-height: 1.3; min-width: 0; flex: 1; }
.hrms-brand-name {
  color: var(--ink, #1a2332); font-size: 15px; font-weight: 700;
  white-space: normal; overflow-wrap: break-word;
  word-break: normal; line-height: 1.3;
}
.hrms-brand-sub {
  color: var(--ink-soft, #5a6577); font-size: 11px;
  margin-top: 4px;
}
.hrms-brand-vertical .brand-logo-img {
  max-width: 46px; height: auto !important;
  object-fit: contain; display: block; margin: 0 auto;
}
.hrms-brand .brand-logo-img { max-width: 34px; height: auto !important; object-fit: contain; flex-shrink: 0; }

.hrms-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 10px; flex: 1; }
.hrms-nav-item {
  color: var(--ink-soft, #5a6577);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  /* Khong cho menu item wrap xuong dong - dung ellipsis neu dai */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hrms-nav-item i { font-size: 17px; width: 18px; text-align: center;
                    flex-shrink: 0; }
.hrms-nav-item:hover { background: var(--hrms-soft, #f0f6f3); color: var(--ink, #1a2332); }
.hrms-nav-item:focus { outline: none; }
.hrms-nav-item:focus:not(.on) {
  background: transparent;
}
.hrms-nav-item.on {
  background: var(--hrms-soft, #e7f4ef);
  color: var(--hrms-accent, #0f6e56);
  font-weight: 600;
}
.hrms-nav-item.soon { color: #9aa4ae; cursor: default; }
.hrms-nav-item.soon:hover { background: none; color: #9aa4ae; }
.hrms-subnav-item:focus { outline: none; }
.hrms-subnav-item:focus:not(.on) {
  background: transparent;
}

/* Sub-menu (muc con) cua Recruitment - thut vao, nho hon
   muc cha mot chut nhung van du ro de doc */
.hrms-subnav {
  display: flex; flex-direction: column; gap: 1px;
  margin: 2px 0 4px 0; padding-left: 26px;
  border-left: 2px solid var(--line, #e2e8e5);
  margin-left: 19px;
}
.hrms-subnav-item {
  color: var(--ink-soft, #5a6577);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 7px;
  text-decoration: none;
  display: block;
  /* Sub-menu cung khong wrap - dai thi ellipsis */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hrms-subnav-item:hover {
  background: var(--hrms-soft, #f0f6f3);
  color: var(--ink, #1a2332);
}
.hrms-subnav-item.on {
  background: var(--hrms-soft, #e7f4ef);
  color: var(--hrms-accent, #0f6e56);
  font-weight: 600;
}
.soon-tag {
  margin-left: auto;
  font-size: 9.5px;
  background: #f0f2f1;
  color: #9aa4ae;
  padding: 1px 7px;
  border-radius: 4px;
}
.hrms-nav-foot { margin-top: auto; padding-top: 8px; }
.hrms-nav-foot .hrms-nav-item {
  border-top: 1px solid var(--line, #eef2f0);
  border-radius: 0;
  margin-top: 4px;
  padding-top: 13px;
}

.hrms-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.hrms-topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--line, #e9efed);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  flex-shrink: 0;
}
.hrms-search {
  flex: 1; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  background: #ffffff;
  border: 1px solid var(--line, #e2e8e5);
  border-radius: 8px;
  padding: 0 14px;
  height: 36px;
}
.hrms-search-ico { color: #9aa4ae; font-size: 15px; }
.hrms-search input {
  border: none; background: none; outline: none;
  font-size: 13px; color: var(--ink, #1a2332);
  width: 100%; height: 100%;
}
.hrms-search input::placeholder { color: #9aa4ae; }

.hrms-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.hrms-bell-wrap { position: relative; }
.hrms-bell {
  font-size: 18px; color: var(--ink-soft, #5a6577);
  text-decoration: none; background: none; border: none;
  cursor: pointer; padding: 4px; position: relative;
  display: flex; align-items: center;
}
.hrms-bell-badge {
  position: absolute; top: -3px; right: -4px;
  background: var(--coral, #d85a30); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; display: flex;
  align-items: center; justify-content: center;
}
.hrms-bell-menu {
  position: absolute; top: 38px; right: 0;
  background: #fff; border: 1px solid var(--line, #e9efed);
  border-radius: 10px; width: 320px; max-height: 420px;
  overflow-y: auto; display: none; z-index: 60;
  box-shadow: 0 6px 22px rgba(0,0,0,.10);
}
.hrms-bell-menu.open { display: block; }
.hrms-bell-head {
  font-size: 13px; font-weight: 700; color: var(--ink, #1a2332);
  padding: 12px 14px; border-bottom: 1px solid var(--line, #e9efed);
}
.hrms-bell-empty {
  font-size: 13px; color: var(--ink-soft, #5a6577);
  padding: 18px 14px; text-align: center;
}
.hrms-bell-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; text-decoration: none;
  border-bottom: 1px solid var(--line, #f0f3f2);
  color: var(--ink, #1a2332);
  position: relative;
  transition: background .15s;
}
.hrms-bell-item:hover { background: var(--hrms-soft, #f4f7f6); }
.hrms-bell-item i { font-size: 16px; color: var(--hrms-accent, #0f6e56); margin-top: 2px; }
.hrms-bell-item span { display: flex; flex-direction: column; gap: 2px; }
.hrms-bell-item strong { font-size: 13px; font-weight: 600; }
.hrms-bell-item small { font-size: 11.5px; color: var(--ink-soft, #5a6577); }

/* UNREAD STATE - highlight notif chua doc */
.hrms-bell-item.unread {
  background: linear-gradient(90deg, #e7f4ef 0%, #f7faf9 100%);
  border-left: 3px solid var(--hrms-accent, #0f6e56);
  padding-left: 11px;  /* compensate border 3px */
}
.hrms-bell-item.unread strong {
  font-weight: 700;
  color: #0f6e56;
}
.hrms-bell-item.unread:hover {
  background: linear-gradient(90deg, #d4ebdf 0%, #eef5f2 100%);
}

/* LEVEL-BASED COLOR - phan biet success/danger/info/warning
   Stick mau ben trai + mau text + mau icon dong bo.
   Dung !important de override theme custom (vd cam) */
.hrms-bell-item.level-success {
  border-left: 3px solid #137a40 !important;
  padding-left: 11px;
}
.hrms-bell-item.level-success strong { color: #137a40 !important; }
.hrms-bell-item.level-success i { color: #137a40 !important; }
.hrms-bell-item.level-success.unread {
  background: linear-gradient(90deg, #e3f6ec 0%, #f7faf9 100%);
}
.hrms-bell-item.level-success.unread:hover {
  background: linear-gradient(90deg, #c9efd8 0%, #eef5f2 100%);
}

.hrms-bell-item.level-danger {
  border-left: 3px solid #c0392b !important;
  padding-left: 11px;
}
.hrms-bell-item.level-danger strong { color: #c0392b !important; }
.hrms-bell-item.level-danger i { color: #c0392b !important; }
.hrms-bell-item.level-danger.unread {
  background: linear-gradient(90deg, #fdeaea 0%, #fbf6f5 100%);
}
.hrms-bell-item.level-danger.unread:hover {
  background: linear-gradient(90deg, #f9d6d3 0%, #f5ebe9 100%);
}

.hrms-bell-item.level-warning {
  border-left: 3px solid #e67e22 !important;
  padding-left: 11px;
}
.hrms-bell-item.level-warning strong { color: #d35400 !important; }
.hrms-bell-item.level-warning i { color: #e67e22 !important; }

/* Dot xanh ben phai cho unread item */
.hrms-bell-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c0392b;
  box-shadow: 0 0 0 2px #fff;
}
.hrms-account {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  cursor: pointer;
}
.hrms-avatar {
  width: 33px; height: 33px; border-radius: 50%;
  background: var(--hrms-soft, #e7f4ef);
  color: var(--hrms-accent, #0f6e56);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12.5px;
  flex-shrink: 0;
}
.hrms-account-meta { line-height: 1.2; }
.hrms-account-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink, #1a2332);
  white-space: nowrap;
}
.hrms-account-role {
  font-size: 10px;
  padding: 0 6px; border-radius: 4px;
  display: inline-block; margin-top: 2px;
  text-transform: uppercase; letter-spacing: .03em;
}
.hrms-account {
  position: relative;
}
.hrms-account-menu {
  position: absolute;
  top: 100%; right: 0;
  background: #fff;
  border: 1px solid var(--line, #e9efed);
  border-radius: 9px;
  padding: 6px;
  min-width: 150px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  /* Cau noi vo hinh phia tren tranh menu bien mat khi
     re chuot tu avatar xuong menu */
  margin-top: 0;
}
.hrms-account-menu::before {
  content: "";
  position: absolute;
  top: -10px; left: 0; right: 0;
  height: 10px;
}
.hrms-account:hover .hrms-account-menu,
.hrms-account-menu:hover { display: flex; }
.hrms-account-menu a {
  font-size: 13px;
  color: var(--ink-soft, #5a6577);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}
.hrms-account-menu a:hover { background: var(--hrms-soft, #f4f7f6); }
.hrms-account-menu a.danger { color: var(--coral, #d85a30); }

.hrms-content {
  flex: 1;
  padding: 22px 24px;
  background: var(--hrms-bg, #f7faf9);
  overflow-x: hidden;
}

@media (max-width: 900px) {
  .hrms-sidebar { width: 60px; }
  .hrms-brand-text,
  .hrms-nav-item span:not(.soon-tag),
  .soon-tag { display: none; }
  .hrms-account-meta { display: none; }
}

/* ============================================================
   MOBILE: tablet nho + dien thoai (max-width 640px)
   - An sidebar mac dinh, mo bang hamburger button
   - Content full width, padding nho
   - Grid 2 cot -> 1 cot
   - Bang dai -> scroll ngang trong khung
   ============================================================ */
@media (max-width: 640px) {
  /* Sidebar an dau, slide-in khi mo */
  .hrms-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,.15);
    padding-top: 56px;
  }
  .hrms-sidebar.open {
    transform: translateX(0);
  }
  /* Khi sidebar open thi text/label hien lai */
  .hrms-sidebar.open .hrms-brand-text,
  .hrms-sidebar.open .hrms-nav-item span:not(.soon-tag),
  .hrms-sidebar.open .soon-tag,
  .hrms-sidebar.open .hrms-account-meta { display: inline; }

  /* Backdrop khi sidebar mo */
  .hrms-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 999;
    display: none;
  }
  .hrms-backdrop.show { display: block; }

  /* Nut hamburger (chi hien tren mobile) */
  .hrms-menu-btn {
    display: inline-flex !important;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 1001;
    width: 38px; height: 38px;
    background: #fff;
    border: 1px solid var(--line, #e9efed);
    border-radius: 8px;
    align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
  }
  .hrms-menu-btn i { font-size: 22px; color: var(--ink, #1c2733); }

  /* Content full width, padding nho hon */
  .hrms-main { padding-top: 56px; }
  .hrms-content { padding: 14px 12px !important; }

  /* Topbar: don gian hoa */
  .hrms-topbar {
    padding-left: 60px !important;
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .hrms-search-wrap { max-width: 100% !important; flex: 1 1 100%; order: 3; }
  .hrms-account { order: 2; }

  /* Tieu de + KPI co lai */
  .dash-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash-head h1 { font-size: 18px; }
  .page-head h1 { font-size: 20px; }

  /* KPI 4 cot -> 2 cot */
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-card { padding: 11px; }
  .kpi-card .v { font-size: 20px !important; }

  /* Grid 2 cot -> 1 cot */
  .grid-2,
  .detail-grid,
  .kpi-pair { grid-template-columns: 1fr !important; }

  /* Card padding nho hon */
  .card { padding: 14px !important; }
  .card-title { font-size: 14px; }

  /* Bang dai: scroll ngang ngot, font nho lai */
  table { font-size: 12.5px; }
  .card > table,
  .hrms-content > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  th, td { padding: 8px 6px !important; }

  /* Account menu hover -> tap (lon hon, de bam) */
  .hrms-account { padding: 6px 8px !important; }
  .hrms-avatar {
    width: 34px !important; height: 34px !important;
    font-size: 13px !important;
  }

  /* Form input: lon hon de de bam */
  input[type=text], input[type=email], input[type=password],
  input[type=date], input[type=number], select, textarea {
    font-size: 16px !important; /* tranh iOS auto-zoom */
    padding: 10px !important;
  }

  /* Button group: stack doc */
  .btn-row,
  .form-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn,
  .form-row .btn { width: 100%; box-sizing: border-box; }

  /* An cot Ngay sinh, dia chi tren mobile o bang nhan vien
     (de save space) - them class .col-mobile-hide khi can */
  .col-mobile-hide { display: none !important; }
}

/* Nut hamburger an tren desktop */
.hrms-menu-btn { display: none; }

/* ===== Dashboard (phong cach moi) ===== */
.dash-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.dash-head h1 { font-size: 20px; }

.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 14px;
}
.kpi-card {
  background: #fff; border: 0.5px solid var(--line, #e9efed);
  border-radius: 11px; padding: 15px;
}
.kpi-top { margin-bottom: 8px; }
.kpi-ico {
  font-size: 20px; color: var(--hrms-accent, #0f6e56);
  background: var(--hrms-soft, #e7f4ef);
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.kpi-label { font-size: 12px; color: var(--ink-soft, #5a6577); }
.kpi-num { font-size: 23px; font-weight: 600; color: var(--ink, #1a2332); margin: 4px 0; }
.kpi-num.muted-num { color: #9aa4ae; }
.kpi-sub { font-size: 11px; }
.kpi-sub.up { color: var(--hrms-accent, #0f6e56); }
.kpi-sub.muted { color: #9aa4ae; }

.dash-grid {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr;
  gap: 12px;
}
.card-title { font-size: 13.5px; font-weight: 600; color: var(--ink, #1a2332); margin-bottom: 12px; }

.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-item {
  background: var(--hrms-soft, #f4f7f6);
  border-radius: 9px; padding: 13px 8px;
  text-align: center; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.qa-item i { font-size: 19px; color: var(--hrms-accent, #0f6e56); }
.qa-item span { font-size: 11px; color: var(--ink-soft, #5a6577); }
.qa-item:hover { background: var(--hrms-soft, #e7f4ef); }
.qa-item.disabled { opacity: .55; cursor: default; }
.qa-item.disabled i, .qa-item.disabled span { color: #9aa4ae; }

.pl-bars { display: flex; flex-direction: column; gap: 9px; }
.pl-bar-head {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--ink-soft, #5a6577); margin-bottom: 4px;
}
.pl-bar-track { height: 6px; background: #eef2f0; border-radius: 4px; }
.pl-bar-fill { height: 100%; border-radius: 4px; background: var(--hrms-accent, #0f6e56); }
.pl-bar-fill.st-new { background: #85b7eb; }
.pl-bar-fill.st-screening { background: #378add; }
.pl-bar-fill.st-shortlist { background: #1d9e75; }
.pl-bar-fill.st-interview { background: #ba7517; }
.pl-bar-fill.st-offer { background: #534ab7; }
.pl-bar-fill.st-hired { background: #0f6e56; }
.pl-bar-fill.st-rejected { background: #d85a30; }

.empty-block {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 9px; height: 130px;
  color: #9aa4ae; text-align: center;
}
.empty-block i { font-size: 28px; }
.empty-block div { font-size: 11.5px; line-height: 1.6; }

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ===== Login dang 2 cot: anh trai - form phai ===== */
.login-split {
  display: flex;
  min-height: 100vh;
}
.login-visual {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--hrms-accent, #0c5d49);
}
.login-visual img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  position: absolute; inset: 0;
}
.login-visual-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(12,93,73,0.05) 0%,
    rgba(12,93,73,0.55) 100%);
  display: flex; align-items: flex-end;
  padding: 48px;
}
.login-visual-text { color: #fff; }
.lv-title {
  font-family: var(--font-serif, 'Fraunces', serif);
  font-size: 30px; font-weight: 600;
  margin-bottom: 6px;
}
.lv-sub { font-size: 15px; opacity: .92; }

.login-form-side {
  width: 460px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card, #fff);
  padding: 40px;
}
.login-box { width: 100%; max-width: 340px; }
.login-box .login-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.login-box .brand-logo-img {
  max-width: 46px; height: auto !important; object-fit: contain;
}
.login-brand-name {
  font-size: 16px; font-weight: 600; color: var(--ink, #18241f);
}
.login-brand-sub {
  font-size: 12px; color: var(--ink-soft, #566660); margin-top: 2px;
}
.login-title {
  font-family: var(--font-serif, 'Fraunces', serif);
  font-size: 26px; color: var(--navy, #0c5d49);
  margin-bottom: 6px;
}
.login-desc {
  font-size: 13.5px; color: var(--ink-soft, #566660);
  margin-bottom: 24px;
}

@media (max-width: 820px) {
  .login-visual { display: none; }
  .login-form-side { width: 100%; }
}

/* ===== Contract progress bar (dai mau muot trang->vang->do) ===== */
.ct-prog-wrap { margin-top: 10px; max-width: 420px; }
.ct-prog-head {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--ink-soft);
  margin-bottom: 5px;
}
.ct-prog-track {
  height: 9px; border-radius: 6px;
  background: #eef2f0;
  overflow: hidden;
  position: relative;
}
.ct-prog-fill {
  height: 100%;
  border-radius: 6px;
  /* dai mau muot: trang/xanh nhat -> vang -> do */
  background: linear-gradient(90deg,
     #d6ebe3 0%, #f4e7b8 55%, #f0b48a 80%, #d9603a 100%);
  background-size: 420px 100%;
  background-repeat: no-repeat;
  transition: width .4s ease;
}
.ct-prog-expired .ct-prog-fill {
  background: #d9603a;
}
.ct-prog-none {
  font-size: 12px; color: var(--ink-soft);
  font-style: italic; margin-top: 8px;
}

/* ===== Chuan: dau * cho field bat buoc (mau do) ===== */
.req, .required-star {
  color: #e0322e !important;
  font-weight: 700;
  margin-left: 2px;
}
/* Thong bao hoan tat action (toast/banner) */
.action-done {
  background: #e7f6ee; border: 1px solid #1f9d57;
  color: #137a40; padding: 11px 16px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.action-done::before { content: "✓"; font-size: 16px; }

/* ===== Status badge nhan vien: Active/Inactive/Pending ===== */
.st-badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.st-active   { background: #e3f6ec; color: #137a40; }
.st-inactive { background: #fde8e6; color: #c5372f; }
.st-pending  { background: #fdf3d6; color: #9a6a00; }

/* ===== Stage badge moi (pipeline tuyen dung) ===== */
.st-stage-hr_review        { background:#fdf3d6; color:#9a6a00; }
.st-stage-passed_screening { background:#e3f0fb; color:#1763a6; }
.st-stage-interview        { background:#e8e3fb; color:#5b3da6; }
.st-stage-passed_interview { background:#dfecdc; color:#2d6e1f; }
.st-stage-offer            { background:#fde9d6; color:#a6601f; }
.st-stage-hired            { background:#e3f6ec; color:#137a40; }
.st-stage-probation        { background:#fff4d6; color:#7a5300; }
.st-stage-confirmed        { background:#d6eef6; color:#0b5a73; font-weight:600; }
.st-stage-rejected         { background:#fde8e6; color:#c5372f; }

/* ========== CUSTOM CONFIRM MODAL ==========
   Thay browser confirm() bang dialog dep, su dung qua
   helper appConfirm(message, callback) trong base.html.
   ============================================ */
.app-confirm-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 24, 30, 0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
}
.app-confirm-backdrop.show { display: flex; }
.app-confirm-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
  font-family: inherit;
}
.app-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.app-confirm-msg {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  line-height: 1.5;
}
.app-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.app-confirm-actions .btn {
  min-width: 100px;
  padding: 8px 18px;
}
