@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  color: #202b2a;
  background: #f5f7f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; min-height: 100vh; }

.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  background: #fff;
  border-right: 1px solid #e7ece9;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -0.4px; }
.brand-mark, .welcome-icon { display: grid; place-items: center; color: #fff; background: #187c68; font-weight: 700; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
nav { display: grid; gap: 5px; margin-top: 42px; }
.nav-link { padding: 11px 13px; color: #687572; text-decoration: none; font-size: 14px; font-weight: 500; border-radius: 8px; }
.nav-link:hover { color: #187c68; background: #f3f8f6; }
.nav-link.active { color: #146b5a; background: #eaf5f1; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 14px 12px 0; color: #98a29f; font-size: 12px; border-top: 1px solid #edf0ef; }

.main-content { min-width: 0; width: min(100%, 1120px); margin: 0 auto; padding: 52px 56px; }
.page-label { margin-bottom: 20px; color: #87928e; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; }
.welcome-card { min-height: 190px; display: flex; align-items: center; gap: 22px; padding: 36px; background: #fff; border: 1px solid #e8edeb; border-radius: 14px; box-shadow: 0 4px 18px rgb(29 52 44 / 3%); }
.welcome-icon { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 16px; font-size: 25px; }
h1 { margin: 0 0 8px; color: #1d2926; font-size: clamp(26px, 4vw, 34px); letter-spacing: -1.1px; }
.welcome-card p { margin: 0; color: #78837f; font-size: 15px; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-heading h1 { margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.button-primary { color: #fff; background: #187c68; }
.button-primary:hover { background: #146b5a; }
.button-secondary { color: #34443f; background: #fff; border-color: #d9e2de; }
.button-secondary:hover { background: #f3f8f6; }
.button-danger { color: #fff; background: #b53636; }
.button-danger:hover { background: #9e2e2e; }
.button:focus-visible, .action-link:focus-visible, .form-field input:focus-visible, .form-field select:focus-visible, .form-field textarea:focus-visible { outline: 3px solid #9bd5c4; outline-offset: 2px; }

.table-wrap { width: 100%; overflow-x: auto; background: #fff; border: 1px solid #e8edeb; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; border-bottom: 1px solid #edf0ef; text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: #61706b; background: #f8faf9; font-size: 12px; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
.empty-state { padding: 36px 16px; color: #78837f; text-align: center; }
.row-actions { display: flex; gap: 14px; }
.action-link { color: #187c68; font-weight: 600; text-decoration: none; }
.action-link:hover { text-decoration: underline; }
.action-danger { color: #b53636; }
.inline-form { display: inline; }
.action-button { padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }

.form-card { max-width: 760px; padding: 28px; background: #fff; border: 1px solid #e8edeb; border-radius: 12px; }
.form-card > p:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-field { display: grid; gap: 7px; }
.form-field-wide { grid-column: 1 / -1; }
.form-field label { font-size: 14px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #ccd8d3; border-radius: 8px; background: #fff; color: #202b2a; font: inherit; }
.form-field textarea { resize: vertical; }
.form-error { padding: 12px 14px; border-radius: 8px; color: #8b2424; background: #fff0ef; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.muted-text { color: #78837f; }
.filters-card { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(170px, 0.7fr) auto; gap: 16px; align-items: end; margin-bottom: 20px; padding: 18px; background: #fff; border: 1px solid #e8edeb; border-radius: 12px; }
.filter-actions { display: flex; gap: 8px; }
.identity-card { display: grid; gap: 5px; margin-bottom: 22px; padding: 15px; border-radius: 8px; color: #55635f; background: #f5f8f7; }
.identity-card strong { color: #202b2a; }

@media (max-width: 640px) {
  .sidebar { width: 190px; flex-basis: 190px; padding-inline: 10px; }
  .main-content { padding: 34px 20px; }
  .welcome-card { align-items: flex-start; flex-direction: column; padding: 26px; }
}

@media (max-width: 460px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; padding: 16px; border-right: 0; border-bottom: 1px solid #e7ece9; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 28px 16px; }
  .form-card { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters-card { grid-template-columns: 1fr; }
}
