:root {
    --color-main: #3A2A7A;
    --color-blue: #0085C8;
    --color-red: #E02828;
    --color-green: #009344;
    --bg-light: #F5F7FB;
    --text-main: #222;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
}

main {
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
}

.main-header {
    background: var(--color-main);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
}

.logo-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 60px;
}

.school-title {
    font-weight: 600;
}

.app-title {
    font-size: 14px;
    opacity: 0.9;
}

/* Центрируем только форму входа */
.auth-body .auth-main {
    display: flex;
    justify-content: center;
    padding: 40px 10px;
}

/* Общий вид карточек во всём приложении */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    width: 100%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

/* Для формы входа ограничиваем ширину */
.auth-main .card {
    max-width: 420px;
}

.card h1 {
    margin-top: 0;
    color: var(--color-main);
}

label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border-radius: 6px;
    border: 1px solid #ccd;
    font: inherit;
}

.btn-primary {
    background: var(--color-blue);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    background: #006da4;
}

.btn-danger {
    background: var(--color-red);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #dde;
    margin-bottom: 16px;
}

.nav-tabs a {
    padding: 8px 12px;
    border-radius: 999px 999px 0 0;
    text-decoration: none;
    color: #555;
    background: #e6e9f3;
}

.nav-tabs a.active {
    background: #fff;
    color: var(--color-main);
    border-bottom: 2px solid var(--color-blue);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.table th, .table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.badge-male {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--color-blue);
    color: #fff;
    font-size: 11px;
}

.badge-female {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--color-red);
    color: #fff;
    font-size: 11px;
}

#seating-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

#seating-seats-container {
    position: relative;
    width: 600px;
    height: 400px;
    border: 1px solid #ccd;
    background: #fafbff;
    overflow: auto;
}

#seating-seats {
    position: relative;
    width: 100%;
    height: 100%;
}

#seating-students {
    width: 260px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ccd;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

.student-chip {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #3A2A7A;
    margin-bottom: 4px;
    font-size: 13px;
    cursor: grab;
    background: #fff;
}

.student-chip:hover {
    background: #f0f3ff;
}

.map-editor-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.map-editor-left {
    flex: 1 1 520px;
}

.map-editor-right {
    flex: 0 0 260px;
}

/* Одна версия .map-editor-canvas, с сеткой */
.map-editor-canvas {
    position: relative;
    width: 800px;
    max-width: 100%;
    height: 500px;
    border: 1px dashed #99a;
    background-image:
        linear-gradient(#eceffd 1px, transparent 1px),
        linear-gradient(90deg, #eceffd 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #f7f8ff;
    border-radius: 8px;
    overflow: hidden;
}

.small-note {
    font-size: 13px;
    color: #666;
}

.seat-tile {
    position: absolute;
    background: #fff;
    border: 2px solid #3A2A7A;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #3A2A7A;
    cursor: move;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.seat-tile:hover {
    background: #eef1ff;
}