:root {
  --green: #5ecb67;
  --green-dark: #269542;
  --ink: #20211f;
  --ink-soft: #2c302b;
  --paper: #f4f5f1;
  --line: #dce2d8;
  --muted: #6c756d;
  --white: #ffffff;
  --amber: #c98219;
  --red: #c94343;
  --blue: #3677c8;
  --radius: 8px;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  background: #1d211e;
}

.login-brand {
  color: white;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(28, 32, 29, 0.94), rgba(31, 48, 36, 0.96)),
    linear-gradient(135deg, #1c201d, #243526);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0;
  color: white;
}

.brand-mark::after {
  content: "->";
  color: var(--green);
  font-weight: 900;
  transform: translateY(-1px);
}

.brand-arrow {
  color: var(--green);
  font-weight: 900;
}

.login-brand h1 {
  font-size: 32px;
  line-height: 1.1;
  margin: 40px 0 16px;
  max-width: 360px;
}

.login-brand p,
.muted {
  color: var(--muted);
}

.login-brand p {
  color: #b9c4bc;
  line-height: 1.55;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(29, 33, 30, 0.72), rgba(29, 33, 30, 0.18)),
    linear-gradient(135deg, #eef3ea 0%, #f7f8f4 100%);
}

.login-card {
  width: min(100%, 460px);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 22px 60px rgba(20, 23, 21, 0.16);
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: white;
}

.primary,
.secondary,
.ghost {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary {
  background: var(--green);
  color: #0d1a10;
  box-shadow: 0 8px 18px rgba(94, 203, 103, 0.22);
}

.secondary {
  background: #e8f7eb;
  color: #12642e;
}

.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid var(--line);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #1d211e;
  color: white;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.profile {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.profile strong {
  display: block;
  font-size: 15px;
}

.profile span {
  display: block;
  color: #b7c3ba;
  font-size: 12px;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  text-align: left;
  color: #dfe8e1;
  background: transparent;
  border-radius: 6px;
  padding: 11px 12px;
}

.nav button.active,
.nav button:hover {
  color: white;
  background: rgba(94, 203, 103, 0.16);
}

.content {
  min-width: 0;
  padding: 22px;
}

.mobile-profile {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 28px rgba(31, 35, 32, 0.04);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 900;
}

.metric-delta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--green-dark);
}

.metric-delta.red {
  color: var(--red);
}

.metric-delta.amber {
  color: var(--amber);
}

.metric-delta.blue {
  color: var(--blue);
}

.section-title {
  font-size: 18px;
  margin: 0 0 12px;
}

.task,
.employee,
.unit,
.alert,
.point-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #fff;
}

.task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.task-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.task h3,
.employee h3,
.unit h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.task p,
.employee p,
.unit p,
.alert p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  color: #223026;
  background: #edf2ee;
}

.pill.green {
  background: #def8e4;
  color: #11642e;
}

.pill.red {
  background: #fde7e7;
  color: #9e2020;
}

.pill.amber {
  background: #fff0d8;
  color: #8a510f;
}

.pill.blue {
  background: #e6f0ff;
  color: #245b9f;
}

.status-select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  min-width: 150px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tabs button {
  border-radius: 6px;
  padding: 9px 12px;
  background: white;
  border: 1px solid var(--line);
  font-weight: 800;
}

.tabs button.active {
  background: #1d211e;
  color: white;
  border-color: #1d211e;
}

.org-tree {
  display: grid;
  gap: 10px;
}

.unit.level-1 {
  border-left: 5px solid var(--green);
}

.unit.level-2 {
  margin-left: 18px;
  border-left: 5px solid #8bd59a;
}

.unit.level-3 {
  margin-left: 36px;
  border-left: 5px solid #b8dac0;
}

.dashboard-chart {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-top: 12px;
}

.bar {
  flex: 1;
  min-width: 24px;
  background: #bfeec7;
  border: 1px solid #96d9a5;
  border-radius: 5px 5px 0 0;
  position: relative;
}

.bar span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
}

.point-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 10px;
  align-items: center;
}

.point-row strong {
  font-size: 14px;
}

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

.point-edit {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, minmax(82px, 1fr));
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
}

.point-edit input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
}

.point-edit-head {
  background: #f8faf6;
  color: var(--muted);
  font-size: 13px;
}

.checklist-controls {
  display: grid;
  grid-template-columns: 150px repeat(2, minmax(92px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.checklist-controls .field {
  margin-top: 0;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-employee {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #fff;
  display: grid;
  grid-template-columns: 1.3fr 260px;
  gap: 14px;
}

.admin-employee h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.admin-employee p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-controls {
  display: grid;
  gap: 10px;
  align-content: start;
}

.access-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.check-line {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  background: #fbfcfa;
}

.check-line input {
  width: 16px;
  height: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.empty {
  border: 1px dashed #cbd4cd;
  border-radius: var(--radius);
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.mobile-bottom {
  display: none;
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell,
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .form-grid,
  .admin-employee,
  .access-grid {
    grid-template-columns: 1fr;
  }

  .admin-employee,
  .access-grid {
    grid-column: auto;
  }

  .login-brand {
    min-height: 260px;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 16px;
    padding-bottom: 78px;
  }

  .mobile-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    background: #1d211e;
    color: white;
    border-radius: var(--radius);
  }

  .mobile-profile strong,
  .mobile-profile span {
    display: block;
  }

  .mobile-profile span {
    margin-top: 3px;
    color: #b7c3ba;
    font-size: 12px;
  }

  .mobile-profile .ghost {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .topbar {
    display: grid;
  }

  .task {
    grid-template-columns: 1fr;
  }

  .point-row,
  .point-edit,
  .checklist-controls {
    grid-template-columns: 1fr 1fr;
  }

  .point-edit strong,
  .point-edit-head strong {
    grid-column: 1 / -1;
  }

  .mobile-bottom {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    left: 0;
    right: 0;
    bottom: 0;
    background: #1d211e;
    padding: 7px;
    gap: 5px;
    z-index: 10;
  }

  .mobile-bottom button {
    color: white;
    background: transparent;
    border-radius: 6px;
    padding: 9px 4px;
    font-size: 10px;
  }

  .mobile-bottom button.active {
    background: rgba(94, 203, 103, 0.2);
  }
}
