/* ============================================================================
   B2B SaaS Platform - Stylesheet (Based on uploaded design)
   Dark theme with teal/green accents
   ============================================================================ */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --secondary: #3b82f6;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark-bg: #1e293b;
    --dark-card: #334155;
    --dark-border: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --input-bg: #0f172a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--dark-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--dark-border);
}

.login-box h1 {
    font-size: 28px;
    margin-bottom: 8px;
    text-align: center;
    color: var(--primary);
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--dark-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-block {
    width: 100%;
    display: block;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--dark-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--input-bg);
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
}

/* ============================================================================
   ADMIN LAYOUT
   ============================================================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--dark-card);
    border-right: 1px solid var(--dark-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

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

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--primary);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-supervisor { background: #8b5cf6; color: white; }
.badge-director { background: #3b82f6; color: white; }
.badge-sales { background: #10b981; color: white; }
.badge-client { background: #64748b; color: white; }
.badge-chatbot { background: #06b6d4; color: white; }
.badge-social_media { background: #ec4899; color: white; }
.badge-email_automation { background: #f59e0b; color: white; }
.badge-credit { background: #10b981; color: white; }
.badge-debit { background: #ef4444; color: white; }

.sidebar-menu {
    flex: 1;
    padding: 12px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(16, 185, 129, 0.05);
    color: var(--primary);
}

.menu-item.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--dark-border);
}

.user-info {
    margin-bottom: 12px;
}

.user-info strong {
    display: block;
    margin-bottom: 4px;
}

.user-info small {
    color: var(--text-secondary);
    font-size: 12px;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 24px;
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--dark-border);
}

.content-header h1 {
    font-size: 28px;
    color: var(--text-primary);
}

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

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

/* ============================================================================
   TABLE STYLES (Based on uploaded image)
   ============================================================================ */
.data-table {
    width: 100%;
    background: var(--dark-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--dark-border);
    margin-bottom: 24px;
}

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

.data-table th {
    background: var(--input-bg);
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--dark-border);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--dark-border);
    font-size: 14px;
}

.data-table tr:hover {
    background: rgba(16, 185, 129, 0.03);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-active { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.status-pending { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-inactive { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.status-suspended { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.status-expired { background: rgba(100, 116, 139, 0.2); color: #64748b; }
.status-cancelled { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.status-info { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.status-warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-error { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.status-critical { background: rgba(220, 38, 38, 0.3); color: #fca5a5; }

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    font-size: 16px;
    transition: color 0.2s;
}

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

/* ============================================================================
   MODAL
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--dark-card);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--dark-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dark-border);
}

.modal-header h3 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

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

.stat-card {
    background: var(--dark-card);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--dark-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .change {
    font-size: 12px;
    margin-top: 8px;
}

.change.positive { color: var(--primary); }
.change.negative { color: var(--danger); }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .data-table {
        overflow-x: auto;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

code {
    background: var(--input-bg);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 13px;
}

small {
    font-size: 12px;
    color: var(--text-secondary);
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
    color: var(--text-secondary);
}
