\
:root {
  --bg: #f5f3ef;
  --panel: #ffffff;
  --text: #171717;
  --muted: #706d68;
  --border: #e4dfd8;
  --brand: #68152a;
  --brand-dark: #310912;
  --brand-soft: #f6e9ed;
  --good: #176a50;
  --good-bg: #e9f5ef;
  --warning: #8b6400;
  --warning-bg: #fff4d6;
  --error: #a53030;
  --error-bg: #fff0ef;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { min-height: 100vh; }

a { color: inherit; }

.ui-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.ui-sidebar {
  background: var(--brand-dark);
  color: #fff;
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ui-brand { padding: 4px 9px 26px; }

.ui-brand-main {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  line-height: 1;
  color: #f4e5bf;
}

.ui-brand-sub {
  margin-top: 7px;
  color: #d9bd7b;
  font-size: 9px;
  letter-spacing: .24em;
}

.ui-nav { display: grid; gap: 5px; }

.ui-nav-item {
  display: block;
  border-radius: 9px;
  padding: 10px 11px;
  text-decoration: none;
  color: rgba(255,255,255,.75);
  font-size: 14px;
}

.ui-nav-item:hover,
.ui-nav-item.active {
  background: rgba(255,255,255,.10);
  color: #fff;
}

.ui-nav-item.active { font-weight: 700; }

.ui-sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 15px 8px 0;
}

.ui-user-name { font-size: 13px; font-weight: 700; }
.ui-user-role { margin-top: 2px; color: rgba(255,255,255,.56); font-size: 11px; }
.ui-profile-link { display: inline-block; margin-top: 12px; color: #e6d2a5; font-size: 12px; }
.ui-version { margin: 14px 0 8px; color: rgba(255,255,255,.45); font-size: 11px; }

.ui-logout {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
}

.ui-main { min-width: 0; }

.ui-topbar {
  min-height: 106px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 32px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.62);
}

.ui-eyebrow { color: var(--muted); font-size: 12px; margin-bottom: 5px; }

h1, h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 { font-size: clamp(30px, 3vw, 44px); }
h2 { font-size: 30px; }

.ui-content {
  padding: 25px 32px 42px;
  max-width: 1440px;
}

.ui-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ui-kpi, .ui-panel, .employee-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ui-kpi { padding: 16px; }
.ui-kpi-label { color: var(--muted); font-size: 12px; }
.ui-kpi-value { margin: 4px 0 2px; font-family: Georgia, serif; font-size: 34px; }
.ui-kpi-note, .ui-muted { color: var(--muted); font-size: 12px; }
.ui-muted.small { font-size: 11px; }

.ui-panel { padding: 18px; margin-bottom: 18px; }
.ui-panel-title { font-weight: 800; font-size: 17px; }
.ui-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ui-empty {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: #fbfaf8;
}

.ui-locations {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ui-location-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfaf8;
}

.ui-location-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 4px;
  flex: 0 0 auto;
}

.ui-location-name { font-weight: 800; }

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ui-button.primary { background: var(--brand); color: #fff; }
.ui-button.secondary { background: #fff; border-color: var(--border); color: var(--text); }
.ui-button.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.ui-button.compact { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.ui-button.full { width: 100%; }

.ui-alert {
  border-radius: 9px;
  padding: 11px 13px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.4;
}

.ui-alert.error { background: var(--error-bg); color: var(--error); border: 1px solid #f2cccc; }
.ui-alert.warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #f0dea6; }

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

.ui-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 13px;
}

.ui-table th {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ui-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #eeeae4;
  vertical-align: middle;
}

.ui-table tr:last-child td { border-bottom: 0; }
.ui-table .actions { width: 1%; white-space: nowrap; }

.ui-actions { display: inline-flex; gap: 6px; align-items: center; }
.ui-actions form { margin: 0; }

.ui-person { display: flex; align-items: center; gap: 9px; }
.ui-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.ui-pill {
  display: inline-block;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-pill.good { background: var(--good-bg); color: var(--good); }
.ui-pill.warning { background: var(--warning-bg); color: var(--warning); }
.ui-pill.muted { background: #f0efed; color: #77736e; }
.ui-pill.neutral { background: #f4f0e9; color: #4e4943; }

.ui-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(220px, 320px);
  gap: 18px;
  align-items: start;
}

.ui-form-card { margin: 0; }

.ui-form { display: grid; gap: 14px; }

.ui-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.ui-field input,
.ui-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d6d0c8;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
}

.ui-field input:focus,
.ui-field select:focus {
  outline: 2px solid rgba(104,21,42,.12);
  border-color: var(--brand);
}

.ui-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}

.ui-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ui-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.ui-form-actions.left { justify-content: flex-start; }

.ui-help-card {
  background: #fbfaf8;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 17px;
  color: #4f4b46;
  font-size: 13px;
  line-height: 1.5;
}

.ui-help-title { font-weight: 800; margin-bottom: 8px; }
.ui-back { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.ui-narrow { max-width: 620px; }

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 80% 10%, rgba(104,21,42,.08), transparent 28%),
    var(--bg);
}

.auth-wrap { width: min(100%, 430px); }
.auth-wrap.wide { width: min(100%, 540px); }

.auth-brand {
  text-align: center;
  margin-bottom: 18px;
}

.auth-brand .ui-brand-main { color: var(--brand); }
.auth-brand .ui-brand-sub { color: #9b7737; }

.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 16px 45px rgba(35,20,20,.07);
}

.auth-card h1 { font-size: 34px; }
.auth-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 18px; }
.auth-version { margin-top: 12px; text-align: center; color: var(--muted); font-size: 11px; }

.employee-home { max-width: 920px; }
.employee-hero {
  padding: 22px;
  margin-bottom: 14px;
  background: var(--brand-dark);
  color: #fff;
  border-radius: 14px;
}
.employee-hero .ui-eyebrow { color: rgba(255,255,255,.58); }
.employee-role { margin-top: 7px; color: #e6d2a5; font-size: 13px; }

.employee-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.employee-card { padding: 17px; }
.employee-card-title { margin: 5px 0; font-size: 24px; font-family: Georgia, serif; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 15px 0;
}

.profile-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

@media (max-width: 1100px) {
  .ui-kpi-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .ui-form-layout { grid-template-columns: 1fr; }
  .ui-help-card { max-width: 680px; }
}

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

  .ui-sidebar {
    min-height: auto;
    padding: 12px 14px;
    position: static;
  }

  .ui-brand { padding: 0 4px 10px; }
  .ui-brand-main { font-size: 30px; }
  .ui-brand-sub { margin-top: 4px; }

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

  .ui-nav-item { text-align: center; padding: 8px 5px; font-size: 11px; }
  .ui-sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 4px 0; }
  .ui-user { min-width: 0; flex: 1; }
  .ui-user-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .ui-user-role, .ui-profile-link, .ui-version { display: none; }
  .ui-sidebar-foot form { margin: 0; }
  .ui-logout { width: auto; padding: 7px 10px; }

  .ui-topbar { min-height: auto; padding: 18px 18px 14px; }
  .ui-topbar h1 { font-size: 30px; }
  .ui-content { padding: 16px 18px 30px; }

  .ui-locations { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .ui-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-topbar { align-items: flex-start; flex-direction: column; }
  .ui-kpi-grid { grid-template-columns: 1fr 1fr; }
  .ui-panel-head { align-items: flex-start; flex-direction: column; }
  .ui-form-grid { grid-template-columns: 1fr; }
  .employee-cards, .profile-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 19px; }
  .auth-card h1 { font-size: 29px; }
}
