/* ==========================================================================
   EduEvent Connect - Master Stylesheet
   Version: 3.4.0 (Added Chat Bubbles & Unread Badges)
   ========================================================================== */

/* 1. ROOT VARIABLES & THEME CONFIGURATION
   -------------------------------------------------------------------------- */
:root {
    /* Brand Colors */
    --ee-primary: #4f46e5;       /* Indigo 600 */
    --ee-primary-hover: #4338ca; /* Indigo 700 */
    --ee-primary-light: #e0e7ff; /* Indigo 100 */
    
    /* Functional Colors */
    --ee-success: #10b981;       /* Emerald */
    --ee-success-bg: #ecfdf5;
    --ee-warning: #f59e0b;       /* Amber */
    --ee-warning-bg: #fffbeb;
    --ee-danger: #ef4444;        /* Red */
    --ee-danger-bg: #fef2f2;
    --ee-info: #3b82f6;          /* Blue */
    --ee-info-bg: #eff6ff;
    
    /* Neutrals */
    --ee-bg-app: #f3f4f6;        /* Page Background */
    --ee-bg-card: #ffffff;       /* Card Background */
    --ee-bg-input: #f9fafb;      /* Inputs */
    --ee-text-main: #111827;     /* Headings */
    --ee-text-body: #374151;     /* Body */
    --ee-text-muted: #6b7280;    /* Meta */
    --ee-border: #e5e7eb;        /* Borders */

    /* UI Measurements */
    --ee-radius: 8px;
    --ee-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ee-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ee-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ee-font-stack: 'Roboto', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --ee-transition: all 0.2s ease-in-out;
}

/* 2. GLOBAL RESET & BASE STYLES
   -------------------------------------------------------------------------- */
.ee-wrapper, .ee-public-wrapper {
    font-family: var(--ee-font-stack);
    color: var(--ee-text-body);
    background-color: var(--ee-bg-app);
    font-size: 15px;
    line-height: 1.6;
    box-sizing: border-box;
    padding: 20px;
}

.ee-wrapper *, .ee-public-wrapper * { box-sizing: border-box; }

a { text-decoration: none; color: var(--ee-primary); transition: var(--ee-transition); }
a:hover { color: var(--ee-primary-hover); }

/* 3. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.ee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.ee-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.ee-grid-2-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.ee-flex-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ee-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 15px; }

.ee-mb { margin-bottom: 16px !important; }
.ee-mb-sm { margin-bottom: 8px !important; }
.ee-mt { margin-top: 16px !important; }
.ee-text-center { text-align: center; }

/* 4. COMPONENT: CARDS & BUTTONS
   -------------------------------------------------------------------------- */
.ee-card {
    background: var(--ee-bg-card);
    border-radius: var(--ee-radius);
    padding: 24px;
    border: 1px solid var(--ee-border);
    box-shadow: var(--ee-shadow-sm);
    position: relative;
    margin-bottom: 20px;
    transition: var(--ee-transition);
}
.ee-card:hover { box-shadow: var(--ee-shadow-md); }

/* Overflow fix for mobile tables inside cards */
@media (max-width: 900px) { 
    .ee-card[style*="overflow:hidden"] { overflow-x: auto !important; } 
}

.ee-card-title {
    display: block; font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--ee-text-muted);
    border-bottom: 1px solid var(--ee-border);
    padding-bottom: 12px; margin: -4px 0 20px 0;
}
.ee-card-title.no-border { border: none; padding: 0; margin: 0 0 15px 0; font-size: 18px; text-transform: none; color: var(--ee-text-main); }

.ee-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; font-size: 14px; font-weight: 500;
    border-radius: var(--ee-radius); border: 1px solid transparent;
    cursor: pointer; transition: var(--ee-transition); gap: 8px; line-height: 1.2;
}
.ee-btn:active { transform: translateY(1px); }

