/* Document Popup - Glassmorphism Design */
@import url('theme.css');

/* Overlay */
/* Overlay */
.document-popup-overlay,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

/* Nested Modal Overlay (higher z-index) */
.modal-overlay {
    z-index: 10001;
}

/* Modal Container */
.document-popup-modal,
.modal-container {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-radius: 24px !important;
    width: 94% !important;
    max-width: 1150px !important;
    max-height: 85vh !important;
    overflow: hidden !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12) !important;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-container {
    max-width: 600px !important;
    max-height: 90vh !important;
}

/* Header */
.popup-header,
.modal-header {
    padding: 24px 40px !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%) !important;
    flex-shrink: 0 !important;
}

.popup-header h2,
.modal-header h3 {
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    letter-spacing: -0.02em !important;
}

.close-btn,
.close-modal-btn,
.close-error-btn {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 4px 12px !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
    line-height: 1 !important;
}

.close-btn:hover,
.close-modal-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

/* Progress */
.progress-container {
    padding: 20px 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    background: rgba(248, 250, 252, 0.5) !important;
    flex-shrink: 0 !important;
}

.step-circle {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #e2e8f0 !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    transition: all 0.3s !important;
    position: relative !important;
    z-index: 2 !important;
}

.step-circle.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    transform: scale(1.1) !important;
}

.step-line {
    width: 60px !important;
    height: 3px !important;
    background: #e2e8f0 !important;
    border-radius: 2px !important;
    position: relative !important;
    z-index: 1 !important;
}

.step-line.active {
    background: #3b82f6 !important;
}

/* Content */
.document-popup-content,
.modal-body {
    padding: 32px 40px !important;
    overflow-y: auto !important;
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
}

.step-content {
    animation: fadeIn 0.3s ease-out !important;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #cbd5e1 !important;
    border-radius: 20px !important;
    padding: 60px 40px !important;
    text-align: center !important;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.6) 100%) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-bottom: 32px !important;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #3b82f6 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.03) 100%) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.12) !important;
}

.upload-icon {
    font-size: 4rem !important;
    color: #94a3b8 !important;
    margin-bottom: 20px !important;
    transition: all 0.3s !important;
}

.upload-area:hover .upload-icon {
    color: #3b82f6 !important;
    transform: scale(1.1) !important;
}

.upload-area h3 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 0 8px 0 !important;
}

.upload-area p {
    color: #64748b !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
}

/* File List */
.selected-files {
    display: grid !important;
    gap: 16px !important;
}

.file-card-clickable {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.file-card-clickable:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08) !important;
    transform: translateY(-2px) !important;
}

.file-info {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.file-icon {
    font-size: 1.5rem !important;
    color: #3b82f6 !important;
}

.file-details {
    display: flex !important;
    flex-direction: column !important;
}

.file-name {
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.95rem !important;
}

.file-size {
    font-size: 0.85rem !important;
    color: #64748b !important;
}

.remove-file,
.remove-signer {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 6px !important;
    transition: all 0.2s !important;
}

.remove-file:hover,
.remove-signer:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

/* Step 2: Signers */
.step-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 24px !important;
}

.step-header h3 {
    margin: 0 !important;
    font-size: 1.25rem !important;
    color: #1e293b !important;
}

.signer-actions {
    display: flex !important;
    gap: 12px !important;
}

.search-signers-btn,
.new-signer-btn {
    padding: 10px 20px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.search-signers-btn {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}

.search-signers-btn:hover {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

.new-signer-btn {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid transparent !important;
    color: #3b82f6 !important;
}

.new-signer-btn:hover {
    background: rgba(59, 130, 246, 0.2) !important;
}

.selected-signers {
    display: grid !important;
    gap: 12px !important;
}

.signer-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
}

.signer-info {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.signer-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

.signer-details {
    display: flex !important;
    flex-direction: column !important;
}

.signer-name {
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.95rem !important;
}

.signer-email {
    font-size: 0.85rem !important;
    color: #64748b !important;
}

/* Step 3: Config */
.config-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 40px !important;
}

.config-left,
.config-right {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
}

.form-group label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.9rem !important;
}

/* Dark Theme - Form labels */
[data-theme="dark"] .form-group label {
    color: #e2e8f0 !important;
}

