/* ===========================================
   HOSTING MANAGER - DARK THEME CSS
   Sistema completo refinado y optimizado
   =========================================== */

/* ===========================================
   1. IMPORTS & VARIABLES
   =========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

:root {
    /* Dark Theme Colors */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f29;
    --bg-tertiary: #252b37;
    --bg-card: #1e242e;
    --bg-hover: #2a3441;
    --bg-light: #2a3441;
    
    /* Text Colors */
    --text-primary: #e4e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accent Colors */
    --accent-primary: #3b82f6;
    --accent-secondary: #1d4ed8;
    --accent-tertiary: #dbeafe;
    --primary: #3b82f6;
    --primary-rgb: 59, 130, 246;
    --primary-color: #3b82f6;
    
    /* Status Colors */
    --success: #10b981;
    --success-color: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --error-color: #ef4444;
    --info: #06b6d4;
    
    /* Border Colors */
    --border-primary: #374151;
    --border-secondary: #4b5563;
    --border-color: #374151;
    
    /* Form Colors */
    --input-bg: #252b37;
    --card-bg: #1e242e;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ===========================================
   2. RESET & BASE STYLES
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

/* ===========================================
   3. LAYOUT
   =========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    transition: transform 0.3s ease;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--accent-primary);
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: var(--bg-primary);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ===========================================
   4. COMPONENTS
   =========================================== */

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-secondary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
    background: transparent;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card.warning::before { 
    background: linear-gradient(90deg, var(--warning), #fbbf24); 
}

.stat-card.error::before { 
    background: linear-gradient(90deg, var(--error), #f87171); 
}

.stat-card.success::before { 
    background: linear-gradient(90deg, var(--success), #34d399); 
}

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

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    font-size: 1.25rem;
}

.stat-icon.primary { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-icon.info { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }

.stat-value,
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-change {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

/* Service Cards */
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.service-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0;
    line-height: 1.3;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.5rem 0 1rem;
}

.service-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--success);
    margin: 1rem 0 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.service-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.service-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.875rem;
}

/* Action Cards */
.action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.action-description,
.action-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.table thead,
.data-table thead {
    background: var(--bg-tertiary);
}

.table th,
.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td,
.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-secondary);
    vertical-align: top;
}

.table tbody tr:hover,
.data-table tr:hover {
    background: var(--bg-hover);
}

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

