:root {
  --bg: #f4f7f5;
  --panel: #ffffff;
  --text: #17211b;
  --muted: #607067;
  --line: #dce5df;
  --green: #1f8a5b;
  --green-dark: #14643f;
  --blue: #2364aa;
  --amber: #bf7b18;
  --red: #b42318;
  --shadow: 0 18px 45px rgba(24, 45, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.locked {
  display: block;
}

body.locked .sidebar,
body.locked .app {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  gap: 20px;
  place-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #10251b, #1f8a5b);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 26px;
}

.login-card p,
.login-card small {
  margin: 0;
  color: var(--muted);
}

.login-card small {
  min-height: 18px;
  color: var(--red);
  font-weight: 800;
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  background: #10251b;
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f4b942;
  color: #10251b;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 4px;
  color: #b8c8bf;
}

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

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbe9e1;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--green);
  color: #ffffff;
}

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

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

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

.user-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

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

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

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

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.form-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.finance-lists {
  margin-top: 20px;
}

.rights-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.rights-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.rights-box input {
  width: auto;
  min-height: auto;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--green);
  outline: 3px solid rgba(31, 138, 91, 0.16);
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--green);
  color: #ffffff;
}

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

.ghost-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.link-button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.small-button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.small-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.small-button.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 8px;
  background: #e9f5ef;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  background: #fff3dc;
  color: var(--amber);
}

.badge.info {
  background: #e9f1fb;
  color: var(--blue);
}

.badge.bad {
  background: #fee4e2;
  color: var(--red);
}

@media (max-width: 1000px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

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

  .stats-grid,
  .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .app {
    padding: 18px;
  }

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

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

  h1 {
    font-size: 24px;
  }
}
