* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202e;
}

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

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: #0f1219;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #9fb7ff);
  color: #0b0d12;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 13px;
  color: #8d96a8;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  color: #c7ccd8;
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 14px;
  font-weight: 600;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.sidebar-footer {
  position: absolute;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9aa3b5;
  font-size: 14px;
}

.dot,
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #30d158;
}

.main {
  padding: 42px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 36px;
  border-radius: 28px;
  background: #151923;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}

.payroll-dashboard-hero {
  padding: 28px 32px;
  border-radius: 8px;
  background: #ffffff;
  color: #17202e;
  border: 1px solid #dce2ea;
}

.eyebrow {
  margin: 0 0 10px;
  color: #98a2b8;
  font-size: 14px;
}

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

.subtitle {
  color: #b7becd;
  margin: 14px 0 0;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(48,209,88,0.12);
  color: #8ff0a4;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.payroll-dashboard-hero .hero-status {
  background: #e8f6ee;
  color: #17623a;
}

.priority-card {
  padding: 28px 32px;
  border-radius: 24px;
  background: #11151e;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}

.priority-card h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.priority-card p {
  margin: 0;
  color: #b7becd;
}

.modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.module-card {
  min-height: 190px;
  padding: 26px;
  border-radius: 24px;
  background: #151923;
  border: 1px solid rgba(255,255,255,0.08);
}

a.module-card {
  color: inherit;
  text-decoration: none;
}

.module-card.featured {
  background: linear-gradient(135deg, #1f2937, #111827);
}

.icon {
  font-size: 30px;
}

.module-card h3 {
  margin: 20px 0 10px;
  font-size: 22px;
}

.module-card p {
  margin: 0;
  color: #b7becd;
  line-height: 1.45;
}

.primary-action {
  width: 100%;
  margin-top: 18px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: #f5f7fb;
  color: #10131a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.clinica-modules {
  align-items: stretch;
}

.clinica-module {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  min-height: 230px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

a.clinica-module:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
  background: #1d2330;
}

.module-placeholder {
  background: #171c26;
}

.module-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 12px;
  background: #f5f7fb;
  color: #10131a;
  font-size: 14px;
  font-weight: 800;
}

.module-action.is-disabled {
  background: rgba(255,255,255,0.08);
  color: #9aa3b5;
}

.payroll-step {
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #dce2ea;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(24, 37, 56, 0.06);
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.step-heading h2 {
  margin: 0;
  font-size: 22px;
  color: #17202e;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #17324d;
  color: #ffffff;
  font-weight: 800;
}

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

.payroll-panel {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfe;
}

.upload-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border: 1px solid #b7c2d0;
  border-radius: 8px;
  background: #ffffff;
  color: #17324d;
  font-weight: 800;
  cursor: pointer;
}

.upload-box:hover {
  border-color: #17324d;
  background: #f8fafc;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-row h3 {
  margin: 0;
  font-size: 18px;
  color: #17202e;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf1f6;
  color: #516070;
  font-size: 12px;
  font-weight: 800;
}

.state-pill[data-state="ready"] {
  background: #e8f6ee;
  color: #17623a;
}

.state-pill[data-state="loading"] {
  background: #fff4d7;
  color: #7a5700;
}

.state-pill[data-state="error"] {
  background: #fdecec;
  color: #a73232;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.metric-list div {
  min-width: 0;
}

.metric-list dt {
  color: #637083;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-list dd {
  margin: 5px 0 0;
  color: #17202e;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.metric-list div:first-child {
  grid-column: 1 / -1;
}

.metric-list div:first-child dd {
  font-size: 14px;
  font-weight: 700;
}

.developer-details {
  margin-top: 14px;
  border-top: 1px solid #dce2ea;
  padding-top: 12px;
  color: #637083;
  font-size: 13px;
}

.developer-details summary {
  cursor: pointer;
  font-weight: 700;
}

.developer-details div {
  margin-top: 10px;
  white-space: pre-line;
  line-height: 1.5;
}

.calculate-step {
  text-align: center;
}

.payroll-calculate-button {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 22px;
  border-radius: 8px;
  background: #17324d;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 18px;
}

.payroll-calculate-button:not(:disabled):hover {
  background: #21476b;
}

.payroll-results {
  margin-top: 18px;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.payroll-results {
  margin-top: 24px;
}

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

.result-grid div {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
}

.result-grid strong,
.result-grid span {
  display: block;
}

.result-grid strong {
  font-size: 28px;
}

.result-grid span {
  color: #b7becd;
  margin-top: 4px;
}

.payroll-engine-table-wrap {
  overflow-x: auto;
  border: 1px solid #dce2ea;
  border-radius: 8px;
}

.payroll-engine-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
  background: #ffffff;
}

.payroll-engine-table th,
.payroll-engine-table td {
  padding: 12px;
  border-bottom: 1px solid #e6ebf1;
  text-align: left;
  vertical-align: top;
}

.payroll-engine-table th {
  color: #637083;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

.payroll-engine-table td {
  color: #17202e;
  font-size: 14px;
}

.payroll-engine-table td:nth-child(5) {
  white-space: pre-line;
}

.payroll-engine-table tr:last-child td {
  border-bottom: 0;
}

.issues-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.issue-item {
  padding: 13px 14px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #f1d39b;
  color: #473000;
}

.issue-item strong {
  display: block;
  margin-bottom: 4px;
}

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

  .main {
    padding: 20px;
  }

  .payroll-dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .sidebar {
    position: relative;
  }

  .sidebar-footer {
    position: static;
    margin-top: 24px;
  }

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

  .upload-dashboard-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .main {
    padding: 14px;
  }

  .payroll-step,
  .payroll-dashboard-hero {
    padding: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .metric-list,
  .result-grid {
    grid-template-columns: 1fr;
  }
}
