/* ========================================
   CUSTOMER MANAGEMENT PAGE STYLES
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Header */
.header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #1f2937;
}

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

.user-info {
    color: #6b7280;
    font-size: 14px;
    padding-right: 12px;
    border-right: 2px solid #e5e7eb;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #10b981;
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-outline {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-outline:hover {
    background: #f9fafb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

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

/* Container */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 40px;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

/* Action Bar */
.action-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #2563eb;
}

/* File Input Wrapper */
.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    left: 0;
    top: 0;
}

/* Customer Grid */
.customer-grid {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.customer-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.customer-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
}

.customer-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

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

.customer-name {
    font-weight: 600;
    color: #1f2937;
}

/* Customer Type Badges */
.customer-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-residential {
    background: #dbeafe;
    color: #1e40af;
}

.type-commercial {
    background: #d1fae5;
    color: #065f46;
}

.type-industrial {
    background: #fef3c7;
    color: #92400e;
}

/* Status */
.status-active {
    color: #10b981;
}

.status-inactive {
    color: #ef4444;
}

/* Empty State */
.empty-state {
    padding: 60px 40px;
    text-align: center;
    color: #6b7280;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1f2937;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Status Message (for messages.js) */
#statusMessage {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 400px;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.status-message.success {
    background: #10b981;
    color: white;
}

.status-message.error {
    background: #ef4444;
    color: white;
}

.status-message.warning {
    background: #f59e0b;
    color: white;
}

.status-message.info {
    background: #2563eb;
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px 50px;
    border-radius: 12px;
    text-align: center;
}

.spinner {
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}