:root {
    --primary: #2457d6;
    --primary-dark: #173ca3;
    --accent: #16a085;
    --ink: #172033;
    --muted: #667085;
    --line: #e4e7ec;
    --surface: #ffffff;
    --canvas: #f3f5f9;
    --danger: #c9364e;
    --success: #138a62;
    --radius: 16px;
    --shadow: 0 18px 50px rgba(23, 32, 51, .10);

    /* Modal */
    --modal-overlay: rgba(0, 0, 0, .5);
    --modal-bg: #fff;
    --modal-radius: 14px;
    --modal-shadow: 0 25px 60px rgba(0, 0, 0, .22);
    --modal-max-width: 520px;
    --modal-padding: 1.5rem;
    --modal-header-size: 1.15rem;
    --modal-header-weight: 750;

    /* Toast */
    --toast-radius: 10px;
    --toast-shadow: 0 8px 30px rgba(0, 0, 0, .14);
    --toast-success-bg: #eafaf4;
    --toast-success-color: #0d6b4c;
    --toast-success-border: #b8dfce;
    --toast-error-bg: #fff2f4;
    --toast-error-color: #92243a;
    --toast-error-border: #f0c4ca;
    --toast-info-bg: #e7f3f8;
    --toast-info-color: #0c5460;
    --toast-info-border: #b8d8e3;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: #f3f4f6;
    padding: 1rem;
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(40px, 7vw, 88px);
    color: #fff;
    background: #12295f;
}

.brand-panel::before,
.brand-panel::after {
    position: absolute;
    content: "";
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
}

.brand-panel::before { width: 420px; height: 420px; top: -190px; right: -130px; }
.brand-panel::after { width: 260px; height: 260px; bottom: -100px; left: -80px; }

.brand,
.brand-message,
.brand-footer { position: relative; z-index: 1; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: .08em;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 13px;
}

.brand-message h1 {
    max-width: 680px;
    margin: 0 0 18px;
    font-size: clamp(40px, 5vw, 72px);
    line-height: .98;
    letter-spacing: -.045em;
}

.brand-message p {
    max-width: 570px;
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.6;
}

.brand-footer { color: rgba(255, 255, 255, .58); font-size: 14px; }

.login-panel {
    display: block;
    width: 100%;
    max-width: 450px;
}

.login-card { 
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login-card h2 { margin: 0; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.035em; }
.intro { margin: 12px 0 32px; color: var(--muted); line-height: 1.6; }

.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }

.field input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: var(--ink);
    background: var(--surface);
    font: inherit;
    transition: border-color .18s, box-shadow .18s;
}

.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36, 87, 214, .12); }

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    transition: background .18s, transform .18s;
}

.button:hover { background: var(--primary-dark); }
.button:active { transform: scale(.98); }
.button-block { width: 100%; }
.button-secondary { color: var(--ink); background: #eef1f6; }
.button-secondary:hover { background: #e1e6ef; }

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid rgba(201, 54, 78, .22);
    border-radius: 11px;
    color: #92243a;
    background: #fff2f4;
    font-size: 14px;
    line-height: 1.5;
}

.app-shell { display: grid; grid-template-columns: 270px 1fr; height: 100vh; overflow: hidden; }

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    color: #fff;
    background: linear-gradient(180deg, #090e17 0%, #111827 100%);
    border-right: 1px solid rgba(255,255,255,0.05);
    overflow-y: auto;
}

.sidebar .brand { margin-bottom: 40px; flex-shrink: 0; padding-left: 8px; }
.nav-label { margin: 24px 12px 8px; color: rgba(255,255,255,.35); font-size: 10.5px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.nav-link { 
    display: flex; 
    min-height: 44px; 
    align-items: center; 
    gap: 12px; 
    padding: 0 16px; 
    border-radius: 12px; 
    color: rgba(255,255,255,.65); 
    text-decoration: none; 
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); transform: translateX(4px); }
.nav-link.active { 
    color: #fff; 
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.8), rgba(37, 99, 235, 0.05));
    font-weight: 700;
}
.nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #60a5fa; border-radius: 0 4px 4px 0; box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.sidebar-user { 
    margin-top: auto; 
    padding: 20px 16px; 
    background: rgba(255,255,255,0.02); 
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0; 
    transition: background 0.2s;
    margin-bottom: 8px;
}
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.sidebar-user strong { display: block; color: #fff; font-size: 0.95rem; margin-bottom: 2px; }
.sidebar-user span { display: block; color: rgba(255,255,255,.5); font-size: 12px; }

.main { padding: clamp(24px, 4vw, 52px); overflow-y: auto; overflow-x: auto; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 38px; }
.topbar h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.topbar p { margin: 7px 0 0; color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.metric, .welcome-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 26px rgba(23,32,51,.04); }
.metric span { color: var(--muted); font-size: 14px; }
.metric strong { display: block; margin-top: 12px; font-size: 28px; }
.status { color: var(--success); }
.welcome-card { margin-top: 20px; padding: clamp(26px, 4vw, 42px); }
.welcome-card h2 { margin: 0 0 10px; font-size: 26px; }
.welcome-card p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.7; }

