/* Собственные стили приложения. Никакой сборки фронта — обычный CSS-файл. */
:root {
    --bg: #f2f4f7;
    --card: #ffffff;
    --line: #d7dce3;
    --text: #1c2430;
    --muted: #66727f;
    --accent: #1f6fd0;
    --accent-dark: #17549c;
    --ok: #1c7c45;
    --err: #b02a2a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    background: #14212f; color: #fff; padding: 12px 20px;
}
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 17px; }
.topbar nav a { color: #cfd8e3; text-decoration: none; margin-left: 18px; }
.topbar nav a:hover { color: #fff; }

.container { max-width: 1120px; margin: 0 auto; padding: 22px 20px 60px; }

h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 19px; margin: 24px 0 10px; }

/* Плитки главной */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile {
    display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 22px; text-decoration: none; color: var(--text); transition: .12s;
}
.tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(20,33,47,.09); }
.tile .tile-title { font-size: 19px; font-weight: 700; }
.tile .tile-desc { color: var(--muted); font-size: 14px; margin-top: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: #eef1f5; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: #4a5765; }
tr.inactive td { color: var(--muted); background: #f8f9fb; }
td.num, th.num { text-align: right; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=date], input[type=number], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
    font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.btn {
    display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: #eef1f5; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #8e2020; }
.btn-lg { font-size: 18px; padding: 14px 26px; }
.btn-sm { font-size: 13px; padding: 5px 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert-ok { background: #e4f4ea; color: var(--ok); border: 1px solid #b9e0c9; }
.alert-err { background: #fbe7e7; color: var(--err); border: 1px solid #f0c2c2; }
.alert ul { margin: 0; padding-left: 18px; }
.error { color: var(--err); font-size: 13px; margin-top: 4px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-open { background: #e4f4ea; color: var(--ok); }
.badge-closed { background: #fde9d6; color: #9a5b13; }
.badge-off { background: #eceff3; color: var(--muted); }

/* Табло веса */
.scale-panel { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 18px; }
@media (max-width: 780px) { .scale-panel { grid-template-columns: 1fr; } }
.scale-display {
    background: #14212f; color: #7dfda3; border-radius: 10px; padding: 18px 22px; text-align: center;
}
.scale-value { font-size: 68px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.scale-unit { font-size: 22px; color: #cfd8e3; }
.scale-state { font-size: 13px; color: #cfd8e3; margin-top: 8px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #8b96a3; margin-right: 6px; }
.dot.on { background: #38d16a; }

/* Модалки Alpine (browser confirm() не используем) */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15,22,31,.55); display: flex;
    align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
    background: #fff; border-radius: 10px; padding: 22px; width: 100%; max-width: 520px;
    box-shadow: 0 18px 44px rgba(0,0,0,.28);
}
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.checklist { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.checklist label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; padding: 5px 0; }
.checklist input { width: auto; }
