/* Modern Minimal CRM - Clean SaaS Design */

:root {
    /* Pastel Color Palette */
    --primary: #6366f1;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--gray-50);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

[x-cloak] {
    display: none !important;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.logo-image {
    max-width: 160px;
    height: auto;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav .nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.sidebar-nav .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav .nav-item i {
    font-size: 20px;
    width: 20px;
}

/* ===== SIDEBAR FOOTER (User Profile & Logout) ===== */
.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

.sidebar-footer .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    background: var(--gray-50);
}

.sidebar-footer .nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.sidebar-footer .nav-item i {
    font-size: 20px;
    width: 20px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--gray-50);
}

/* ===== TOP HEADER ===== */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    white-space: nowrap;
}

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

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: var(--gray-50);
    transition: all 0.2s ease;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.user-avatar:hover {
    background: var(--gray-200);
}

.user-avatar i {
    font-size: 24px;
    color: var(--gray-600);
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    padding: 32px;
    max-width: 1600px;
}

/* Expand content wrapper on larger screens */
@media (min-width: 1920px) {
    .content-wrapper {
        max-width: 1920px;
        padding: 40px;
    }
}

@media (min-width: 2200px) {
    .content-wrapper {
        max-width: 2200px;
        padding: 48px;
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
    font-size: 18px;
}

.card-body {
    padding: 24px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Responsive stats grid for larger screens */
@media (min-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium-large */
    }
}

@media (min-width: 1600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on extra large */
    }
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-primary .stat-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-success .stat-icon {
    background: var(--success-light);
    color: var(--success);
}

.stat-warning .stat-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-info .stat-icon {
    background: var(--info-light);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

/* ===== ACTIVITY LIST ===== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.activity-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.activity-time {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
    font-size: 14px;
}

/* ===== PAGE ACTIONS ===== */
.page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn i {
    font-size: 16px;
}

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

.btn-primary:hover {
    background: #5558e3;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* Icon Buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.btn-icon i {
    font-size: 16px;
}

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

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

.btn-icon-secondary {
    color: var(--gray-600);
}

.btn-icon-secondary:hover {
    background: var(--gray-100);
}

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

.btn-icon-danger:hover {
    background: var(--danger-light);
}

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

.btn-icon-success:hover {
    background: var(--success-light);
}

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

/* ===== TABLES ===== */
.table-search {
    position: relative;
    max-width: 400px;
}

.table-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
    z-index: 2;
}

.table-search input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: var(--gray-50);
    transition: all 0.2s ease;
}

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

/* Autocomplete dropdown styling */
input[type="text"]::-webkit-list-button,
input[type="search"]::-webkit-list-button {
    display: none;
}

/* Style browser autocomplete */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--white) inset !important;
    box-shadow: 0 0 0 30px var(--white) inset !important;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table thead th {
    background: var(--gray-50);
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

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

.data-table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-700);
}

