/* ============================================
   PhishGuard - Modern SaaS Design System
   Inspired by Fluent Design / qr-generator.ai
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --secondary: #8b5cf6;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info: #3b82f6;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --sidebar-width: 270px;
    --sidebar-collapsed: 70px;
    --header-height: 0px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-sidebar: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
}

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

.phsim-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Hide WP admin bar */
html[lang] { margin-top: 0 !important; }
#wpadminbar { display: none !important; }

/* --- Login Page --- */
.phsim-login-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: var(--gradient-bg);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.phsim-login-body::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -200px; right: -100px;
}

.phsim-login-body::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    bottom: -100px; left: -50px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.phsim-login-wrapper {
    position: relative; z-index: 1;
    width: 100%; max-width: 440px;
}

.phsim-login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-xl), 0 0 80px rgba(99,102,241,0.15);
    border: 1px solid rgba(255,255,255,0.2);
}

.phsim-login-header { text-align: center; margin-bottom: 32px; }

.phsim-login-logo {
    width: 72px; height: 72px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px; color: white;
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}

.phsim-login-header h1 {
    font-size: 28px; color: var(--gray-900);
    font-weight: 700; margin-bottom: 4px;
}

.phsim-login-header p {
    color: var(--gray-500); font-size: 15px;
}

.phsim-login-form .phsim-form-group {
    margin-bottom: 20px;
}

.phsim-login-form label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--gray-700); margin-bottom: 6px;
}

.phsim-login-form input {
    width: 100%; padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px; color: var(--gray-800);
    transition: all 0.2s;
    background: white;
}

.phsim-login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.phsim-login-footer {
    text-align: center; margin-top: 24px;
    color: var(--gray-400); font-size: 13px;
}

.phsim-login-info {
    text-align: center; margin-top: 24px;
    color: rgba(255,255,255,0.7); font-size: 14px;
}

/* --- App Layout --- */
.phsim-app {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.phsim-sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width 0.3s ease;
    overflow: hidden;
}

.phsim-sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.phsim-logo {
    display: flex; align-items: center; gap: 12px;
    font-size: 20px; font-weight: 700;
}

.phsim-logo i {
    font-size: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: brightness(1.5);
}

.phsim-sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: none; color: white;
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}

.phsim-sidebar-toggle:hover {
    background: rgba(255,255,255,0.2);
}

/* --- Navigation --- */
.phsim-nav {
    flex: 1; padding: 16px 12px;
    overflow-y: auto;
}

.phsim-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.phsim-nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.phsim-nav-item.active {
    color: white;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.phsim-nav-item i {
    width: 20px; text-align: center; font-size: 16px;
}

.phsim-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 12px 16px;
}

.phsim-nav-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    padding: 4px 16px 8px;
}

/* --- Sidebar Footer --- */
.phsim-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.phsim-user-info {
    display: flex; align-items: center; gap: 12px;
}

.phsim-user-avatar {
    width: 40px; height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
    text-transform: uppercase;
}

.phsim-user-name {
    font-size: 14px; font-weight: 600;
}

.phsim-user-role {
    font-size: 12px; color: rgba(255,255,255,0.5);
}

/* --- Main Content --- */
.phsim-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--gray-50);
    transition: margin-left 0.3s ease;
}

.phsim-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Page Header --- */
.phsim-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.phsim-page-header h1 {
    font-size: 28px; font-weight: 700;
    color: var(--gray-900);
    display: flex; align-items: center; gap: 12px;
}

.phsim-page-header h1 i {
    color: var(--primary);
}

.phsim-page-header p {
    color: var(--gray-500); font-size: 15px; margin-top: 4px;
}

/* --- Cards --- */
.phsim-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.phsim-card:hover {
    box-shadow: var(--shadow-md);
}

.phsim-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.phsim-card-header h3 {
    font-size: 16px; font-weight: 600;
    color: var(--gray-800);
    display: flex; align-items: center; gap: 8px;
}

.phsim-card-header h3 i {
    color: var(--primary);
}

.phsim-card-body {
    padding: 24px;
}

