:root {
  --bg: #f5f6f8;
  --ink: #172026;
  --muted: #66707d;
  --line: #d9dee7;
  --panel: #ffffff;
  --dark: #101820;
  --gold: #b8892d;
  --green: #08775f;
  --danger: #a12b2b;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  min-height: 40px;
  padding: 0 14px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  border: 1px solid rgb(255 255 255 / 0.25);
}

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

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

.sidebar {
  background: var(--dark);
  color: #fff;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.35);
  color: var(--gold);
  font-weight: 800;
}

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

h1 {
  font-size: 28px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 18px;
}

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

.sidebar .label,
.sidebar span {
  color: #b8c1cf;
}

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

.nav-item {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgb(255 255 255 / 0.25);
  background: rgb(255 255 255 / 0.08);
}

.session-card {
  margin-top: auto;
  border: 1px solid rgb(255 255 255 / 0.18);
  padding: 14px;
}

.session-card p {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.session-card span {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.content {
  padding: 28px;
}

.login-panel {
  width: min(440px, 100%);
  margin: 9vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px;
  display: grid;
  gap: 22px;
}

.login-form,
.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.topbar,
.section-head,
.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.month-field {
  width: 180px;
}

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

.summary-grid article,
.table-wrap,
.credential-panel,
.profile-panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.summary-grid article {
  padding: 18px;
}

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

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

.credential-panel {
  padding: 16px;
  display: grid;
  grid-template-columns: 180px repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.profile-panel {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.view-section {
  display: grid;
  gap: 12px;
}

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

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

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

.badge {
  display: inline-flex;
  border: 1px solid #b8dfd2;
  color: var(--green);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

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

dialog {
  width: min(820px, calc(100vw - 32px));
  border: 1px solid var(--line);
  padding: 0;
}

dialog::backdrop {
  background: rgb(16 24 32 / 0.45);
}

#clientForm {
  padding: 20px;
}

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

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

.icon {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: #eef2f7;
  color: var(--ink);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--dark);
  color: #fff;
  padding: 12px 14px;
  max-width: 420px;
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .credential-panel,
  .form-grid {
    grid-template-columns: 1fr;
  }

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