/*
 * Sinergia Trainer — общие стили
 * Корпоративный синий #1e40af, системный sans, минимум зависимостей.
 */

:root {
    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --primary-dark: #1e3a8a;
    --text: #1f2937;
    --muted: #6b7280;
    --text-muted: #6b7280;
    --bg: #f9fafb;
    --surface: #ffffff;
    --card: #ffffff;
    --border: #e5e7eb;
    --error: #dc2626;
    --success: #16a34a;
    --warning: #f59e0b;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Шапка приложения */
.app-header {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.app-header .user-info {
    font-size: 0.9rem;
    opacity: 0.95;
}

/* Контейнеры */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.container.narrow {
    max-width: 480px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

h2 { color: var(--primary); margin-top: 0; }

/* Формы */
label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

/* Кнопки */
button.primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

button.primary:hover { background: var(--primary-hover); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; background: var(--muted); }

button.secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

button.danger {
    background: var(--error);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

/* Статусы */
.error {
    color: var(--error);
    font-size: 0.9rem;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: #fee2e2;
    border-radius: 4px;
}

.success {
    color: var(--success);
    font-size: 0.9rem;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: #dcfce7;
    border-radius: 4px;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
}

th, td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.active { background: #dcfce7; color: #166534; }
.badge.inactive { background: #fee2e2; color: #991b1b; }
.badge.admin { background: #dbeafe; color: #1e40af; }
.badge.manager { background: #fef3c7; color: #92400e; }

/* Адаптив (десктоп + планшет) */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .app-header { padding: 1rem; }
    table { font-size: 0.85rem; }
}
