/**
 * ETT Base CSS - Theme Variables and Components
 * Author: Eddy Murias
 * Date: 2026-01-20
 *
 * This file contains CSS variables for theming and component styles.
 * Used by both DEV (with Tailwind CDN) and PROD (with compiled Tailwind).
 */

/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Tailwind utility fallback — works even when CDN is unavailable */
.hidden {
    display: none !important;
}

/* Theme CSS Variables - Light theme (default) */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --text-primary: #334155;
    --text-secondary: #6b7280;
    --text-inverse: #ffffff;
    --border-color: #e5e7eb;
    --border-secondary: #d1d5db;
    --btn-primary-bg: #3b82f6;
    --btn-primary-hover: #2563eb;
    --btn-dark-bg: #4b5563;
    --btn-dark-hover: #374151;
    --btn-secondary-bg: #6b7280;
    --btn-secondary-hover: #4b5563;
    --alert-error-bg: #fef2f2;
    --alert-error-text: #b91c1c;
    --alert-error-border: #fecaca;
    --alert-success-bg: #f0fdf4;
    --alert-success-text: #166534;
    --alert-success-border: #bbf7d0;
    --focus-ring: rgba(59, 130, 246, 0.1);
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-inverse: #000000;
    --border-color: #262626;
    --border-secondary: #404040;
    --btn-primary-bg: #2563eb;
    --btn-primary-hover: #3b82f6;
    --btn-secondary-bg: #404040;
    --btn-secondary-hover: #525252;
    --alert-error-bg: #450a0a;
    --alert-error-text: #fca5a5;
    --alert-error-border: #7f1d1d;
    --alert-success-bg: #052e16;
    --alert-success-text: #86efac;
    --alert-success-border: #14532d;
    --focus-ring: rgba(37, 99, 235, 0.3);
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Auto theme (follows system preference) */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg-primary: #000000;
        --bg-secondary: #0a0a0a;
        --bg-tertiary: #1a1a1a;
        --text-primary: #e5e5e5;
        --text-secondary: #a3a3a3;
        --text-inverse: #000000;
        --border-color: #262626;
        --border-secondary: #404040;
        --btn-primary-bg: #2563eb;
        --btn-primary-hover: #3b82f6;
        --btn-secondary-bg: #404040;
        --btn-secondary-hover: #525252;
        --alert-error-bg: #450a0a;
        --alert-error-text: #fca5a5;
        --alert-error-border: #7f1d1d;
        --alert-success-bg: #052e16;
        --alert-success-text: #86efac;
        --alert-success-border: #14532d;
        --focus-ring: rgba(37, 99, 235, 0.3);
        --shadow: rgba(0, 0, 0, 0.5);
    }
}

/* Base Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0 30px;
}

/* Card Components */
.card {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-body {
    padding: 20px;
}

/* Button Components */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: var(--btn-secondary-hover);
}

/* Form Components */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-secondary);
    border-radius: 5px;
    font-size: 14px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Select dropdown arrow fix */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a3a3a3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Tags Dropdown */
