* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    min-height: 64px;
    background: #0f172a;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
}

.topbar strong {
    display: block;
    font-size: 18px;
}

.topbar span {
    color: #cbd5e1;
    font-size: 13px;
}

.topbar nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar nav a {
    background: rgba(255,255,255,0.08);
    padding: 9px 14px;
    border-radius: 12px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 64px);
}

.tabs {
    background: #111827;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tab-btn {
    border: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: #1f2937;
    color: #e5e7eb;
    cursor: pointer;
    text-align: right;
    font-size: 15px;
}

.tab-btn.active {
    background: #2563eb;
    color: white;
}

.content {
    padding: 24px;
    max-width: 1100px;
    width: 100%;
}

.panel-title h1 {
    margin-bottom: 4px;
}

.panel-title p {
    color: #64748b;
    margin-top: 0;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    margin: 18px 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.card h2,
.card h1 {
    margin-top: 0;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 12px;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

button {
    font-family: inherit;
}

.card button,
.login-card button,
.chat-input-row button {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
}

.record-item {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: #f8fafc;
}

.record-item h3 {
    margin: 0 0 8px;
}

.record-item p {
    white-space: pre-wrap;
}

.record-item small,
.chat-message small {
    color: #64748b;
}

.muted {
    color: #64748b;
}

.hidden {
    display: none;
}

.chat-box {
    height: 360px;
    overflow: auto;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    margin-bottom: 12px;
}

.chat-message {
    background: white;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.chat-message p {
    margin: 6px 0;
}

.chat-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.chat-input-row input {
    margin: 0;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, #1d4ed8, transparent 32%),
        #0f172a;
}

.login-card {
    width: min(420px, calc(100% - 32px));
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.brand {
    color: #2563eb;
    font-weight: bold;
    margin-bottom: 12px;
}

.login-card h1 {
    margin-top: 0;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 14px;
}

.hint {
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px;
    font-size: 13px;
    color: #475569;
}

.manager-layout {
    padding: 24px;
    max-width: 1100px;
    margin: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px;
    text-align: right;
}

th {
    background: #f8fafc;
}

@media (max-width: 820px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: row;
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
    }

    .content {
        padding: 14px;
    }

    .chat-input-row {
        grid-template-columns: 1fr;
    }
}
