<style nonce="{{ csp_nonce }}">
    /* ═══════════════════════════════════════════════════════════
       BUTTONS
       ═══════════════════════════════════════════════════════════ */
    .btn {
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        padding: 11px 24px;
        background: var(--accent);
        color: #fff;
        text-decoration: none; border-radius: 6px; font-size: 14px;
        font-weight: 600; border: none; cursor: pointer;
        transition: background 0.15s, box-shadow 0.15s;
        font-family: var(--font);
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    .btn:hover {
        background: var(--accent-bright);
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    }
    .btn-outline {
        background: transparent;
        border: 1.5px solid var(--border-light);
        color: var(--text);
        box-shadow: none;
    }
    .btn-outline:hover {
        border-color: #bbb;
        color: var(--text);
        background: rgba(0,0,0,0.02);
    }
    .btn-sm {
        padding: 6px 14px;
        font-size: 13px;
        line-height: 1.4;
    }

    /* ═══════════════════════════════════════════════════════════
       FORM INPUTS — unified styling for all input types
       ═══════════════════════════════════════════════════════════ */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="url"],
    input[type="date"],
    input[type="search"],
    input[type="tel"],
    input[type="time"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    select,
    textarea,
    .form-control {
        margin: 0;
        padding: 10px 14px;
        border: 1.5px solid var(--border);
        border-radius: 6px;
        font-size: 14px;
        line-height: 1.4;
        background: #fafafa;
        color: var(--text);
        transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
        min-height: 42px;
        box-sizing: border-box;
        font-family: var(--font);
        width: 100%;
    }
    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus,
    input[type="number"]:focus,
    input[type="url"]:focus,
    input[type="date"]:focus,
    input[type="search"]:focus,
    input[type="tel"]:focus,
    input[type="time"]:focus,
    input[type="datetime-local"]:focus,
    input[type="month"]:focus,
    input[type="week"]:focus,
    select:focus,
    textarea:focus,
    .form-control:focus {
        outline: none;
        border-color: var(--accent);
        background: #fff;
        box-shadow: 0 0 0 3px var(--accent-glow);
    }
    input[type="text"]::placeholder,
    input[type="email"]::placeholder,
    input[type="password"]::placeholder,
    input[type="number"]::placeholder,
    input[type="url"]::placeholder,
    input[type="date"]::placeholder,
    input[type="search"]::placeholder,
    input[type="tel"]::placeholder,
    input[type="time"]::placeholder,
    input[type="datetime-local"]::placeholder,
    input[type="month"]::placeholder,
    input[type="week"]::placeholder,
    textarea::placeholder,
    .form-control::placeholder {
        color: var(--text-dim);
        opacity: 1;
    }

    /* Color input — special handling */
    input[type="color"] {
        padding: 2px;
        height: 42px;
        width: 42px;
        cursor: pointer;
        border-radius: 6px;
    }

    /* File input */
    input[type="file"] {
        padding: 8px 12px;
        font-size: 14px;
        font-family: var(--font);
        border: 1.5px dashed var(--border);
        border-radius: 6px;
        background: #fafafa;
        min-height: 42px;
        cursor: pointer;
    }
    input[type="file"]:hover {
        border-color: var(--accent);
        background: var(--accent-dim);
    }

    /* Range input */
    input[type="range"] {
        width: 100%;
        height: 6px;
        -webkit-appearance: none;
        appearance: none;
        background: var(--border);
        border-radius: 3px;
        outline: none;
    }
    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--accent);
        cursor: pointer;
        border: 2px solid #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }

    /* Disabled inputs */
    input:disabled,
    select:disabled,
    textarea:disabled,
    input[readonly] {
        opacity: 0.5;
        cursor: not-allowed;
        background: #f3f4f6;
    }

    /* Checkbox + Radio */
    input[type="checkbox"],
    input[type="radio"] {
        width: 18px;
        height: 18px;
        margin: 0;
        cursor: pointer;
        accent-color: var(--accent);
        flex-shrink: 0;
    }

    /* Select — arrow styling */
    select {
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 36px;
    }

    /* Textarea */
    textarea {
        min-height: 80px;
        resize: vertical;
    }

    /* ═══════════════════════════════════════════════════════════
       FORM GROUPS — unified form field styling
       ═══════════════════════════════════════════════════════════ */
    label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--text);
        margin-bottom: 6px;
        cursor: pointer;
    }
    .form-group {
        margin-bottom: 16px;
    }
    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--text);
        margin-bottom: 6px;
    }
    .form-group .form-hint {
        font-size: 12px;
        color: var(--text-dim);
        margin-top: 4px;
    }

    /* Inline form — inputs in a row */
    .form-inline {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .form-inline .form-group {
        margin-bottom: 0;
        flex: 1;
    }

    /* ═══════════════════════════════════════════════════════════
       CARDS
       ═══════════════════════════════════════════════════════════ */
    .card {
        background: white;
        border-radius: 8px;
        padding: 24px;
        margin-bottom: 20px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    .card h2 {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 8px;
        color: var(--text);
    }
    .card .description {
        font-size: 14px;
        color: #666;
        margin-bottom: 20px;
        line-height: 1.5;
    }

    /* Card header — for list-style cards */
    .card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border);
    }
    .card-header h2 {
        margin-bottom: 0;
    }

    /* Card footer */
    .card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    /* Empty state inside cards */
    .card.empty-state {
        text-align: center;
        padding: 48px 24px;
        color: var(--text-muted);
    }

    /* ═══════════════════════════════════════════════════════════
       ALERTS — success, error, info banners
       ═══════════════════════════════════════════════════════════ */
    .success, .alert-success {
        background: #d4edda;
        color: #155724;
        padding: 12px 16px;
        border-radius: 6px;
        margin-bottom: 16px;
        font-size: 14px;
    }
    .error, .alert-error, .alert-danger {
        background: #f8d7da;
        color: #721c24;
        padding: 12px 16px;
        border-radius: 6px;
        margin-bottom: 16px;
        font-size: 14px;
    }
    .info, .alert-info {
        background: #dbeafe;
        color: #1e40af;
        padding: 12px 16px;
        border-radius: 6px;
        margin-bottom: 16px;
        font-size: 14px;
    }
    .warning, .alert-warning {
        background: #fef3c7;
        color: #92400e;
        padding: 12px 16px;
        border-radius: 6px;
        margin-bottom: 16px;
        font-size: 14px;
    }

    /* ═══════════════════════════════════════════════════════════
       TOGGLE SWITCHES — iOS-style toggle
       ═══════════════════════════════════════════════════════════ */
    .toggle-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    .toggle-row:last-child { border-bottom: none; }
    .toggle-label { font-size: 14px; }
    .toggle-label .label-title { font-weight: 600; }
    .toggle-label .label-desc { color: #6b7280; font-size: 12px; margin-top: 2px; }

    .toggle-switch {
        position: relative;
        width: 44px;
        height: 24px;
        display: inline-block;
        flex-shrink: 0;
    }
    .toggle-switch input { opacity: 0; width: 0; height: 0; }
    .toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0; left: 0; right: 0; bottom: 0;
        background: #d1d5db;
        border-radius: 24px;
        transition: 0.2s;
    }
    .toggle-slider:before {
        content: "";
        position: absolute;
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background: white;
        border-radius: 50%;
        transition: 0.2s;
    }
    .toggle-switch input:checked + .toggle-slider {
        background: var(--accent);
    }
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(20px);
    }

    /* ═══════════════════════════════════════════════════════════
       DANGER ZONE — destructive action cards
       ═══════════════════════════════════════════════════════════ */
    .danger-zone {
        border: 1px solid #fecaca;
    }
    .danger-zone h2 { color: #dc3545; }

    /* ═══════════════════════════════════════════════════════════
       USER INFO BAR — profile summary strip
       ═══════════════════════════════════════════════════════════ */
    .user-info-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background: #f9fafb;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    .user-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--accent);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 18px;
        flex-shrink: 0;
    }
    .user-details { flex: 1; min-width: 0; }
    .user-details .name { font-weight: 600; font-size: 16px; }
    .user-details .email { color: #666; font-size: 13px; margin-top: 2px; }
    .user-details .tier { display: inline-block; margin-top: 4px; }

    /* ═══════════════════════════════════════════════════════════
       MODAL
       ═══════════════════════════════════════════════════════════ */
    .modal-overlay {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
        z-index: 1000; align-items: center; justify-content: center; padding: 20px;
    }
    .modal-overlay.open { display: flex; }
    .modal-box {
        background: var(--bg-card, #fff); border-radius: 12px; width: 100%; max-width: 520px;
        max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    }
    .modal-header {
        display: flex; align-items: center; justify-content: space-between;
        padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
    }
    .modal-header h3 { font-size: 17px; font-weight: 600; margin: 0; }
    .modal-close {
        background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted);
        padding: 4px 8px; border-radius: 4px; line-height: 1;
    }
    .modal-close:hover { background: var(--bg); color: var(--text); }
    .modal-body { padding: 20px 24px; }
    .modal-footer {
        display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px;
        border-top: 1px solid var(--border);
    }
    .modal-footer .btn-outline { background: white; }
</style>