:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d7deea;
  --blue: #2563eb;
  --green: #0f7b57;
  --red: #b8322a;
  --amber: #9a6500;
  --soft-blue: #e8f0ff;
  --soft-green: #e5f6ee;
  --soft-red: #fdebe9;
  --soft-amber: #fff4d6;
  --shadow: 0 14px 34px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

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

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

textarea {
  min-height: 74px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: #9ca9bc;
}

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

.danger {
  color: var(--red);
  border-color: #efb7b1;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 20px 14px;
  background: #172033;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  padding: 6px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

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

.brand strong {
  font-size: 20px;
  margin-bottom: 5px;
}

.brand span,
.user-box {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.sidebar nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 10px 11px;
  border-radius: 6px;
}

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

.user-box {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.content {
  margin-left: 248px;
  padding: 24px;
  max-width: 1500px;
}

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

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

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

.card {
  min-height: 92px;
  padding: 14px;
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.card strong {
  font-size: 24px;
}

.panel {
  overflow: hidden;
}

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

.panel-body {
  padding: 16px;
}

form {
  display: grid;
  gap: 12px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  max-height: 67vh;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}

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

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

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.paid,
.active-pill {
  background: var(--soft-green);
  color: var(--green);
}

.unpaid,
.inactive-pill {
  background: var(--soft-red);
  color: var(--red);
}

.work-pill {
  background: var(--soft-amber);
  color: var(--amber);
}

.shift-pill {
  background: var(--soft-blue);
  color: var(--blue);
}

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

.flash {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #b9e8cf;
  border-radius: 8px;
  background: #ecfdf3;
  color: #0f6b4a;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

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

.error {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--red);
  background: var(--soft-red);
}

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

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.checkline input {
  width: 16px;
  min-height: 16px;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 1fr) minmax(92px, auto);
  gap: 10px;
  align-items: center;
}

.bar-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.bar-row strong {
  text-align: right;
  font-size: 13px;
}

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

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.bar-track.green i {
  background: var(--green);
}

.bar-track.amber i {
  background: var(--amber);
}

.ajax-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 8px;
  background: #101827;
  color: #fff;
  box-shadow: 0 16px 32px rgba(16, 24, 39, 0.22);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ajax-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.ajax-toast.error-toast {
  background: #b8322a;
}

.dashboard-page {
  --bg: #222436;
  --panel: #2b2d42;
  --text: #ffffff;
  --muted: #aab0c5;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  background:
    radial-gradient(circle at 14% 4%, rgba(12, 145, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #202232 0%, #2c2e42 48%, #202233 100%);
}

.dashboard-page .sidebar {
  background: rgba(27, 29, 43, 0.76);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.16);
}

.dashboard-page .brand strong {
  color: #10a4ff;
}

.dashboard-page .content {
  max-width: 1600px;
}

.dashboard-page input,
.dashboard-page select,
.dashboard-page textarea {
  background: #242638;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dashboard-page .primary {
  background: #0b91ff;
  border-color: #0b91ff;
  box-shadow: 0 10px 22px rgba(11, 145, 255, 0.24);
}

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

.dash-top h1 {
  margin: 3px 0 6px;
  font-size: 31px;
}

.dash-brand {
  color: #0b91ff;
  font-weight: 700;
}

.dash-filters {
  display: grid;
  grid-template-columns: 160px 160px auto;
  gap: 10px;
  align-items: end;
  min-width: 460px;
}

.dash-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.hero-card,
.dash-panel,
.metric-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(53, 55, 76, 0.94), rgba(38, 40, 59, 0.94));
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 16px;
}

.hero-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.hero-card strong {
  display: block;
  font-size: 18px;
}

.hero-mark {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #d90034;
  box-shadow: 0 12px 22px rgba(217, 0, 52, 0.22);
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  min-height: 150px;
  padding: 22px;
  overflow: hidden;
}

.metric-card button {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  border-color: rgba(255, 255, 255, 0.8);
  background: transparent;
  color: #fff;
}

.metric-card span {
  display: block;
  max-width: 190px;
  font-weight: 700;
  line-height: 1.25;
}

.metric-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 30px;
  font-size: 34px;
  letter-spacing: 0;
}

.metric-card.blue {
  background: linear-gradient(135deg, #0b8ff2, #0877d3);
}

.metric-card.orange {
  background: linear-gradient(135deg, #ffb20b, #ff9700);
}

.metric-card.cyan {
  background: linear-gradient(135deg, #18cfd2, #0fb5c7);
}

.mini-donut {
  --value: 0;
  --color: #fff;
  position: absolute;
  right: 38px;
  bottom: 30px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(var(--color) calc(var(--value) * 1%), rgba(255, 255, 255, 0.22) 0);
}

.mini-donut::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.18);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
}

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

.dash-panel {
  overflow: hidden;
  padding: 22px;
}

.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dash-panel-head h2 {
  font-size: 17px;
}

.dash-panel-head strong {
  display: block;
  margin-top: 8px;
  color: #0b91ff;
  font-size: 36px;
}

.dash-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.line-chart {
  display: block;
  width: 100%;
  height: 300px;
}

.line-chart line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-dasharray: 3 4;
}

.line-chart polyline {
  fill: none;
  stroke: #0b91ff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.donut-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: center;
}

.donut {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: var(--donut);
  display: grid;
  place-items: center;
  box-shadow: 0 18px 36px rgba(11, 145, 255, 0.12);
}

.donut > div {
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #2b2d42;
  text-align: center;
}

.donut strong {
  display: block;
  color: #0b91ff;
  font-size: 24px;
}

.donut span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.legend-list {
  display: grid;
  gap: 14px;
}

.legend-list div {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: center;
}

.legend-list i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-list span {
  color: #fff;
  font-size: 13px;
}

.legend-list strong {
  color: #fff;
}

.dash-bars {
  display: grid;
  gap: 15px;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 190px) 1fr minmax(100px, auto);
  gap: 12px;
  align-items: center;
}

.dash-bar-row span {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-bar-row div {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

.dash-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0b91ff;
}

.amber-bars .dash-bar-row i {
  background: #ffad0a;
}

.cyan-bars .dash-bar-row i {
  background: #16c8cf;
}

.dash-bar-row strong {
  color: #fff;
  font-size: 13px;
  text-align: right;
}

@media (max-width: 1050px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .content {
    margin-left: 0;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .grid,
  .filters,
  .dash-top,
  .dash-filters,
  .dash-hero,
  .dash-metrics,
  .dash-grid,
  .dash-grid.compact,
  .donut-layout {
    grid-template-columns: 1fr;
  }

  .dash-top {
    display: grid;
  }

  .dash-filters {
    min-width: 0;
  }
}

@media (max-width: 650px) {
  .content {
    padding: 14px;
  }

  .cards,
  .form-row,
  .bar-row {
    grid-template-columns: 1fr;
  }

  .bar-row strong {
    text-align: left;
  }

  .page-head {
    display: grid;
  }
}