.tags-dropdown {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .tags-dropdown {
    background: var(--bg-secondary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.tags-dropdown::-webkit-scrollbar {
    width: 6px;
}

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

.tags-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.tag-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.tag-dropdown-option:last-child {
    border-bottom: none;
}

.tag-dropdown-option:hover {
    background: var(--bg-secondary);
    transform: translateX(2px);
}

[data-theme="dark"] .tag-dropdown-option:hover {
    background: var(--bg-tertiary);
}

.tag-dropdown-option.selected {
    background: var(--bg-tertiary);
    font-weight: 500;
}

[data-theme="dark"] .tag-dropdown-option.selected {
    background: var(--bg-secondary);
}

.tag-dropdown-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Alert Components */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: var(--alert-error-bg);
    color: var(--alert-error-text);
    border: 1px solid var(--alert-error-border);
}

.alert-success {
    background: var(--alert-success-bg);
    color: var(--alert-success-text);
    border: 1px solid var(--alert-success-border);
}

/* Navbar */
.navbar {
    background: #1f2937;
    border-bottom: 1px solid #374151;
    padding: 0;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    max-width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-logo {
    height: 32px;
    width: auto;
}

.navbar-company {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

/* Navigation Links */
.navbar-links {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: 40px;
}

.navbar-links a,
.navbar-links span,
.navbar-links .nav-link {
    color: #ffffff !important;
}

@media (min-width: 768px) {
    .navbar-links {
        display: flex;
    }
    .hamburger-menu {
        display: none !important;
    }
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 180px;
    z-index: 1000;
    padding: 6px 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

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

/* Support Queue Badge - Navbar */
.support-queue-badge {
    display: inline-block;
    background: #f38ba8;
    color: #1e1e2e;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    min-width: 16px;
    text-align: center;
    animation: pulseBadge 1s infinite;
}

.support-queue-badge.hidden {
    display: none;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* User Menu Dropdown */
.navbar-user-menu {
    position: relative;
}

.navbar-username {
    color: #ffffff;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar-username:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: -6px;
    padding-top: 6px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1000;
}

.navbar-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    height: 6px;
}

.navbar-user-menu:hover .navbar-dropdown,
.navbar-dropdown:hover {
    display: block;
}

.navbar-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s;
}

.navbar-dropdown a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.navbar-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-divider {
    height: 1px;
    background-color: #374151;
    margin: 4px 0;
}

/* Spinner */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

[data-theme="dark"] .spinner {
    border-color: #333;
    border-top-color: #f3f3f3;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

/* Status Badges - Light */
.badge-status-nuevo { background: #dbeafe; color: #1e40af; }
.badge-status-en_proceso { background: #fef3c7; color: #92400e; }
.badge-status-resuelto { background: #d1fae5; color: #065f46; }
.badge-status-cerrado { background: #e5e7eb; color: #4b5563; }

/* Priority Badges - Light */
.badge-priority-baja { background: #f3f4f6; color: #6b7280; }
.badge-priority-media { background: #fef3c7; color: #92400e; }
.badge-priority-alta { background: #fee2e2; color: #991b1b; }
.badge-priority-urgente { background: #fca5a5; color: #7f1d1d; }

/* Status Badges - Dark */
[data-theme="dark"] .badge-status-nuevo { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-status-en_proceso { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .badge-status-resuelto { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-status-cerrado { background: #374151; color: #d1d5db; }

/* Priority Badges - Dark */
[data-theme="dark"] .badge-priority-baja { background: #374151; color: #d1d5db; }
[data-theme="dark"] .badge-priority-media { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .badge-priority-alta { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .badge-priority-urgente { background: #991b1b; color: #f87171; }

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-switcher:hover {
    transform: scale(1.1);
}

.theme-switcher svg {
    width: 24px;
    height: 24px;
    fill: var(--text-primary);
}

/* Hamburger Menu */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    margin-right: 15px;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-close {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
}

.mobile-menu-nav {
    padding: 20px;
}

.mobile-menu-nav a {
    display: block;
    padding: 12px 0;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.mobile-menu-nav a:hover {
    padding-left: 10px;
    color: var(--btn-primary-bg);
}

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

.mobile-menu-overlay.active {
    display: block;
}

/* Menu Sections with Submenu */
.mobile-menu .mobile-menu-nav .menu-section {
    margin-bottom: 12px;
    border-bottom: none !important;
}

.mobile-menu .mobile-menu-nav .menu-section-title {
    padding: 12px 0 8px 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: none !important;
    margin-bottom: 0;
}

.mobile-menu .mobile-menu-nav .menu-section-items {
    margin-left: 16px;
    padding-left: 12px;
    border-left: 2px solid var(--btn-primary-bg);
    background: var(--bg-tertiary);
    border-radius: 0 6px 6px 0;
    margin-top: 0;
    margin-bottom: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.mobile-menu .mobile-menu-nav .menu-section-items a {
    padding: 8px 12px !important;
    font-size: 14px;
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: none !important;
    border-radius: 4px;
    margin: 2px 0;
}

.mobile-menu .mobile-menu-nav .menu-section-items a:hover {
    padding-left: 18px !important;
    color: var(--btn-primary-bg);
    background: var(--bg-secondary);
}

.navbar-desktop-links {
    display: none;
}

/* Dark mode table styles */
[data-theme="dark"] table {
    color: var(--text-primary);
}

[data-theme="dark"] th {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] td {
    border-color: var(--border-color);
}

[data-theme="dark"] tr:hover {
    background-color: var(--bg-tertiary);
}

/* Dark mode link styles */
[data-theme="dark"] a {
    color: #60a5fa;
}

[data-theme="dark"] a:hover {
    color: #93bbfc;
}

/* CKEditor Dark Mode Styles */
[data-theme="dark"] .ck.ck-editor {
    --ck-color-base-background: #1a1a1a;
    --ck-color-base-foreground: #1a1a1a;
    --ck-color-base-border: #262626;
    --ck-color-button-default-background: transparent;
    --ck-color-button-default-hover-background: #262626;
    --ck-color-button-on-background: #262626;
    --ck-color-toolbar-background: #1a1a1a;
    --ck-color-toolbar-border: #262626;
    --ck-color-input-background: #000000;
    --ck-color-input-border: #262626;
    --ck-color-dropdown-panel-background: #1a1a1a;
    --ck-color-dropdown-panel-border: #262626;
    --ck-color-text: #e5e5e5;
    --ck-color-list-background: #1a1a1a;
    --ck-color-list-button-hover-background: #262626;
    --ck-color-panel-background: #1a1a1a;
    --ck-color-panel-border: #262626;
}

[data-theme="dark"] .ck.ck-content {
    background-color: #000000 !important;
    color: #e5e5e5 !important;
}

[data-theme="dark"] .ck.ck-toolbar {
    background-color: #1a1a1a !important;
    border-color: #262626 !important;
}

[data-theme="dark"] .ck.ck-editor__main > .ck-editor__editable {
    background-color: #000000 !important;
    color: #e5e5e5 !important;
}

[data-theme="dark"] .ck.ck-editor__editable.ck-focused {
    background-color: #000000 !important;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-3 { margin-top: 15px; }
.mb-3 { margin-bottom: 15px; }

/* Responsive Styles */
@media (max-width: 768px) {
    .navbar-center {
        position: static;
        transform: none;
        flex: 1;
        justify-content: center;
    }

    .navbar-username {
        padding: 6px 10px;
        font-size: 14px;
    }

    .navbar-username span {
        display: none;
    }
}

@media (max-width: 480px) {
    .navbar-company {
        font-size: 14px;
    }

    .navbar-logo {
        height: 25px;
    }
}

/* Push Notification Button Styles */
.push-notification-btn:hover {
    transform: scale(1.05);
}

.push-notification-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   Modern Settings Page Styles - Dark Pastel Design
   Author: Eddy Murias
   Date: 2026-01-22
   Updated: Yellow rounded frames, 2-column layout
   ============================================ */

/* Settings Page Container - 2 Column Grid Layout */
.settings-page-modern {
    padding: 0;
}

.settings-page-modern .card {
    background: transparent;
    box-shadow: none;
    border: none;
}

.settings-page-modern .card-body {
    padding: 0;
}

/* Grid container for 2-column layout in settings pages */
.settings-page-modern .settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 20px;
    width: 100%;
    margin-top: 0 !important;
}

.settings-page-modern .settings-grid.single-column {
    grid-template-columns: 1fr !important;
}

.settings-page-modern .settings-grid.three-columns {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 1280px) {
    .settings-page-modern .settings-grid.three-columns {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .settings-page-modern .settings-grid.three-columns {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1024px) {
    .settings-page-modern .settings-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Modern Section - Yellow Rounded Frame */
.settings-section-modern {
    position: relative;
    margin-bottom: 24px;
    padding: 24px 28px;
    border-radius: 16px;
    /* Yellow frame - Catppuccin Yellow #f9e2af */
    border: 2px solid rgba(249, 226, 175, 0.4);
    background: rgba(30, 30, 46, 0.6); /* Catppuccin Base */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.settings-section-modern:hover {
    border-color: rgba(249, 226, 175, 0.6);
    box-shadow: 0 0 12px rgba(249, 226, 175, 0.15);
}

/* Full width section (spans both columns) */
.settings-section-modern.full-width {
    grid-column: 1 / -1;
}

/* Catppuccin Mocha Pastel Color Variants - Eye-comfortable dark theme */
/* Source: https://catppuccin.com/palette/ */

.settings-section-modern.section-blue {
    /* Catppuccin Blue #89b4fa - Primary actions, info */
    background: linear-gradient(135deg, rgba(137, 180, 250, 0.12) 0%, rgba(137, 180, 250, 0.04) 100%);
}

.settings-section-modern.section-lavender {
    /* Catppuccin Lavender #b4befe - Highlighted sections */
    background: linear-gradient(135deg, rgba(180, 190, 254, 0.12) 0%, rgba(180, 190, 254, 0.04) 100%);
}

.settings-section-modern.section-sapphire {
    /* Catppuccin Sapphire #74c7ec - Interactive elements */
    background: linear-gradient(135deg, rgba(116, 199, 236, 0.12) 0%, rgba(116, 199, 236, 0.04) 100%);
}

.settings-section-modern.section-sky {
    /* Catppuccin Sky #89dceb - Notifications, active states */
    background: linear-gradient(135deg, rgba(137, 220, 235, 0.12) 0%, rgba(137, 220, 235, 0.04) 100%);
}

.settings-section-modern.section-teal {
    /* Catppuccin Teal #94e2d5 - Success, completed */
    background: linear-gradient(135deg, rgba(148, 226, 213, 0.12) 0%, rgba(148, 226, 213, 0.04) 100%);
}

.settings-section-modern.section-green {
    /* Catppuccin Green #a6e3a1 - Positive states */
    background: linear-gradient(135deg, rgba(166, 227, 161, 0.12) 0%, rgba(166, 227, 161, 0.04) 100%);
}

.settings-section-modern.section-mauve {
    /* Catppuccin Mauve #cba6f7 - Premium, special */
    background: linear-gradient(135deg, rgba(203, 166, 247, 0.12) 0%, rgba(203, 166, 247, 0.04) 100%);
}

.settings-section-modern.section-pink {
    /* Catppuccin Pink #f5c2e7 - Decorative accents */
    background: linear-gradient(135deg, rgba(245, 194, 231, 0.10) 0%, rgba(245, 194, 231, 0.03) 100%);
}

.settings-section-modern.section-flamingo {
    /* Catppuccin Flamingo #f2cdcd - Soft alerts */
    background: linear-gradient(135deg, rgba(242, 205, 205, 0.10) 0%, rgba(242, 205, 205, 0.03) 100%);
}

.settings-section-modern.section-rosewater {
    /* Catppuccin Rosewater #f5e0dc - Hover, warm accents */
    background: linear-gradient(135deg, rgba(245, 224, 220, 0.10) 0%, rgba(245, 224, 220, 0.03) 100%);
}

.settings-section-modern.section-peach {
    /* Catppuccin Peach #fab387 - Warnings, pending */
    background: linear-gradient(135deg, rgba(250, 179, 135, 0.10) 0%, rgba(250, 179, 135, 0.03) 100%);
}

.settings-section-modern.section-yellow {
    /* Catppuccin Yellow #f9e2af - Tips, important info */
    background: linear-gradient(135deg, rgba(249, 226, 175, 0.10) 0%, rgba(249, 226, 175, 0.03) 100%);
}

.settings-section-modern.section-maroon {
    /* Catppuccin Maroon #eba0ac - Caution */
    background: linear-gradient(135deg, rgba(235, 160, 172, 0.10) 0%, rgba(235, 160, 172, 0.03) 100%);
}

.settings-section-modern.section-red {
    /* Catppuccin Red #f38ba8 - Errors, danger */
    background: linear-gradient(135deg, rgba(243, 139, 168, 0.10) 0%, rgba(243, 139, 168, 0.03) 100%);
}

.settings-section-modern.section-surface {
    /* Catppuccin Surface0 #313244 - Neutral sections */
    background: linear-gradient(135deg, rgba(49, 50, 68, 0.5) 0%, rgba(49, 50, 68, 0.3) 100%);
}

/* Legacy aliases for backward compatibility */
.settings-section-modern.section-purple { background: linear-gradient(135deg, rgba(203, 166, 247, 0.12) 0%, rgba(203, 166, 247, 0.04) 100%); }
.settings-section-modern.section-emerald { background: linear-gradient(135deg, rgba(166, 227, 161, 0.12) 0%, rgba(166, 227, 161, 0.04) 100%); }
.settings-section-modern.section-amber { background: linear-gradient(135deg, rgba(249, 226, 175, 0.10) 0%, rgba(249, 226, 175, 0.03) 100%); }
.settings-section-modern.section-rose { background: linear-gradient(135deg, rgba(243, 139, 168, 0.10) 0%, rgba(243, 139, 168, 0.03) 100%); }
.settings-section-modern.section-indigo { background: linear-gradient(135deg, rgba(180, 190, 254, 0.12) 0%, rgba(180, 190, 254, 0.04) 100%); }
.settings-section-modern.section-slate { background: linear-gradient(135deg, rgba(49, 50, 68, 0.5) 0%, rgba(49, 50, 68, 0.3) 100%); }
.settings-section-modern.section-orange { background: linear-gradient(135deg, rgba(250, 179, 135, 0.10) 0%, rgba(250, 179, 135, 0.03) 100%); }

/* Section Header - Compact */
.settings-section-modern .section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(249, 226, 175, 0.2); /* Yellow accent */
}

.settings-section-modern .section-icon {
    font-size: 24px;
    line-height: 1;
}

.settings-section-modern .section-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #f9e2af; /* Catppuccin Yellow - matches frame */
    letter-spacing: -0.01em;
}

.settings-section-modern .section-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #bac2de; /* Catppuccin Subtext0 */
}

/* Form Elements */
.settings-section-modern .form-group {
    margin-bottom: 20px;
}

.settings-section-modern .form-group:last-child {
    margin-bottom: 0;
}

.settings-section-modern .form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #bac2de; /* Catppuccin Subtext1 */
    margin-bottom: 8px;
}

.settings-section-modern .form-control {
    width: 100%;
    background: rgba(49, 50, 68, 0.5); /* Catppuccin Surface0 */
    border: 1px solid rgba(205, 214, 244, 0.1);
    border-radius: 10px;
    color: #cdd6f4; /* Catppuccin Text */
    padding: 12px 14px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.settings-section-modern .form-control:focus {
    outline: none;
    background: rgba(69, 71, 90, 0.6); /* Catppuccin Surface1 */
    border-color: rgba(249, 226, 175, 0.4); /* Yellow to match frame */
    box-shadow: 0 0 0 2px rgba(249, 226, 175, 0.1);
}

.settings-section-modern .form-control::placeholder {
    color: #6c7086; /* Catppuccin Overlay0 */
}

.settings-section-modern textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.settings-section-modern select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a1a1aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Form Hint Text */
.settings-section-modern .form-hint {
    display: block;
    font-size: 12px;
    color: #7f849c; /* Catppuccin Overlay1 */
    margin-top: 6px;
}

.settings-section-modern .form-hint.warning {
    color: #f9e2af; /* Catppuccin Yellow */
}

/* Checkbox & Toggle Styles */
.settings-section-modern .form-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(249, 226, 175, 0.1);
}

.settings-section-modern .form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.settings-section-modern .form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(249, 226, 175, 0.3); /* Yellow accent */
    background: rgba(49, 50, 68, 0.5);
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
}

.settings-section-modern .form-checkbox input[type="checkbox"]:checked {
    background: #f9e2af; /* Catppuccin Yellow */
    border-color: #f9e2af;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%231e1e2e' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.settings-section-modern .checkbox-label {
    font-size: 14px;
    color: #bac2de;
}

.settings-section-modern .checkbox-hint {
    font-size: 12px;
    color: #7f849c;
    margin-top: 2px;
}

/* Inline Form Grid */
.settings-section-modern .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .settings-section-modern .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Action Buttons within Section */
.settings-section-modern .section-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(249, 226, 175, 0.15);
}

.settings-section-modern .btn {
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.settings-section-modern .btn-secondary {
    background: rgba(69, 71, 90, 0.5);
    border: 1px solid rgba(249, 226, 175, 0.2);
    color: #bac2de;
}

.settings-section-modern .btn-secondary:hover {
    background: rgba(88, 91, 112, 0.6);
    border-color: rgba(249, 226, 175, 0.3);
}

/* Status Banner - Compact */
.settings-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(249, 226, 175, 0.2); /* Yellow accent */
}

.settings-status-banner.status-enabled {
    background: linear-gradient(135deg, rgba(166, 227, 161, 0.12) 0%, rgba(166, 227, 161, 0.04) 100%); /* Catppuccin Green */
}

.settings-status-banner.status-disabled {
    background: linear-gradient(135deg, rgba(108, 112, 134, 0.15) 0%, rgba(108, 112, 134, 0.05) 100%); /* Catppuccin Overlay0 */
}

.settings-status-banner .status-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-status-banner .status-icon {
    font-size: 22px;
}

.settings-status-banner .status-title {
    font-weight: 600;
    font-size: 14px;
    color: #cdd6f4; /* Catppuccin Text */
    margin: 0;
}

.settings-status-banner .status-description {
    font-size: 12px;
    color: #bac2de; /* Catppuccin Subtext0 */
    margin: 1px 0 0 0;
}

/* Info/Alert Box within Section - Catppuccin Colors - Compact */
.settings-info-box {
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid rgba(205, 214, 244, 0.05);
}

.settings-info-box.info-blue {
    background: rgba(137, 180, 250, 0.08); /* Catppuccin Blue */
}

.settings-info-box.info-amber,
.settings-info-box.info-yellow {
    background: rgba(249, 226, 175, 0.08); /* Catppuccin Yellow */
}

.settings-info-box.info-emerald,
.settings-info-box.info-green {
    background: rgba(166, 227, 161, 0.08); /* Catppuccin Green */
}

.settings-info-box.info-indigo,
.settings-info-box.info-lavender {
    background: rgba(180, 190, 254, 0.08); /* Catppuccin Lavender */
}

.settings-info-box.info-purple,
.settings-info-box.info-mauve {
    background: rgba(203, 166, 247, 0.08); /* Catppuccin Mauve */
}

.settings-info-box.info-rose,
.settings-info-box.info-red {
    background: rgba(243, 139, 168, 0.08); /* Catppuccin Red */
}

.settings-info-box.info-teal {
    background: rgba(148, 226, 213, 0.08); /* Catppuccin Teal */
}

.settings-info-box.info-sky {
    background: rgba(137, 220, 235, 0.08); /* Catppuccin Sky */
}

.settings-info-box.info-peach {
    background: rgba(250, 179, 135, 0.08); /* Catppuccin Peach */
}

.settings-info-box h4 {
    font-size: 14px;
    font-weight: 600;
    color: #cdd6f4; /* Catppuccin Text */
    margin: 0 0 4px 0;
}

.settings-info-box p {
    font-size: 13px;
    color: #bac2de; /* Catppuccin Subtext0 */
    margin: 0;
    line-height: 1.4;
}

.settings-info-box ul {
    margin: 0;
    padding-left: 16px;
}

.settings-info-box li {
    font-size: 13px;
    color: #bac2de; /* Catppuccin Subtext0 */
    line-height: 1.5;
}

/* Stats Grid - Compact */
.settings-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.settings-stat-card {
    text-align: center;
    padding: 10px 8px;
    background: rgba(49, 50, 68, 0.3); /* Catppuccin Surface0 */
    border-radius: 8px;
    border: 1px solid rgba(205, 214, 244, 0.05);
}

.settings-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #cdd6f4; /* Catppuccin Text */
}

.settings-stat-card .stat-label {
    font-size: 12px;
    color: #7f849c; /* Catppuccin Overlay1 */
    margin-top: 2px;
}

/* Catppuccin accent colors for stats */
.settings-stat-card.stat-blue .stat-value { color: #89b4fa; } /* Catppuccin Blue */
.settings-stat-card.stat-emerald .stat-value,
.settings-stat-card.stat-green .stat-value { color: #a6e3a1; } /* Catppuccin Green */
.settings-stat-card.stat-amber .stat-value,
.settings-stat-card.stat-yellow .stat-value { color: #f9e2af; } /* Catppuccin Yellow */
.settings-stat-card.stat-teal .stat-value { color: #94e2d5; } /* Catppuccin Teal */
.settings-stat-card.stat-mauve .stat-value { color: #cba6f7; } /* Catppuccin Mauve */

@media (max-width: 640px) {
    .settings-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Actions (Save/Cancel) - Compact */
.settings-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-bottom: 40px;
}

.settings-form-actions .btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: 1px solid rgba(249, 226, 175, 0.2); /* Yellow accent */
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-form-actions .btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    border-color: rgba(249, 226, 175, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.settings-form-actions .btn-link {
    color: #bac2de;
    padding: 8px 14px;
    background: transparent;
    border: none;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.settings-form-actions .btn-link:hover {
    color: #cdd6f4;
}

/* Preview Image Container */
.settings-image-preview {
    display: inline-block;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
}

.settings-image-preview img {
    display: block;
    max-height: 60px;
    border-radius: 4px;
}

/* Color Picker */
.settings-section-modern input[type="color"] {
    width: 60px;
    height: 50px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    cursor: pointer;
    padding: 4px;
}

.settings-section-modern input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.settings-section-modern input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Flash Messages */
.settings-page-modern .alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: none;
}

.settings-page-modern .alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(52, 211, 153, 0.1) 100%);
    color: #6ee7b7;
}

.settings-page-modern .alert-danger {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2) 0%, rgba(244, 63, 94, 0.1) 100%);
    color: #fda4af;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease-out;
    max-width: 380px;
    min-width: 280px;
}

.toast.toast-success {
    background: linear-gradient(135deg, rgba(148, 226, 213, 0.95) 0%, rgba(166, 227, 161, 0.9) 100%);
    border: 1px solid rgba(148, 226, 213, 0.5);
    color: #1e1e2e;
}

.toast.toast-error {
    background: linear-gradient(135deg, rgba(243, 139, 168, 0.95) 0%, rgba(235, 160, 172, 0.9) 100%);
    border: 1px solid rgba(243, 139, 168, 0.5);
    color: #1e1e2e;
}

.toast.toast-warning {
    background: linear-gradient(135deg, rgba(249, 226, 175, 0.95) 0%, rgba(250, 179, 135, 0.9) 100%);
    border: 1px solid rgba(249, 226, 175, 0.5);
    color: #1e1e2e;
}

.toast.toast-info {
    background: linear-gradient(135deg, rgba(137, 180, 250, 0.95) 0%, rgba(180, 190, 254, 0.9) 100%);
    border: 1px solid rgba(137, 180, 250, 0.5);
    color: #1e1e2e;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.25);
}

.toast.toast-hiding {
    animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================
   Email Templates Modern Styles
   ======================================== */

/* Modern Table for Email Templates */
.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern th,
.table-modern td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(205, 214, 244, 0.08);
}

.table-modern th {
    background: rgba(49, 50, 68, 0.3);
    color: #cdd6f4;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-modern tbody tr {
    transition: background-color 0.15s;
}

.table-modern tbody tr:hover {
    background: rgba(49, 50, 68, 0.2);
}

/* Template name cell */
.template-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.template-name strong {
    color: #cdd6f4;
    font-weight: 500;
}

.template-description {
    color: #bac2de;
    font-size: 12px;
}

/* Code badge for template codes */
.code-badge {
    display: inline-block;
    background: rgba(137, 180, 250, 0.15);
    color: #89b4fa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Modern badges */
.badge-modern {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-modern.badge-success {
    background: rgba(148, 226, 213, 0.2);
    color: #94e2d5;
}

.badge-modern.badge-secondary {
    background: rgba(147, 153, 178, 0.2);
    color: #9399b2;
}

/* Empty state */
.empty-state-modern {
    text-align: center;
    padding: 48px 24px;
    color: #bac2de;
}

.empty-state-modern .empty-icon {
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state-modern p {
    margin: 0;
    font-size: 15px;
}

/* Variables grid for template variables */
.variables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .variables-grid {
        grid-template-columns: 1fr;
    }
}

.variables-column {
    /* Container for each column */
}

.variables-list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
}

.variables-list-modern li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(205, 214, 244, 0.06);
}

.variables-list-modern li:last-child {
    border-bottom: none;
}

.variables-list-modern code {
    flex-shrink: 0;
}

.variables-list-modern span {
    color: #bac2de;
    font-size: 13px;
}

/* Text utility classes */
.text-secondary {
    color: #bac2de !important;
}

.text-muted {
    color: #6c7086 !important;
}

/* ========================================
   Modern Modals for Email Templates
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 17, 27, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-modern {
    background: linear-gradient(135deg, #1e1e2e 0%, #181825 100%);
    border: 1px solid rgba(205, 214, 244, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-modern.modal-lg {
    max-width: 800px;
}

.modal-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(205, 214, 244, 0.08);
}

.modal-header-modern h2 {
    margin: 0;
    color: #cdd6f4;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: rgba(243, 139, 168, 0.15);
    border: none;
    color: #f38ba8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(243, 139, 168, 0.25);
}

.modal-body-modern {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Preview Tabs for Email Preview */
.preview-tabs-modern {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(49, 50, 68, 0.3);
    border-radius: 10px;
}

.preview-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #bac2de;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-tab:hover {
    color: #cdd6f4;
}

.preview-tab.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.preview-subject-modern {
    padding: 12px 16px;
    background: rgba(49, 50, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
    color: #cdd6f4;
    font-size: 14px;
}

.preview-subject-modern strong {
    color: #bac2de;
    margin-right: 8px;
}

.preview-content-modern {
    background: rgba(49, 50, 68, 0.3);
    border-radius: 8px;
    min-height: 300px;
    overflow: hidden;
}

.preview-content-modern iframe {
    width: 100%;
    height: 400px;
    border: none;
    background: #fff;
    border-radius: 8px;
}

.preview-content-modern pre {
    margin: 0;
    padding: 16px;
    color: #cdd6f4;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Template Info Grid */
.template-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.info-label {
    color: #bac2de;
    font-size: 13px;
    flex-shrink: 0;
}

.info-value {
    color: #cdd6f4;
    font-size: 13px;
}

/* Template Variables Section */
.template-variables {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(205, 214, 244, 0.08);
}

.variables-title {
    margin: 0 0 12px 0;
    color: #bac2de;
    font-size: 13px;
    font-weight: 500;
}

.variables-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Full width section */
.settings-section-modern.full-width {
    grid-column: 1 / -1;
}

/* ============================================================
   Typography Scale - Global Standards (ALL APPS)
   ============================================================
   REGLA GLOBAL: Tamaños mínimos obligatorios en toda la app.
   Base UI: 14px (0.875rem) | Reading: 16px (1rem)
   Minimum: 13px (0.8125rem) for metadata/captions only
   NEVER use font-size below 0.8rem for visible text
   ============================================================ */

/* Global minimum font-size enforcement */
body {
    font-size: 14px;
    line-height: 1.6;
}

/* Ensure all text elements have readable sizes */
p, li, td, th, span, label, a, div, dd, dt {
    min-height: 0; /* prevent layout issues */
}

/* Force minimum on inline-styled content (articles, user HTML) */
.article-content *,
.prose-content *,
.user-content * {
    font-size: clamp(0.875rem, 1em, 3rem) !important;
}

/* Except headings which should be larger */
.article-content h1, .prose-content h1, .user-content h1 { font-size: clamp(1.5rem, 1.75rem, 3rem) !important; font-weight: 700; }
.article-content h2, .prose-content h2, .user-content h2 { font-size: clamp(1.25rem, 1.5rem, 2.5rem) !important; font-weight: 600; }
.article-content h3, .prose-content h3, .user-content h3 { font-size: clamp(1.125rem, 1.25rem, 2rem) !important; font-weight: 600; }
.article-content h4, .prose-content h4, .user-content h4 { font-size: clamp(1rem, 1.125rem, 1.75rem) !important; font-weight: 600; }

/* Reading content containers */
.prose-content,
.article-content,
.user-content {
    font-size: 1rem;
    line-height: 1.75;
    color: #cdd6f4;
}
.prose-content p, .article-content p, .user-content p { line-height: 1.75; margin-bottom: 1em; }

/* Small utility classes - minimum 0.8125rem (13px) */
.text-xs { font-size: max(0.8125rem, 0.75rem) !important; }
.text-sm { font-size: max(0.875rem, 0.875rem) !important; }