.form-group input[type="date"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: white !important;
    color: #1e293b !important;
    font-size: 0.95rem !important;
    transition: all 0.2s !important;
    font-family: inherit !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Dark Theme - Form inputs */
[data-theme="dark"] .form-group input[type="date"],
[data-theme="dark"] .form-group input[type="text"],
[data-theme="dark"] .form-group input[type="email"],
[data-theme="dark"] .form-group input[type="tel"],
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: #94a3b8 !important;
}

.radio-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.radio-option {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    background: white !important;
}

.radio-option:hover {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.02) !important;
}

.radio-option input[type="radio"] {
    margin-right: 12px !important;
    accent-color: #3b82f6 !important;
}

/* Toggle Switch */
.toggle-switch {
    width: 48px !important;
    height: 26px !important;
    background: #e2e8f0 !important;
    border-radius: 13px !important;
    position: relative !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    margin-right: 12px !important;
}

.toggle-switch.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.toggle-circle {
    width: 22px !important;
    height: 22px !important;
    background: white !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.toggle-switch.active .toggle-circle {
    transform: translateX(22px) !important;
}

.toggle-label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

/* Footer */
.popup-footer,
.modal-footer {
    padding: 24px 40px !important;
    border-top: 1px solid rgba(226, 232, 240, 0.6) !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 16px !important;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%) !important;
    flex-shrink: 0 !important;
}

.modal-back-btn {
    padding: 12px 24px !important;
    background: transparent !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}

.modal-back-btn:hover,
.cancel-btn:hover {
    background: #f8fafc !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.modal-action-btn,
.confirm-btn {
    padding: 12px 32px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
}

.modal-action-btn:hover,
.confirm-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35) !important;
}

.modal-action-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Contacts Modal */
.search-box {
    position: relative !important;
    margin-bottom: 20px !important;
}

.search-box i {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #94a3b8 !important;
}

.search-box input {
    width: 100% !important;
    padding: 12px 16px 12px 44px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
}

.contacts-list {
    max-height: 300px !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.contact-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px !important;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    transition: all 0.2s !important;
}

.contact-item:hover {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.contact-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.contact-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #e2e8f0 !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
}

.contact-name {
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.9rem !important;
}

.contact-email {
    font-size: 0.8rem !important;
    color: #64748b !important;
}

