/* ============================================
   WIN MANAGER v4.1 — ADMIN APP (frontend panel)
   Panel del Dueño de Plataforma en /panel-admin/
   ============================================ */

:root {
    --wm-admin-bg: #F8FAFC;
    --wm-admin-card: #FFFFFF;
    --wm-admin-border: #E2E8F0;
    --wm-admin-text: #0F172A;
    --wm-admin-muted: #64748B;
    --wm-admin-primary: #1E40AF;
    --wm-admin-sidebar-w: 260px;
    --wm-admin-topbar-h: 64px;
}

/* === Hide theme chrome on admin panel page === */
body.page-template-default:has(.wm-admin-app),
body.page:has(.wm-admin-app) {
    background: var(--wm-admin-bg);
}
.wm-admin-app { background: var(--wm-admin-bg); min-height: 100vh; }
.wm-admin-app * { box-sizing: border-box; }

/* Hide theme header/footer around the panel */
body:has(.wm-admin-app) > header,
body:has(.wm-admin-app) > footer,
body:has(.wm-admin-app) .site-header,
body:has(.wm-admin-app) .site-footer {
    display: none !important;
}

/* === App layout === */
.wm-admin-app {
    display: flex;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--wm-admin-text);
}

/* === Sidebar === */
.wm-admin-sidebar {
    width: var(--wm-admin-sidebar-w);
    background: #0F172A;
    color: #E2E8F0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.wm-admin-logo { display: flex; align-items: center; gap: 12px; }
.wm-admin-logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #1E40AF, #60A5FA);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.wm-admin-logo strong { display: block; font-size: 15px; color: #fff; }
.wm-admin-logo small { display: block; font-size: 11px; color: rgba(255,255,255,0.6); }

.wm-sidebar-toggle {
    display: none;
    background: none; border: none;
    color: #E2E8F0; font-size: 18px; cursor: pointer;
    width: 32px; height: 32px; border-radius: 8px;
}
.wm-sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

.wm-admin-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.wm-admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: all 0.15s ease;
    position: relative;
}

.wm-admin-nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.wm-admin-nav-item.active {
    background: linear-gradient(135deg, #1E40AF, #2563EB);
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.4);
}

.wm-admin-nav-icon { font-size: 18px; flex-shrink: 0; }
.wm-admin-nav-label { flex: 1; }

.wm-admin-nav-badge {
    background: #DC2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    animation: wmPulse 2s infinite;
}

@keyframes wmPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.wm-admin-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.wm-admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.wm-admin-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60A5FA, #A78BFA);
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.wm-admin-user-info strong {
    display: block;
    font-size: 13px;
    color: #fff;
    line-height: 1.2;
}

