/* tracks/static/tracks/css/style.css */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Login Page Styles - Must come before body styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-form {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.login-form h1 {
    color: #2563eb;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-form h2 {
    color: #374151;
    margin-bottom: 30px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Regular body styles for logged-in pages */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header h1 a {
    color: #2563eb;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
}

.header nav a {
    margin-left: 20px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
}

.header nav a:hover {
    color: #2563eb;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h2 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 5px;
}

.dashboard-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 8px;
}

.stat-card p {
    color: #6b7280;
    font-weight: 500;
    margin: 0;
}

/* Clients Grid */
.clients-section {
    margin-bottom: 40px;
}

.clients-section h3 {
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 1.5rem;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.client-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.client-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.client-name {
    color: #1f2937;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.client-name:hover {
    color: #2563eb;
}

.client-id {
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 500;
}

.client-summary {
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.summary-row .label {
    color: #6b7280;
    font-size: 0.9rem;
}

.summary-row .amount {
    font-weight: 600;
}

.summary-row .count {
    color: #374151;
    font-weight: 600;
}

.client-contact {
    margin-bottom: 15px;
    min-height: 40px;
}

.contact-item {
    margin: 4px 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.contact-label {
    font-weight: 500;
}

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

.client-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Recent Activity */
.recent-activity {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.recent-activity h3 {
    margin-bottom: 15px;
    color: #1f2937;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.recent-item:last-child {
    border-bottom: none;
}

.item-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.item-date {
    color: #6b7280;
    font-size: 0.9rem;
    min-width: 40px;
}

.item-type {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.item-client, .item-project {
    color: #374151;
    font-size: 0.9rem;
}

.item-amount {
    font-weight: 600;
    color: #374151;
}
.client-header {
    margin-bottom: 30px;
}

.client-header h2 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 10px;
}

.contact-info {
    color: #6b7280;
    margin: 5px 0;
}

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

//* Summary cards */
.summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-card h3, .summary-card h4 {
    margin-bottom: 15px;
    color: #1f2937;
    font-size: 1.2rem;
}

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

.summary-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    gap: 12px; /* Fixed gap between label and amount */
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    color: #6b7280;
    font-weight: 500;
    min-width: fit-content; /* Prevents label from shrinking */
}

.summary-item .amount {
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap; /* Prevents amount from wrapping */
}

.amount.outstanding { color: #dc2626; }
.amount.unbilled { color: #f59e0b; }
.amount.invoiced { color: #2563eb; }
.amount.payments { color: #10b981; }
.amount.balance { color: #6b7280; }
.payment-amount { color: #10b981; }

.summary-item .hours {
    color: #7c3aed;
    font-weight: 600;
    white-space: nowrap;
}

.summary-item .count {
    color: #374151;
    font-weight: 600;
    white-space: nowrap;
}

/* Project sections */
.project-section {
    margin-bottom: 40px;
}

.project-header {
    margin-bottom: 20px;
}

.project-title {
    color: #1f2937;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
}

.project-title:hover {
    color: #2563eb;
}

.project-description {
    color: #6b7280;
    margin: 8px 0;
    font-style: italic;
}

.default-rate {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Tables */
.items-table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

th {
    background: #f9fafb;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.item-row:hover {
    background: #f9fafb;
}

.date {
    white-space: nowrap;
    color: #6b7280;
}

.description {
    max-width: 300px;
}

.no-description {
    color: #9ca3af;
}

/* Type badges */
.type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.type-work { background: #dbeafe; color: #1e40af; }
.type-expense { background: #fef3c7; color: #92400e; }
.type-payment { background: #d1fae5; color: #065f46; }
.type-adjustment { background: #e0e7ff; color: #3730a3; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.billable { background: #fef3c7; color: #92400e; }
.status-badge.invoiced { background: #dbeafe; color: #1e40af; }
.status-badge.non-billable { background: #f3f4f6; color: #6b7280; }
.status-badge.payment { background: #d1fae5; color: #065f46; }

/* Actions */
.edit-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.edit-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Quick actions */
.quick-actions {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.quick-actions h3 {
    margin-bottom: 15px;
    color: #1f2937;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

/* Empty states */
.no-items, .no-projects {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.no-projects a {
    margin-top: 15px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
}