:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-strong: #eef4f1;
  --line: #dbe5e1;
  --text: #17211d;
  --muted: #66746e;
  --primary: #14735f;
  --primary-dark: #0c5748;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow: 0 18px 50px rgba(16, 44, 36, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: 40px;
  padding: 48px clamp(20px, 7vw, 96px);
}

.brand-panel {
  max-width: 560px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 30px;
  box-shadow: var(--shadow);
}

.brand-mark.compact {
  width: 42px;
  height: 42px;
  font-size: 21px;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 22px;
}

.muted,
.helper-text {
  color: var(--muted);
  line-height: 1.6;
}

.login-card,
.content-panel,
.dialog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: #31413b;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdcd7;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 95, 0.14);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.ghost-button {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.icon-button {
  width: 40px;
  padding: 0;
  background: var(--surface-strong);
  color: var(--text);
}

.helper-text {
  margin-bottom: 0;
  font-size: 13px;
}

.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: #10251f;
  color: #fff;
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-row span {
  display: block;
  margin-top: 3px;
  color: #a9beb7;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  display: block;
  border-radius: 6px;
  color: #d7e6e1;
  padding: 11px 12px;
  text-decoration: none;
}

nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar .ghost-button {
  margin-top: auto;
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stats-grid article {
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.content-panel {
  overflow: hidden;
}

.panel-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  position: relative;
  overflow-x: auto;
}

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

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.actions-col {
  width: 230px;
}

.employee-name {
  display: grid;
  gap: 3px;
}

.employee-name strong {
  font-size: 15px;
}

.employee-name span {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active {
  background: #dff4eb;
  color: #0b5f4b;
}

.status-pill.inactive {
  background: #f8e6e3;
  color: var(--danger);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.row-actions .danger {
  color: var(--danger);
}

.empty-state {
  padding: 40px 18px;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(13, 31, 26, 0.45);
}

.dialog-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dialog-card header,
.dialog-card footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.dialog-card footer {
  justify-content: flex-end;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  background: #10251f;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
}

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .sidebar nav {
    flex: 1;
  }

  .sidebar .ghost-button {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .login-view,
  .workspace {
    padding: 20px;
  }

  .brand-panel {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }

  .topbar,
  .panel-toolbar,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
