/* Tesla-Inspired Light UI */
.tsm-dashboard * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.tsm-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    color: #1a1a1a;
}

/* Tesla Header */
.tsm-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 30px 40px;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-title h1 {
    font-size: 2.2em;
    font-weight: 300;
    color: #1a1a1a;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.header-title p {
    color: #666;
    font-size: 1em;
    font-weight: 400;
    margin: 0;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.8);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    min-width: 160px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #d0d7e0;
    transform: translateY(-1px);
}

.stat-icon {
    font-size: 1.5em;
    opacity: 0.8;
}

.stat-number {
    display: block;
    font-size: 1.6em;
    font-weight: 300;
    color: #1a1a1a;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 400;
}

/* Quick Actions - Tesla Style */
.tsm-quick-actions {
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 40px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.quick-action-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

/* Main Content */
.tsm-main-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-header h2 {
    font-size: 1.6em;
    font-weight: 300;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.header-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 400;
    color: #666;
    white-space: nowrap;
    font-size: 0.9em;
}

.modern-select {
    padding: 10px 14px;
    border: 1px solid #d0d7e0;
    border-radius: 8px;
    background: white;
    font-size: 0.9em;
    transition: all 0.3s ease;
    min-width: 180px;
    color: #1a1a1a;
}

.modern-select:focus {
    outline: none;
    border-color: #1a1a1a;
}

/* Tesla Table */
.services-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

.modern-table th {
    background: #f8f9fa;
    padding: 18px 20px;
    text-align: left;
    font-weight: 500;
    color: #666;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #1a1a1a;
}

.service-row {
    transition: all 0.2s ease;
}

.service-row:hover {
    background: #f8fafc;
}

.taxi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.taxi-id {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 0.95em;
}

.taxi-plate {
    font-size: 0.8em;
    color: #666;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.time-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.time-main {
    font-weight: 400;
    color: #1a1a1a;
    font-size: 0.95em;
}

.time-sub {
    font-size: 0.75em;
    color: #888;
}

.km-value, .tt-value {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 400;
    color: #1a1a1a;
    font-size: 0.95em;
}

.duration-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    display: inline-block;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    display: inline-block;
}

.status-badge.active {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #b91c1c;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: #666;
}

.empty-icon {
    font-size: 3em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-weight: 300;
}

.empty-state p {
    margin-bottom: 30px;
    font-size: 1em;
    color: #666;
}

.empty-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-action-btn:hover {
    background: #333;
}

/* Tesla Modal */
.tsm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.tsm-modal.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid #e2e8f0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.modal-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.4em;
    font-weight: 300;
    letter-spacing: -0.3px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f1f5f9;
    color: #1a1a1a;
}

.modal-body {
    padding: 28px;
}

/* Tesla Form Styles */
.modern-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 400;
    color: #666;
    font-size: 0.9em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d7e0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    color: #1a1a1a;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #1a1a1a;
}

.form-input:read-only {
    background-color: #f8f9fa;
    color: #666;
    cursor: not-allowed;
}

.form-hint {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 0.8em;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Service Summary */
.service-summary-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.service-summary-card h3 {
    margin: 0 0 16px 0;
    color: #1a1a1a;
    font-size: 1.1em;
    font-weight: 400;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-item.full-width {
    grid-column: 1 / -1;
}

.summary-item label {
    font-weight: 400;
    color: #666;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item span {
    color: #1a1a1a;
    font-size: 0.9em;
    font-weight: 400;
}

/* Tesla Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: #1a1a1a;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #333;
}

.btn-warning {
    background: #dc2626;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Tesla Toast */
.tsm-toast {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 400;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 320px;
    font-size: 0.9em;
}

.tsm-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.tsm-toast.success {
    background: #1a1a1a;
}

.tsm-toast.error {
    background: #dc2626;
}

/* Body modal open state */
body.modal-open {
    overflow: hidden;
}

/* Loading state */
.loading {
    position: relative;
    color: transparent !important;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tsm-header {
        padding: 24px 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-card {
        min-width: auto;
        flex: 1;
        padding: 14px 16px;
    }
    
    .tsm-quick-actions {
        padding: 16px 20px;
    }
    
    .tsm-main-content {
        padding: 24px 20px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-controls {
        width: 100%;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .modern-select {
        min-width: auto;
        flex: 1;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-container {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 14px 12px;
    }
}

@media (max-width: 480px) {
    .header-title h1 {
        font-size: 1.8em;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 1.4em;
    }
    
    .modern-table {
        font-size: 0.8em;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .tsm-toast {
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

/* Tesla-inspired subtle animations */
.service-row,
.stat-card,
.quick-action-btn,
.action-btn,
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.modern-select:focus,
.btn:focus {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .tsm-quick-actions,
    .action-btn,
    .header-controls {
        display: none;
    }
    
    .tsm-header {
        background: white;
        border-bottom: 2px solid #1a1a1a;
    }
    
    .tsm-main-content {
        box-shadow: none;
        border: none;
    }
}