:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --line: #d8e0ec;
  --text: #1b2d53;
  --muted: #5b6f94;
  --accent: #75c4ba;
  --accent-strong: #58a89f;
  --brand: #1b2d53;
  --brand-strong: #142343;
  --topbar-link: #f1f6ff;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --info-bg: #dbeafe;
  --info-text: #1e3a8a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-strong);
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  background: var(--brand);
  border-bottom: 4px solid var(--accent);
  box-shadow: 0 8px 18px rgba(27, 45, 83, 0.16);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  gap: 1.2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  display: block;
  width: auto;
  height: 44px;
  background: #fff;
  border-radius: 10px;
  padding: 0.25rem 0.45rem;
}

.brand-app {
  display: inline-block;
  border-left: 1px solid rgba(255, 255, 255, 0.32);
  padding-left: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav a {
  text-decoration: none;
  color: var(--topbar-link);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(117, 196, 186, 0.55);
  color: #fff;
}

.main {
  padding: 1.25rem 0 2rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid > * {
  min-width: 0;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hr-review-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}

.hr-review-layout-empty {
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 7px 18px rgba(27, 45, 83, 0.06);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--line);
  background: #f9fafb;
  color: #374151;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 10px;
}

.flash-error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash-info {
  background: var(--info-bg);
  color: var(--info-text);
}

form {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(117, 196, 186, 0.45);
  outline-offset: 1px;
  border-color: var(--accent);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

button:hover,
.btn:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn-secondary {
  background: #fff;
  color: var(--brand);
  border-color: #c8d4e8;
}

.btn-secondary:hover {
  background: #eef3fb;
}

.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-small {
  padding: 0.35rem 0.62rem;
  font-size: 0.86rem;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.4rem 0.8rem;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
}

.check-item input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
}

.manage-item {
  margin-bottom: 0.75rem;
}

.manage-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 640px;
}

.hr-request-list td:first-child {
  white-space: nowrap;
}

.hr-request-list th:nth-child(3),
.hr-request-list td:nth-child(3),
.hr-request-list th:nth-child(5),
.hr-request-list td:nth-child(5) {
  white-space: nowrap;
}

.hr-request-list th:nth-child(5),
.hr-request-list td:nth-child(5) {
  width: 1%;
}

th,
td {
  padding: 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  font-size: 0.92rem;
  color: #334a74;
  background: #f0f5fb;
}

.status {
  text-transform: lowercase;
}

details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  background: #fff;
}

summary {
  font-weight: 600;
  cursor: pointer;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.65rem;
}

@media (max-width: 860px) {
  .topbar-inner {
    min-height: 70px;
    padding: 0.65rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .hr-review-layout {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    height: 38px;
  }

  .brand-app {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
    padding-left: 0;
    padding-top: 0.25rem;
  }
}

@media (max-width: 1120px) {
  .hr-review-layout {
    grid-template-columns: 1fr;
  }
}