/* Button Variants */
.ee-btn-primary { background: var(--ee-primary); color: #fff; box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2); }
.ee-btn-primary:hover { background: var(--ee-primary-hover); color: #fff; }

.ee-btn-white { background: #fff; border-color: var(--ee-border); color: var(--ee-text-body); }
.ee-btn-white:hover { background: var(--ee-bg-app); border-color: #d1d5db; color: var(--ee-text-main); }

.ee-btn-danger { background: var(--ee-danger); color: #fff; }
.ee-btn-danger:hover { background: #dc2626; color: #fff; }

.ee-btn-success { background: var(--ee-success); color: #fff; }
.ee-btn-success:hover { background: #059669; color: #fff; }

.ee-btn-block { width: 100%; display: flex; }
.ee-btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.ee-btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 4px; }

/* Icon Button (Standard) */
.ee-btn-icon { 
    width: 36px; height: 36px; padding: 0; border-radius: 50%; 
    display: inline-flex; align-items: center; justify-content: center; 
    border: 1px solid var(--ee-border); background: white; 
    cursor: pointer; color: var(--ee-text-muted); transition: 0.2s;
}
.ee-btn-icon:hover { 
    color: var(--ee-text-main); border-color: var(--ee-text-muted); 
}

/* Danger Icon Button (Red Trash Can) */
.ee-btn-icon-danger {
    width: 36px; height: 36px; padding: 0; border-radius: 50%; 
    display: inline-flex; align-items: center; justify-content: center; 
    border: 1px solid var(--ee-border); background: white; 
    cursor: pointer; color: var(--ee-danger); transition: 0.2s;
}
.ee-btn-icon-danger:hover { 
    color: #fff; 
    border-color: var(--ee-danger); 
    background: var(--ee-danger); 
}

/* --- NEW: Chat Bubble & Unread Badge Styles --- */
.ee-chat-bubble {
    max-width: 70%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 18px;
    clear: both;
    word-wrap: break-word;
}
.ee-chat-bubble.me {
    float: right;
    background: #dcf8c6;
    align-self: flex-end;
}
.ee-chat-bubble.them {
    float: left;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
}
.ee-chat-sender {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 2px;
    color: #4b5563;
}
.ee-chat-time {
    font-size: 9px;
    color: #6b7280;
    text-align: right;
    margin-top: 4px;
}
.ee-chat-unread-badge {
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 4px;
    position: relative;
    top: -8px;
}
#chatMessages {
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}
/* ------------------------------------------------- */

/* 5. FORMS & INPUTS
   -------------------------------------------------------------------------- */
.ee-form-group { margin-bottom: 20px; }
.ee-form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--ee-text-main); }

.ee-form-control {
    width: 100%; padding: 10px 14px;
    background: var(--ee-bg-input); border: 1px solid var(--ee-border);
    border-radius: var(--ee-radius); font-size: 14px;
    color: var(--ee-text-main); transition: var(--ee-transition);
}
.ee-form-control:focus { outline: none; border-color: var(--ee-primary); background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
textarea.ee-form-control { min-height: 100px; resize: vertical; }

.ee-input-group {
    display: flex; gap: 10px; align-items: center;
    background: var(--ee-bg-app); padding: 10px;
    border: 1px solid var(--ee-border); border-radius: var(--ee-radius); margin-bottom: 10px;
}

/* 6. TABLES & STATUS
   -------------------------------------------------------------------------- */
.ee-table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--ee-radius); border: 1px solid var(--ee-border); }
.ee-table { width: 100%; border-collapse: collapse; min-width: 700px; background: #fff; }
.ee-table th { text-align: left; padding: 14px 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--ee-text-muted); background: var(--ee-bg-app); border-bottom: 2px solid var(--ee-border); white-space: nowrap; }
.ee-table td { padding: 14px 20px; border-bottom: 1px solid var(--ee-border); font-size: 14px; vertical-align: middle; color: var(--ee-text-body); }
.ee-table tbody tr:hover { background-color: var(--ee-bg-input); }

.ee-avatar-initials { width: 36px; height: 36px; background: var(--ee-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.ee-clickable-name { color: var(--ee-primary); cursor: pointer; font-weight: 500; }

.ee-badge { padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: inline-flex; align-items: center; }
.ee-badge-verified, .ee-badge-accepted, .ee-badge-present { background: var(--ee-success-bg); color: var(--ee-success); }
.ee-badge-pending { background: var(--ee-warning-bg); color: var(--ee-warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.ee-badge-rejected { background: var(--ee-danger-bg); color: var(--ee-danger); }
.ee-badge-rejected_reupload { background: var(--ee-danger-bg); color: #b91c1c; border: 1px dashed var(--ee-danger); }
.ee-badge-not_submitted, .ee-badge-neutral { background: var(--ee-bg-app); color: var(--ee-text-muted); }

.ee-status-mini-select {
    padding: 6px 24px 6px 10px; font-size: 12px; font-weight: 600; border-radius: 6px; border: 1px solid transparent; cursor: pointer;
    background-color: var(--ee-bg-app); color: var(--ee-text-body); appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236b7280%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 8px auto;
}
.ee-status-mini-select:hover { border-color: var(--ee-border); }
.ee-status-mini-select.status-verified { background-color: var(--ee-success-bg); color: #065f46; }
.ee-status-mini-select.status-rejected { background-color: var(--ee-danger-bg); color: #991b1b; }
.ee-status-mini-select.status-pending { background-color: var(--ee-warning-bg); color: #92400e; }

/* 7. PUBLIC DASHBOARD & SIDEBAR (MOBILE READY)
   -------------------------------------------------------------------------- */
.ee-public-wrapper { display: flex; gap: 30px; align-items: start; max-width: 1200px; margin: 0 auto; min-height: 80vh; }

.ee-public-sidebar {
    width: 280px; flex-shrink: 0; background: var(--ee-bg-card); border-radius: var(--ee-radius);
    border: 1px solid var(--ee-border); position: sticky; top: 30px; z-index: 100;
    display: flex; flex-direction: column;
}

.ee-sidebar-header {
    padding: 24px; text-align: center; border-bottom: 1px solid var(--ee-border);
    background: linear-gradient(to bottom, var(--ee-bg-app), #fff); border-radius: var(--ee-radius) var(--ee-radius) 0 0;
}
.ee-user-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: var(--ee-shadow-md); margin-bottom: 12px; }
.ee-user-name { font-weight: 700; font-size: 16px; color: var(--ee-text-main); }
.ee-user-email { font-size: 13px; color: var(--ee-text-muted); }

.ee-nav-menu { padding: 15px; display: flex; flex-direction: column; gap: 4px; }
.ee-nav-item {
    padding: 12px 16px; border-radius: var(--ee-radius); color: var(--ee-text-body); font-weight: 500; font-size: 14px;
    display: flex; align-items: center; gap: 12px;
}
.ee-nav-item i { width: 20px; text-align: center; color: var(--ee-text-muted); transition: 0.2s; }
.ee-nav-item:hover, .ee-nav-item.active { background: var(--ee-primary-light); color: var(--ee-primary); }
.ee-nav-item:hover i, .ee-nav-item.active i { color: var(--ee-primary); }

.ee-public-content { flex: 1; min-width: 0; }
.ee-mobile-nav-toggle { display: none; }
.ee-close-sidebar { display: none; }

/* Mobile Logic */
@media (max-width: 991px) {
    .ee-public-wrapper { display: block; padding: 10px; }
    .ee-grid-2 { grid-template-columns: 1fr; }
    
    .ee-mobile-nav-toggle {
        display: flex; align-items: center; justify-content: space-between;
        background: var(--ee-bg-card); padding: 15px 20px; margin-bottom: 20px;
        border-radius: var(--ee-radius); border: 1px solid var(--ee-border);
        box-shadow: var(--ee-shadow-sm); cursor: pointer; font-weight: 600; color: var(--ee-primary);
    }
    .ee-public-sidebar {
        position: fixed; top: 0; left: 0; width: 280px; height: 100vh; z-index: 9999;
        border-radius: 0; border: none; transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 15px rgba(0,0,0,0.1); overflow-y: auto;
    }
    .ee-public-sidebar.active { transform: translateX(0); }
    .ee-close-sidebar {
        display: block; position: absolute; top: 15px; right: 15px;
        font-size: 24px; color: var(--ee-text-muted); cursor: pointer;
        width: 32px; height: 32px; text-align: center; line-height: 32px; background: rgba(255,255,255,0.8); border-radius: 50%;
    }
    .ee-sidebar-backdrop {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 9998; display: none; backdrop-filter: blur(2px);
    }
    .ee-public-sidebar.active + .ee-sidebar-backdrop, .ee-sidebar-backdrop.active { display: block; }
}

/* 8. STUDENT DASHBOARD MODULES
   -------------------------------------------------------------------------- */
.ee-event-list-card {
    display: flex; background: var(--ee-bg-card); border: 1px solid var(--ee-border);
    border-radius: var(--ee-radius); overflow: hidden; margin-bottom: 20px; transition: var(--ee-transition);
}
.ee-event-list-card:hover { transform: translateY(-2px); box-shadow: var(--ee-shadow-md); border-color: var(--ee-primary-light); }
.ee-event-thumb { width: 120px; background-color: var(--ee-bg-input); background-size: cover; background-position: center; flex-shrink: 0; }
.ee-event-info { padding: 20px; flex: 1; }
@media (max-width: 600px) {
    .ee-event-list-card { flex-direction: column; }
    .ee-event-thumb { width: 100%; height: 140px; }
}

.ee-connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-bottom: 25px; }
.ee-connect-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 15px; background: #fff; border: 1px solid var(--ee-border); border-radius: var(--ee-radius);
    text-align: center; color: var(--ee-text-main); font-weight: 500; font-size: 13px; transition: var(--ee-transition);
}
.ee-connect-btn:hover { transform: translateY(-3px); box-shadow: var(--ee-shadow-md); }
.ee-connect-btn.whatsapp i { color: #25D366; font-size: 24px; }
.ee-connect-btn.meet i { color: #00897B; font-size: 24px; }
.ee-connect-btn.map i { color: #EA4335; font-size: 24px; }
.ee-connect-btn.web i { color: var(--ee-primary); font-size: 24px; }

/* Timeline */
.ee-timeline { position: relative; margin: 10px 0; }
.ee-timeline-item { display: flex; gap: 20px; position: relative; padding-bottom: 30px; }
.ee-timeline-item::before { content: ''; position: absolute; top: 20px; left: 20px; width: 2px; height: 100%; background: var(--ee-border); z-index: 0; }
.ee-timeline-item:last-child { padding-bottom: 0; }
.ee-timeline-item:last-child::before { display: none; }
.ee-timeline-icon {
    width: 42px; height: 42px; border-radius: 50%; background: #fff;
    border: 2px solid var(--ee-border); color: var(--ee-text-muted);
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1; flex-shrink: 0; font-size: 16px;
    box-shadow: 0 0 0 4px var(--ee-bg-app);
}
.ee-timeline-content { flex: 1; background: var(--ee-bg-card); border: 1px solid var(--ee-border); padding: 16px; border-radius: var(--ee-radius); position: relative; }
.status-green .ee-timeline-icon { border-color: var(--ee-success); color: var(--ee-success); background: var(--ee-success-bg); }
.status-orange .ee-timeline-icon { border-color: var(--ee-warning); color: var(--ee-warning); background: var(--ee-warning-bg); }
.status-red .ee-timeline-icon { border-color: var(--ee-danger); color: var(--ee-danger); background: var(--ee-danger-bg); }
.status-blue .ee-timeline-icon { border-color: var(--ee-primary); color: var(--ee-primary); background: var(--ee-primary-light); }

/* Material List */
.ee-material-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px; background: #fff; border: 1px solid var(--ee-border);
    border-radius: var(--ee-radius); margin-bottom: 10px;
}
.ee-material-icon { font-size: 24px; color: var(--ee-primary); margin-right: 15px; }
.ee-material-meta { font-size: 12px; color: var(--ee-text-muted); }

/* --- NEW: COUPON STYLES --- */
.ee-coupon-ticket {
    display: flex; align-items: center; 
    background: #fff; border: 1px dashed var(--ee-primary);
    border-radius: 8px; margin-bottom: 10px; overflow: hidden;
    transition: var(--ee-transition);
}
.ee-coupon-ticket:hover { transform: translateY(-2px); box-shadow: var(--ee-shadow-sm); }
.coupon-icon {
    width: 50px; height: 60px; background: var(--ee-primary-light);
    color: var(--ee-primary); display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.coupon-info { flex: 1; padding: 0 15px; font-size: 14px; }
.coupon-qr { 
    width: 50px; height: 60px; background: #222; color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.coupon-qr:hover { background: #000; }

/* 9. ADMIN MODULES
   -------------------------------------------------------------------------- */
.ee-tabs-container { border-bottom: 1px solid var(--ee-border); margin-bottom: 25px; overflow-x: auto; }
.ee-tabs { display: flex; gap: 5px; min-width: max-content; }
.ee-tab-item {
    padding: 12px 20px; text-decoration: none; color: var(--ee-text-muted); font-weight: 600; font-size: 14px;
    border-bottom: 2px solid transparent; transition: var(--ee-transition);
}
.ee-tab-item:hover, .ee-tab-item.active { color: var(--ee-primary); border-bottom-color: var(--ee-primary); }
.ee-tab-item.active { background: var(--ee-primary-light); }

/* Analytics */
.ee-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.ee-stat-card {
    background: #fff; padding: 25px; border-radius: var(--ee-radius);
    border: 1px solid var(--ee-border); display: flex; justify-content: space-between; align-items: center;
}
.ee-stat-info h3 { margin: 0; font-size: 28px; font-weight: 800; color: var(--ee-text-main); }
.ee-stat-info span { font-size: 13px; text-transform: uppercase; color: var(--ee-text-muted); font-weight: 600; }
.ee-stat-card .ee-icon { font-size: 40px; opacity: 0.2; }
.ee-stat-card.blue .ee-icon { color: var(--ee-info); }
.ee-stat-card.green .ee-icon { color: var(--ee-success); }
.ee-stat-card.orange .ee-icon { color: var(--ee-warning); }

/* Chart Logic */
.ee-chart-container { 
    height: 300px; width: 100%; display: flex; align-items: flex-end; justify-content: space-around; 
    padding: 20px 0 40px 0; border-bottom: 1px solid var(--ee-border);
}
.ee-chart-bar-group { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; flex: 1; max-width: 80px; }
.ee-chart-bar { width: 40px; background: var(--ee-primary); border-radius: 4px 4px 0 0; position: relative; transition: height 0.5s ease; min-height: 2px; }
.ee-chart-bar:hover { background: var(--ee-primary-hover); }
.ee-bar-value { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); font-weight: bold; font-size: 12px; color: var(--ee-text-main); }
.ee-chart-label { margin-top: 10px; font-size: 11px; color: var(--ee-text-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Profile Editor */
.ee-profile-form-card { max-width: 600px; margin: 0 auto; }
.ee-avatar-edit { position: relative; width: 100px; height: 100px; margin: 0 auto 20px; }
.ee-avatar-edit img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--ee-border); }
.ee-avatar-edit-btn {
    position: absolute; bottom: 0; right: 0; background: var(--ee-primary); color: white; border-radius: 50%;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid white;
}

/* 10. MODALS & ALERTS
   -------------------------------------------------------------------------- */
.ee-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.ee-modal-content {
    background: #fff; width: 100%; max-width: 650px; border-radius: 12px; padding: 30px;
    position: relative; max-height: 90vh; overflow-y: auto; box-shadow: var(--ee-shadow-lg);
    animation: eeModalSlide 0.3s ease-out;
}
@keyframes eeModalSlide { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.ee-modal-close { position: absolute; top: 15px; right: 20px; font-size: 28px; color: var(--ee-text-muted); cursor: pointer; transition: 0.2s; }
.ee-modal-close:hover { color: var(--ee-danger); }

.ee-alert { padding: 15px; border-radius: var(--ee-radius); margin-bottom: 20px; font-size: 14px; border: 1px solid transparent; }
.ee-alert-info { background: var(--ee-info-bg); color: #1e40af; border-color: #bfdbfe; }
.ee-alert-success { background: var(--ee-success-bg); color: #065f46; border-color: #a7f3d0; }
.ee-alert-error { background: var(--ee-danger-bg); color: #991b1b; border-color: #fecaca; }

/* 11. ID CARD DESIGNER & GENERATOR (15 TEMPLATES)
   -------------------------------------------------------------------------- */

/* BASE STRUCTURE (Crucial for html2canvas) */
.ee-id-card {
    width: 340px; height: 540px; background: #ffffff; overflow: hidden; position: relative;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    box-sizing: border-box; font-family: 'Roboto', sans-serif; border: 1px solid #e5e7eb;
}
.tpl-header { width: 100%; display: flex; align-items: center; justify-content: center; text-transform: uppercase; font-weight: 700; line-height: 1.2; padding: 10px; }
.tpl-body { flex: 1; width: 100%; padding: 15px 20px; display: flex; flex-direction: column; align-items: center; position: relative; }
.tpl-avatar { object-fit: cover; z-index: 10; background: #f3f4f6; }
.tpl-name { font-weight: 800; color: var(--ee-text-main); margin-bottom: 5px; line-height: 1.3; }
.tpl-meta { width: 100%; margin-top: 10px; text-align: left; font-size: 13px; color: var(--ee-text-body); }
.tpl-meta-row { border-bottom: 1px solid #f3f4f6; padding: 6px 0; display: flex; }
.tpl-meta-row strong { width: 95px; flex-shrink: 0; color: var(--ee-text-muted); }
.tpl-qr { margin-top: auto; margin-bottom: 15px; }
.tpl-qr img { width: 100px; height: 100px; display: block; }

/* TEMPLATES (1-15) */
.ee-id-tpl-1 .tpl-header { height: 110px; background: var(--ee-primary); color: white; font-size: 18px; }
.ee-id-tpl-1 .tpl-avatar { width: 130px; height: 130px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-top: -65px; margin-bottom: 15px; }
.ee-id-tpl-1 .tpl-name { font-size: 22px; }

.ee-id-tpl-2 .tpl-header { height: 140px; background: #059669; color: white; font-size: 20px; clip-path: ellipse(80% 80% at 50% 20%); align-items: flex-start; padding-top: 25px; }
.ee-id-tpl-2 .tpl-avatar { width: 120px; height: 120px; border-radius: 50%; border: 4px solid #fff; margin-top: -60px; margin-bottom: 20px; }
.ee-id-tpl-2 .tpl-name { color: #065f46; font-size: 24px; text-transform: uppercase; }

.ee-id-tpl-3 { background: #111827; border: 4px solid #d97706; }
.ee-id-tpl-3 .tpl-header { height: 100px; background: #d97706; color: #111827; font-size: 18px; letter-spacing: 1px; }
.ee-id-tpl-3 .tpl-avatar { width: 130px; height: 130px; border-radius: 8px; border: 2px solid #d97706; margin-top: -50px; margin-bottom: 15px; }
.ee-id-tpl-3 .tpl-name { color: #f3f4f6; font-size: 22px; }
.ee-id-tpl-3 .tpl-meta-row { border-color: #374151; color: #d1d5db; }
.ee-id-tpl-3 .tpl-meta-row strong { color: #d97706; }
.ee-id-tpl-3 .tpl-qr { background: white; padding: 5px; border-radius: 4px; }

.ee-id-tpl-4 .tpl-header { height: 80px; background: #dc2626; color: white; font-size: 16px; }
.ee-id-tpl-4 .tpl-avatar { width: 140px; height: 140px; border-radius: 12px; border: 4px solid #fff; margin-top: 20px; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.ee-id-tpl-4 .tpl-name { font-size: 24px; color: #dc2626; border-bottom: 2px solid #dc2626; padding-bottom: 5px; display: inline-block; margin-bottom: 15px; }

.ee-id-tpl-5 { border: 10px solid #4f46e5; }
.ee-id-tpl-5 .tpl-header { background: white; color: #4f46e5; height: 80px; border-bottom: 1px solid #eee; font-size: 20px; }
.ee-id-tpl-5 .tpl-avatar { width: 120px; height: 120px; border-radius: 50%; margin: 20px 0; border: 1px solid #ddd; }
.ee-id-tpl-5 .tpl-name { font-weight: 300; font-size: 26px; color: #000; }

.ee-id-tpl-6 .tpl-header { height: 50px; background: #2563eb; color: white; }
.ee-id-tpl-6 .tpl-body { background: linear-gradient(to bottom, #eff6ff 0%, #ffffff 100%); }
.ee-id-tpl-6 .tpl-avatar { width: 110px; height: 110px; border-radius: 0; border: 3px solid #2563eb; margin: 20px 0; }
.ee-id-tpl-6 .tpl-name { font-family: 'Courier New', monospace; font-weight: 700; }

.ee-id-tpl-7 .tpl-header { height: 120px; background: linear-gradient(135deg, #6366f1, #a855f7); color: white; clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); }
.ee-id-tpl-7 .tpl-avatar { width: 120px; height: 120px; border-radius: 50%; border: 4px solid #fff; margin-top: -60px; margin-bottom: 15px; }
.ee-id-tpl-7 .tpl-name { color: #7c3aed; }

.ee-id-tpl-8 { border-top: 20px solid #f97316; }
.ee-id-tpl-8 .tpl-header { background: #fff; color: #f97316; height: 60px; border-bottom: 2px solid #f97316; font-size: 20px; }
.ee-id-tpl-8 .tpl-avatar { width: 140px; height: 140px; border-radius: 8px; margin: 20px 0; border: 1px solid #ccc; }
.ee-id-tpl-8 .tpl-name { text-transform: uppercase; letter-spacing: 2px; font-size: 20px; }

.ee-id-tpl-9 .tpl-header { height: 150px; background: #0d9488; color: white; clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); align-items: flex-start; padding-top: 20px; }
.ee-id-tpl-9 .tpl-avatar { width: 110px; height: 110px; border-radius: 50%; border: 4px solid #ccfbf1; margin-top: -70px; margin-bottom: 10px; }
.ee-id-tpl-9 .tpl-name { color: #0f766e; font-size: 24px; }

.ee-id-tpl-10 .tpl-header { background: #000; color: #fff; height: 90px; }
.ee-id-tpl-10 .tpl-avatar { width: 100px; height: 120px; border-radius: 4px; border: 2px solid #000; margin-top: -40px; background: #fff; }
.ee-id-tpl-10 .tpl-name { margin-top: 10px; font-family: sans-serif; text-transform: uppercase; border-bottom: 1px solid #000; padding-bottom: 5px; display: block; width: 100%; }

.ee-id-tpl-11 .tpl-header { height: 100px; background: #ec4899; color: white; border-bottom-left-radius: 50% 20px; border-bottom-right-radius: 50% 20px; }
.ee-id-tpl-11 .tpl-avatar { width: 130px; height: 130px; border-radius: 50%; border: 6px solid #fbcfe8; margin-top: -65px; background: white; }
.ee-id-tpl-11 .tpl-name { color: #be185d; }

.ee-id-tpl-12 { background: linear-gradient(to bottom, #1e40af 50%, #ffffff 50%); }
.ee-id-tpl-12 .tpl-header { background: transparent; color: white; height: 100px; align-items: flex-end; padding-bottom: 20px; }
.ee-id-tpl-12 .tpl-avatar { width: 140px; height: 140px; border-radius: 50%; border: 5px solid white; box-shadow: 0 5px 15px rgba(0,0,0,0.2); margin-top: 10px; }
.ee-id-tpl-12 .tpl-name { margin-top: 15px; color: #1e3a8a; }
.ee-id-tpl-12 .tpl-meta { background: rgba(255,255,255,0.9); padding: 10px; border-radius: 8px; }

.ee-id-tpl-13 .tpl-header { height: 40px; background: #475569; color: white; font-size: 12px; justify-content: flex-start; padding-left: 20px; }
.ee-id-tpl-13 .tpl-body { align-items: flex-start; text-align: left; }
.ee-id-tpl-13 .tpl-avatar { width: 100px; height: 100px; border-radius: 4px; position: absolute; right: 20px; top: 20px; border: 1px solid #94a3b8; }
.ee-id-tpl-13 .tpl-name { margin-top: 20px; width: 60%; font-size: 20px; line-height: 1.1; }
.ee-id-tpl-13 .tpl-meta { margin-top: 20px; }
.ee-id-tpl-13 .tpl-qr { position: absolute; right: 20px; bottom: 20px; }

.ee-id-tpl-14 { background: #fffbeb; border: 2px double #b45309; }
.ee-id-tpl-14 .tpl-header { height: 90px; background: transparent; color: #b45309; font-family: 'Georgia', serif; font-style: italic; font-size: 22px; border-bottom: 1px solid #fcd34d; }
.ee-id-tpl-14 .tpl-avatar { width: 120px; height: 120px; border-radius: 50%; border: 2px solid #b45309; margin-top: 20px; }
.ee-id-tpl-14 .tpl-name { font-family: 'Georgia', serif; color: #78350f; margin-top: 10px; }

.ee-id-tpl-15 { background: #000; color: #0f0; font-family: 'Courier New', monospace; border: 2px solid #0f0; }
.ee-id-tpl-15 .tpl-header { background: #111; color: #0f0; border-bottom: 1px dashed #0f0; }
.ee-id-tpl-15 .tpl-avatar { width: 120px; height: 120px; border-radius: 0; border: 2px solid #0f0; margin-top: 20px; filter: grayscale(100%); }
.ee-id-tpl-15 .tpl-name { color: #fff; margin-top: 15px; text-transform: uppercase; }
.ee-id-tpl-15 .tpl-meta-row { border-bottom: 1px dashed #333; }
.ee-id-tpl-15 .tpl-meta-row strong { color: #0f0; }
.ee-id-tpl-15 .tpl-qr { background: #fff; padding: 5px; }

/* --- ADMIN PREVIEW WRAPPER --- */
.ee-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.ee-id-preview-wrapper {
    width: 100%; padding-top: 158%; position: relative; background: #f3f4f6;
    border: 3px solid transparent; border-radius: 8px; cursor: pointer; overflow: hidden; transition: all 0.2s;
}
.ee-template-radio:checked + .ee-id-preview-wrapper { border-color: var(--ee-primary); box-shadow: 0 0 0 4px var(--ee-primary-light); }
.ee-id-preview-wrapper .ee-id-card {
    position: absolute; top: 0; left: 0; transform-origin: top left;
    transform: scale(0.47); border: none; box-shadow: none; pointer-events: none;
}
@media (min-width: 1200px) { .ee-id-preview-wrapper .ee-id-card { transform: scale(0.55); } }

/* Canvas Responsive Fix */
#cert_canvas { max-width: 100%; overflow: hidden; margin: 0 auto; box-shadow: 0 0 20px rgba(0,0,0,0.1); }

/* 12. UTILITY FIXES & PATCHES (ADDED)
   -------------------------------------------------------------------------- */
.ee-text-primary { color: var(--ee-primary); }
.ee-text-danger { color: var(--ee-danger); }

/* Modal Data List Styles */
.ee-data-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ee-data-item { font-size: 14px; border-bottom: 1px dashed var(--ee-border); padding-bottom: 4px; display: flex; }
.ee-data-item strong { color: var(--ee-text-muted); width: 140px; flex-shrink: 0; display: inline-block; }

.ee-info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #6b7280;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    text-align: center;
    line-height: 16px;
    margin-left: 5px;
    cursor: help;
}
.ee-info-icon:hover {
    background: #4b5563;
}