:root {
  --navy: #17342a;
  --navy-2: #285c47;
  --red: #68ad51;
  --red-dark: #4f913d;
  --ink: #18231e;
  --muted: #647168;
  --line: #dfe6e1;
  --surface: #ffffff;
  --background: #f4f7f3;
  --success: #438a37;
  --shadow: 0 18px 50px rgba(23, 52, 42, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
a { color: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr);
  background: #f5f7f5;
}
.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(42px, 6vw, 82px);
  color: white;
  background: linear-gradient(145deg, #173a2d 0%, #0c241b 100%);
}
.brand-panel::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -230px;
  bottom: -230px;
  border: 70px solid rgba(104, 173, 81, .55);
  border-radius: 50%;
}
.brand { position: relative; z-index: 1; }
.login-logo {
  position: relative;
  z-index: 1;
  width: min(230px, 65%);
  padding: 12px 15px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}
.login-logo img { display: block; width: 100%; height: auto; }
.brand-kicker { margin: 0 0 18px !important; color: #8dc97a !important; font-size: 12px !important; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.brand h1 { max-width: 520px; margin: 0; font-size: clamp(38px, 4vw, 62px); line-height: 1.04; letter-spacing: -.045em; }
.brand p { max-width: 480px; margin: 22px 0 0; color: #cfddd3; font-size: 17px; line-height: 1.65; }
.brand-foot { position: relative; z-index: 1; color: #a9c4b3; font-size: 13px; }
.login-panel { display: grid; place-items: center; padding: clamp(34px, 7vw, 96px); background: var(--surface); }
.login-card { width: min(100%, 420px); }
.eyebrow { margin: 0 0 10px; color: var(--red); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-card h2 { margin: 0; color: var(--navy); font-size: 34px; letter-spacing: -.03em; }
.intro { margin: 12px 0 32px; color: var(--muted); line-height: 1.6; }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.field input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid #cfd5df;
  border-radius: 9px;
  outline: none;
  background: #fff;
  transition: border .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 4px rgba(23, 57, 95, .11); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 0 20px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: white;
  background: #4f963d;
  font-weight: 800;
  transition: background .15s, transform .15s;
}
.button:hover { background: #3f7d31; }
.button:active { transform: translateY(1px); }
.button.full { width: 100%; }
.button.secondary { min-height: 40px; background: var(--navy-2); font-size: 14px; }
.alert { margin: 0 0 22px; padding: 13px 15px; border: 1px solid #f4c7c7; border-radius: 8px; color: #8f2525; background: #fff5f5; font-size: 14px; }
.security-note { margin-top: 24px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { display: flex; flex-direction: column; padding: 24px 20px; color: white; background: linear-gradient(180deg, #173b2d, #10281f); }
.sidebar-title { display: flex; align-items: center; margin-bottom: 16px; padding: 12px; border-radius: 10px; background: white; }
.sidebar-title img { display: block; width: 100%; max-width: 176px; height: auto; margin: 0 auto; }
.sidebar-title span { display: none; }
.nav-label { padding: 20px 12px 8px; color: #8fb29c; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 8px; color: #d5e5da; text-decoration: none; font-size: 14px; font-weight: 650; }
.nav-item.active { color: #fff; background: rgba(104,173,81,.2); box-shadow: inset 3px 0 0 var(--red); }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #71849a; }
.nav-item.active .nav-dot { background: var(--red); }
.nav-item.disabled { cursor: default; opacity: .55; }
.sidebar-spacer { flex: 1; }
.sidebar-user { padding: 18px 12px 0; border-top: 1px solid rgba(255,255,255,.12); color: #d5e5da; font-size: 13px; line-height: 1.5; }
.main { min-width: 0; background: var(--background); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 clamp(24px, 4vw, 54px); border-bottom: 1px solid var(--line); background: white; }
.topbar-title { position: relative; padding-left: 17px; font-size: 15px; font-weight: 800; color: var(--navy); }
.topbar-title::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 5px; border-radius: 4px; background: var(--red); }
.topbar form { margin: 0; }
.content { padding: 42px clamp(24px, 4vw, 54px); }
.welcome { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 30px; }
.welcome h1 { margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.welcome p { margin: 10px 0 0; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--success); font-size: 13px; font-weight: 750; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.metric { padding: 22px; border: 1px solid var(--line); border-top: 3px solid #b8d6ae; border-radius: 12px; background: white; box-shadow: 0 3px 12px rgba(23,52,42,.04); }
.metric-link { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.metric-link:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(16,37,63,.09); }
.metric-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-value { margin-top: 12px; color: var(--navy); font-size: 30px; font-weight: 850; letter-spacing: -.04em; }
.metric-note { margin-top: 8px; color: #98a2b3; font-size: 12px; }
.grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-top: 20px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 3px 12px rgba(23,52,42,.04); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; color: var(--navy); font-size: 17px; }
.empty { padding: 54px 28px; text-align: center; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 15px; border-radius: 12px; color: #3f7f33; background: #edf7e9; font-weight: 850; }
.profile-list { margin: 0; padding: 6px 22px 18px; }
.profile-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.profile-row:last-child { border-bottom: 0; }
.profile-row dt { color: var(--muted); }
.profile-row dd { margin: 0; color: var(--ink); font-weight: 700; word-break: break-word; }
.role { display: inline-block; margin: 0 5px 5px 0; padding: 5px 8px; border-radius: 6px; color: #356b2e; background: #edf7e9; font-size: 11px; font-weight: 800; }
.quick-actions { padding: 8px 22px 20px; }
.quick-actions a { display: flex; flex-direction: column; gap: 5px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--navy); text-decoration: none; }
.quick-actions a:last-child { border-bottom: 0; }
.quick-actions span { color: var(--muted); font-size: 13px; }
.page-heading, .detail-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1, .detail-heading h1 { margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.page-heading p:last-child, .detail-heading p:last-child { margin: 8px 0 0; color: var(--muted); }
.page-heading .button { flex: 0 0 auto; }
.customer-create-card { max-width: 1050px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.form-section-heading { margin: 28px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-section-heading h2 { margin: 0 0 6px; color: var(--navy); font-size: 20px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.password-reset-card { margin-top: 20px; }
.password-reset-card form { margin-top: 16px; }
.filters { display: grid; grid-template-columns: minmax(240px, 1.4fr) minmax(170px, .8fr) minmax(150px, .7fr) auto auto; gap: 12px; align-items: center; margin-bottom: 18px; }
.filters input[type="search"], .filters select, .action-form input:not([type="checkbox"]), .action-form select, .action-form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd5df; border-radius: 8px; outline: none; background: white;
}
.filters input:focus, .filters select:focus, .action-form select:focus, .action-form textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(23,57,95,.1); }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--muted); font-size: 13px !important; font-weight: 600 !important; }
.check input { width: 16px; height: 16px; accent-color: var(--red); }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.request-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.request-table th { padding: 14px 16px; color: var(--muted); background: #fafbfc; text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.request-table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.request-table tbody tr:hover { background: #fbfcfe; }
.reference { display: inline-block; color: var(--navy-2); font-weight: 850; text-decoration: none; }
.subline { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.flag { display: block; width: fit-content; margin-top: 5px; padding: 3px 6px; border-radius: 4px; color: #8b3029; background: #fbe5df; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.status-pill, .priority-chip { display: inline-block; padding: 6px 9px; border-radius: 999px; color: #356b2e; background: #edf7e9; font-size: 11px; font-weight: 800; }
.priority-chip { margin-left: 7px; color: #9f1239; background: #ffe4e6; }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--navy-2); font-size: 13px; font-weight: 750; text-decoration: none; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 20px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 20px; }
.section-card { overflow: hidden; }
.prose { padding: 22px; color: #344054; line-height: 1.7; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0 22px 22px; gap: 1px; background: var(--line); }
.detail-list > div { min-height: 78px; padding: 16px; background: white; }
.detail-list dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.detail-list dd { margin: 7px 0 0; color: var(--ink); font-size: 14px; line-height: 1.5; }
.action-form { display: grid; gap: 16px; padding: 20px 22px 22px; }
.action-form.bordered { border-top: 1px solid var(--line); }
.action-form label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 750; }
.timeline { padding: 8px 22px 18px; }
.timeline-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item > div { display: flex; justify-content: space-between; gap: 20px; }
.timeline-item span { color: var(--muted); font-size: 11px; }
.timeline-item p { margin: 9px 0 0; color: #344054; line-height: 1.55; }
.empty.compact { padding: 24px 0; }
.alert.success { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
.admin-grid { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(0, 1.3fr); gap: 20px; align-items: start; }
.admin-section-heading { margin-top: 48px; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-form fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.action-form legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 750; }
.role-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-option { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 9px !important; padding: 9px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.role-option input { width: 16px; height: 16px; accent-color: var(--red); }
.role-option span { display: grid; gap: 2px; }
.role-option small, .action-form label > small, .muted-text { color: var(--muted); font-size: 11px; font-weight: 500; }
.status-pill.muted { color: var(--muted); background: #f2f4f7; }
.table-action { display: inline-flex; padding: 7px 11px; border-radius: 7px; color: #356b2e; background: #edf7e9; font-size: 12px; font-weight: 800; text-decoration: none; }
.table-action:hover { background: #dcefd5; }
.manage-user-card { max-width: 720px; }
.account-toggle { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 12px !important; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fafcf9; }
.account-toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); }
.account-toggle span { display: grid; gap: 4px; }
.account-toggle small { color: var(--muted); font-weight: 500; }
.customer-sites-card { margin-top: 20px; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--background); }
.error-card { max-width: 520px; padding: 40px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); text-align: center; }
.error-card h1 { color: var(--navy); }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 320px; padding: 42px; }
  .login-logo { width: 190px; }
  .brand { margin-top: 54px; }
  .brand h1 { font-size: 42px; }
  .brand-foot { display: none; }
  .app-shell { grid-template-columns: 78px 1fr; }
  .nav-item span:last-child, .nav-label, .sidebar-user { display: none; }
  .sidebar-title { padding: 9px; }
  .sidebar-title img { width: 48px; max-width: 48px; object-fit: cover; object-position: left; }
  .sidebar-title, .nav-item { justify-content: center; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .brand-panel { min-height: 245px; padding: 28px 24px; }
  .login-logo { width: 155px; }
  .brand { margin-top: 34px; }
  .brand-kicker, .brand p { display: none; }
  .brand h1 { font-size: 34px; }
  .login-panel { padding: 34px 24px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 20px; }
  .content { padding: 28px 20px; }
  .metrics { grid-template-columns: 1fr; }
  .welcome { display: block; }
  .status { margin-top: 18px; }
  .filters { grid-template-columns: 1fr; }
  .page-heading, .detail-heading { display: block; }
  .detail-heading > div:last-child { margin-top: 15px; }
  .detail-list { grid-template-columns: 1fr; }
  .form-two, .role-options { grid-template-columns: 1fr; }
}
