/* Приложение «Инструменты». Фрейм Битрикс24 всегда светлый — палитра светлая, близкая к интерфейсу портала. */
:root {
    --bg: #eef2f4;
    --surface: #ffffff;
    --text: #333333;
    --muted: #80868e;
    --line: #dfe3e6;
    --accent: #2fc6f6;
    --accent-strong: #11a9d9;
    --primary: #bbed21;
    --primary-text: #535c69;
    --good-bg: #eef9e3;
    --good: #4f8a10;
    --bad-bg: #fff0f0;
    --bad: #c62828;
    --warn: #b26a00;
    --radius: 10px;
    font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 15px; margin: 16px 0 8px; font-weight: 600; }
p { margin: 0 0 8px; line-height: 1.45; }

.page { padding: 16px; }

.shell { min-height: 100vh; }

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
}

.tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab {
    border: 0;
    background: none;
    padding: 14px 12px 12px;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    border-radius: 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab.admin { margin-left: auto; }

.user { color: var(--muted); white-space: nowrap; font-size: 13px; }

.content { padding: 16px; max-width: 1280px; }

.stack { display: flex; flex-direction: column; gap: 16px; }

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.panel.empty { text-align: center; padding: 40px 20px; }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { margin-top: 0; }

.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }

.hint { color: var(--muted); font-size: 13px; }

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 9px;
    background: #fff4d6;
    color: var(--warn);
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}

.note { padding: 10px 14px; border-radius: 8px; background: #f3f6f8; }
.note.good { background: var(--good-bg); color: var(--good); }
.note.bad { background: var(--bad-bg); color: var(--bad); }

.list { margin: 0; padding-left: 20px; line-height: 1.6; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 8px 0; }
.row.end { justify-content: flex-end; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field { margin: 12px 0; }
.label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input, select {
    font: inherit;
    color: var(--text);
    padding: 7px 10px;
    border: 1px solid #c6cdd3;
    border-radius: 6px;
    background: #fff;
    min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

button {
    font: inherit;
    padding: 7px 16px;
    border-radius: 6px;
    border: 1px solid #c6cdd3;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}
button:hover { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
button.primary:hover { background: #d2f95f; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 10px;
    border-radius: 14px;
    background: #e5f7fd;
    font-size: 13px;
}
.chip-x { border: 0; background: none; padding: 0 6px; font-size: 16px; line-height: 1; color: var(--muted); }
.chip-x:hover { color: var(--bad); }

.combo { position: relative; max-width: 420px; }
.combo input { width: 100%; }
.combo-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 2px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    z-index: 10;
    max-height: 280px;
    overflow-y: auto;
}
.combo-list button { width: 100%; text-align: left; border: 0; border-radius: 0; padding: 6px 12px; }
.combo-list button:hover { background: #f1f8fb; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    max-width: 420px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #333;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
    z-index: 20;
}
.toast.good { background: var(--good); }
.toast.bad { background: var(--bad); }

@media (max-width: 640px) {
    .content, .page { padding: 12px 16px; }
    .cards, .grid2 { grid-template-columns: 1fr; }
    .user { display: none; }
}
