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

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.screen {
    min-height: 100vh;
}

/* Auth Screen */
.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    text-align: center;
}

/* Header */
header {
    background: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

section {
    background: var(--card-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Timer Section */
.timer-container {
    text-align: center;
}

.timer-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.project-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    min-width: 200px;
}

.timer-description {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.btn-timer {
    min-width: 120px;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #1a252f;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Projects List */
.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.project-card {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-info h3 {
    margin-bottom: 0.5rem;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    color: var(--text-color);
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Time Entries */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.entry-card {
    padding: 1rem;
    border-left: 4px solid;
    background: var(--bg-color);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-info {
    flex: 1;
}

.entry-time {
    font-weight: bold;
    color: var(--primary-color);
}

.entry-actions {
    display: flex;
    gap: 0.5rem;
}

.daily-summary {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    text-align: center;
}

.summary-item .label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.break-indicator {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

/* Settings Form */
.settings-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.date-filter {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .timer-controls {
        flex-direction: column;
    }

    .timer-description {
        width: 100%;
    }

    .projects-list {
        grid-template-columns: 1fr;
    }
}

/* Customers */
.customers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.customer-card {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-info h3 {
    margin-bottom: 0.25rem;
}

.badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
}

/* Project groups */
.project-group {
    margin-bottom: 1.5rem;
}

.project-group-title {
    font-size: 1rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.project-info h4 {
    margin-bottom: 0.25rem;
}

/* Form rows (manual entry + breaks) */
.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
}

.settings-hint,
.empty-hint {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.empty-hint {
    margin: 0.5rem 0;
}

/* Fixed breaks list */
.breaks-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.break-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-radius: 4px;
}

.break-label {
    font-weight: 600;
    min-width: 100px;
}

.break-time {
    flex: 1;
    color: var(--primary-color);
    font-weight: bold;
}

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

    .customers-list {
        grid-template-columns: 1fr;
    }

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

/* Week overview */
.week-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.week-range {
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.weekly-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

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

.week-table th,
.week-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.week-table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7f8c8d;
}

.week-table tfoot td {
    border-top: 2px solid var(--border-color);
    font-weight: 600;
}

.export-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.export-bar input[type="date"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Trips */
.mileage-rate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rate-input {
    width: 90px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}
