/* ============================================
   Admin Pages Styles
   ============================================ */

.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
}

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

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

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

.btn-edit:hover,
.btn-delete:hover {
    opacity: 0.9;
}

/* Tables */
.ip-table,
.admin-table {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--card-border);
}

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

thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-primary);
}

tbody tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--bg-secondary);
}

.ip-address {
    font-family: 'Courier New', monospace;
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--card-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #7f1d1d;
    border: 2px solid #dc2626;
}

[data-theme="dark"] .alert-error {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

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

.stat-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 2px solid var(--card-border);
    text-align: center;
}

.stat-box.blue {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.stat-box.green {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stat-box.yellow {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.stat-box.red {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.stat-box.gray {
    border-color: #6b7280;
    background: rgba(107, 114, 128, 0.12);
}

.stat-box .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-box.blue .stat-value {
    color: #3b82f6;
}

.stat-box.green .stat-value {
    color: #10b981;
}

.stat-box.yellow .stat-value {
    color: #f59e0b;
}

.stat-box.red .stat-value {
    color: #ef4444;
}

.stat-box.gray .stat-value {
    color: #374151;
}

.stat-box .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* User Cards */
.user-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.user-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-stats {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Filter Input */
.filter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Business List Items */
.business-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.business-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.business-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.business-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.business-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .business-item {
        flex-direction: column;
        gap: 1rem;
    }

    .business-actions {
        width: 100%;
        justify-content: flex-start;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem;
    }
}
