* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #1e293b;
    line-height: 1.5;
}

header {
    background: white;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    max-height: 50px;
    width: auto;
}

nav a, nav span {
    margin-left: 1rem;
    text-decoration: none;
    color: #3b82f6;
    font-weight: 500;
}

nav a:hover {
    text-decoration: underline;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

button, .btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

button:hover, .btn:hover {
    background: #2563eb;
}

.btn.danger {
    background: #ef4444;
}

.btn.danger:hover {
    background: #dc2626;
}

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.auth-container input, 
form input, 
form textarea, 
form select {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
}

input[type="date"], 
input[type="time"] {
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    width: 100%;
    font-family: inherit;
}

form label {
    font-weight: 600;
    margin-top: 0.5rem;
    display: block;
}

/* Calendar styles */
.calendar-container {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-weekday {
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
}

.calendar-day {
    min-height: 80px;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: white;
    overflow-y: auto;
}

.calendar-day strong {
    display: block;
    margin-bottom: 0.25rem;
}

.calendar-day .event {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: default;
}

.event.approved {
    background: #dcfce7;
    border-left: 3px solid #10b981;
}

.event.pending {
    background: #fef9c3;
    border-left: 3px solid #f59e0b;
}

.event.rejected {
    background: #ffe4e2;
    border-left: 3px solid #ef4444;
}

/* External booking (other contractor) - greyed out */
.event.busy {
    background: #f1f5f9;
    border-left: 3px solid #94a3b8;
    color: #475569;
}

/* Status badges */
.status-approved {
    color: #10b981;
    font-weight: bold;
}

.status-pending {
    color: #f59e0b;
    font-weight: bold;
}

.status-rejected {
    color: #ef4444;
    font-weight: bold;
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow-x: auto;
    display: block;
}

.data-table th, 
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
}

/* Booking cards (for pending approvals) */
.booking-card {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-left: 4px solid #3b82f6;
}

.booking-card h3 {
    margin-bottom: 0.5rem;
    color: #0f172a;
}

/* Stats on admin dashboard */
.stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.stat-card {
    background: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 1.25rem;
    font-weight: 600;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

/* Booking list for contractor */
.booking-list {
    list-style: none;
    margin-top: 1rem;
}

.booking-list li {
    background: white;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #3b82f6;
}

/* iCal link */
.ical-link {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #eef2ff;
    border-radius: 0.5rem;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    nav a, nav span {
        margin: 0 0.5rem;
    }
    .calendar-day {
        min-height: 60px;
        font-size: 0.75rem;
    }
    .calendar-day .event {
        font-size: 0.6rem;
        white-space: normal;
        word-break: break-word;
    }
    .data-table th, 
    .data-table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    .stat-card {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
    .btn, button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}