/* TG bot admin — мінімальний CSS, vanilla */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f4f5f7;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #222;
}

.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

header {
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e3e8;
    padding-bottom: 12px;
}
header h1 {
    margin: 0 0 8px;
    color: #111;
    font-size: 22px;
}
header nav a {
    display: inline-block;
    margin-right: 16px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
}
header nav a.active {
    color: #0a7;
    font-weight: 600;
    border-bottom: 2px solid #0a7;
}
header nav a:hover { color: #0a7; }

/* Flash messages */
.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 14px;
}
.flash-ok {
    background: #e8f7ec;
    color: #1b6d2e;
    border: 1px solid #b8e4c4;
}
.flash-err {
    background: #fdeaea;
    color: #9c2626;
    border: 1px solid #f0b8b8;
}
.flash ul { margin: 6px 0 0 20px; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid #e4e6ea;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.card h2 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}
.card p.hint {
    margin: 6px 0 0;
    color: #888;
    font-size: 12px;
}

/* Key-value inputs table */
table.kv {
    width: 100%;
    border-collapse: collapse;
}
table.kv td {
    padding: 6px 4px;
    border-bottom: 1px solid #f0f1f3;
}
table.kv td:first-child { /* lint-layout-ignore */
    color: #555;
    width: 55%;
}
table.kv td:last-child { /* lint-layout-ignore */
    text-align: right;
}
table.kv tr:last-child td { border-bottom: none; } /* lint-layout-ignore */
table.kv label {
    margin-right: 12px;
    font-size: 13px;
    color: #444;
}
input[type="number"],
input[type="text"] {
    font: inherit;
    padding: 6px 8px;
    border: 1px solid #cdd0d6;
    border-radius: 4px;
    background: #fff;
    width: 140px;
    text-align: right;
}
input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #0a7;
    box-shadow: 0 0 0 3px rgba(0, 160, 112, 0.15);
}

/* Pause checkbox */
label.checkbox.pause {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fef6e8;
    border: 1px solid #f2d48a;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}
label.checkbox.pause:has(input:checked) {
    background: #fde1d7;
    border-color: #e8937a;
    color: #9c2626;
}

/* Chips (marks, damages) */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
label.chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid #d0d3d8;
    border-radius: 16px;
    background: #fafbfc;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    transition: background .12s;
}
label.chip:hover { background: #f0f1f3; }
label.chip input { display: none; }
label.chip.on {
    background: #e0f4eb;
    border-color: #0a7;
    color: #0a7;
    font-weight: 500;
}
label.chip.on.danger {
    background: #fdeaea;
    border-color: #c94141;
    color: #9c2626;
}

/* Save button */
.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 20px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e4e6ea;
    border-radius: 8px;
}
.btn-save {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    background: #0a7;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s;
}
.btn-save:hover { background: #096; }
.btn-save:active { background: #085; }
.meta {
    margin: 0;
    color: #888;
    font-size: 12px;
}

/* Stats page */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border: 1px solid #e4e6ea;
    border-radius: 8px;
    padding: 16px 18px;
}
.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: #0a7;
    line-height: 1;
}
.stat-lbl {
    margin-top: 4px;
    color: #444;
    font-size: 13px;
}
.stat-sub {
    margin-top: 6px;
    color: #888;
    font-size: 11px;
}

/* Log table */
table.log {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.log th, table.log td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
table.log th {
    background: #fafbfc;
    color: #555;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}
table.log td.empty {
    text-align: center;
    color: #888;
    padding: 24px;
}
.log-row.status-error td { background: #fef4f4; }
.log-row.status-skipped_paused td { color: #888; }
.log-row.status-skipped_no_lots td { color: #b67800; }
.log-row.status-skipped_gap td { color: #888; font-size: 12px; }
.log-row.status-sent td { }

/* Mobile */
@media (max-width: 600px) {
    table.kv td { display: block; width: 100% !important; text-align: left; }
    table.kv td:first-child { padding-bottom: 2px; font-size: 12px; } /* lint-layout-ignore */
    input[type="number"] { width: 100%; text-align: left; }
    .actions { flex-direction: column; align-items: stretch; }
    .btn-save { width: 100%; }
}
