@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/static/fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/static/fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/static/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/static/fonts/Inter-Bold.woff2") format("woff2"); }

:root {
  --color-bg: #F6F6F9;
  --color-surface: #FFFFFF;
  --color-text: #3F3F46;
  --color-text-strong: #121212;
  --color-nav-active-text: #334155;
  --color-accent: #FFCC00;
  --color-accent-hover: #FFD940;
  --color-nav-active: #FFD940;
  --color-muted: #64748B;
  --color-divider: #F1F5F9;
  --color-border: #E4E4E7;
  --color-input-border: #CBD5E1;
  --color-input-focus: #303030;
  --color-running-bg: #FFEDA7;
  --color-running-text: #F8AB17;
  --color-success-bg: #F0FDF4;
  --color-success-text: #16A34A;
  --color-error-bg: #FEEEEE;
  --color-error-row: #FFF2F2;
  --color-error-text: #DC2626;
  --color-info-bg: #F1EEFE;
  --color-shadow: rgba(63, 63, 70, 0.08);
  --radius-card: 16px;
  --radius-control: 12px;
  --sidebar-width: 104px;
  --header-height: 72px;
  --font-main: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 20px;
}

a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
}

.sidebar-logo { display: block; width: 48px; height: 48px; margin: 4px 0 20px; }
.sidebar-logo img { display: block; width: 100%; height: 100%; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 92px;
  height: 72px;
  border-radius: var(--radius-control);
  color: var(--color-text);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  text-decoration: none;
}
.nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--color-divider); }
.nav-item.is-active { background: var(--color-nav-active); color: var(--color-nav-active-text); }

.main { display: flex; flex-direction: column; min-width: 0; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-height);
  padding: 0 32px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.header-title { font-size: 30px; line-height: 36px; font-weight: 700; color: var(--color-text); }
.header-user { display: flex; align-items: center; gap: 16px; font-size: 15px; font-weight: 500; }
.header-user form { margin: 0; }

.content { flex: 1; padding: 24px 32px; display: flex; flex-direction: column; gap: 24px; }
.content-narrow { max-width: 720px; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 2px 8px var(--color-shadow);
  padding: 20px 24px;
}
.card-title { font-size: 18px; line-height: 26px; font-weight: 600; margin-bottom: 16px; }
.card-label { font-size: 13px; color: var(--color-muted); }
.card-value { font-size: 16px; font-weight: 600; color: var(--color-text); }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.card-row:last-child { border-bottom: 0; }
.card-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--color-muted); padding: 12px 12px; }
.table td { padding: 12px 12px; border-top: 1px solid var(--color-divider); font-size: 14px; }
.table tr.is-error td { background: var(--color-error-row); }
.table-wrap + .form { margin-top: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--color-accent);
  color: var(--color-text-strong);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--color-accent-hover); }
.btn-secondary { background: var(--color-surface); border-color: var(--color-input-border); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-divider); }
.btn-block { display: flex; width: 100%; height: 44px; font-size: 15px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-info-bg);
  color: var(--color-text);
}
.badge-running { background: var(--color-running-bg); color: var(--color-running-text); }
.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-error { background: var(--color-error-bg); color: var(--color-error-text); }

.form { display: flex; flex-direction: column; gap: 16px; }
.form-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 200px; }
.field label { font-size: 14px; font-weight: 600; color: var(--color-text); }
.input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-input-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-strong);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
}
.input:focus { outline: none; border-color: var(--color-input-focus); }
.code { padding: 1px 6px; border-radius: 4px; background: var(--color-divider); color: var(--color-text-strong); font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.link-button { padding: 0; border: 0; background: none; color: var(--color-text); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.field-error { font-size: 12px; color: var(--color-error-text); }

.alert { padding: 12px 16px; border-radius: var(--radius-control); font-size: 14px; font-weight: 500; }
.alert-error { background: var(--color-error-bg); color: var(--color-error-text); }
.alert-success { background: var(--color-success-bg); color: var(--color-success-text); }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; padding: 32px; }
.auth-logo { display: block; width: 180px; height: auto; margin: 0 auto 4px; }
.auth-title { font-size: 20px; line-height: 28px; font-weight: 700; text-align: center; }
.auth-divider { text-align: center; font-size: 13px; color: var(--color-muted); }
