:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #17201c;
  background: #f4f6f5;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.environment-banner { position: fixed; inset: 0 0 auto 0; z-index: 100; padding: 6px 12px; background: #8a2d16; color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.environment-banner:not([hidden]) + .login-shell,
.environment-banner:not([hidden]) + .login-shell + .app-shell { padding-top: 28px; }
button, input, select, dialog { font: inherit; letter-spacing: 0; }
button { border: 1px solid #bec7c1; background: #fff; color: #17201c; border-radius: 5px; padding: 8px 12px; cursor: pointer; }
button:hover { border-color: #4c6b5a; }
button.primary { color: #fff; background: #1d5b3a; border-color: #1d5b3a; }
button.danger { color: #fff; background: #8f2f2f; border-color: #8f2f2f; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e9eeeb; }
.login-panel { width: min(400px, 100%); background: #fff; border: 1px solid #cdd5d0; border-radius: 6px; padding: 28px; box-shadow: 0 8px 24px rgba(20, 34, 26, .08); }
.login-panel h1 { font-size: 22px; margin: 6px 0 22px; }
.form-note { color: #56645c; font-size: 13px; line-height: 1.45; }
.login-panel label { display: grid; gap: 6px; margin: 14px 0; font-size: 13px; font-weight: 600; }
.login-panel input { width: 100%; border: 1px solid #aeb9b2; border-radius: 4px; padding: 10px; }
.login-panel button { width: 100%; margin-top: 10px; }
.brand { color: #1d5b3a; font-weight: 800; font-size: 20px; }
.error { min-height: 20px; color: #a32929; font-size: 13px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { background: #202925; color: #eef4f0; padding: 18px 12px; }
.brand-block { padding: 4px 8px 18px; border-bottom: 1px solid #3c4842; display: grid; gap: 2px; }
.brand-block strong { font-size: 18px; }
.brand-block span { font-size: 12px; color: #aebbb4; }
nav { display: grid; gap: 2px; margin-top: 14px; }
nav button { border: 0; color: #dfe8e3; background: transparent; text-align: left; padding: 8px 10px; }
nav button:hover, nav button.active { background: #35443c; color: #fff; }
main { min-width: 0; padding: 0 24px 28px; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d3dad6; }
.topbar h1 { font-size: 22px; margin: 0; }
.topbar p { margin: 4px 0 0; color: #637069; font-size: 13px; }
.admin-session { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.metric { background: #fff; border: 1px solid #d2d9d5; border-radius: 6px; padding: 14px; }
.metric span { display: block; color: #65726b; font-size: 12px; }
.metric strong { display: block; margin-top: 6px; font-size: 24px; }
.toolbar { display: flex; align-items: end; gap: 12px; margin: 18px 0 10px; }
.toolbar label { display: grid; gap: 4px; font-size: 12px; color: #59665f; }
.toolbar select, .toolbar input { min-width: 180px; border: 1px solid #bfc8c2; border-radius: 4px; padding: 8px; background: #fff; }
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; }
.organization-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.organization-tabs button.active { color: #fff; background: #3f7257; border-color: #3f7257; }
.action-surface { margin: 0 0 14px; border: 1px solid #cbd4cf; border-radius: 6px; background: #fff; }
.action-heading { min-height: 62px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.action-heading h2 { margin: 0; font-size: 15px; }
.action-heading p { margin: 3px 0 0; color: #65726b; font-size: 12px; }
.action-form { border-top: 1px solid #d7ded9; padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; }
.action-form label { display: grid; gap: 5px; color: #4f5d55; font-size: 12px; font-weight: 600; }
.action-form input, .action-form select { width: 100%; border: 1px solid #aeb9b2; border-radius: 4px; padding: 8px; background: #fff; }
.action-form .action-submit { align-self: end; min-height: 35px; }
.data-surface { position: relative; min-height: 240px; background: #fff; border-top: 2px solid #3f7257; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { background: #edf1ef; color: #4a5850; text-align: left; padding: 9px; border-bottom: 1px solid #cbd4cf; white-space: nowrap; }
td { padding: 9px; border-bottom: 1px solid #e4e8e6; max-width: 320px; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 5px; min-width: 150px; }
.row-actions button { padding: 5px 7px; font-size: 11px; white-space: nowrap; }
tr:hover td { background: #f8faf9; }
.empty, .loading { padding: 46px 20px; text-align: center; color: #69766f; }
#alerts .notice { margin-top: 12px; border-left: 3px solid #b07812; background: #fff8e8; padding: 10px 12px; font-size: 13px; }
#alerts .notice p { margin: 0 0 6px; }
.notice-success { border-left-color: #1d5b3a !important; background: #eef8f1 !important; }
.notice-error { border-left-color: #8f2f2f !important; background: #fff0f0 !important; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; font-size: 12px; }
dialog { width: min(520px, calc(100% - 32px)); border: 1px solid #abb8b0; border-radius: 7px; padding: 0; color: #17201c; }
dialog::backdrop { background: rgba(14, 24, 19, .55); }
.confirmation-panel { padding: 22px; display: grid; gap: 14px; }
.confirmation-panel h2, .confirmation-panel p { margin: 0; }
.confirmation-panel label { display: grid; gap: 6px; font-size: 13px; }
.confirmation-panel input { border: 1px solid #aeb9b2; border-radius: 4px; padding: 9px; }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 8px; }
.state-active, .state-online, .state-completed { color: #17623b; font-weight: 700; }
.state-suspended, .state-revoked, .state-failed, .state-overage { color: #a32929; font-weight: 700; }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 0 12px 20px; }
  .topbar { align-items: flex-start; padding: 14px 0; gap: 12px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar select, .toolbar input { min-width: 0; width: 100%; }
  .toolbar-actions { margin-left: 0; }
  .action-form { grid-template-columns: 1fr; }
}
