/* ── KOI Design System CSS Variables ── */

:root {
    /* Фоны */
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-hover: #475569;

    /* Текст */
    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e0;
    --text-muted: #94a3b8;

    /* Акценты */
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-light: #8b5cf6;

    /* Семантика */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Скругления */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Тени */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);

    /* Шрифт */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

a {
    color: var(--accent-light);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--bg-hover);
}
.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--error);
    color: #fff;
}
.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ── Form elements ── */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-input.error {
    border-color: var(--error);
}

.form-error {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
}

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

/* ── Cards ── */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* ── Tables ── */

.table-container {
    overflow-x: auto;
}

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

table thead {
    background: var(--bg-input);
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--bg-hover);
}

table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr:hover {
    background: var(--bg-hover);
}

/* ── Status badges ── */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.badge-pending { background: rgba(245,158,11,.2); color: #f59e0b; }
.badge-approved { background: rgba(16,185,129,.2); color: #10b981; }
.badge-rejected { background: rgba(239,68,68,.2); color: #ef4444; }
.badge-documents_sent { background: rgba(59,130,246,.2); color: #3b82f6; }
.badge-documents_signed { background: rgba(139,92,246,.2); color: #8b5cf6; }
.badge-completed { background: rgba(16,185,129,.2); color: #10b981; }

/* ── Layout ── */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 24px 0;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
}

/* ── Utility ── */

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.gap-1 { gap: 8px; }
