:root {
    font-family: Tahoma, Arial, sans-serif;
    color: #1f2937;
    background: #f5f7fb;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    line-height: 1.8;
}

a {
    color: #2457c5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 5%;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.brand {
    color: #172554;
    font-size: 1.1rem;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user form {
    margin: 0;
}

.page-container {
    width: min(1100px, 92%);
    margin: 32px auto;
}

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1,
.auth-card h1 {
    margin: 0 0 8px;
}

.muted {
    color: #6b7280;
}

.bot-grid,
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.bot-card,
.auth-card,
.empty-state {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgb(15 23 42 / 4%);
}

.bot-card h2 {
    margin-top: 0;
}

.bot-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.role-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.85rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

.button-primary {
    color: white;
    background: #2457c5;
}

.button-primary:hover {
    background: #1e40af;
    text-decoration: none;
}

.button-outline {
    color: #374151;
    background: white;
    border-color: #d1d5db;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 32px;
}

.auth-card {
    width: min(440px, 100%);
}

.form-stack {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.form-field {
    display: grid;
    gap: 6px;
}

.form-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
    direction: rtl;
}

.form-input:focus {
    outline: 2px solid #93b4ff;
    border-color: #2457c5;
}

.field-error,
.form-errors {
    color: #b91c1c;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #eef2ff;
    border-radius: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 10px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.button-danger {
    color: #ffffff;
    background: #b91c1c;
}

.button-danger:hover {
    background: #991b1b;
}

.form-field small {
    font-size: 0.85rem;
}

.form-input {
    max-width: 100%;
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}