/* ============================================
   THEME: Corporate Green (Default)
   Base theme — no overrides needed, uses :root
   ============================================ */

/* ============================================
   THEME: Corporate Blue
   ============================================ */
[data-theme="corporate-blue"] {
    --apple-blue: #3b82f6;
    --apple-blue-dark: #2563eb;
    --accent-rgb: 59, 130, 246;
    --gradient-text-end: #1e40af;
    --accent-secondary: #60a5fa;
    --bg-start: #f3f4f6;
    --bg-end: #f3f4f6;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --input-bg: #f9fafb;
    --input-border: #d1d5db;
    --input-focus: rgba(59, 130, 246, 0.4);
    --danger: #ef4444;
    --success: #10b981;
    --sidebar-bg: #0f172a;
    --topbar-bg: #ffffff;
    --dropdown-bg: #ffffff;
    --select-option-bg: #ffffff;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: rgba(59, 130, 246, 0.15);
}

/* ============================================
   THEME: Corporate Purple
   ============================================ */
[data-theme="corporate-purple"] {
    --apple-blue: #8b5cf6;
    --apple-blue-dark: #7c3aed;
    --accent-rgb: 139, 92, 246;
    --gradient-text-end: #5b21b6;
    --accent-secondary: #a78bfa;
    --bg-start: #f5f3ff;
    --bg-end: #f5f3ff;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --input-bg: #faf5ff;
    --input-border: #d1d5db;
    --input-focus: rgba(139, 92, 246, 0.4);
    --danger: #ef4444;
    --success: #10b981;
    --sidebar-bg: #1e1033;
    --topbar-bg: #ffffff;
    --dropdown-bg: #ffffff;
    --select-option-bg: #ffffff;
    --sidebar-text: #a78bfa;
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: rgba(139, 92, 246, 0.15);
}

/* ============================================
   THEME: Corporate Dark
   ============================================ */
[data-theme="corporate-dark"] {
    --apple-blue: #10b981;
    --apple-blue-dark: #059669;
    --accent-rgb: 16, 185, 129;
    --gradient-text-end: #34d399;
    --accent-secondary: #34d399;
    --bg-start: #111827;
    --bg-end: #111827;
    --card-bg: #1f2937;
    --card-border: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --input-bg: #374151;
    --input-border: #4b5563;
    --input-focus: rgba(16, 185, 129, 0.4);
    --danger: #f87171;
    --success: #34d399;
    --sidebar-bg: #0f172a;
    --topbar-bg: #1f2937;
    --dropdown-bg: #1f2937;
    --select-option-bg: #1f2937;
    --sidebar-text: #9ca3af;
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: rgba(16, 185, 129, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

[data-theme="corporate-dark"] .form-group input:focus,
[data-theme="corporate-dark"] .form-select:focus,
[data-theme="corporate-dark"] .form-textarea:focus,
[data-theme="corporate-dark"] .date-native input[type="date"]:focus,
[data-theme="corporate-dark"] .date-masked-input:focus,
[data-theme="corporate-dark"] .date-split-input:focus,
[data-theme="corporate-dark"] .date-datetime-input:focus {
    background: #4b5563;
}

[data-theme="corporate-dark"] .form-group input::placeholder {
    color: #6b7280;
}

[data-theme="corporate-dark"] .clients-table th {
    background: #1f2937;
}

[data-theme="corporate-dark"] .clients-table td {
    border-bottom-color: #374151;
}

[data-theme="corporate-dark"] .clients-table tbody tr:hover {
    background: #374151;
}

[data-theme="corporate-dark"] .stat-icon-green {
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="corporate-dark"] .stat-icon-purple {
    background: rgba(139, 92, 246, 0.15);
}

[data-theme="corporate-dark"] .stat-icon-cyan {
    background: rgba(6, 182, 212, 0.15);
}

[data-theme="corporate-dark"] .stat-icon-red {
    background: rgba(248, 113, 113, 0.15);
}

[data-theme="corporate-dark"] .progress-bar {
    background: #374151;
}

[data-theme="corporate-dark"] .badge-activo {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="corporate-dark"] .badge-inactivo {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="corporate-dark"] .alert-error {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="corporate-dark"] .alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="corporate-dark"] .btn-secondary {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
}

[data-theme="corporate-dark"] .btn-secondary:hover {
    background: #4b5563;
}

[data-theme="corporate-dark"] .btn-danger {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="corporate-dark"] .btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

[data-theme="corporate-dark"] .btn-success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="corporate-dark"] .btn-success:hover {
    background: rgba(16, 185, 129, 0.2);
}

[data-theme="corporate-dark"] .topbar-user:hover,
[data-theme="corporate-dark"] .hamburger:hover {
    background: #374151;
}

[data-theme="corporate-dark"] .topbar-dropdown-item:hover {
    background: #374151;
}

[data-theme="corporate-dark"] .topbar-dropdown-logout:hover {
    background: rgba(248, 113, 113, 0.12);
}

[data-theme="corporate-dark"] .maintenance-banner,
[data-theme="corporate-dark"] .maintenance-countdown-bar {
    background: rgba(245, 158, 11, 0.12);
    border-bottom-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

[data-theme="corporate-dark"] .maintenance-modal {
    background: #1f2937;
}

[data-theme="corporate-dark"] .maintenance-modal-icon {
    background: rgba(245, 158, 11, 0.15);
}

[data-theme="corporate-dark"] .maintenance-modal-time {
    color: #fbbf24;
}

[data-theme="corporate-dark"] .maintenance-modal-btn {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

[data-theme="corporate-dark"] .date-datetime-badge {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}

[data-theme="corporate-dark"] .pp-select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7l6 6 6-6' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

[data-theme="corporate-dark"] .form-select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ============================================
   THEME: Corporate Red
   ============================================ */
[data-theme="corporate-red"] {
    --apple-blue: #ef4444;
    --apple-blue-dark: #dc2626;
    --accent-rgb: 239, 68, 68;
    --gradient-text-end: #991b1b;
    --accent-secondary: #f87171;
    --bg-start: #fef2f2;
    --bg-end: #fef2f2;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --input-bg: #fff5f5;
    --input-border: #d1d5db;
    --input-focus: rgba(239, 68, 68, 0.4);
    --danger: #ef4444;
    --success: #10b981;
    --sidebar-bg: #1c1917;
    --topbar-bg: #ffffff;
    --dropdown-bg: #ffffff;
    --select-option-bg: #ffffff;
    --sidebar-text: #a8a29e;
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: rgba(239, 68, 68, 0.15);
}

/* ============================================
   Theme Selector Component
   ============================================ */
.theme-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.theme-option {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.theme-option input[type="radio"] {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.theme-preview {
    width: 100px;
    height: 70px;
    border-radius: 10px;
    border: 2px solid var(--card-border);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.theme-preview-selected {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.theme-preview-sidebar {
    width: 28%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

.theme-preview-topbar {
    height: 18px;
    width: 100%;
}

.theme-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-preview-accent {
    width: 24px;
    height: 8px;
    border-radius: 4px;
    margin-left: 20px;
}

.theme-option-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.theme-label-active {
    color: var(--apple-blue);
    font-weight: 600;
}