.wm-admin-user-info small {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.wm-admin-logout {
    color: rgba(255,255,255,0.6);
    font-size: 20px;
    text-decoration: none;
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.wm-admin-logout:hover { background: rgba(220,38,38,0.15); color: #FCA5A5; }

/* === Main content === */
.wm-admin-main {
    flex: 1;
    margin-left: var(--wm-admin-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Topbar === */
.wm-admin-topbar {
    height: var(--wm-admin-topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--wm-admin-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0; z-index: 50;
}

.wm-sidebar-open {
    display: none;
    background: #F1F5F9;
    border: none;
    width: 40px; height: 40px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
}

.wm-admin-topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--wm-admin-text);
    flex: 1;
}

.wm-admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wm-admin-topbar-alert {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #FCD34D;
    animation: wmBlink 2s infinite;
}
@keyframes wmBlink { 0%, 70% { opacity: 1; } 85% { opacity: 0.7; } }

.wm-admin-topbar-btn {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--wm-admin-muted);
    background: #F1F5F9;
    transition: all 0.15s;
}
.wm-admin-topbar-btn:hover { background: #E2E8F0; color: var(--wm-admin-text); }

/* === Content === */
.wm-admin-content {
    padding: 28px;
    flex: 1;
    max-width: 1500px;
    width: 100%;
}

.wm-admin-section-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.wm-admin-section-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    color: var(--wm-admin-text);
}

.wm-admin-section-header p {
    color: var(--wm-admin-muted);
    margin: 4px 0 0;
    font-size: 14px;
    width: 100%;
}

/* === KPI stats grid === */
.wm-admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.wm-admin-kpi {
    background: var(--wm-admin-card);
    border: 1px solid var(--wm-admin-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.wm-admin-kpi::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--kpi-color, #1E40AF);
}

.wm-admin-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: var(--kpi-color, #1E40AF);
}

.wm-admin-kpi-alert {
    background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
    border-color: #FCD34D;
}

.wm-admin-kpi-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--kpi-color, #1E40AF) 12%, white);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.wm-admin-kpi-body { flex: 1; min-width: 0; }
.wm-admin-kpi-label {
    display: block;
    font-size: 12px;
    color: var(--wm-admin-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.wm-admin-kpi-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--wm-admin-text);
    line-height: 1.2;
}
.wm-admin-kpi-sub {
    display: block;
    font-size: 12px;
    color: var(--wm-admin-muted);
    margin-top: 4px;
}
.wm-kpi-alert { color: #B45309 !important; font-weight: 600; }
.wm-admin-kpi-action {
    display: inline-block;
    margin-top: 6px;
    color: var(--kpi-color, #1E40AF);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

/* === Two columns === */
.wm-admin-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 960px) {
    .wm-admin-two-col { grid-template-columns: 1fr; }
}

/* === Panels (generic cards) === */
.wm-admin-panel {
    background: var(--wm-admin-card);
    border: 1px solid var(--wm-admin-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.wm-admin-panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--wm-admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wm-admin-panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--wm-admin-text);
}

.wm-admin-link {
    font-size: 13px;
    color: var(--wm-admin-primary);
    text-decoration: none;
    font-weight: 600;
}

.wm-admin-panel-table { padding: 0; }

/* === Quick actions === */
.wm-admin-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 16px;
}

.wm-admin-quick {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: #F8FAFC;
    border-radius: 12px;
    text-decoration: none;
    color: var(--wm-admin-text);
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    transition: all 0.15s;
    position: relative;
}

.wm-admin-quick:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
    transform: translateX(2px);
}

.wm-admin-quick-alert {
    background: #FFFBEB !important;
    color: #92400E !important;
    border-color: #FDE68A !important;
}

.wm-admin-quick span:first-child { font-size: 18px; }
.wm-admin-quick-badge {
    margin-left: auto;
    background: #DC2626;
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

/* === Activity list === */
.wm-admin-activity-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 360px;
    overflow-y: auto;
}
.wm-admin-activity-list li {
    padding: 12px 20px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
}
.wm-admin-activity-list li:last-child { border-bottom: none; }
.wm-admin-activity-time {
    font-size: 11px;
    color: #94A3B8;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    text-transform: uppercase;
}
.wm-admin-activity-desc, .wm-admin-activity-list li span:last-child { flex: 1; color: #475569; }
.wm-empty { color: var(--wm-admin-muted); text-align: center; padding: 30px; }

/* === Biz list === */
.wm-admin-bizlist { padding: 8px 0; }
.wm-admin-bizrow {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #F1F5F9;
}
.wm-admin-bizrow:last-child { border-bottom: none; }
.wm-admin-bizrow-main { flex: 1; min-width: 0; }
.wm-admin-bizrow-main strong { display: block; font-size: 14px; color: var(--wm-admin-text); }
.wm-admin-bizrow-main small { display: block; font-size: 12px; color: var(--wm-admin-muted); margin-top: 2px; }

/* === Plan pills === */
.wm-plan-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* === Toolbar === */
.wm-admin-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.wm-admin-input {
    padding: 10px 14px;
    border: 1.5px solid var(--wm-admin-border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: var(--wm-admin-text);
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}
.wm-admin-input:focus { border-color: var(--wm-admin-primary); box-shadow: 0 0 0 3px rgba(30,64,175,0.1); }
.wm-input-mono { font-family: 'SF Mono', Consolas, monospace; font-size: 11px; background: #F8FAFC; }
.wm-input-xs { width: 70px; }

#wmBizSearch, #wmBizFilter { min-width: 200px; }
#wmBizSearch { flex: 1; min-width: 240px; }

/* === Table === */
.wm-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wm-admin-table thead th {
    background: #F8FAFC;
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--wm-admin-border);
    white-space: nowrap;
}

.wm-admin-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #F1F5F9;
    color: #475569;
    vertical-align: middle;
}

.wm-admin-table tbody tr:hover { background: #F8FAFC; }
.wm-admin-table tbody tr:last-child td { border-bottom: none; }

.wm-admin-biz-cell strong { display: block; color: var(--wm-admin-text); }
.wm-admin-biz-cell small { display: block; font-size: 12px; color: var(--wm-admin-muted); margin-top: 2px; }
.wm-admin-biz-cell small a { color: var(--wm-admin-primary); text-decoration: none; }

.wm-admin-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 6px;
}

/* === Tabs === */
.wm-admin-tabs {
    display: flex;
    gap: 4px;
    background: #F1F5F9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    width: fit-content;
}

.wm-admin-tab {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wm-admin-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.wm-admin-tab:hover { color: var(--wm-admin-text); }
.wm-admin-tab.active {
    background: #fff;
    color: var(--wm-admin-text);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.wm-admin-tab-count {
    background: #E2E8F0;
    color: #475569;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}
.wm-admin-tab.active .wm-admin-tab-count { background: var(--wm-admin-primary); color: #fff; }

/* === Empty state === */
.wm-admin-empty {
    text-align: center;
    padding: 60px 20px;
    background: #F8FAFC;
}
.wm-admin-empty-icon { font-size: 64px; display: block; margin-bottom: 16px; opacity: 0.5; }
.wm-admin-empty h3 { font-size: 18px; color: var(--wm-admin-text); margin: 0 0 8px; }
.wm-admin-empty p { color: var(--wm-admin-muted); margin: 0 0 20px; }

/* === Payment cards === */
.wm-admin-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.wm-admin-payment-card {
    background: #fff;
    border: 1.5px solid var(--wm-admin-border);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.2s;
}

.wm-admin-payment-card:hover {
    border-color: var(--wm-admin-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.wm-payment-pending { border-left: 4px solid #F59E0B; }
.wm-payment-approved { border-left: 4px solid #10B981; }
.wm-payment-rejected { border-left: 4px solid #EF4444; opacity: 0.75; }

.wm-admin-payment-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #F1F5F9;
    gap: 10px;
}

.wm-admin-payment-head strong { display: block; color: var(--wm-admin-text); font-size: 14px; }
.wm-admin-payment-head small { display: block; font-size: 11px; color: var(--wm-admin-muted); margin-top: 3px; }

.wm-admin-payment-body { margin-bottom: 14px; }
.wm-admin-payment-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    color: var(--wm-admin-muted);
}
.wm-admin-payment-row strong { color: var(--wm-admin-text); }

.wm-admin-payment-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* === Plans admin grid === */
.wm-plans-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.wm-plan-admin-card {
    background: #fff;
    border: 2px solid var(--wm-admin-border);
    border-radius: 18px;
    padding: 18px;
    position: relative;
    transition: all 0.2s;
    cursor: grab;
}

.wm-plan-admin-card:hover {
    border-color: var(--plan-color, #1E40AF);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.wm-plan-admin-card.wm-plan-inactive { opacity: 0.55; }

.wm-plan-admin-drag {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #CBD5E1;
    font-size: 18px;
    line-height: 1;
    cursor: grab;
}

.wm-plan-admin-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.wm-plan-admin-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}

.wm-plan-admin-title { flex: 1; min-width: 0; }
.wm-plan-admin-title strong { display: block; font-size: 16px; color: var(--wm-admin-text); }
.wm-plan-admin-title small { display: block; font-size: 11px; color: var(--wm-admin-muted); margin-top: 2px; }
.wm-plan-admin-title code { font-size: 11px; background: #F1F5F9; padding: 2px 6px; border-radius: 4px; }

.wm-plan-tag-trial {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.wm-plan-admin-desc {
    font-size: 13px;
    color: var(--wm-admin-muted);
    margin: 0 0 14px;
    line-height: 1.4;
}

.wm-plan-admin-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid #F1F5F9;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 10px;
}
.wm-plan-admin-price strong {
    color: var(--plan-color, #1E40AF);
    font-size: 24px;
    font-weight: 800;
}
.wm-plan-admin-price small { color: var(--wm-admin-muted); font-size: 12px; }

.wm-plan-admin-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.wm-plan-admin-specs > div {
    background: #F8FAFC;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 11px;
    color: var(--wm-admin-muted);
    line-height: 1.3;
}
.wm-plan-admin-specs strong {
    display: block;
    font-size: 18px;
    color: var(--wm-admin-text);
    font-weight: 800;
}

.wm-plan-admin-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
}

/* === Switch === */
.wm-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.wm-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.wm-switch-slider {
    position: relative;
    width: 40px; height: 22px;
    background: #CBD5E1;
    border-radius: 11px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.wm-switch-slider::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.wm-switch input:checked + .wm-switch-slider {
    background: #10B981;
}
.wm-switch input:checked + .wm-switch-slider::before {
    transform: translateX(18px);
}

.wm-switch-label { font-size: 12px; color: var(--wm-admin-muted); font-weight: 600; }

.wm-switch-label-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--wm-admin-text);
}

.wm-switch-label-row input[type=checkbox] {
    width: 20px; height: 20px;
    cursor: pointer;
    accent-color: var(--wm-admin-primary);
}

/* === Settings === */
.wm-admin-settings { max-width: 900px; }
.wm-admin-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.wm-form-fullwidth { grid-column: 1 / -1; }

.wm-admin-settings .wm-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.wm-admin-settings .wm-form-group input[type=text],
.wm-admin-settings .wm-form-group input[type=number],
.wm-admin-settings .wm-form-group input[type=email],
.wm-admin-settings .wm-form-group textarea,
.wm-admin-settings .wm-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--wm-admin-border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.wm-admin-settings .wm-form-group input:focus,
.wm-admin-settings .wm-form-group textarea:focus {
    border-color: var(--wm-admin-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.wm-admin-settings .wm-form-group small {
    display: block;
    font-size: 11px;
    color: var(--wm-admin-muted);
    margin-top: 4px;
}

/* === Plan modal === */
.wm-modal-plan .wm-modal-body,
.wm-plan-form {
    max-height: 75vh;
    overflow-y: auto;
    padding: 24px;
}

.wm-form-row-2, .wm-form-row-3 {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}
.wm-form-row-2 { grid-template-columns: 1fr 1fr; }
.wm-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.wm-plan-form .wm-form-group { margin-bottom: 14px; }
.wm-plan-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.wm-plan-form input[type=text],
.wm-plan-form input[type=number],
.wm-plan-form input[type=color],
.wm-plan-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--wm-admin-border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.wm-plan-form input[type=color] {
    height: 44px;
    padding: 4px;
    cursor: pointer;
}

.wm-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.wm-feature-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1.5px solid transparent;
}

.wm-feature-check:hover { border-color: var(--wm-admin-primary); }
.wm-feature-check input { accent-color: var(--wm-admin-primary); cursor: pointer; }

.wm-plan-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--wm-admin-border);
    margin-top: 16px;
}

/* === Subscription badges (shared with public) === */
.wm-sub-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.wm-sub-active { background: #DCFCE7; color: #166534; }
.wm-sub-warning { background: #FEF3C7; color: #92400E; }
.wm-sub-expired { background: #FEE2E2; color: #991B1B; }

/* === Login required === */
.wm-admin-login-wrap {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.wm-admin-login-box {
    background: #fff;
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    border: 1px solid var(--wm-admin-border);
}

.wm-admin-login-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.wm-admin-login-box h2 {
    font-size: 24px;
    margin: 0 0 12px;
    color: var(--wm-admin-text);
}

.wm-admin-login-box p {
    color: var(--wm-admin-muted);
    margin-bottom: 24px;
}

/* === Mobile === */
@media (max-width: 900px) {
    .wm-admin-sidebar {
        transform: translateX(-100%);
    }
    .wm-admin-sidebar.wm-sidebar-open-state {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0,0,0,0.2);
    }
    .wm-admin-main { margin-left: 0; }
    .wm-sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .wm-sidebar-open { display: flex; align-items: center; justify-content: center; }
    .wm-admin-content { padding: 16px; }
    .wm-admin-stats-grid { grid-template-columns: 1fr 1fr; }
    .wm-admin-kpi-value { font-size: 22px; }
    .wm-admin-section-header h1 { font-size: 22px; }
    .wm-admin-settings-grid { grid-template-columns: 1fr; }
    .wm-form-row-2, .wm-form-row-3 { grid-template-columns: 1fr; }
    .wm-features-grid { grid-template-columns: 1fr; }
    .wm-admin-topbar-alert span { display: none; }
}

@media (max-width: 480px) {
    .wm-admin-stats-grid { grid-template-columns: 1fr; }
    .wm-admin-topbar { padding: 0 14px; }
    .wm-admin-topbar-btn span { display: none; }
}

/* === Backdrop when sidebar is open on mobile === */
.wm-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.wm-sidebar-backdrop.active { display: block; }

/* === Alerts inline === */
.wm-alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 14px;
    border: 1px solid transparent;
}
.wm-alert-info { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.wm-alert-error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.wm-alert-success { background: #DCFCE7; color: #166534; border-color: #86EFAC; }

/* === Toast (reused) === */
#wmToast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0F172A;
    color: #fff;
    padding: 14px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
}
#wmToast.wm-toast-show { opacity: 1; transform: translateY(0); }

/* === Fade in === */
.wm-fade-in { animation: wmFadeIn 0.4s ease-out; }
@keyframes wmFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Modal overlay (reused for plan modal) === */
.wm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}
.wm-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 640px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    animation: wmModalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wmModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.wm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--wm-admin-border);
}
.wm-modal-header h3 { margin: 0; font-size: 18px; color: var(--wm-admin-text); }
.wm-modal-close {
    background: #F1F5F9;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: var(--wm-admin-muted);
}
.wm-modal-close:hover { background: #E2E8F0; color: var(--wm-admin-text); }

/* === Buttons extras === */
.wm-btn-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}
.wm-btn-danger:hover {
    background: #DC2626;
    color: #fff;
    border-color: #DC2626;
}

/* === v4.3 — Status stack (multiple badges) === */
.wm-status-stack { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.wm-sub-neutral { background: #F1F5F9; color: #64748B; }

/* === Vendor profile form === */
#wmVendorProfileForm .wm-form-group { margin-bottom: 16px; }
#wmVendorProfileForm label { display: block; font-weight: 600; color: #475569; margin-bottom: 6px; font-size: 13px; }
#wmVendorProfileForm input,
#wmVendorProfileForm textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
#wmVendorProfileForm input:focus, #wmVendorProfileForm textarea:focus {
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}