.add-contact-btn {
    padding: 6px 16px !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.add-contact-btn:hover {
    border-color: #3b82f6 !important;
    background: #eff6ff !important;
}

/* Success/Error Modals */
.success-modal,
.error-modal {
    text-align: center !important;
    padding: 48px !important;
    max-width: 480px !important;
}

.success-icon,
.error-icon {
    font-size: 4rem !important;
    margin-bottom: 24px !important;
}

.success-icon {
    color: #10b981 !important;
}

.error-icon {
    color: #ef4444 !important;
}

.success-modal h3,
.error-modal h3 {
    font-size: 1.5rem !important;
    color: #1e293b !important;
    margin-bottom: 16px !important;
}

.success-modal p,
.error-modal p {
    color: #64748b !important;
    line-height: 1.6 !important;
    margin-bottom: 24px !important;
}

.next-steps {
    background: #f8fafc !important;
    border-radius: 12px !important;
    padding: 20px !important;
    text-align: left !important;
    margin-top: 24px !important;
}

.next-steps h4 {
    margin: 0 0 12px 0 !important;
    color: #1e293b !important;
    font-size: 1rem !important;
}

.next-steps ul {
    margin: 0 !important;
    padding-left: 20px !important;
    color: #64748b !important;
}

.next-steps li {
    margin-bottom: 8px !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    min-height: 200px;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

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

/* Invite Member Popup - Dark Theme Support */
[data-theme="dark"] .modal-container {
    background: rgba(30, 41, 59, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .modal-header h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .modal-footer {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .modal-back-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .modal-back-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

/* Role Options - Dark Theme */
[data-theme="dark"] .role-option {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .role-option:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .role-option div:first-of-type > div:first-child {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .role-option div:first-of-type > div:last-child {
    color: #94a3b8 !important;
}

/* Invite Illustration - Dark Theme */
[data-theme="dark"] .invite-illustration div:first-child {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%) !important;
}

[data-theme="dark"] .invite-illustration p {
    color: #94a3b8 !important;
}

/* ========================================
   Premium Role Selector Cards
   ======================================== */

.role-selector-premium {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.role-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.role-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-card-inner {
    position: relative;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.role-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.role-card:hover .role-card-inner {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.role-card:hover .role-card-inner::before {
    opacity: 1;
}

/* Selected State */
.role-card input[type="radio"]:checked + .role-card-inner {
    border-color: #3b82f6;
    background: linear-gradient(145deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 8px 24px rgba(59, 130, 246, 0.15);
}

.role-card input[type="radio"]:checked + .role-card-inner::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Card Header */
.role-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

/* Icon Wrapper */
.role-icon-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.role-icon-wrapper i {
    position: relative;
    z-index: 2;
}

.role-icon-glow {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.3s ease;
}

/* Editor Icon */
.role-icon-editor {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.role-icon-editor .role-icon-glow {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Admin Icon */
.role-icon-admin {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.role-icon-admin .role-icon-glow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.role-card:hover .role-icon-glow,
.role-card input[type="radio"]:checked + .role-card-inner .role-icon-glow {
    opacity: 0.4;
}

.role-card input[type="radio"]:checked + .role-card-inner .role-icon-wrapper {
    transform: scale(1.05);
}

/* PRO Badge */
.role-badge-pro {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Check Mark */
.role-check {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.role-card[data-role="admin"] .role-check {
    top: auto;
    bottom: 16px;
    right: 16px;
}

.role-card input[type="radio"]:checked + .role-card-inner .role-check {
    opacity: 1;
    transform: scale(1);
}

/* Card Content */
.role-card-content {
    position: relative;
    z-index: 1;
}

.role-title {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.role-subtitle {
    margin: 0 0 14px 0;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

/* Permissions */
.role-permissions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #475569;
    transition: color 0.2s ease;
}

.permission-item i {
    font-size: 0.75rem;
    color: #10b981;
    flex-shrink: 0;
}

.role-card input[type="radio"]:checked + .role-card-inner .permission-item {
    color: #1e293b;
}

/* ========================================
   Dark Theme - Role Cards
   ======================================== */

[data-theme="dark"] .role-card-inner {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .role-card:hover .role-card-inner {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .role-card input[type="radio"]:checked + .role-card-inner {
    border-color: #3b82f6;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(59, 130, 246, 0.1) 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 8px 24px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .role-title {
    color: #f1f5f9;
}

[data-theme="dark"] .role-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .permission-item {
    color: #94a3b8;
}

[data-theme="dark"] .role-card input[type="radio"]:checked + .role-card-inner .permission-item {
    color: #e2e8f0;
}

[data-theme="dark"] .role-icon-editor {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .role-icon-admin {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* ========================================
   Responsive - Role Cards
   ======================================== */

@media (max-width: 520px) {
    .role-selector-premium {
        grid-template-columns: 1fr;
    }

    .role-card-inner {
        padding: 16px;
    }

    .role-icon-wrapper {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

/* ========================================
   PREMIUM TEMPLATES POPUP
   Elegant & Sophisticated Design
   ======================================== */

/* Overlay */
.templates-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes templateOverlayIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.templates-popup-overlay.fade-out {
    animation: templateOverlayOut 0.3s ease-out forwards;
}

@keyframes templateOverlayOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Modal Container */
.templates-popup-modal {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 28px;
    width: 94%;
    max-width: 680px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 32px 64px -12px rgba(0, 0, 0, 0.25),
        0 0 120px rgba(20, 184, 166, 0.08);
    animation: templateModalIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

@keyframes templateModalIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.templates-popup-header {
    padding: 28px 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0.8) 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: relative;
}

.templates-popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 3px;
    background: linear-gradient(90deg, #14b8a6 0%, #06b6d4 50%, #0ea5e9 100%);
    border-radius: 0 0 4px 4px;
}

.templates-popup-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.templates-popup-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(145deg, #14b8a6 0%, #0d9488 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 24px rgba(20, 184, 166, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.templates-popup-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}

.templates-popup-icon i {
    font-size: 1.35rem;
    color: white;
    position: relative;
    z-index: 1;
}

.templates-popup-title h2 {
    margin: 0;
    font-family: 'Sora', -apple-system, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.templates-popup-title p {
    margin: 4px 0 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.templates-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.templates-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Search */
.templates-popup-search {
    padding: 20px 32px;
    background: #f8fafc;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    position: relative;
}

.templates-popup-search i {
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.templates-popup-search input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: #1e293b;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.templates-popup-search input::placeholder {
    color: #94a3b8;
}

.templates-popup-search input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.templates-popup-search:has(input:focus) i {
    color: #14b8a6;
}

/* Content */
.templates-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px 32px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.templates-popup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Loading State */
.templates-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
    gap: 16px;
}

.templates-loading i {
    font-size: 2.5rem;
    color: #14b8a6;
    animation: templateSpinner 1s linear infinite;
}

@keyframes templateSpinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.templates-loading p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    margin: 0;
}

/* Empty State */
.templates-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.templates-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.1) 0%, rgba(20, 184, 166, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px solid rgba(20, 184, 166, 0.15);
}

.templates-empty-icon i {
    font-size: 2rem;
    color: #14b8a6;
}

.templates-empty h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
}

.templates-empty p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 24px;
    max-width: 280px;
    line-height: 1.5;
}

.templates-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(145deg, #14b8a6 0%, #0d9488 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.3);
}

.templates-create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.4);
}

/* Template List Item */
.template-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.template-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-list-item:hover {
    border-color: #14b8a6;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow:
        0 8px 24px rgba(20, 184, 166, 0.12),
        0 0 0 1px rgba(20, 184, 166, 0.1);
    transform: translateY(-2px);
}

.template-list-item:hover::before {
    opacity: 1;
}

.template-list-item:active {
    transform: translateY(0) scale(0.99);
}

.template-list-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(20, 184, 166, 0.15);
    transition: all 0.3s ease;
}

.template-list-item:hover .template-list-icon {
    background: linear-gradient(145deg, #14b8a6 0%, #0d9488 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.template-list-icon i {
    font-size: 1.2rem;
    color: #14b8a6;
    transition: color 0.3s ease;
}

.template-list-item:hover .template-list-icon i {
    color: white;
}

.template-list-info {
    flex: 1;
    min-width: 0;
}

.template-list-info h4 {
    margin: 0 0 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.template-list-item:hover .template-list-info h4 {
    color: #0d9488;
}

.template-list-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.template-list-meta i {
    font-size: 0.7rem;
    color: #14b8a6;
}

.template-list-item:hover .template-list-meta {
    background: rgba(20, 184, 166, 0.1);
    color: #0d9488;
}

.template-list-arrow {
    color: #cbd5e1;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.template-list-item:hover .template-list-arrow {
    color: #14b8a6;
    transform: translateX(4px);
}

/* ========================================
   TEMPLATE VARIABLES POPUP
   ======================================== */

.template-vars-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease-out;
}

.template-vars-overlay.fade-out {
    animation: templateOverlayOut 0.3s ease-out forwards;
}

.template-vars-modal {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 28px;
    width: 94%;
    max-width: 560px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 32px 64px -12px rgba(0, 0, 0, 0.25),
        0 0 120px rgba(6, 182, 212, 0.08);
    animation: templateModalIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

/* Header */
.template-vars-header {
    padding: 28px 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0.8) 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: relative;
}

.template-vars-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 3px;
    background: linear-gradient(90deg, #06b6d4 0%, #6366f1 50%, #818cf8 100%);
    border-radius: 0 0 4px 4px;
}

.template-vars-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.template-vars-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    aspect-ratio: 1;
    border-radius: 16px;
    background: linear-gradient(145deg, #06b6d4 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 24px rgba(6, 182, 212, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.template-vars-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}

.template-vars-icon i {
    font-size: 1.35rem;
    color: white;
    position: relative;
    z-index: 1;
}

.template-vars-title h2 {
    margin: 0;
    font-family: 'Sora', -apple-system, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-vars-title p {
    margin: 4px 0 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.template-vars-close {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    aspect-ratio: 1;
    border-radius: 12px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.template-vars-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Content */
.template-vars-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    background: #f8fafc;
}

.template-vars-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-var-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-var-group label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-var-group label::before {
    content: '{{';
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.template-var-group label::after {
    content: '}}';
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.template-var-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: #1e293b;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-var-input::placeholder {
    color: #94a3b8;
}

.template-var-input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.template-no-vars {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: #64748b;
    text-align: center;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}

/* Footer */
.template-vars-footer {
    padding: 20px 32px 28px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.8) 0%, #ffffff 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.template-btn-cancel {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.template-btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.template-btn-create {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: linear-gradient(145deg, #06b6d4 0%, #6366f1 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

.template-btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

.template-btn-create i {
    font-size: 0.9rem;
}

/* ========================================
   DARK THEME - Templates Popup
   ======================================== */

[data-theme="dark"] .templates-popup-modal,
[data-theme="dark"] .template-vars-modal {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .templates-popup-header,
[data-theme="dark"] .template-vars-header {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .templates-popup-title h2,
[data-theme="dark"] .template-vars-title h2 {
    color: #f1f5f9;
}

[data-theme="dark"] .templates-popup-title p,
[data-theme="dark"] .template-vars-title p {
    color: #94a3b8;
}

[data-theme="dark"] .templates-close-btn,
[data-theme="dark"] .template-vars-close {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

[data-theme="dark"] .templates-close-btn:hover,
[data-theme="dark"] .template-vars-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .templates-popup-search {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .templates-popup-search input {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

[data-theme="dark"] .templates-popup-search input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .templates-popup-search input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
}

[data-theme="dark"] .templates-popup-content,
[data-theme="dark"] .template-vars-content {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(30, 41, 59, 0.3) 100%);
}

[data-theme="dark"] .template-list-item {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .template-list-item:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-color: #14b8a6;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(20, 184, 166, 0.2);
}

[data-theme="dark"] .template-list-icon {
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.15) 0%, rgba(20, 184, 166, 0.08) 100%);
    border-color: rgba(20, 184, 166, 0.2);
}

[data-theme="dark"] .template-list-info h4 {
    color: #f1f5f9;
}

[data-theme="dark"] .template-list-item:hover .template-list-info h4 {
    color: #5eead4;
}

[data-theme="dark"] .template-list-meta {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

[data-theme="dark"] .template-list-item:hover .template-list-meta {
    background: rgba(20, 184, 166, 0.15);
    color: #5eead4;
}

[data-theme="dark"] .template-list-arrow {
    color: #475569;
}

[data-theme="dark"] .template-list-item:hover .template-list-arrow {
    color: #14b8a6;
}

[data-theme="dark"] .templates-empty h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .templates-empty p {
    color: #94a3b8;
}

[data-theme="dark"] .templates-empty-icon {
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.15) 0%, rgba(20, 184, 166, 0.08) 100%);
    border-color: rgba(20, 184, 166, 0.2);
}

[data-theme="dark"] .template-var-group label {
    color: #e2e8f0;
}

[data-theme="dark"] .template-var-input {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

[data-theme="dark"] .template-var-input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .template-var-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .template-no-vars {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

[data-theme="dark"] .template-vars-footer {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(30, 41, 59, 0.3) 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .template-btn-cancel {
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-theme="dark"] .template-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

/* ========================================
   DARK THEME - Contacts Search Modal
   (Buscar Assinantes)
   ======================================== */

/* Search Box */
[data-theme="dark"] .search-box input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .search-box input::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .search-box input:focus {
    background: #1e293b !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .search-box i {
    color: #64748b !important;
}

/* Contacts List */
[data-theme="dark"] .contacts-list {
    background: transparent !important;
}

[data-theme="dark"] .contacts-list p {
    color: #94a3b8 !important;
}

/* Contact Item */
[data-theme="dark"] .contact-item {
    background: transparent !important;
    border-color: transparent !important;
}

[data-theme="dark"] .contact-item:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Contact Avatar */
[data-theme="dark"] .contact-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
}

/* Contact Info */
[data-theme="dark"] .contact-name {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .contact-email {
    color: #94a3b8 !important;
}

/* Add Contact Button */
[data-theme="dark"] .add-contact-btn {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .add-contact-btn:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* ========================================
   RESPONSIVE - Templates Popup
   ======================================== */

@media (max-width: 640px) {
    .templates-popup-modal,
    .template-vars-modal {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .templates-popup-header,
    .template-vars-header {
        padding: 20px 20px 18px;
    }

    .templates-popup-header::before,
    .template-vars-header::before {
        left: 20px;
        right: 20px;
    }

    .templates-popup-icon,
    .template-vars-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .templates-popup-icon i,
    .template-vars-icon i {
        font-size: 1.15rem;
    }

    .templates-popup-title h2,
    .template-vars-title h2 {
        font-size: 1.25rem;
    }

    .templates-popup-search {
        padding: 16px 20px;
    }

    .templates-popup-search i {
        left: 40px;
    }

    .templates-popup-content,
    .template-vars-content {
        padding: 20px;
    }

    .template-vars-footer {
        padding: 16px 20px 24px;
    }
}
