/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f8fafc;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

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

.logo span {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.restaurant-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.restaurant-info p {
    font-size: 14px;
    color: #6b7280;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: block;
    padding: 12px 24px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background: #f9fafb;
    color: #1f2937;
}

.nav-item.active {
    background: #f0fdf4;
    color: rgb(0, 100, 0);
    border-right-color: rgb(0, 100, 0);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.demo-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: #f8fafc;
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 32px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.page-title p {
    color: #6b7280;
    font-size: 16px;
}

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

.btn-primary {
    background: rgb(0, 100, 0);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: rgb(0, 80, 0);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: rgb(0, 100, 0);
    color: rgb(0, 100, 0);
}

/* Customers Dashboard */
.customers-dashboard {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Customer Overview Cards */
.customer-overview {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
}

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

.overview-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgb(0, 100, 0) 0%, rgb(0, 120, 0) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-content h3 {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.card-value {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 4px;
}

.card-change {
    font-size: 12px;
    font-weight: 500;
}

.card-change.positive {
    color: #059669;
}

.card-change.negative {
    color: #dc2626;
}

/* Customer Filters */
.customer-filters {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filters-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.customer-count {
    font-size: 14px;
    color: #6b7280;
}

.filters-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

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

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: rgb(0, 100, 0);
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
}

.filter-options {
    display: flex;
    gap: 12px;
}

.filter-options select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
}

.filter-options select:focus {
    outline: none;
    border-color: rgb(0, 100, 0);
}

/* Customer List Section */
.customer-list-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.customer-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn.active {
    background: rgb(0, 100, 0);
    color: white;
    border-color: rgb(0, 100, 0);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sort-controls label {
    color: #6b7280;
    font-weight: 500;
}

.sort-controls select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 13px;
}

.sort-direction {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.sort-direction:hover {
    background: #f3f4f6;
}

/* Customer Table */
.customer-table-container {
    overflow-x: auto;
}

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

.customer-table th {
    background: #f9fafb;
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.customer-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    vertical-align: middle;
}

.customer-table tbody tr:hover {
    background: #f9fafb;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(0, 100, 0) 0%, rgb(0, 120, 0) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.customer-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.customer-details p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.contact-info {
    font-size: 13px;
    color: #6b7280;
}

.contact-info div {
    margin-bottom: 2px;
}

.order-count {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.total-spent {
    font-size: 16px;
    font-weight: 600;
    color: rgb(0, 100, 0);
}

.avg-order {
    font-size: 14px;
    color: #6b7280;
}

.last-order {
    font-size: 13px;
    color: #6b7280;
}

.customer-segment {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.segment-vip {
    background: #fef3c7;
    color: #92400e;
}

.segment-regular {
    background: #dbeafe;
    color: #1e40af;
}

.segment-new {
    background: #dcfce7;
    color: #166534;
}

.segment-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.customer-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f3f4f6;
}

.action-btn.primary:hover {
    background: #f0fdf4;
    color: rgb(0, 100, 0);
}

/* Customer Cards View */
.customer-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 24px;
}

.customer-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: white;
    transition: all 0.2s;
    position: relative;
}

.customer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.customer-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.customer-card .customer-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.customer-card-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.customer-card-info p {
    font-size: 13px;
    color: #6b7280;
}

.customer-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.card-stat {
    text-align: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.card-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2px;
}

.card-stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 500;
}

.customer-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    font-size: 13px;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: rgb(0, 100, 0);
    color: rgb(0, 100, 0);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
}

.page-number {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-number:hover {
    background: #f9fafb;
}

.page-number.active {
    background: rgb(0, 100, 0);
    color: white;
    border-color: rgb(0, 100, 0);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgb(0, 100, 0);
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Segment Creation */
.segment-criteria {
    margin: 20px 0;
}

.segment-criteria h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.criteria-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.criteria-group label {
    font-size: 14px;
    color: #6b7280;
    flex: 1;
}

.criteria-group input,
.criteria-group select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.segment-preview {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-top: 20px;
}

.segment-preview h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.segment-preview p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.preview-stats {
    font-size: 12px;
    color: rgb(0, 100, 0);
    font-weight: 500;
}

/* Customer Detail Content */
.customer-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.detail-section {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.detail-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    color: #1f2937;
    font-weight: 600;
}

.order-history {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.order-history-list {
    max-height: 300px;
    overflow-y: auto;
}

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

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

.order-date {
    font-size: 13px;
    color: #6b7280;
}

.order-items {
    font-size: 13px;
    color: #1f2937;
    flex: 1;
    margin: 0 16px;
}

.order-amount {
    font-size: 14px;
    font-weight: 600;
    color: rgb(0, 100, 0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .customer-detail-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .overview-cards {
        grid-template-columns: 1fr;
    }
    
    .filters-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-options {
        flex-wrap: wrap;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .customer-table-container {
        font-size: 12px;
    }
    
    .customer-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        padding: 16px 20px;
    }
    
    .customers-dashboard {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 16px;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}