/* Панель разработчика «Фитодиагностика». Без сторонних шрифтов и библиотек. */
:root {
  --bg: #f5f6f4;
  --panel: #ffffff;
  --text: #1d2420;
  --muted: #66706a;
  --line: #e1e5e2;
  --accent: #2f6b4f;
  --accent-soft: #e6f0ea;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 10px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* Каркас */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: #1f3a2d; color: #dfe9e3; padding: 16px 0; display: flex; flex-direction: column; }
.brand { padding: 0 18px 16px; font-weight: 600; font-size: 15px; color: #fff; }
.brand small { display: block; font-weight: 400; color: #9fb8aa; font-size: 12px; margin-top: 2px; }
.nav a { display: block; padding: 8px 18px; color: #dfe9e3; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .1); border-left-color: #8fd3ad; color: #fff; }
.nav .later { color: #7f978a; }
.sidebar .account { margin-top: auto; padding: 12px 18px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.sidebar .account button { margin-top: 8px; }
.main { padding: 24px 32px; min-width: 0; }

/* Элементы */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.metric .value { font-size: 26px; font-weight: 600; }
.metric .label { color: var(--muted); }
button, .btn {
  font: inherit; border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
button:hover { border-color: #c4ccc7; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #275b43; }
button.danger { color: var(--danger); border-color: #efc6c1; }
button.link { border: none; background: none; color: var(--accent); padding: 0; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea {
  font: inherit; border: 1px solid #cfd6d2; border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #b5d6c3; border-color: var(--accent); }
textarea { width: 100%; min-height: 90px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
label.field, div.field { display: block; }
.field > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
label.field input:not([type=checkbox]):not([type=radio]), label.field select { width: 100%; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f3f1; font-weight: 500; color: var(--muted); font-size: 12px; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f7faf8; }
tr.dim td { color: var(--muted); }
td.actions { white-space: nowrap; text-align: right; }
td.actions button + button { margin-left: 6px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef1ef; color: var(--muted); }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

.attention li { margin: 6px 0; }
.attention .kind { display: inline-block; min-width: 160px; }
.notice { padding: 10px 12px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* Окна */
.overlay { position: fixed; inset: 0; background: rgba(20, 30, 25, .35); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 10; overflow: auto; }
.modal { background: #fff; border-radius: 10px; box-shadow: var(--shadow); width: min(560px, 100%); padding: 20px; }
.modal.wide { width: min(760px, 100%); }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.secret { display: flex; gap: 8px; align-items: center; background: #f4f7f5; border: 1px dashed #b9c9bf; border-radius: 6px; padding: 8px 10px; }
.secret .value { font-family: ui-monospace, Consolas, monospace; font-size: 16px; flex: 1; word-break: break-all; }
.error-text { color: var(--danger); margin-top: 8px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.toast { background: #22352b; color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow); max-width: 420px; }
.toast.error { background: var(--danger); }

/* Вход */
.login { max-width: 360px; margin: 12vh auto; }
.login h1 { text-align: center; }
.login .card > * + * { margin-top: 12px; }
.login button { width: 100%; }
