:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202a;
  background: #f5f7f9;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #edf1f4; }
.login-panel { width: min(380px, 100%); padding: 36px; background: #fff; border: 1px solid #d9e0e5; border-radius: 6px; box-shadow: 0 12px 36px rgba(20, 35, 50, .08); }
.login-panel h1 { margin: 18px 0 4px; font-size: 24px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: #087e72; font-weight: 800; font-size: 20px; }
.brand-mark.small { width: 30px; height: 30px; font-size: 14px; }
.muted { color: #667680; margin: 0 0 24px; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 600; color: #34434d; }
input, select { width: 100%; height: 40px; border: 1px solid #bdc8cf; border-radius: 4px; padding: 0 11px; background: #fff; color: #17202a; }
input:focus, select:focus { outline: 2px solid rgba(8,126,114,.2); border-color: #087e72; }
button { border: 1px solid #bdc8cf; background: #fff; border-radius: 4px; min-height: 36px; padding: 0 13px; color: #26343d; }
button:hover { background: #f1f5f6; }
button.primary { color: #fff; background: #087e72; border-color: #087e72; }
button.primary:hover { background: #066d63; }
button.danger { color: #a32929; border-color: #dcaeae; }
.wide { width: 100%; }
.error { color: #b42318; min-height: 18px; margin: 0; font-weight: 500; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { background: #172a32; color: #eaf0f2; display: flex; flex-direction: column; min-height: 100vh; }
.brand-row { height: 64px; display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.09); }
nav { padding: 14px 10px; display: grid; gap: 4px; }
nav button { display: flex; gap: 11px; align-items: center; border: 0; color: #b9c6cb; background: transparent; text-align: left; height: 40px; }
nav button.active, nav button:hover { color: #fff; background: #27404a; }
.sidebar-foot { margin-top: auto; min-height: 62px; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.09); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar .icon-button { color: #fff; border-color: transparent; background: transparent; }
.workspace { min-width: 0; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; background: #fff; border-bottom: 1px solid #dce3e7; }
.topbar h2 { font-size: 20px; margin: 0 0 3px; }
.topbar p { margin: 0; color: #71808a; }
.content { padding: 24px 28px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar input { width: min(320px, 100%); }
.table-wrap { overflow-x: auto; border: 1px solid #d9e0e5; border-radius: 6px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; height: 48px; padding: 8px 14px; border-bottom: 1px solid #e6ebee; vertical-align: middle; }
th { color: #5d6a73; background: #f7f9fa; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfc; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.actions button { min-height: 30px; padding: 0 9px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #159447; }
.status.disabled::before, .status.pending_delete::before { background: #d89016; }
.empty { padding: 54px 20px; text-align: center; color: #71808a; }
.notice { margin: 14px 28px 0; padding: 10px 13px; border-left: 3px solid #087e72; background: #eaf6f4; color: #165c55; }
.notice.bad { border-color: #b42318; background: #fff0ee; color: #8f1d14; }
.icon-button { width: 36px; padding: 0; font-size: 20px; display: inline-grid; place-items: center; }
dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid #cad3d8; border-radius: 6px; box-shadow: 0 24px 70px rgba(16,30,40,.25); }
dialog::backdrop { background: rgba(13,27,34,.48); }
.modal-shell > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #e1e6e9; }
.modal-shell h3 { margin: 0; font-size: 17px; }
#modal-body { padding: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.secret-box { background: #f4f7f8; border: 1px solid #d6dfe3; padding: 12px; word-break: break-all; font-family: ui-monospace, monospace; }
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; padding-bottom: 62px; }
  .sidebar { position: fixed; z-index: 10; inset: auto 0 0; min-height: 62px; height: 62px; flex-direction: row; }
  .brand-row, .sidebar-foot span { display: none; }
  nav { flex: 1; display: flex; padding: 6px; }
  nav button { flex: 1; justify-content: center; height: 50px; padding: 0 6px; }
  .sidebar-foot { margin: 0; padding: 8px 6px; border: 0; min-height: 62px; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .notice { margin: 12px 16px 0; }
}