.data-table .actions-col {
    width: 120px;
    text-align: right;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-sm i {
    font-size: 16px;
    color: var(--gray-500);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-neutral {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-scheduled {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-confirmed {
    background: var(--info-light);
    color: var(--info);
}

.badge-completed {
    background: var(--success-light);
    color: var(--success);
}

.badge-cancelled {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===== FORMS ===== */
.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--white);
    transition: all 0.2s ease;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.mb-3 {
    margin-bottom: 20px;
}

/* ===== MODALS ===== */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
}

/* ===== HAMBURGER MENU ===== */
.hamburger-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hamburger-menu:hover {
    background: var(--gray-200);
}

.hamburger-menu i {
    font-size: 24px;
    color: var(--gray-700);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
    }

    .hamburger-menu {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .top-header {
        padding: 0 20px;
        height: 64px;
        gap: 12px;
    }

    .search-box {
        width: 220px;
    }

    .content-wrapper {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .page-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 12px;
        height: 60px;
        gap: 8px;
    }

    .header-left {
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .header-right {
        gap: 8px;
        flex: 0 0 auto;
    }

    .search-box {
        width: 240px;
    }

    .search-box input {
        font-size: 13px;
        padding: 8px 12px 8px 36px;
    }

    .search-box i {
        left: 12px;
        font-size: 14px;
    }

    .page-title {
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .content-wrapper {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 16px;
    }

    .card-title {
        font-size: 15px;
    }

    .table-search {
        max-width: 100%;
        margin-bottom: 16px;
    }

    .table-search input {
        font-size: 13px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 10px 6px;
        font-size: 12px;
    }

    .data-table thead th {
        font-size: 11px;
    }

    .user-cell {
        gap: 8px;
    }

    .user-avatar-sm {
        width: 28px;
        height: 28px;
    }

    .user-avatar-sm i {
        font-size: 14px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .btn span {
        display: none;
    }

    .btn i {
        margin: 0;
    }

    .btn-icon {
        width: 28px;
        height: 28px;
    }

    .btn-icon i {
        font-size: 14px;
    }

    .page-actions {
        margin-bottom: 16px;
    }

    .action-buttons {
        gap: 2px;
    }

    .badge {
        padding: 3px 8px;
        font-size: 11px;
    }

    .activity-item {
        padding: 12px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .activity-title {
        font-size: 13px;
    }

    .activity-subtitle {
        font-size: 12px;
    }

    .activity-time {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 0 8px;
        height: 56px;
    }

    .header-left {
        gap: 6px;
    }

    .header-right {
        gap: 6px;
    }

    .hamburger-menu {
        width: 36px;
        height: 36px;
    }

    .hamburger-menu i {
        font-size: 20px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .user-avatar i {
        font-size: 20px;
    }

    .search-box {
        width: 180px;
    }

    .search-box input {
        padding: 6px 10px 6px 32px;
        font-size: 12px;
    }

    .search-box i {
        left: 10px;
        font-size: 13px;
    }

    .page-title {
        font-size: 15px;
    }

    .content-wrapper {
        padding: 12px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
        gap: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }

    .card-body {
        padding: 12px;
    }

    .card-header {
        padding: 12px;
    }

    .table-search input {
        font-size: 12px;
        padding: 8px 10px 8px 32px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 8px 4px;
        font-size: 11px;
    }
}

/* ===== UTILITIES ===== */
.mt-4 {
    margin-top: 24px;
}

.g-4 {
    gap: 24px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-lg-6 {
    flex: 0 0 50%;
    padding: 0 12px;
}

@media (max-width: 992px) {
    .col-lg-6 {
        flex: 0 0 100%;
    }
}

/* ===== GLOBAL SEARCH ===== */
.search-box {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.search-dropdown-item:hover {
    background: var(--gray-50);
}

.search-dropdown-item i {
    font-size: 20px;
    color: var(--gray-400);
}

.search-dropdown-content {
    flex: 1;
}

.search-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.search-dropdown-info {
    font-size: 12px;
    color: var(--gray-500);
}

.search-dropdown-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--gray-400);
    font-size: 14px;
}

/* Customer Detail Modal */
.customer-detail-modal .modal-dialog {
    max-width: 600px;
}

.customer-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.customer-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customer-detail-avatar i {
    font-size: 32px;
    color: var(--primary);
}

.customer-detail-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.customer-detail-section {
    margin-bottom: 24px;
}

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

.customer-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.customer-detail-row {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.customer-detail-row:last-child {
    border-bottom: none;
}

.customer-detail-label {
    min-width: 100px;
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.customer-detail-value {
    flex: 1;
    font-size: 14px;
    color: var(--gray-900);
}

.customer-detail-value a {
    color: var(--primary);
    text-decoration: none;
}

.customer-detail-value a:hover {
    text-decoration: underline;
}

.vehicle-item {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.vehicle-item:last-child {
    margin-bottom: 0;
}

.vehicle-plate {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.vehicle-details {
    font-size: 13px;
    color: var(--gray-600);
}

@media (max-width: 576px) {
    .customer-detail-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
    }

    .customer-detail-row {
        flex-direction: column;
        gap: 4px;
    }

    .customer-detail-label {
        min-width: auto;
    }
}

/* ===== TIRE MANAGEMENT STYLES ===== */

/* Tire Card - Main Grid View */
.tire-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tire-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* Condition-based borders */
.tire-condition-new {
    border-left: 4px solid var(--success);
}

.tire-condition-good {
    border-left: 4px solid var(--info);
}

.tire-condition-fair {
    border-left: 4px solid var(--warning);
}

.tire-condition-needs_repair {
    border-left: 4px solid var(--danger);
}

.tire-card-header {
    padding: 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.tire-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tire-type-summer {
    background: var(--warning-light);
    color: var(--warning);
}

.tire-type-winter {
    background: var(--info-light);
    color: var(--info);
}

.tire-type-all-season {
    background: var(--success-light);
    color: var(--success);
}

.tire-condition-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
}

.tire-card-body {
    padding: 16px;
    flex: 1;
}

.tire-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.tire-size {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 12px;
}

.tire-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.tire-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-600);
}

.tire-info-item i {
    color: var(--gray-400);
    font-size: 14px;
    width: 16px;
}

.tire-storage-progress {
    margin-top: 12px;
}

.tire-storage-progress .progress {
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.tire-storage-progress .progress-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.tire-storage-progress small {
    font-size: 11px;
}

.tire-notes {
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
}

.tire-card-footer {
    padding: 12px 16px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* Tire Summary Card - For Customer Profile */
.tire-summary-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}

.tire-summary-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.tire-summary-header {
    padding: 10px 12px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tire-type-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.tire-condition-badge-sm {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
}

.tire-summary-body {
    padding: 12px;
}

.tire-summary-body > div {
    margin-bottom: 4px;
}

.tire-summary-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--gray-500);
}

.tire-summary-meta i {
    font-size: 12px;
}

.tire-storage-time-left {
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
    font-size: 11px;
    color: var(--gray-600);
}

.tire-storage-time-left i {
    margin-right: 4px;
}

/* Card Header with Button */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Searchable Select Styling */
.searchable-select {
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
}

.searchable-select option {
    padding: 8px;
    cursor: pointer;
}

.searchable-select option:hover {
    background: var(--primary-light);
}

.searchable-select[size] {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
}

/* Custom brand container animation */
#custom-brand-container {
    transition: all 0.3s ease;
}

/* Modal adjustments for larger forms */
.modal-dialog {
    max-width: 800px;
}

@media (min-width: 992px) {
    .modal-dialog {
        max-width: 900px;
    }
}

/* Responsive Tire Grid */
@media (max-width: 1200px) {
    .tire-card {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .tire-brand {
        font-size: 16px;
    }

    .tire-size {
        font-size: 13px;
    }

    .tire-info-item {
        font-size: 11px;
    }

    .tire-card-footer {
        justify-content: center;
    }

    .tire-summary-card {
        margin-bottom: 12px;
    }

    /* Make searchable selects more mobile-friendly */
    .searchable-select {
        font-size: 13px;
        max-height: 150px;
    }

    .searchable-select option {
        padding: 10px 8px;
    }

    /* Larger modal on mobile */
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }

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

/* ===== AI ASSISTANT PANEL ===== */

/* Dashboard two-column layout */
.dashboard-container {
    display: flex;
    gap: 24px;
    height: 100%;
}

.dashboard-main {
    flex: 1;
    min-width: 0;
}

.assistant-panel {
    flex: 1;
    min-width: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 48px);
    position: sticky;
    top: 24px;
}

/* Assistant Header */
.assistant-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.assistant-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.assistant-title i {
    color: var(--primary);
}

.assistant-header .badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* Suggestion Chips */
.assistant-chips {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.assistant-chip {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.assistant-chip:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

.assistant-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages Area */
.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assistant-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
    text-align: center;
}

.assistant-empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
}

.assistant-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Message Bubbles */
.assistant-message {
    display: flex;
    margin-bottom: 8px;
}

.assistant-message-user {
    justify-content: flex-end;
}

.assistant-message-assistant {
    justify-content: flex-start;
}

.assistant-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    word-wrap: break-word;
}

.assistant-message-user .assistant-message-bubble {
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.assistant-message-assistant .assistant-message-bubble {
    background: var(--gray-100);
    color: var(--gray-900);
    border-bottom-left-radius: 4px;
}

.assistant-message-content {
    font-size: 14px;
    line-height: 1.5;
}

/* Markdown Content Styles */
.markdown-content p {
    margin: 0 0 0.75em 0;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 1em 0 0.5em 0;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child,
.markdown-content h5:first-child,
.markdown-content h6:first-child {
    margin-top: 0;
}

.markdown-content h1 { font-size: 1.5em; }
.markdown-content h2 { font-size: 1.3em; }
.markdown-content h3 { font-size: 1.1em; }
.markdown-content h4 { font-size: 1em; }
.markdown-content h5 { font-size: 0.9em; }
.markdown-content h6 { font-size: 0.85em; }

.markdown-content strong {
    font-weight: 600;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.markdown-content li {
    margin: 0.25em 0;
}

.markdown-content code {
    background: var(--gray-200);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: var(--gray-200);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.75em 0;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    margin: 0.75em 0;
    color: var(--gray-700);
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--gray-300);
    margin: 1em 0;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: underline;
}

.markdown-content a:hover {
    color: var(--primary-dark);
}

/* Markdown Tables */
.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    font-size: 13px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
}

.markdown-content thead {
    background: var(--gray-200);
}

.markdown-content th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-300);
    border-right: 1px solid var(--gray-300);
}

.markdown-content th:last-child {
    border-right: none;
}

.markdown-content td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
}

.markdown-content td:last-child {
    border-right: none;
}

.markdown-content tr:last-child td {
    border-bottom: none;
}

.markdown-content tbody tr:hover {
    background: var(--gray-50);
}

/* Adjust for user messages (dark background) */
.assistant-message-user .markdown-content code {
    background: rgba(255, 255, 255, 0.2);
}

.assistant-message-user .markdown-content pre {
    background: rgba(255, 255, 255, 0.15);
}

.assistant-message-user .markdown-content table {
    border-color: rgba(255, 255, 255, 0.3);
}

.assistant-message-user .markdown-content th {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.assistant-message-user .markdown-content td {
    border-color: rgba(255, 255, 255, 0.2);
}

.assistant-message-user .markdown-content a {
    color: #ffffff;
    text-decoration: underline;
}

/* Typing Indicator */
.assistant-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.assistant-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.assistant-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.assistant-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Input Area */
.assistant-input-container {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    background: var(--white);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.assistant-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    color: var(--gray-900);
    transition: all 0.2s ease;
}

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

.assistant-input:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.assistant-send-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.assistant-send-btn:hover:not(:disabled) {
    background: #4f46e5;
    transform: scale(1.05);
}

.assistant-send-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* Responsive Design for Assistant Panel */
@media (max-width: 1200px) {
    .dashboard-container {
        flex-direction: column;
    }

    .assistant-panel {
        width: 100%;
        min-width: unset;
        height: 550px;
        position: relative;
        top: auto;
        order: -1; /* Show assistant widget first - main landing element on mobile */
        margin-bottom: 24px;
    }

    .dashboard-main {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .assistant-panel {
        height: 600px; /* Larger fixed height for better mobile experience */
        margin-bottom: 20px;
    }

    .assistant-chips {
        display: none; /* Hide suggested questions on mobile to save space */
    }

    .assistant-message-bubble {
        max-width: 90%;
    }

    .assistant-header {
        padding: 16px;
    }

    .assistant-title {
        font-size: 16px;
    }

    .assistant-messages {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .assistant-panel {
        height: 550px; /* Good height for small mobile screens */
        margin-bottom: 20px;
    }
}

/* ===== SETTINGS PAGE TAB NAVIGATION ===== */
/* Match sidebar navigation colors and styling */
.list-group-item-action {
    border: none !important;
    padding: 12px 16px !important;
    margin-bottom: 4px !important;
    border-radius: var(--border-radius-sm) !important;
    transition: all 0.2s ease !important;
    color: var(--gray-600) !important;
}

.list-group-item-action:hover {
    background: var(--gray-50) !important;
    color: var(--gray-900) !important;
}

.list-group-item-action.active {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border: none !important;
}

.list-group-item-action.active i {
    color: var(--primary) !important;
}

.list-group-item-action i {
    color: inherit;
}
