:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #991b1b;
    --primary-dark: #7f1d1d;
    --dark: #1f2937;
    --green-bg: #dcfce7;
    --green-text: #166534;
    --yellow-bg: #fef3c7;
    --yellow-text: #92400e;
    --red-bg: #fee2e2;
    --red-text: #991b1b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px;
}

.header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.header h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.user-box {
    background: #f9fafb;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.user-box a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
}

.alert {
    background: var(--green-bg);
    color: var(--green-text);
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-weight: 700;
    border: 1px solid #bbf7d0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    line-height: 1.1;
}

.filters {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.filters a {
    background: #f9fafb;
    color: var(--dark);
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 13px;
    transition: 0.2s ease;
}

.filters a:hover {
    background: #f3f4f6;
}

.filters a.active {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}

.filters a.export {
    margin-left: auto;
    background: #14532d;
    color: white;
    border-color: #14532d;
}

table {
    width: 100%;
    background: var(--card);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

th {
    background: #111827;
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.45;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.badge,
.success,
.warning,
.danger,
.follow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}

.badge {
    background: #f3f4f6;
    color: var(--dark);
    border: 1px solid var(--border);
}

.success {
    background: var(--green-bg);
    color: var(--green-text);
}

.warning {
    background: var(--yellow-bg);
    color: var(--yellow-text);
}

.danger {
    background: var(--red-bg);
    color: var(--red-text);
}

.follow {
    background: #f3f4f6;
    color: var(--dark);
    text-decoration: none;
    border: 1px solid var(--border);
}

.active-follow {
    background: var(--yellow-bg);
    color: var(--yellow-text);
    border-color: #fde68a;
}

.link {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

input,
select,
textarea {
    font-family: inherit;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    outline: none;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.12);
}

label {
    color: var(--dark);
}

@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 700px) {
    .container {
        padding: 16px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .filters a.export {
        margin-left: 0;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #6b7280;
    font-size: 12px;
    border-top: 1px solid #e5e7eb;
}