* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    color: #1f2d3d;
    background: #f4f6f8;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 6px;
}

.sidebar .brand {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
}

.sidebar a:hover { background: #334155; color: #fff; }

.sidebar .spacer, .card-head .spacer { flex: 1; }

.sidebar .me { font-size: 13px; color: #94a3b8; padding: 8px 10px; }

.content { flex: 1; padding: 24px 32px; }

h1 { font-size: 22px; margin: 0 0 16px; }

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    margin-bottom: 16px;
}

th, td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    vertical-align: middle;
}

th { background: #eef2f7; font-weight: 600; }

table.nested { box-shadow: none; margin: 0; }

ul.notes { margin: 0; padding-left: 18px; }
ul.notes li { margin: 2px 0; }

tr.voided td { opacity: .5; text-decoration: line-through; }

.muted { color: #64748b; font-size: 13px; }
.mono { font-family: Consolas, monospace; font-size: 12px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #e2e8f0;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fee2e2; color: #991b1b; }

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    padding: 16px;
    margin-bottom: 16px;
}

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

button {
    background: #1e88e5;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 14px;
    cursor: pointer;
}
button:hover { background: #1565c0; }

button.link { background: none; color: #cbd5e1; padding: 8px 10px; text-align: left; }
button.link:hover { background: #334155; }

form.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #475569; }

input, select {
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    min-width: 140px;
}

.notice, .ok, .error {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.ok { background: #dcfce7; color: #166534; }
.error { background: #fee2e2; color: #991b1b; }
.notice { background: #e0f2fe; color: #075985; }

.login {
    max-width: 340px;
    margin: 80px auto;
    background: #fff;
    padding: 28px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.login h1 { margin-bottom: 4px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.login button { margin-top: 6px; }

/* Магазины и устройства */
.stores-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stores-toolbar .search {
    flex: 1 1 320px;
    min-width: 260px;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.stores-toolbar .spacer { flex: 1; }

.stores-toolbar .count { margin-left: 20px; white-space: nowrap; color: #64748b; }

.check { color: #2e7d32; font-weight: 700; }
.editable { cursor: pointer; }
.editable:hover { text-decoration: underline dotted; }

.nowrap { white-space: nowrap; }

.store-card { padding: 0; overflow: hidden; }

/* зебра, чтобы глаза не разбегались */
.store-card:nth-child(even) { background: #ffffff; }
.store-card:nth-child(odd) { background: #f4f8ff; }

.store-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.store-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

table.devices { margin: 0; }
table.devices th, table.devices td { padding: 6px 12px; }

.inline-edit {
    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 6px;
    min-width: 160px;
    transition: border-color .15s, background .15s;
}
.inline-edit:hover:not(:disabled) { border-color: #cbd5e1; background: #fff; }
.inline-edit:focus { outline: none; border-color: #1e88e5; background: #fff; box-shadow: 0 0 0 3px rgba(30, 136, 229, .15); }
.inline-edit:disabled { color: inherit; background: transparent; cursor: default; }
.inline-edit.match { background: #fffbe6; border-color: #ffe08a; }

.store-name { font-size: 17px; font-weight: 600; }

.link.small { font-size: 12px; padding: 2px 6px; color: #1565c0; background: none; border: none; cursor: pointer; }
.link.small:hover { text-decoration: underline; }

button.small { height: 30px; padding: 0 12px; font-size: 13px; }

.saved { color: #166534; font-size: 12px; }

mark { background: #ffe58f; padding: 0 2px; border-radius: 3px; }

