* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #222;
}

.topbar {
    background: #0d1b2a;
    color: #fff;
    padding: 14px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 20px;
    font-weight: bold;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
}

nav a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 25px auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    padding: 22px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

h1, h2, h3 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 15px;
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

button, .btn {
    background: #1b75bb;
    color: #fff;
    padding: 11px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover {
    background: #145a91;
}

.btn-danger {
    background: #c0392b;
}

.btn-danger:hover {
    background: #922b21;
}

.login-wrapper {
    max-width: 420px;
    margin: 80px auto;
}

.error {
    background: #ffe6e6;
    color: #b00020;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.success {
    background: #e7f8ec;
    color: #1e7e34;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    padding: 22px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #1b75bb;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table th,
table td {
    padding: 11px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

table th {
    background: #0d1b2a;
    color: #fff;
}

footer {
    text-align: center;
    padding: 20px;
    color: #777;
}

canvas {
    max-width: 100%;
}

.card canvas {
    margin-top: 15px;
}

.source-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

.source-scraper {
    background: #1b75bb;
}

.source-lead-form {
    background: #28a745;
}

.source-csv {
    background: #6c757d;
}

.source-unknown {
    background: #343a40;
}

.calendar-legend {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 20px;
}

.legend-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.legend-dot.booked {
    background: #1b75bb;
}

.legend-dot.completed {
    background: #28a745;
}

.legend-dot.cancelled {
    background: #dc3545;
}

.legend-dot.converted {
    background: #6f42c1;
}

.legend-dot.noshow {
    background: #fd7e14;
}

.legend-dot.manual {
    background: #6c757d;
}

@media (max-width: 800px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        margin-top: 12px;
    }

    nav a {
        display: inline-block;
        margin: 5px 10px 5px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}