/* Custom CSS variables for beautiful HSL theming */
:root {
    /* Fonts */
    --font-primary: 'Inter', 'Noto Sans KR', sans-serif;
    --font-heading: 'Outfit', 'Inter', 'Noto Sans KR', sans-serif;

    /* Theme colors (Default: Dark Slate Theme) */
    --bg-app: #0f172a; /* Slate 900 */
    --bg-sidebar: #1e293b; /* Slate 800 */
    --bg-card: rgba(30, 41, 59, 0.7); /* Translucent Slate 800 */
    --bg-input: #334155; /* Slate 700 */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --text-muted: #64748b; /* Slate 500 */
    
    /* Brand & Accent Colors */
    --primary: hsl(220, 95%, 60%);
    --primary-hover: hsl(220, 95%, 50%);
    --primary-soft: rgba(37, 99, 235, 0.15);
    
    --success: hsl(142, 70%, 45%);
    --success-soft: rgba(16, 185, 129, 0.15);
    
    --warning: hsl(38, 92%, 50%);
    --warning-soft: rgba(245, 158, 11, 0.15);
    
    --danger: hsl(350, 89%, 60%);
    --danger-soft: rgba(239, 68, 68, 0.15);

    --purple: hsl(262, 80%, 60%);
    --purple-soft: rgba(139, 92, 246, 0.15);

    --orange: hsl(24, 90%, 55%);
    --orange-soft: rgba(249, 115, 22, 0.15);
    
    /* Layout & Effects */
    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --glass-blur: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-app: #f8fafc; /* Slate 50 */
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-input: #f1f5f9; /* Slate 100 */
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8; /* Slate 400 */
    
    --primary-soft: rgba(37, 99, 235, 0.08);
    --success-soft: rgba(16, 185, 129, 0.08);
    --warning-soft: rgba(245, 158, 11, 0.08);
    --danger-soft: rgba(239, 68, 68, 0.08);
    --purple-soft: rgba(139, 92, 246, 0.08);
    --orange-soft: rgba(249, 115, 22, 0.08);
    
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
}

/* General Resets & Defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: var(--transition-smooth);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Containers */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
    transition: var(--transition-smooth);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 3rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-text span {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
}

/* Menu items */
.menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-divider {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
    transform: translateX(4px);
}

.menu-item.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), hsl(220, 95%, 55%));
    box-shadow: var(--shadow-sm);
}

