* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #18181b;
    --primary-dark: #09090b;
    --success: #18181b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #fafafa;
    --bg-card: #ffffff;
    --sidebar-bg: #09090b;
    --sidebar-hover: #18181b;
    --text-primary: #09090b;
    --text-secondary: #71717a;
    --text-light: #a1a1aa;
    --border: #e4e4e7;
    --accent: #3f3f46;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.logo h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.logo p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

.nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #a1a1aa;
    text-decoration: none;
    transition: all 0.15s;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    border-left: 2px solid transparent;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-category {
    padding: 20px 20px 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #71717a;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-category svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
    border-left-color: #ffffff;
}

.nav-item.active {
    background: var(--sidebar-hover);
    color: #ffffff;
    border-left-color: #ffffff;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary {
    background: #dbeafe;
    color: var(--primary);
}

.stat-icon.success {
    background: #d1fae5;
    color: var(--success);
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Info Card */
.info-card .info-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-main);
    border-radius: 8px;
}

.info-item i {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.info-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.info-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group label i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.15s;
    background: white;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Checkbox Label */
.checkbox-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-success {
    background: var(--primary);
    color: white;
    border: 1px solid transparent;
}

.btn-success:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modern Action Buttons */
.btn-view {
    background: #ffffff;
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-view:hover {
    background: #fafafa;
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-view svg {
    width: 16px;
    height: 16px;
}

.btn-excel {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-excel:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-excel svg {
    width: 16px;
    height: 16px;
}

.btn-delete {
    background: #ffffff;
    color: #dc2626;
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid #fecaca;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.1);
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.btn-delete svg {
    width: 16px;
    height: 16px;
}

.btn-danger {
    background: #dc2626;
    color: white;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.btn-danger svg {
    width: 18px;
    height: 18px;
}

.btn-delete-all {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    transition: all 0.2s ease;
    margin-left: 0;
}

.btn-delete-all:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Progress */
.progress-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-main);
    border-radius: 8px;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.progress-header i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f4f4f5;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-stats {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Business Preview */
.business-preview {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-main);
    border-radius: 8px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.preview-header i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.preview-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.preview-item i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    text-align: left;
    padding: 12px;
    background: #fafafa;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid #f4f4f5;
    color: var(--text-primary);
}

tbody tr:hover {
    background: #fafafa;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-overlay .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.modal-overlay .modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-overlay .modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.modal-overlay .modal-close:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.modal-overlay .modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.business-item,
.review-item {
    padding: 16px;
    margin-bottom: 16px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.15s;
}

.business-item:hover,
.review-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.business-item:last-child,
.review-item:last-child {
    margin-bottom: 0;
}

.business-header,
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.business-name,
.review-author {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.business-rating,
.review-rating {
    font-size: 14px;
    color: var(--text-secondary);
}

.business-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.business-detail-item {
    font-size: 14px;
    color: var(--text-secondary);
}

.business-detail-item strong {
    color: var(--text-primary);
    margin-right: 8px;
}

.business-detail-item a {
    color: var(--primary);
    text-decoration: none;
}

.business-detail-item a:hover {
    text-decoration: underline;
}

.review-text {
    margin: 12px 0;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.review-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Old Modal (keep for compatibility) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-main);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--border);
}

.modal-close i {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--primary);
}

.toast.error {
    background: #dc2626;
}

.toast.warning {
    background: #f59e0b;
}

/* Logs Container */
.logs-container {
    margin-top: 16px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.logs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f4f4f5;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.logs-header svg {
    width: 16px;
    height: 16px;
}

.logs-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.log-entry {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    background: white;
    border-left: 3px solid #d4d4d8;
}

.log-entry.log-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.log-entry.log-success {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.log-entry.log-error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.log-entry.log-detail {
    border-left-color: #a855f7;
    background: #faf5ff;
    font-size: 11px;
}

/* Scrollbar for logs */
.logs-content::-webkit-scrollbar {
    width: 8px;
}

.logs-content::-webkit-scrollbar-track {
    background: #f4f4f5;
}

.logs-content::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 4px;
}

.logs-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}
