:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f3;
  --text: #182023;
  --muted: #69777b;
  --line: #dce4e5;
  --primary: #087f8c;
  --primary-dark: #05606a;
  --accent: #d95f43;
  --gold: #d8a325;
  --ok: #188f61;
  --danger: #c64545;
  --shadow: 0 18px 50px rgba(27, 45, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  background:
    linear-gradient(120deg, rgba(8, 127, 140, 0.88), rgba(24, 32, 35, 0.64)),
    url("https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  min-height: 100vh;
  padding: 44px;
  background: rgba(255, 255, 255, 0.96);
}

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

.login-panel h1,
.page-title h1 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.login-panel p,
.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #425054;
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.13);
}

.button,
.ghost-button,
.danger-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 14px;
  font-weight: 720;
}

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

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

.ghost-button {
  background: var(--surface-2);
  color: var(--text);
}

.danger-button {
  background: #ffe9e9;
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 750;
  text-align: left;
}

.link-button:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  padding: 0;
  place-items: center;
  background: var(--surface-2);
  color: var(--text);
  font-size: 22px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: #172327;
  color: #fff;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

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

.nav button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: #d9e4e6;
  text-align: left;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.session-box {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #c7d5d8;
  font-size: 13px;
}

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

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

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

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

.panel,
.card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 18px;
}

.card {
  padding: 16px;
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.stat-card span,
.muted {
  color: var(--muted);
}

.manager-home {
  min-height: calc(100vh - 56px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
}

.choice-grid {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.choice-card {
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow);
}

.choice-card h2 {
  margin: 0 0 8px;
}

.choice-card p {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: #f7faf9;
  color: #425054;
  z-index: 1;
}

tr:hover td {
  background: #fbfefe;
}

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

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

.pill.admin {
  background: #e8f4ed;
  color: #176640;
}

.pill.manager {
  background: #fff1df;
  color: #8a5207;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.project-card {
  display: grid;
  gap: 12px;
}

.project-card h3 {
  margin: 0;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr 48px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e8eeee;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.bar-fill.alt {
  background: var(--accent);
}

.bar-fill.gold {
  background: var(--gold);
}

.empty {
  padding: 34px;
  border: 1px dashed #c9d5d7;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: #fbfdfd;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 27, 30, 0.48);
}

.modal {
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  overflow: auto;
  padding: 20px;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7e6;
  color: #744b04;
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.success {
  color: var(--ok);
  font-weight: 700;
}

@media (max-width: 900px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .grid.two,
  .grid.three,
  .choice-grid,
  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .toolbar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
