:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #1f2937;
  --primary-soft: #f9fafb;
  --accent: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  background: linear-gradient(135deg, #111827, #374151);
  color: white;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand > div {
  margin-left: 1cm;
}

.brand-logo {
  width: 170px;
  height: auto;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 .35rem;
  color: #d1d5db;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
}

h1 {
  margin: 0;
  font-size: 2rem;
}

.tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.tab,
button {
  border: 0;
  border-radius: 999px;
  padding: .75rem 1rem;
  cursor: pointer;
  font-weight: 700;
}

.tab {
  background: rgba(255, 255, 255, .12);
  color: white;
}

.tab.active {
  background: white;
  color: #111827;
}

.tabs-separator {
  width: 1px;
  height: 38px;
  background: rgba(255, 255, 255, .35);
  margin: 0 .75rem;
}

.modification-nav-button {
  background: #ffffff;
  color: #111827;
  border: 2px solid rgba(255, 255, 255, .55);
}

.modification-nav-button:hover {
  background: #f3f4f6;
}

main {
  padding: 2rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.toolbar,
.actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

input,
select {
  border: 1px solid var(--border);
  background: white;
  border-radius: 12px;
  padding: .8rem 1rem;
  min-width: 220px;
  font-size: .95rem;
}

#employee-search {
  flex: 1 1 420px;
  min-width: 320px;
}

button {
  background: var(--primary);
  color: white;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.meta {
  color: var(--muted);
  margin: 1rem 0;
  font-weight: 700;
}

.table-wrap {
  background: white;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: auto;
  box-shadow: 0 16px 35px rgba(15, 23, 42, .06);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}

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

th {
  background: var(--primary-soft);
  position: sticky;
  top: 0;
  cursor: pointer;
  white-space: nowrap;
}

td {
  font-size: .92rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.subsidiary-detail {
  margin-top: 1.5rem;
}

.subsidiary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.subsidiary-sheet {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.75rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .07);
}

.subsidiary-sheet-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.subsidiary-sheet-header h2 {
  margin: 0;
  font-size: 1.35rem;
  color: #111827;
}

.subsidiary-sheet-header p {
  margin: .45rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.subsidiary-sections {
  display: grid;
  gap: 1.25rem;
}

.subsidiary-sections section {
  background: #f9fafb;
  border: 1px solid #eef2f7;
  border-radius: 16px;
  padding: 1rem;
}

.subsidiary-sections h3 {
  margin: 0 0 .85rem;
  font-size: 1rem;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.subsidiary-sections dl {
  margin: 0;
  display: grid;
  gap: .65rem;
}

.subsidiary-sections dl div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: .75rem;
  align-items: baseline;
}

.subsidiary-sections dt {
  color: var(--muted);
  font-weight: 700;
}

.subsidiary-sections dd {
  margin: 0;
  color: #111827;
}

.subsidiary-sections dd a {
  color: var(--accent);
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: white;
  width: min(620px, 100%);
  border-radius: 22px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
}

.modal-card h2 {
  margin-top: 0;
}

.modal-help {
  color: var(--muted);
  font-weight: 700;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
}

#modification-form {
  display: grid;
  gap: 1rem;
}

#modification-form label {
  display: grid;
  gap: .35rem;
  font-weight: 700;
}

#modification-form textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem 1rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .95rem;
  resize: vertical;
}

#modification-status {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 700px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand > div {
    margin-left: 0;
  }

  .brand-logo {
    width: 130px;
  }

  main {
    padding: 1rem;
  }

  input,
  select {
    width: 100%;
  }

  .tabs-separator {
    display: none;
  }

  .subsidiary-list {
    grid-template-columns: 1fr;
  }

  .subsidiary-sections dl div {
    grid-template-columns: 1fr;
    gap: .2rem;
  }
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }

  main {
    padding: 0;
  }

  .table-wrap,
  .subsidiary-sheet {
    box-shadow: none;
    border: none;
  }

  table {
    min-width: 0;
    font-size: 10px;
  }

  th,
  td {
    padding: 4px;
  }
}

#employee-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

#employee-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

#employee-table tbody tr:hover {
  background: #dbeafe;
}

#employee-table tbody tr:hover td {
  color: #111827;
}
