/* =========================
   GarageCRM - Clean Light Theme
   Inspired by Lovable.app Design
========================= */

:root {
    --bg: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-blue: #1E40AF;
    --bg-blue-light: #3B82F6;

    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --text-white: #FFFFFF;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-light: #EFF6FF;

    --success: #22C55E;
    --success-bg: #DCFCE7;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
}

/* =========================
   LOGIN PAGE - Split Layout
========================= */
.auth-container {
    display: flex;
    min-height: 100vh;
}

.auth-left {
    flex: 0 0 480px;
    background: linear-gradient(135deg, var(--bg-blue) 0%, var(--bg-blue-light) 100%);
    color: var(--text-white);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.auth-brand-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.auth-brand-name {
    font-size: 24px;
    font-weight: 700;
}

.auth-tagline {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 48px;
    line-height: 1.6;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-feature {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.auth-feature-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.auth-feature-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.auth-feature-text p {
    font-size: 14px;
    opacity: 0.8;
}

.auth-right {
    flex: 1;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-form-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-form-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-form-header p {
    color: var(--text-secondary);
}

.demo-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.demo-btn:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.demo-btn-icon {
    font-size: 18px;
}

.disable-demo-link {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 24px;
    cursor: pointer;
}

.disable-demo-link:hover {
    color: var(--text-secondary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input-wrapper {
    position: relative;
}

.form-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-simple {
    padding-left: 14px;
}

.form-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.form-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

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

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

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

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* =========================
   DASHBOARD HEADER
========================= */
.app-header {
    background: linear-gradient(135deg, var(--bg-blue) 0%, var(--bg-blue-light) 100%);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.header-info h1 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.header-info span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-add {
    padding: 10px 20px;
    background: var(--bg-white);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add:hover {
    background: var(--border-light);
}

.btn-logout {
    padding: 10px 20px;
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* =========================
   DASHBOARD CONTENT
========================= */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-card-content h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-card-content .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.summary-card-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.summary-card-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.summary-card-icon.yellow {
    background: var(--warning-bg);
    color: var(--warning);
}

.summary-card-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

/* =========================
   FILTERS BAR
========================= */
.filters-bar {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-filter {
    padding: 10px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-filter:hover {
    border-color: var(--text-muted);
    background: var(--bg);
}

.filter-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.filter-dropdown-wrapper {
    position: relative;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    z-index: 50;
    padding: 16px;
}

.filter-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
}

.filter-reset {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.filter-reset:hover {
    background: var(--primary-light);
}

.filter-section {
    margin-bottom: 16px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-select {
    padding: 10px 32px 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* =========================
   DATA TABLE
========================= */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

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

.data-table thead {
    background: var(--bg);
}

.data-table th {
    padding: 18px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary);
    background: linear-gradient(180deg, var(--primary-light) 0%, rgba(239, 246, 255, 0.5) 100%);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.data-table th.sortable:hover {
    background: var(--border-light);
    color: var(--primary);
}

.data-table th.sortable.active {
    color: var(--primary);
    background: var(--primary-light);
}

.sort-icon {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.5;
}

.data-table th.sortable:hover .sort-icon,
.data-table th.sortable.active .sort-icon {
    opacity: 1;
}

.data-table td {
    padding: 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.customer-name {
    font-weight: 600;
}

/* Actions column toggle */
.hide-actions .actions-col,
.hide-actions .action-buttons {
    display: none !important;
}

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

.vehicle-info {
    display: flex;
    flex-direction: column;
}

.vehicle-no {
    font-weight: 600;
    color: var(--primary);
}

.vehicle-model {
    font-size: 12px;
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.status-badge.overdue {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-badge.expiring {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.ok {
    background: var(--success-bg);
    color: var(--success);
}

/* Date column color classes */
.date-red {
    background: var(--danger-bg) !important;
    color: var(--danger) !important;
    font-weight: 600;
}

.date-yellow {
    background: var(--warning-bg) !important;
    color: #B45309 !important;
    font-weight: 600;
}

.date-green {
    background: var(--success-bg) !important;
    color: var(--success) !important;
    font-weight: 600;
}

/* WhatsApp Button - Always visible */
.whatsapp-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.6);
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
}

.whatsapp-btn:active {
    transform: scale(0.95);
}

.whatsapp-icon {
    font-size: 20px;
}

/* WhatsApp Modal Styles */
.whatsapp-modal {
    max-width: 450px;
}

.whatsapp-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.whatsapp-header h2 {
    color: white;
}

.whatsapp-info {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.whatsapp-customer-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.whatsapp-field {
    margin-bottom: 16px;
}

.whatsapp-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.whatsapp-copy-row {
    display: flex;
    gap: 8px;
}

.whatsapp-copy-row input,
.whatsapp-copy-row textarea {
    flex: 1;
}

.btn-copy {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn-copy.copied {
    background: var(--success-bg);
    border-color: var(--success);
}

.whatsapp-actions {
    margin-top: 24px;
    text-align: center;
}

.btn-whatsapp-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp-open:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-tip {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

/* Message Type Selector */
.whatsapp-vehicle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.whatsapp-today {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.whatsapp-today span {
    font-weight: 700;
    color: var(--primary);
}

.message-type-selector {
    margin-top: 24px;
}

.selector-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.message-type-buttons {
    display: flex;
    gap: 16px;
}

.msg-type-btn {
    flex: 1;
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.msg-type-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.msg-type-btn.insurance:hover {
    border-color: var(--warning);
    background: var(--warning-bg);
}

.msg-type-btn.service:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.msg-type-icon {
    font-size: 32px;
}

.msg-type-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.msg-type-date {
    font-size: 14px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    margin-top: 4px;
}

.msg-type-btn.service .msg-type-date {
    background: linear-gradient(135deg, var(--primary) 0%, #1E88E5 100%);
}

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

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.action-btn.whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
    color: white;
}

.action-btn.call:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Make action buttons more visible by default */
.action-btn.view {
    background: #FFF3E0;
    border-color: #FFB74D;
}

.action-btn.edit {
    background: #FFF8E1;
    border-color: #FFD54F;
}

.action-btn.whatsapp {
    background: #E8F5E9;
    border-color: #81C784;
}

.action-btn.call {
    background: #E3F2FD;
    border-color: #64B5F6;
}

/* =========================
   MODALS
========================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 101;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

/* =========================
   CUSTOMER DETAIL MODAL
========================= */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.detail-customer {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-avatar {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.detail-name {
    font-size: 20px;
    font-weight: 700;
}

.detail-status {
    margin-top: 4px;
}

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

.btn-whatsapp {
    padding: 10px 16px;
    background: var(--bg-white);
    border: 1px solid #25D366;
    color: #25D366;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-whatsapp:hover {
    background: #25D366;
    color: white;
}

.btn-call {
    padding: 10px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-call:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.detail-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.detail-info-icon {
    color: var(--text-muted);
    font-size: 18px;
    margin-top: 2px;
}

.detail-info-label {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.prediction-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.prediction-card {
    background: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    padding: 16px;
}

.prediction-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 8px;
}

.prediction-card-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.service-history-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.service-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.service-history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.btn-add-service {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add-service:hover {
    background: var(--primary-hover);
}

/* Parts List Styles */
.btn-add-part {
    padding: 8px 14px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-add-part:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.part-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
}

.part-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.part-row .part-name {
    flex: 2;
}

.part-row .part-amount {
    flex: 1;
}

.btn-remove-part {
    padding: 8px 12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
}

.btn-remove-part:hover {
    opacity: 0.9;
}

/* Service entry expandable details */
.service-entry-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.service-entry.expanded .service-entry-details {
    display: block;
}

.parts-table {
    width: 100%;
    font-size: 13px;
    margin-bottom: 8px;
}

.parts-table th,
.parts-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.parts-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
}

.service-entry-comments {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 8px;
}

.service-entry {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.service-entry:last-child {
    margin-bottom: 0;
}

.service-entry-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.service-entry-content {
    flex: 1;
}

.service-entry-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.service-entry-date {
    font-size: 15px;
    font-weight: 600;
}

.service-entry-km {
    font-size: 13px;
    color: var(--text-muted);
}

.service-entry-cost {
    text-align: right;
}

.service-entry-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.service-entry-details-link {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}

.service-entry-details-link:hover {
    text-decoration: underline;
}

/* =========================
   FORMS IN MODALS
========================= */
.modal-form .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form .form-input {
    padding: 12px 14px;
}

.modal-form textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    padding: 12px 24px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.btn-submit {
    padding: 12px 24px;
    background: var(--primary);
    border: none;
    color: white;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: var(--primary-hover);
}

/* =========================
   LOADING OVERLAY
========================= */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   TOAST NOTIFICATIONS
========================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-content .toast-title {
    font-weight: 600;
    font-size: 14px;
}

.toast-content .toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* =========================
   EMPTY STATE
========================= */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1024px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .prediction-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-left {
        display: none;
    }

    .auth-right {
        padding: 24px;
    }

    .app-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .dashboard-container {
        padding: 16px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-controls {
        flex-wrap: wrap;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-form .form-row-2 {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-actions {
        width: 100%;
    }

    .detail-actions button,
    .detail-actions a {
        flex: 1;
        justify-content: center;
    }
}
