* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #20252b;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: min(420px, calc(100% - 32px));
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.brand {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 8px 0 12px;
}

h2 {
    margin-top: 0;
}

.muted {
    color: #69737d;
}

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

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccd3da;
    border-radius: 8px;
    font-size: 16px;
}

button {
    margin-top: 22px;
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    background: #222;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.secondary {
    margin-top: 0;
}

.error {
    margin: 16px 0;
    padding: 10px 12px;
    background: #fdecec;
    border-radius: 8px;
}

.topbar {
    background: white;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e6ea;
}

.topbar h1 {
    margin-bottom: 0;
}

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

.panel {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 22px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.04);
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.site-card {
    border: 1px solid #e0e5e9;
    border-radius: 10px;
    padding: 18px;
}

.site-card strong,
.site-card span {
    display: block;
}

.site-card span {
    margin-top: 6px;
    color: #69737d;
}

.dashboard-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.stat-card {
    border: 1px solid #e0e5e9;
    border-radius: 10px;
    padding: 18px;
    background: #fafbfc;
}

.stat-card span {
    display: block;
    color: #69737d;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
}

.site-heading {
    margin-top: 32px;
}

.site-card {
    background: #fafbfc;
}

.site-number {
    font-size: 22px;
    font-weight: 700;
    margin: 10px 0 8px;
}

.site-card span {
    margin-top: 4px;
}

@media (max-width: 640px) {
    .topbar {
        padding: 16px 18px;
    }

    .topbar h1 {
        font-size: 22px;
    }

    .container {
        margin-top: 18px;
    }

    .panel {
        padding: 18px;
    }

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

.search-panel {
    margin-bottom: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid #e5e9ed;
}

.search-row {
    display: flex;
    gap: 10px;
    max-width: 620px;
}

.search-row input {
    flex: 1;
}

.search-row button {
    margin-top: 0;
    white-space: nowrap;
}

#search-message {
    margin-top: 10px;
}

.search-results {
    margin-top: 22px;
}

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

.results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.results-table th,
.results-table td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid #e5e9ed;
}

.results-table th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #69737d;
}

.results-table td {
    font-size: 14px;
}

@media (max-width: 640px) {
    .search-row {
        flex-direction: column;
    }

    .search-row button {
        width: 100%;
    }
}

.tcm-logo {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
}

@media (max-width: 640px) {
    .tcm-logo {
        width: 190px;
    }
}

.call-note {
    margin: 18px 0 0;
    padding: 12px 14px;
    background: #f7f8fa;
    border: 1px solid #e3e7eb;
    border-radius: 8px;
    color: #5f6872;
    font-size: 13px;
    line-height: 1.5;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.date-controls button {
    margin-top: 0;
}

.date-controls input[type="date"] {
    width: auto;
    min-height: 42px;
}

@media (max-width: 700px) {
    .dashboard-heading {
        flex-direction: column;
    }

    .date-controls {
        width: 100%;
    }
}