/* Status & Type Badges */
.status-badge,
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.success,
.status-active,
.status-paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.warning,
.status-suspended,
.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.error,
.status-cancelled,
.status-expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.status-badge.secondary {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

/* Service Type Badges */
.service-type,
.service-type-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.type-hosting { 
    background: linear-gradient(135deg, #dbeafe, #bfdbfe); 
    color: #1e40af; 
    border-color: #3b82f6;
}
.type-development { 
    background: linear-gradient(135deg, #dcfce7, #bbf7d0); 
    color: #166534; 
    border-color: #10b981;
}
.type-design { 
    background: linear-gradient(135deg, #fce7f3, #fbcfe8); 
    color: #be185d; 
    border-color: #ec4899;
}
.type-photography { 
    background: linear-gradient(135deg, #fef3c7, #fde68a); 
    color: #92400e; 
    border-color: #f59e0b;
}
.type-application { 
    background: linear-gradient(135deg, #ede9fe, #ddd6fe); 
    color: #6b21a8; 
    border-color: #8b5cf6;
}
.type-marketing { 
    background: linear-gradient(135deg, #ecfdf5, #d1fae5); 
    color: #047857; 
    border-color: #059669;
}
.type-maintenance { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444;
    border-color: #ef4444;
}
.type-other { 
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0); 
    color: #475569; 
    border-color: #64748b;
}

/* Billing Cycle Badges */
.billing-cycle,
.badge-cycle-monthly,
.badge-cycle-quarterly,
.badge-cycle-semiannual,
.badge-cycle-annual,
.badge-cycle-biennial,
.badge-cycle-one_time {
    background: var(--bg-light);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-color);
}

.badge-cycle-monthly { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge-cycle-quarterly { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.badge-cycle-semiannual { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.badge-cycle-annual { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.badge-cycle-biennial { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.badge-cycle-one_time { background: rgba(107, 114, 128, 0.1); color: #6b7280; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

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

.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

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

.btn-info:hover:not(:disabled) {
    background: #0891b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(6, 182, 212, 0.3);
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-icon.danger:hover {
    background: var(--error-color);
    color: white;
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-left-color: var(--info);
    color: var(--info);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
    min-width: 160px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--card-bg);
    padding: 0 1rem;
    border-radius: 8px 8px 0 0;
}

.tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px 6px 0 0;
}

.tab.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.tab:hover {
    background: rgba(59, 130, 246, 0.03);
    color: var(--text-primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ===========================================
   5. SPECIFIC PAGE STYLES
   =========================================== */

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.stats-dashboard {
    grid-template-columns: repeat(3, 1fr);
}

/* Services Page */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.filters-section {
    margin: 1.5rem 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filters-grid .form-control {
    margin-bottom: 0;
}

/* Client Dashboard Specific */
.service-status-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-primary);
    position: relative;
    overflow: hidden;
}

.service-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-success);
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 1.5rem;
}

.service-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.service-detail {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    transition: all 0.2s ease;
}

.service-detail:hover {
    border-color: var(--border-secondary);
    transform: translateY(-1px);
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.detail-content {
    flex: 1;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.text-accent {
    color: var(--accent-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.text-accent:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Renewal Widget */
.renewal-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.renewal-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0deg 270deg, var(--bg-tertiary) 270deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 1.5rem;
}

.renewal-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--bg-card);
    border-radius: 50%;
}

.renewal-days {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.renewal-days span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.renewal-date {
    color: var(--success);
    font-weight: 700;
}

.renewal-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.renewal-actions {
    width: 100%;
}

.renewal-cost {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.cost-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cost-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Account Summary */
.account-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.summary-item.full-width {
    grid-column: 1 / -1;
}

.summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.summary-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.summary-icon.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.summary-icon.secondary {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-value.notes {
    font-style: italic;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Payment Links Page */
.payment-links-page .content-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.payment-links-page .actions-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.payment-links-page .description-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-links-page .amount-cell {
    font-family: monospace;
    font-weight: 600;
    color: var(--success-color);
}

.payment-links-page .actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Payment Methods */
.payment-method {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.payment-method:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.payment-method.selected {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.payment-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.payment-icon.yape { background: #722F93; color: white; }
.payment-icon.plin { background: #00D4AA; color: white; }
.payment-icon.bank { background: #1F2937; color: white; }
.payment-icon.mercadopago { background: #00B1EA; color: white; }

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-primary);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.file-upload.dragover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-upload-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Empty State */
.payments-list {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Due Date Styling */
.due-date {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.due-ok {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.due-soon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.due-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* ===========================================
   6. UTILITIES
   =========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--error); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); opacity: 0.7; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

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

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Grid Utilities */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Badge General */
.badge-secondary {
    background: var(--text-secondary);
}

/* ===========================================
   7. ANIMATIONS & TRANSITIONS
   =========================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===========================================
   8. MEDIA QUERIES
   =========================================== */

/* Large Desktop */
@media (max-width: 1200px) {
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop to Tablet */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet */
@media (max-width: 968px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0rem;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        height: 100%;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: flex !important;
    }
    
    /* Header Mobile */
    .header {
        padding: 1rem;
    }
    
    .header-title {
        font-size: 1.2rem;
    }
    
    /* Content Mobile */
    .p-4 {
        padding: 1rem !important;
    }
    
    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Tables Mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .table .hide-mobile {
        display: none;
    }
    
    /* Actions Mobile */
    .actions-cell .btn-icon {
        width: 40px;
        height: 40px;
        margin: 2px;
    }
    
    /* Modals Mobile */
    .modal {
        align-items: flex-start;
        padding: 1rem;
    }
    
    .modal-content {
        width: 100%;
        max-width: none;
        margin: 0;
        max-height: calc(100vh - 2rem);
        padding: 1.5rem;
    }
    
    .modal-footer,
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Forms Mobile */
    .form-control {
        font-size: 16px;
        padding: 12px;
        border-radius: 8px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    /* Search Mobile */
    .search-box input {
        min-width: 100%;
        margin-bottom: 1rem;
    }
    
    .content-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .actions-right {
        justify-content: center;
    }
    
    /* Navigation Mobile */
    .nav-link {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* Cards Mobile */
    .card {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .action-title {
        font-size: 0.9rem;
    }
    
    .action-icon {
        font-size: 1.5rem;
    }
    
    /* Service Specific Mobile */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .service-price {
        font-size: 1.5rem;
    }
    
    .service-actions {
        flex-direction: column;
    }
    
    .service-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Tabs Mobile */
    .tabs {
        overflow-x: auto;
        padding: 0 0.5rem;
    }
    
    .tab {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Renewal Mobile */
    .renewal-circle {
        width: 120px;
        height: 120px;
    }
    
    .renewal-circle::before {
        width: 90px;
        height: 90px;
    }
    
    .renewal-days {
        font-size: 2rem;
    }
    
    /* Grid Mobile */
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    /* Filters Mobile */
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    /* Action Buttons Mobile */
    .action-buttons {
        flex-wrap: wrap;
    }
    
    /* Payment Links Page Mobile */
    .payment-links-page .content-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .payment-links-page .actions-right {
        justify-content: center;
    }
    
    .payment-links-page .search-box input {
        min-width: 100%;
    }
}

/* Mobile Small */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-grid {
        gap: 1rem;
    }
    
    .table {
        min-width: 500px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Mobile Extra Small */
@media (max-width: 480px) {
    /* Header */
    .header-title {
        font-size: 1.1rem;
    }
    
    /* Stats */
    .stat-number {
        font-size: 1.3rem;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Modals */
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Dropdown */
    .dropdown {
        align-self: flex-end;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-icon:hover {
        background: var(--bg-secondary);
    }
    
    .nav-link:hover {
        background: var(--bg-secondary);
    }
    
    .action-card:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
}

/* Dark Mode Considerations */
@media (prefers-color-scheme: dark) {
    .stat-card {
        background: rgba(255,255,255,0.05);
    }
    
    .action-card {
        background: rgba(255,255,255,0.05);
    }
    
    .data-table tr:hover {
        background: rgba(255,255,255,0.05);
    }
}

/* ===========================================
   9. CLIENT DASHBOARD SPECIFIC STYLES
   =========================================== */

/* Content Header */
.content-header {
    margin-bottom: 2rem;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

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

.content-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    opacity: 0.9;
    font-size: 1rem;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Services Grid */
.services-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Service Card Enhancements */
.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

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

.service-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Service Type Badges */
.service-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.type-development { 
    background: #dcfce7; 
    color: #166534; 
}

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

.type-application { 
    background: #ede9fe; 
    color: #6b21a8; 
}

.type-design { 
    background: #fce7f3; 
    color: #be185d; 
}

.type-marketing { 
    background: #ecfdf5; 
    color: #047857; 
}

.type-other { 
    background: #f1f5f9; 
    color: #475569; 
}

/* Service Status */
.service-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active { 
    background: #dcfce7; 
    color: #166534; 
}

.status-warning { 
    background: #fef3c7; 
    color: #92400e; 
}

.status-danger { 
    background: #fee2e2; 
    color: #dc2626; 
}

/* Service Info Grid */
.service-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    background: var(--bg-light);
    padding: 0.75rem;
    border-radius: 6px;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Next Due Styling */
.next-due {
    font-size: 1.1rem;
    font-weight: 700;
}

.due-soon { 
    color: var(--warning); 
}

.due-overdue { 
    color: var(--error); 
}

.due-ok { 
    color: var(--success); 
}

/* Service Actions */
.service-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { 
    background: #dcfce7; 
    color: #166534; 
}

.badge-warning { 
    background: #fef3c7; 
    color: #92400e; 
}

.badge-danger { 
    background: #fee2e2; 
    color: #dc2626; 
}

/* Text Utilities */
.text-primary { 
    color: var(--primary-color); 
}

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

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

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive adjustments for Client Dashboard */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .service-info {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        padding: 1.5rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .welcome-card {
        padding: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.25rem;
    }
}