/* ---------- База ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: #222;
    background: #fff;
}

/* ---------- Шапка ---------- */
.topbar {
    background: #222;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 12px;
}

.topbar .brand {
    font-size: 18px;
    font-weight: bold;
    margin-left: 0;
}

/* ---------- Главная таблица ---------- */
table.layout {
    width: 100%;
    border-collapse: collapse;
    min-height: calc(100vh - 120px); /* чтобы подвал не подпрыгивал */
}

table.layout > tbody > tr > td {
    vertical-align: top;
    padding: 20px;
}

td.left {
    width: 200px;
    background: #f4f4f4;
    border-right: 1px solid #ddd;
}

td.center {
    /* растягивается сам, т.к. width не задан */
}

td.right {
    width: 200px;
    background: #f4f4f4;
    border-left: 1px solid #ddd;
}

/* ---------- Меню ---------- */
.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    margin-bottom: 8px;
}

.menu a {
    color: #222;
    text-decoration: none;
}

.menu a:hover {
    text-decoration: underline;
}

/* ---------- Подвал ---------- */
.footer {
    background: #222;
    color: #aaa;
    padding: 12px 20px;
    text-align: center;
    font-size: 13px;
}

/* ---------- Формы (базово) ---------- */
form p { margin: 12px 0; }
form label { display: block; }
form input[type="text"],
form input[type="password"],
form input[type="date"] {
    padding: 6px 8px;
    border: 1px solid #ccc;
    width: 100%;
    max-width: 320px;
}

button {
    padding: 8px 16px;
    border: 1px solid #222;
    background: #222;
    color: #fff;
    cursor: pointer;
}

button:hover {
    background: #000;
}

.errors {
    color: #900;
    background: #fee;
    padding: 10px 20px;
    border: 1px solid #fbb;
}

.success {
    color: #060;
    background: #efe;
    padding: 10px 20px;
    border: 1px solid #bfb;
}

/* ---------- Мобильный: колонки стакаются ---------- */
@media (max-width: 768px) {
    table.layout,
    table.layout > tbody,
    table.layout > tbody > tr,
    table.layout > tbody > tr > td {
        display: block;
        width: 100%;
    }

    td.left, td.right {
        border: none;
        border-top: 1px solid #ddd;
    }
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    display: block;
    margin-bottom: 16px;
}