/* DB Info Card in Sidebar */
.db-info-card {
    background-color: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.connected {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-green 2s infinite;
}

.status-indicator.disconnected {
    background-color: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.db-info-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.db-status-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.db-filename {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2.5rem;
    background-color: var(--bg-app);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(var(--glass-blur));
    transition: var(--transition-smooth);
}

.header-title h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-icon-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.btn-icon-toggle:hover {
    background-color: var(--bg-input);
    border-color: var(--border-hover);
    transform: rotate(15deg) scale(1.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    border: 2px solid var(--border-color);
}

/* Content Wrapper */
.content-wrapper {
    padding: 2.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Card base */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(var(--glass-blur));
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

/* Welcome Alert */
.welcome-alert {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px dashed var(--primary);
    border-radius: var(--radius-lg);
    padding: 3rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-icon {
    font-size: 4rem;
    color: var(--primary);
    background-color: var(--primary-soft);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.2);
}

.welcome-text h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 600px;
    line-height: 1.6;
}

.welcome-buttons {
    display: flex;
    gap: 1rem;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    opacity: 0;
    transition: var(--transition-smooth);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.bg-blue-soft { background-color: var(--primary-soft); }
.bg-green-soft { background-color: var(--success-soft); }
.bg-purple-soft { background-color: var(--purple-soft); }
.bg-orange-soft { background-color: var(--orange-soft); }

.text-blue { color: var(--primary); }
.text-green { color: var(--success); }
.text-purple { color: var(--purple); }
.text-orange { color: var(--orange); }

.stat-data {
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 0.2rem;
    letter-spacing: -0.5px;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Control Panel */
.control-panel {
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

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

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 3rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-primary);
    outline: none;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    background-color: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.select-control {
    padding: 0.85rem 1.5rem 0.85rem 1rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-primary);
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.select-control:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), hsl(220, 95%, 55%));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-purple {
    background: linear-gradient(135deg, var(--purple), hsl(262, 80%, 55%));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-purple:hover {
    background: linear-gradient(135deg, hsl(262, 80%, 50%), var(--purple));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.pt-4 { padding-top: 1.5rem; }
.border-top { border-top: 1px solid var(--border-color); }
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700; }
.mr-2 { margin-right: 0.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* Table Section */
.table-container {
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.data-table .customer-info {
    font-weight: 600;
    color: var(--text-primary);
}

.data-table .repair-snippet {
    max-width: 200px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.data-table .cell-address {
    max-width: 180px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.data-table .badge-history {
    background-color: var(--primary-soft);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.data-table .badge-history:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

.amount-text {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.btn-action:hover {
    color: white;
}

.btn-action.edit:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-soft);
}

.btn-action.delete:hover {
    background-color: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 2px 8px var(--danger-soft);
}

/* Table Footer */
.table-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.entries-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.table-tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Modal Windows */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    width: 100%;
    max-width: 600px;
    padding: 1.5rem;
    transform: translateY(30px);
    transition: var(--transition-smooth);
}

.modal.active .modal-dialog {
    transform: translateY(0);
}

.modal-content {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .modal-content {
    background-color: #ffffff;
}

.modal-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.modal-close {
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.modal-body {
    padding: 1.75rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 480px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group label.required::after {
    content: ' *';
    color: var(--danger);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-wrapper input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-primary);
    outline: none;
    transition: var(--transition-smooth);
}

[data-theme="light"] .input-wrapper input,
[data-theme="light"] .form-group textarea {
    background-color: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
}

.input-wrapper input {
    padding-left: 2.75rem;
}

.input-wrapper input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background-color: var(--bg-sidebar);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    min-width: 300px;
    max-width: 450px;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition-smooth);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .toast {
    background-color: #ffffff;
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger { border-left-color: var(--danger); }

.toast-icon {
    font-size: 1.2rem;
}

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

.toast-message {
    flex-grow: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-close {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Timeline/History Styles */
.history-user-info {
    background-color: var(--primary-soft);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
}

.history-timeline-section h5,
.quick-add-visit h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.history-timeline {
    position: relative;
    padding-left: 2rem;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.history-item-premium {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
}

.history-item-premium:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.history-item-premium::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--bg-sidebar);
    border: 3px solid var(--purple);
    box-shadow: 0 0 0 3px var(--bg-sidebar);
}

[data-theme="light"] .history-item-premium::before {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px #ffffff;
}

.history-item-date-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--purple), hsl(262, 80%, 50%));
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 5px rgba(139, 92, 246, 0.3);
}

.history-item-content {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

[data-theme="light"] .history-item-content {
    background-color: #f8fafc;
}

.timeline-repair,
.timeline-payment,
.timeline-remarks {
    font-size: 0.88rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.timeline-repair i {
    font-size: 0.95rem;
    width: 18px;
}

.timeline-payment i {
    font-size: 1rem;
    width: 18px;
}

.timeline-remarks i {
    font-size: 0.95rem;
    width: 18px;
}

/* Clickable Name in table */
.data-table .customer-info.clickable-name {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--primary-soft);
    font-weight: 600;
}

.data-table .customer-info.clickable-name:hover {
    color: var(--primary-hover);
    text-decoration-color: var(--primary-hover);
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
    }
    
    .brand {
        margin-bottom: 1.5rem;
    }
    
    .menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .menu-divider {
        display: none;
    }
    
    .db-info-card {
        margin: 0;
        flex-grow: 1;
    }
    
    .btn-block {
        width: auto;
    }
    
    .main-content {
        height: auto;
        overflow-y: visible;
    }
    
    .content-wrapper {
        padding: 1.5rem;
    }
    
    .app-header {
        padding: 1.5rem;
    }
}

/* Monthly Payments Feature Styles */
.monthly-grid-layout {
    transition: var(--transition-smooth);
}

.trend-chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.chart-row:hover {
    background-color: var(--border-color);
}

.chart-label {
    width: 80px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-bar-wrapper {
    flex-grow: 1;
    height: 14px;
    background-color: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    border-radius: 10px;
    width: 0%;
    transition: width 1s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.chart-value {
    width: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

.chart-row.current-selected-month {
    background-color: var(--primary-soft);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.chart-row.current-selected-month .chart-bar {
    background: linear-gradient(90deg, var(--success), var(--primary));
}

.chart-row.current-selected-month .chart-label {
    color: var(--primary);
}

@media (max-width: 1200px) {
    .monthly-grid-layout {
        grid-template-columns: 1fr !important;
    }
}
