* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
}

a {
    text-decoration: none;
    color: #2563eb;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
}

.auth-box {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 380px;
}

.auth-box h1 {
    margin-top: 0;
    font-size: 22px;
    text-align: center;
}

form label {
    display: block;
    margin: 12px 0 4px;
    font-size: 14px;
    font-weight: 600;
}

form input[type="text"],
form input[type="password"],
form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    margin-top: 16px;
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    background: #e5e7eb;
    color: #1f2937;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.muted {
    color: #6b7280;
    font-size: 13px;
}

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

.alert-success {
    background: #dcfce7;
    color: #166534;
}

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

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #1e3a8a;
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 28px;
}

.sidebar nav a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: #dbeafe;
    margin-bottom: 6px;
    font-size: 14px;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar nav a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
}

.sidebar .user-info {
    margin-top: auto;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 16px;
}

.sidebar .logout-btn {
    margin-top: 10px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.main-content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1100px;
}

.page-title {
    font-size: 20px;
    margin: 0 0 18px;
}

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

.stat-box {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a8a;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card h2 {
    margin-top: 0;
    font-size: 17px;
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.leads-table th,
.leads-table td {
    text-align: right;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

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

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 12px 16px;
    }

    .sidebar .brand {
        margin-bottom: 0;
    }

    .sidebar nav {
        display: flex;
        gap: 6px;
    }

    .sidebar .user-info {
        margin-top: 0;
        margin-right: auto;
        border-top: none;
        padding-top: 0;
    }

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

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

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