/* ==============================
   Dashboard
   ============================== */

/* --- Progress bar (shimmer + gradient, same as landing) --- */
.dash-progress .progress-bar-bg {
    height: 22px;
    border-radius: 99px;
    background: var(--line);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
}
.dash-progress .progress-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), #1a3fa0);
    background-size: 200% 100%;
    transition: none;
}
.dash-progress .progress-bar-fill.animated {
    animation: dash-shimmer 1.5s linear infinite;
}
@keyframes dash-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Cards --- */
.dash-card {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(23,32,51,.04);
    margin-bottom: 1.25rem;
    transition: transform .25s cubic-bezier(.22,1,.36,1),
                box-shadow .25s cubic-bezier(.22,1,.36,1);
}
.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(23,32,51,.1);
}
.dash-card-header {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
}
.dash-card-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}
.dash-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.dash-card-sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .85rem;
}
.dash-progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .65rem;
    font-size: .9rem;
    color: var(--muted);
}
.dash-progress-stats strong {
    color: var(--ink);
    font-weight: 700;
}
.dash-progress-pct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: .15rem .65rem;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.6;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #1a3fa0);
    border-radius: 99px;
}

/* --- Prizes --- */
.dash-prizes-stats {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 1rem;
    color: var(--muted);
    flex-wrap: wrap;
}
.dash-prizes-stats strong {
    font-weight: 700;
}
.dash-pending-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .85rem;
}
.dash-number-pill {
    display: inline-flex;
    padding: .2rem .65rem;
    background: #fff2f4;
    border: 1px solid rgba(201,54,78,.2);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--danger);
    font-family: 'Courier New', monospace;
}

/* --- Top sellers ranking --- */
.dash-ranking {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.dash-ranking-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .6rem;
    border-radius: 10px;
    transition: background .2s, transform .15s;
    cursor: default;
}
.dash-ranking-row:hover {
    background: #f0f4ff;
}
.dash-ranking-pos {
    width: 1.5rem;
    text-align: center;
    font-size: .95rem;
    font-weight: 700;
    flex-shrink: 0;
}
.dash-ranking-name {
    width: 130px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}
.dash-ranking-bar {
    flex: 1;
    height: 10px;
    background: var(--line);
    border-radius: 99px;
    overflow: hidden;
    min-width: 60px;
}
.dash-ranking-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), #1a3fa0);
    background-size: 200% 100%;
    animation: dash-shimmer 1.5s linear infinite;
    transition: width .8s cubic-bezier(.22,1,.36,1);
}
.dash-ranking-num {
    width: 2.5rem;
    text-align: right;
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    flex-shrink: 0;
}

.alert-success { border-color: rgba(19, 138, 98, .22); color: #0d6b4c; background: #eafaf4; }

.form-section { margin-bottom: 2.5rem; padding: 1.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 26px rgba(23,32,51,.04); }
.form-section h2 { margin: 0 0 .25rem; font-size: 1.35rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.section-header h2 { margin-bottom: 0; }
.field-hint { margin: 0 0 1.25rem; color: var(--muted); font-size: .875rem; line-height: 1.6; }

.field textarea { width: 100%; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: var(--surface); font: inherit; resize: vertical; transition: border-color .18s, box-shadow .18s; }
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36, 87, 214, .12); }
.field select { width: 100%; height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: var(--surface); font: inherit; appearance: auto; cursor: pointer; transition: border-color .18s, box-shadow .18s; }
.field select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36, 87, 214, .12); }
.field input[type="file"] { height: auto; padding: 10px 15px; }

