* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: #111827;
    color: #fff;
    padding: 14px 0;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topnav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.topnav a {
    color: #fff;
    text-decoration: none;
}

.topnav a:hover {
    text-decoration: underline;
}

.page {
    padding: 24px 0 40px;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 20px;
}

.auth-card {
    max-width: 420px;
    margin: 48px auto;
}

.grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 20px;
}

.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.stat-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.stat-card p {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
}

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

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    color: #1f2937;
}

textarea {
    resize: vertical;
}

.btn {
    display: inline-block;
    background: #111827;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
}

.btn:hover {
    opacity: 0.95;
}

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

.table th,
.table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.table th {
    background: #f9fafb;
    font-weight: 700;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge {
    display: inline-block;
    background: #e5e7eb;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
}

.status-badge {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.lead-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.message-box {
    margin-top: 8px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    min-height: 48px;
}

.note-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.note-item:last-child {
    border-bottom: 0;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #6b7280;
}

.inline-form {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.inline-form .form-group {
    flex: 1 1 280px;
    margin-bottom: 0;
}

.timeline-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.timeline-item:last-child {
    border-bottom: 0;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #6b7280;
}

@media (max-width: 900px) {
    .stats-grid,
    .two-cols {
        grid-template-columns: 1fr;
    }

    .topbar-inner,
    .lead-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form .form-group {
        width: 100%;
    }
}
.filters-form {
    margin-bottom: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.filters-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-light {
    background: #e5e7eb;
    color: #111827;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.status-badge-table {
    background: #eef2ff;
    color: #3730a3;
    font-weight: 600;
}

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

    .filters-actions {
        width: 100%;
    }

    .filters-actions .btn {
        width: 100%;
        text-align: center;
    }
}