/* --- Stat Cards --- */
.phsim-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.phsim-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.phsim-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.phsim-stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.phsim-stat-blue::after { background: var(--gradient-primary); }
.phsim-stat-green::after { background: linear-gradient(135deg, #10b981, #059669); }
.phsim-stat-yellow::after { background: linear-gradient(135deg, #f59e0b, #d97706); }
.phsim-stat-red::after { background: linear-gradient(135deg, #ef4444, #dc2626); }

.phsim-stat-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white;
    flex-shrink: 0;
}

.phsim-stat-blue .phsim-stat-icon { background: var(--gradient-primary); }
.phsim-stat-green .phsim-stat-icon { background: linear-gradient(135deg, #10b981, #059669); }
.phsim-stat-yellow .phsim-stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.phsim-stat-red .phsim-stat-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }

.phsim-stat-value {
    font-size: 28px; font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.phsim-stat-label {
    font-size: 13px; color: var(--gray-500);
    margin-top: 4px;
}

/* --- Buttons --- */
.phsim-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

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

.phsim-btn-primary {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}
.phsim-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
    transform: translateY(-1px);
}

.phsim-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}
.phsim-btn-success:hover {
    box-shadow: 0 4px 12px rgba(16,185,129,0.4);
    transform: translateY(-1px);
}

.phsim-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}
.phsim-btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239,68,68,0.4);
}

.phsim-btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.phsim-btn-outline {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.phsim-btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.phsim-btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.phsim-btn-lg { padding: 14px 28px; font-size: 16px; }
.phsim-btn-full { width: 100%; justify-content: center; }

.phsim-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Tables --- */
.phsim-table-wrap { overflow-x: auto; }

.phsim-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.phsim-table thead th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.phsim-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.phsim-table tbody tr:hover {
    background: var(--gray-50);
}

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

.phsim-loading-text {
    text-align: center !important;
    color: var(--gray-400) !important;
    padding: 32px !important;
}

/* --- Forms --- */
.phsim-form-group {
    margin-bottom: 20px;
}

.phsim-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.phsim-form-group input,
.phsim-form-group select,
.phsim-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    transition: all 0.2s;
    font-family: inherit;
}

.phsim-form-group input:focus,
.phsim-form-group select:focus,
.phsim-form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

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

.phsim-form-help {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
    display: block;
}

.phsim-form-row {
    display: flex; gap: 20px; flex-wrap: wrap;
}

.phsim-col-4 { flex: 1; min-width: 200px; }
.phsim-col-6 { flex: 1; min-width: 250px; }
.phsim-col-8 { flex: 2; min-width: 300px; }

.phsim-form-actions {
    display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap;
}

/* --- Schedule Radio Cards --- */
.phsim-schedule-options {
    display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}

.phsim-radio-card {
    flex: 1; min-width: 160px; cursor: pointer;
}

.phsim-radio-card input { display: none; }

.phsim-radio-card-content {
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.2s;
}

.phsim-radio-card-content i {
    font-size: 28px; color: var(--gray-400);
    display: block; margin-bottom: 8px;
}

.phsim-radio-card-content strong {
    display: block; color: var(--gray-700); margin-bottom: 4px;
}

.phsim-radio-card-content p {
    font-size: 12px; color: var(--gray-400); margin: 0;
}

.phsim-radio-card input:checked + .phsim-radio-card-content {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.phsim-radio-card input:checked + .phsim-radio-card-content i {
    color: var(--primary);
}

.phsim-radio-card input:checked + .phsim-radio-card-content strong {
    color: var(--primary-dark);
}

.phsim-schedule-details {
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-top: 12px;
}

/* --- Template Selector --- */
.phsim-template-selector {
    display: flex; gap: 12px; flex-wrap: wrap;
}

.phsim-template-check {
    cursor: pointer;
}

.phsim-template-check input { display: none; }

.phsim-template-check-content {
    padding: 14px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 10px;
}

.phsim-template-check-content .check-icon {
    width: 22px; height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.phsim-template-check input:checked + .phsim-template-check-content {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.phsim-template-check input:checked + .phsim-template-check-content .check-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* --- Templates Grid --- */
.phsim-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.phsim-template-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: all 0.2s;
}

.phsim-template-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.phsim-template-card-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.phsim-template-card-header h4 {
    font-size: 16px; font-weight: 600;
    color: var(--gray-800); margin-bottom: 4px;
}

.phsim-template-card-header .category-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-top: 6px;
}

.phsim-template-card-body {
    padding: 16px 20px;
}

.phsim-template-card-body .subject {
    font-size: 13px; color: var(--gray-600);
    margin-bottom: 8px;
}

.phsim-template-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex; justify-content: flex-end; gap: 8px;
    background: var(--gray-50);
}

/* --- Badges --- */
.phsim-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.phsim-badge-info { background: #eef2ff; color: #4f46e5; }
.phsim-badge-success { background: #ecfdf5; color: #059669; }
.phsim-badge-warning { background: #fffbeb; color: #d97706; }
.phsim-badge-danger { background: #fef2f2; color: #dc2626; }
.phsim-badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* --- Status Badges --- */
.status-draft { background: var(--gray-100); color: var(--gray-600); }
.status-running { background: #dbeafe; color: #1d4ed8; }
.status-paused { background: #fef3c7; color: #92400e; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-sent { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* --- Progress Bar --- */
.phsim-progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.phsim-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.phsim-progress-text {
    font-size: 12px; color: var(--gray-500); margin-top: 4px;
}

/* --- Code Editor / WYSIWYG --- */
.phsim-wysiwyg-wrap {
    width: 100%;
}

.phsim-required {
    color: var(--danger);
}

.phsim-wysiwyg-wrap .tox-tinymce {
    border: 2px solid var(--gray-200) !important;
    border-radius: var(--radius) !important;
}

.phsim-wysiwyg-wrap .tox:not(.tox-tinymce-inline) .tox-editor-header {
    border-bottom: 1px solid var(--gray-100);
}

.phsim-editor-wrap {
    width: 100%;
}

.phsim-template-code-visible #tpl-code-wrap {
    width: 100%;
}

.phsim-template-code-visible .phsim-code-editor {
    width: 100%;
    min-height: 620px;
}

.phsim-code-editor {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    background: var(--gray-900) !important;
    color: #e2e8f0 !important;
    border-radius: var(--radius) !important;
    padding: 16px !important;
    min-height: 300px;
    tab-size: 2;
}

.phsim-variables-help {
    background: var(--primary-bg);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--gray-600);
}

.phsim-variables-help code {
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

/* --- Preview --- */
.phsim-preview-frame {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 200px;
    background: white;
}

/* --- Modal --- */
.phsim-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.phsim-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.phsim-modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.phsim-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--gray-100);
}

.phsim-modal-header h3 {
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}

.phsim-modal-close {
    background: var(--gray-100);
    border: none; cursor: pointer;
    width: 36px; height: 36px;
    border-radius: 10px;
    font-size: 20px; color: var(--gray-500);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.phsim-modal-close:hover {
    background: var(--gray-200); color: var(--gray-800);
}

.phsim-modal-body { padding: 24px 28px; }
.phsim-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--gray-100);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* --- Profile --- */
.phsim-profile-info {
    display: flex; align-items: center; gap: 24px;
    flex-wrap: wrap;
}

.phsim-profile-avatar {
    width: 80px; height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; color: white;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(99,102,241,0.3);
    flex-shrink: 0;
}

.phsim-profile-details p {
    font-size: 14px; color: var(--gray-600);
    margin-bottom: 8px;
}

.phsim-profile-details strong {
    color: var(--gray-800); min-width: 120px; display: inline-block;
}

/* --- Recipient Count --- */
.phsim-recipient-count {
    padding: 10px 16px;
    background: var(--primary-bg);
    border-radius: 10px;
    font-size: 14px;
    color: var(--gray-600);
}

/* --- Loading --- */
.phsim-loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

.phsim-spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- Category Colors --- */
.cat-bankowosc { background: #e3f2fd; color: #1565c0; }
.cat-kurier { background: #fff3e0; color: #e65100; }
.cat-faktura { background: #e8eaf6; color: #283593; }
.cat-it-helpdesk { background: #e8f5e9; color: #2e7d32; }
.cat-marketplace { background: #f3e5f5; color: #6a1b9a; }
.cat-energia { background: #fff8e1; color: #f57f17; }
.cat-telekomunikacja { background: #e1f5fe; color: #0277bd; }
.cat-custom { background: var(--gray-100); color: var(--gray-600); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .phsim-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .phsim-sidebar.open {
        transform: translateX(0);
    }

    .phsim-main {
        margin-left: 0;
    }

    .phsim-content {
        padding: 16px;
    }

    .phsim-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .phsim-form-row {
        flex-direction: column;
    }

    .phsim-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .phsim-templates-grid {
        grid-template-columns: 1fr;
    }

    /* Show mobile toggle */
    .phsim-mobile-toggle {
        display: block;
        position: fixed;
        top: 16px; left: 16px;
        z-index: 101;
        background: var(--gradient-primary);
        color: white;
        border: none;
        width: 44px; height: 44px;
        border-radius: 12px;
        font-size: 18px;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
    }
}

/* --- Chart container --- */
canvas {
    max-width: 100%;
}

/* --- Toastify customization --- */
.toastify {
    border-radius: 10px !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 14px 24px !important;
}

/* --- Category badges for templates --- */
.phsim-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* --- Empty state --- */
.phsim-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}

.phsim-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.phsim-empty p {
    font-size: 16px;
    margin-bottom: 8px;
}