.radio-group { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: .5rem; }
.radio-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .95rem; }
.radio-label input[type="radio"] { width: auto; height: auto; cursor: pointer; accent-color: var(--primary); }

.prize-card { margin-top: 1.25rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.prize-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.prize-card-header h3 { margin: 0; font-size: 1.1rem; color: var(--primary); }

.button-danger { color: #fff; background: var(--danger); }
.button-danger:hover { background: #a82d42; }
.button-sm { min-height: 36px; padding: 0 14px; font-size: .85rem; }

.inline-actions { margin-bottom: 1rem; }

.instant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.instant-grid .field { margin-bottom: 0; }
.instant-input { text-align: center; font-family: 'Courier New', monospace; letter-spacing: .15em; font-size: 1.1rem; }

.prize-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.prize-row .field { flex: 1; min-width: 200px; }

.actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }

.progress-bar-bg { height: 28px; border-radius: 14px; background: var(--line); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 14px; background: var(--primary); transition: width .6s ease; }

.stat-card { padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.stat-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 750; color: var(--ink); }

.event-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.event-card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-activo { color: #fff; background: var(--primary); }
.badge-completado { color: #fff; background: var(--success); }
.badge-cancelado { color: #fff; background: var(--danger); }
.badge-premio { color: #fff; background: #e67e22; }
.badge-secundario { color: #fff; background: var(--accent); }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: .5rem; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 0; min-width: 600px; }
.data-table th, .data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; }
.data-table th { font-weight: 700; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; background: var(--canvas); }
.data-table tr:hover td { background: rgba(36, 87, 214, .03); }

@media (max-width: 860px) {
    .prize-row { flex-direction: column; }
    .instant-grid { grid-template-columns: repeat(2, 1fr); }
    .section-header { flex-direction: column; align-items: flex-start; }
    .data-table { font-size: .8rem; min-width: 0; border: none; }
    .data-table thead { display: none; }
    .data-table tbody tr { 
        display: flex; 
        flex-direction: column; 
        margin-bottom: 1rem; 
        border: 1px solid var(--line); 
        border-radius: 8px; 
        background: var(--surface);
    }
    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(0,0,0,.04);
        padding: 0.75rem 1rem;
        text-align: right;
    }
    .data-table tbody td:last-child { border-bottom: none; }
    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.8em;
        color: var(--muted);
        text-transform: uppercase;
        margin-right: 1rem;
        text-align: left;
    }
    .event-card-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 860px) {
    .login-panel { padding: 10px; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { padding: 18px; }
    .sidebar .brand { margin-bottom: 20px; }
    .sidebar-user { display: none; }
    .metrics { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
}

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
    position: fixed; inset: 0; z-index: 999;
    display: none; place-items: center;
    background: var(--modal-overlay);
    animation: modalFadeIn .2s ease;
}

.modal-overlay.open { display: grid; }

.modal {
    position: relative;
    width: calc(100% - 2rem);
    max-width: var(--modal-max-width);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--modal-radius);
    background: var(--modal-bg);
    box-shadow: var(--modal-shadow);
    animation: modalSlideIn .25s ease;
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--modal-padding) var(--modal-padding) 0;
}

.modal-title {
    margin: 0;
    font-size: var(--modal-header-size);
    font-weight: var(--modal-header-weight);
}

.modal-close {
    display: grid; place-items: center;
    width: 32px; height: 32px; padding: 0;
    border: none; border-radius: 8px;
    background: transparent; color: var(--muted);
    font-size: 1.3rem; cursor: pointer;
    transition: background .15s;
}

.modal-close:hover { background: var(--canvas); }

.modal-body { padding: var(--modal-padding); }

.modal-actions {
    display: flex; gap: .75rem; justify-content: flex-end;
    padding: 0 var(--modal-padding) var(--modal-padding);
}

.modal-actions .button { min-width: 100px; }

/* Confirm variant */
.modal-confirm .modal-btn-action { background: var(--primary); }
.modal-confirm .modal-btn-action:hover { background: var(--primary-dark); }

/* Danger variant */
.modal-danger .modal-btn-action { background: var(--danger); }
.modal-danger .modal-btn-action:hover { background: #a82d42; }

/* Large variant */
.modal-lg {
    max-width: 900px;
    width: 95vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-lg .modal-header { flex-shrink: 0; }
.modal-lg .modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}
.modal-lg .modal-actions { flex-shrink: 0; }

/* Form variant */
.modal-form .modal-btn-action { background: var(--primary); }
.modal-form .modal-btn-action:hover { background: var(--primary-dark); }
.modal-form .field { margin-bottom: 1rem; }
.modal-form .field label { font-size: .85rem; }
.modal-form .field input,
.modal-form .field select {
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    color: var(--ink);
    background: var(--surface);
    font: inherit; font-size: .95rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s;
}
.modal-form .field input:focus,
.modal-form .field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 87, 214, .1);
}
.modal-form .field-error input,
.modal-form .field-error select {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(201, 54, 78, .1);
}
.modal-form .field-msg {
    display: none;
    margin-top: 4px;
    font-size: .8rem;
    color: var(--danger);
}
.modal-form .field-error .field-msg { display: block; }

/* =============================================
   TOAST
   ============================================= */
.toast-container {
    position: fixed; top: 1.25rem; right: 1.25rem;
    z-index: 9999;
    display: flex; flex-direction: column; gap: .5rem;
    pointer-events: none;
}

.toast {
    display: flex; align-items: center; gap: .75rem;
    padding: .9rem 1.1rem;
    border: 1px solid;
    border-radius: var(--toast-radius);
    box-shadow: var(--toast-shadow);
    font-size: .9rem; font-weight: 600;
    pointer-events: auto;
    animation: toastSlideIn .3s ease;
    max-width: 420px;
}

.toast-success {
    background: var(--toast-success-bg);
    color: var(--toast-success-color);
    border-color: var(--toast-success-border);
}

.toast-error {
    background: var(--toast-error-bg);
    color: var(--toast-error-color);
    border-color: var(--toast-error-border);
}

.toast-info {
    background: var(--toast-info-bg);
    color: var(--toast-info-color);
    border-color: var(--toast-info-border);
}

.toast-close {
    margin-left: auto;
    background: none; border: none;
    font-size: 1.1rem; cursor: pointer;
    color: inherit; opacity: .6; padding: 0 4px;
}
.toast-close:hover { opacity: 1; }

.toast.removing { animation: toastFadeOut .25s ease forwards; }

/* Animations */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

@media (max-width: 600px) {
    .modal { max-width: 100%; margin: 0 .5rem; max-height: 85vh; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .button { width: 100%; }
    .toast { max-width: 100%; }
}

/* =============================================
   IMAGE MANAGER
   ============================================= */
.image-manager { display: flex; flex-direction: column; gap: 1.5rem; }
.im-section h4 { margin: 0 0 .75rem; font-size: 1rem; }
.im-main-preview { min-height: 100px; }
.im-image-card { position: relative; display: inline-block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.im-image-card img { display: block; max-width: 160px; max-height: 120px; object-fit: contain; background: #f8f8f8; }
.im-image-card-main { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(36,87,214,.2); }
.im-image-actions { display: flex; gap: .25rem; padding: 4px; background: rgba(0,0,0,.04); align-items: center; justify-content: center; }
.im-image-actions .im-btn-sm { font-size: .75rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.im-image-actions .im-btn-sm:hover { background: var(--canvas); }
.im-image-actions .im-btn-danger { color: var(--danger); border-color: rgba(201,54,78,.3); }
.im-image-actions .im-btn-danger:hover { background: #fff2f4; }
.im-badge { font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.im-badge-primary { color: #fff; background: var(--primary); }
.im-empty { padding: 2rem; text-align: center; color: var(--muted); font-size: .9rem; border: 2px dashed var(--line); border-radius: 10px; }
.im-upload-row { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.im-upload-row input[type="file"] { flex: 1; font-size: .85rem; }
.im-gallery-grid { display: flex; gap: .5rem; flex-wrap: wrap; }
.im-gallery-grid .im-image-card img { max-width: 100px; max-height: 80px; }
