/* LeaveHub - responsive stylesheet, no external assets */
:root {
  --navy: #102a43;
  --navy-dark: #0b1f33;
  --blue: #1f6feb;
  --blue-light: #e8f1ff;
  --bg: #f4f6fb;
  --text: #1b2733;
  --muted: #5b6b7c;
  --border: #d6dee8;
  --green: #1a7f4b;
  --green-bg: #e3f6ec;
  --amber: #9a6700;
  --amber-bg: #fff5d6;
  --red: #b42318;
  --red-bg: #fde8e6;
  --gray-bg: #eceff3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
}
.topbar .brand a { color: #fff; font-size: 20px; font-weight: 700; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.topbar nav a { color: #d7e3f4; padding: 4px 8px; border-radius: 6px; }
.topbar nav a:hover { background: var(--navy-dark); text-decoration: none; }
.topbar nav a.active { background: var(--blue); color: #fff; }
.user-email { color: #9fb6d4; font-size: 13px; margin-left: 8px; }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px 40px; }

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 14px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat-value { font-size: 26px; font-weight: 700; margin: 0; }
.card-neutral { border-top: 4px solid var(--navy); }
.card-approved { border-top: 4px solid var(--green); }
.card-pending { border-top: 4px solid var(--amber); }
.card-remaining { border-top: 4px solid var(--blue); }

.auth-card { max-width: 460px; margin: 24px auto; }

.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
input, select, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-light); border-color: var(--blue); }

.button {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.button:hover { background: #1a5fd0; text-decoration: none; }
.button.secondary { background: #fff; color: var(--navy); border-color: var(--border); }
.button.danger { background: #fff; color: var(--red); border-color: var(--red); }
.button.danger:hover { background: var(--red-bg); }
.link-button { background: none; border: none; color: #d7e3f4; cursor: pointer; font: inherit; padding: 4px 8px; }
.link-button:hover { background: var(--navy-dark); border-radius: 6px; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.filter-form { margin-bottom: 14px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--navy); color: #fff; font-size: 13px; }
.table tr:hover td { background: #f8fafd; }
.admin-form { min-width: 220px; }
.admin-form input, .admin-form select { padding: 5px 7px; font-size: 13px; }
.decide-inline input[type="text"] { width: 170px; }
.decide-form { margin-top: 10px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending { background: var(--amber-bg); color: var(--amber); }
.badge-approved { background: var(--green-bg); color: var(--green); }
.badge-rejected { background: var(--red-bg); color: var(--red); }
.badge-cancelled { background: var(--gray-bg); color: var(--muted); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash-ok { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.flash-error { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.field-error { color: var(--red); font-size: 13px; margin: -4px 0 0; font-weight: 600; }

.details { display: grid; grid-template-columns: 190px 1fr; gap: 6px 12px; margin: 0; }
.details dt { color: var(--muted); font-weight: 600; }
.details dd { margin: 0; }
.pre { white-space: pre-wrap; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 3px solid var(--border); }
.timeline li { margin-bottom: 10px; padding-left: 10px; }
.event-label { font-weight: 700; }

.pagination { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; font-size: 14px; }
.page-info { color: var(--muted); }

.quota-inline p { margin: 0; }
.error-card { max-width: 560px; margin: 40px auto; text-align: center; }
.error-card h1 { font-size: 52px; color: var(--navy); }

.server-now { color: #d7e3f4; font-size: 13px; margin-left: 8px; white-space: nowrap; }
.today-row td { background: #e8f1ff; font-weight: 600; }
.today-card .stat-value { font-size: 22px; margin-bottom: 2px; }
.month-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.month-nav strong { color: var(--navy); }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; }

@media (max-width: 720px) {
  .details { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
  .topbar { padding: 10px 12px; }
  main { padding: 0 10px 30px; }
}

.schedule-module { text-transform: uppercase; }

/* v2.2: Lịch làm việc tuần - in ấn gọn */
@media print {
  header.topbar, footer, .week-nav, .page-head .button { display: none !important; }
  body { background: #fff; }
  .weekly-table { width: 100%; font-size: 10px; }
  .weekly-table th, .weekly-table td { border: 1px solid #333; padding: 2px 4px; }
  .leave-flag { font-weight: 700; }
}

/* v1.7 Z2: tên lịch chưa có tài khoản -> đỏ đậm */
.unmapped-name { color: #b42318; font-weight: 700; }
option:disabled { color: #b42318; }

/* v1.6 W3: toàn bộ dữ liệu hiển thị IN HOA; email/password không đổi dữ liệu. */
main { text-transform: uppercase; }
main input[type='text'], main input[type='search'], main textarea {
  text-transform: uppercase;
}
main input[type='password'], main input[type='email'], main input[type='url'] {
  text-transform: none;
}

/* v2.6: XNVL - giao diện hoạt hình chủ đề xét nghiệm y học (teal/cyan) */
:root {
  --navy: #0f766e;
  --navy-dark: #115e59;
  --blue: #0d9488;
  --blue-light: #ccfbf1;
  --bg: #f0fdfa;
  --text: #134e4a;
  --muted: #0f766e;
  --border: #99f6e4;
  --green: #0f766e;
  --green-bg: #ccfbf1;
  --amber: #9a6700;
  --amber-bg: #fef3c7;
  --red: #b42318;
  --red-bg: #fee4e2;
  --gray-bg: #ecfdf5;
}
body {
  background:
    radial-gradient(circle at 8% 4%, #ccfbf1 0, transparent 38%),
    radial-gradient(circle at 92% 0, #cffafe 0, transparent 34%),
    var(--bg);
}
.topbar {
  background: linear-gradient(120deg, #0f766e, #0891b2);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 6px 20px rgba(8, 145, 178, .22);
}
.topbar .brand a { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo {
  width: 34px;
  height: 34px;
  padding: 3px;
  border-radius: 12px;
  background: #fff;
  vertical-align: middle;
}
.topbar nav a { border-radius: 999px; padding: 6px 12px; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255, 255, 255, .2); }
.card {
  border-radius: 18px;
  border-color: #bdf3e9;
  box-shadow: 0 10px 26px rgba(13, 148, 136, .09);
}
.card-neutral { border-top: 4px solid #0891b2; }
.card-approved { border-top: 4px solid #0d9488; }
.card-pending { border-top: 4px solid #f59e0b; }
.card-remaining { border-top: 4px solid #67e8f9; }
.button {
  background: linear-gradient(135deg, #0d9488, #0891b2);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(8, 145, 178, .22);
}
.button:hover { background: linear-gradient(135deg, #0f766e, #0e7490); }
.button.secondary {
  background: #fff;
  color: #0f766e;
  border: 1px solid #99f6e4;
  box-shadow: none;
}
.button.danger { background: #fff; color: var(--red); border: 1px solid #fda29b; }
input, select, textarea { border-radius: 12px; border-color: #bdf3e9; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid #99f6e4;
  border-color: #0d9488;
}
.table th { background: linear-gradient(120deg, #0f766e, #0891b2); }
.table tbody tr:nth-child(even) td { background: #f0fdfa; }
.table tr:hover td { background: #ccfbf1; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #ccfbf1; color: #0f766e; }
.badge-rejected { background: #fee4e2; color: #b42318; }
.badge-cancelled { background: #ecfdf5; color: #115e59; }
.flash { border-radius: 14px; }
.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  max-width: 980px;
  margin: 22px auto;
}
.login-wrap .auth-card { width: 100%; max-width: none; margin: 0; }
.login-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(13, 148, 136, .14);
}
.hero-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: linear-gradient(120deg, #e6fffb, #ecfeff);
  border: 1px solid #bdf3e9;
  box-shadow: 0 10px 26px rgba(13, 148, 136, .1);
  overflow: hidden;
}
.hero-banner-img {
  width: min(46%, 440px);
  height: auto;
  border-radius: 16px;
  display: block;
}
.hero-copy h1 { margin-bottom: 4px; }
.empty-state { text-align: center; padding: 20px 10px; text-transform: none; }
.empty-state img { width: min(150px, 40vw); height: auto; opacity: .95; }
.empty-state p { margin: 8px 0 0; }
.week-nav .button { margin: 2px 0; }
.schedule-module { text-transform: uppercase; }

@media (max-width: 720px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-hero { order: -1; }
  .hero-banner { flex-direction: column; align-items: flex-start; }
  .hero-banner-img { width: 100%; }
  .topbar { border-radius: 0 0 14px 14px; }
}
@media (max-width: 380px) {
  .topbar { padding: 8px 10px; }
  .topbar .brand a { font-size: 18px; }
  .card { padding: 14px 12px; border-radius: 14px; }
  main { padding: 0 8px 24px; }
  .table { font-size: 13px; }
}

@media print {
  .hero-banner, .login-hero, .empty-state img, .brand-logo {
    display: none !important;
  }
  body { background: #fff; }
}
