/* ============================================================
   WP Auto Login Hub — Standalone PHP App CSS
   Pure CSS, no framework. CSS custom properties for theming.
   ============================================================ */

:root {
    --sidebar-bg:      #1a1d2e;
    --sidebar-hover:   #23273d;
    --sidebar-active:  #6c63ff;
    --sidebar-text:    #9ca3af;
    --sidebar-width:   230px;

    --primary:         #6c63ff;
    --primary-hover:   #5a52e8;
    --danger:          #ef4444;
    --danger-hover:    #dc2626;
    --success:         #10b981;
    --warning:         #f59e0b;
    --info:            #3b82f6;

    --bg:              #f5f7fb;
    --card-bg:         #ffffff;
    --card-border:     #e5e7eb;
    --card-shadow:     0 1px 4px rgba(0,0,0,.06);
    --radius:          7px;
    --radius-lg:       12px;

    --text:            #111827;
    --text-muted:      #6b7280;
    --border:          #e5e7eb;
    --input-border:    #d1d5db;

    --font:            -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition:      .15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Courier New', monospace; font-size: 12px; background: #f3f4f6; padding: 2px 5px; border-radius: 3px; }

/* ── Auth Page ─────────────────────────────────────────────── */
.wal-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d2e 0%, #2d3154 100%);
}

.wal-login-page {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wal-login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.wal-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.wal-login-logo {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
}

.wal-login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.wal-login-subtitle {
    color: var(--text-muted);
    font-size: 13px;
}

.wal-login-form .wal-btn-full {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 14px;
    margin-top: 8px;
}

.wal-alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.wal-alert--error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── App Layout ────────────────────────────────────────────── */
.wal-wrap {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.wal-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.wal-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: #fff;
}

.wal-brand-icon { width: 28px; height: 28px; color: var(--primary); flex-shrink: 0; }
.wal-brand-text { font-size: 15px; font-weight: 700; letter-spacing: .2px; }

.wal-nav-list { list-style: none; padding: 12px 10px 0; flex: 1; }
.wal-nav-item { margin-bottom: 2px; }

.wal-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 13.5px;
    transition: background var(--transition), color var(--transition);
}

.wal-nav-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.wal-nav-item--active .wal-nav-link { background: var(--sidebar-active); color: #fff; }
.wal-nav-item--active .wal-nav-link:hover { background: var(--primary-hover); }

.wal-sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wal-sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wal-sidebar-username {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wal-sidebar-role {
    font-size: 11px;
    color: rgba(255,255,255,.4);
}

.wal-logout-btn {
    color: rgba(255,255,255,.4);
    transition: color var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.wal-logout-btn:hover { color: var(--danger); text-decoration: none; }

/* ── Main ─────────────────────────────────────────────────── */
.wal-main {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
    overflow-x: auto;
}

.wal-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.wal-page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.wal-page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.wal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none !important;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}

.wal-btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.wal-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.wal-btn-secondary { background: #374151; color: #fff; }
.wal-btn-secondary:hover { background: #1f2937; }

.wal-btn-outline  { background: transparent; color: var(--text); border-color: var(--border); }
.wal-btn-outline:hover { background: var(--bg); border-color: #9ca3af; color: var(--text); }

.wal-btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.wal-btn-danger:hover { background: var(--danger-hover); }

.wal-btn-logout   { border-color: var(--danger); color: var(--danger); }
.wal-btn-logout:hover { background: var(--danger); color: #fff; }

.wal-btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.wal-btn-disabled, .wal-btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.wal-btn-sm       { padding: 5px 10px; font-size: 12px; }
.wal-btn-full     { width: 100%; justify-content: center; }

/* ── Cards ─────────────────────────────────────────────────── */
.wal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.wal-card--overflow { overflow-x: auto; }

.wal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.wal-card-header h2 { font-size: 15px; font-weight: 600; }
.wal-card-body { padding: 20px; }
.wal-card-body--flush { padding: 0; }

/* ── Stats Row ─────────────────────────────────────────────── */
.wal-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) { .wal-stats-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 500px) { .wal-stats-row { grid-template-columns: 1fr; } }

.wal-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
}

.wal-stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.wal-stat-icon--blue   { background: var(--info); }
.wal-stat-icon--green  { background: var(--success); }
.wal-stat-icon--purple { background: #8b5cf6; }
.wal-stat-icon--orange { background: var(--warning); }

.wal-stat-body { display: flex; flex-direction: column; }
.wal-stat-number { font-size: 28px; font-weight: 700; line-height: 1; }
.wal-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Quick Actions ─────────────────────────────────────────── */
.wal-quick-actions { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }

/* ── Tables ─────────────────────────────────────────────────── */
.wal-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.wal-table thead th {
    text-align: left; padding: 10px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .4px;
    white-space: nowrap;
}

.wal-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.wal-table tbody tr:last-child { border-bottom: none; }
.wal-table tbody tr:hover { background: #fafafa; }
.wal-table tbody td { padding: 12px 16px; vertical-align: middle; }
.wal-td-actions { white-space: nowrap; }
.wal-td-actions .wal-btn + .wal-btn { margin-left: 6px; }

/* ── Badges ─────────────────────────────────────────────────── */
.wal-status-badge {
    display: inline-block; padding: 2px 9px;
    border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.wal-status-badge--active   { background: #dcfce7; color: #166534; }
.wal-status-badge--inactive { background: #f3f4f6; color: #6b7280; }
.wal-status-badge--error    { background: #fee2e2; color: #991b1b; }

.wal-role-badge {
    display: inline-block; padding: 2px 9px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.wal-role-badge--admin { background: #ede9fe; color: #5b21b6; }
.wal-role-badge--team  { background: #dbeafe; color: #1e40af; }
.wal-role-badge--sm    { font-size: 10px; padding: 1px 6px; }

.wal-event-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; background: #f3f4f6; color: #374151; }
.wal-event-badge--login-success { background: #dcfce7; color: #166534; }
.wal-event-badge--login-failed  { background: #fee2e2; color: #991b1b; }
.wal-event-badge--site-added    { background: #dbeafe; color: #1e40af; }
.wal-event-badge--user-created  { background: #ede9fe; color: #5b21b6; }

/* ── Forms ─────────────────────────────────────────────────── */
.wal-input, .wal-select {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--input-border); border-radius: var(--radius);
    font-size: 13px; font-family: var(--font); color: var(--text); background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.wal-input:focus, .wal-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,99,255,.13);
}
.wal-input-group { display: flex; gap: 8px; }
.wal-input-group .wal-input { flex: 1; }
.wal-form-row { margin-bottom: 16px; }
.wal-form-row label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .3px; }
.wal-form-row-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wal-form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.wal-search-bar { display: flex; gap: 8px; margin-bottom: 16px; max-width: 440px; }
.wal-search-input { flex: 1; padding: 8px 12px; border: 1px solid var(--input-border); border-radius: var(--radius); font-size: 13px; font-family: var(--font); outline: none; }
.wal-search-input:focus { border-color: var(--primary); }

/* ── Tabs ─────────────────────────────────────────────────── */
.wal-tab-bar { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.wal-tab { padding: 8px 16px; font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color var(--transition), border-color var(--transition); }
.wal-tab:hover { color: var(--text); text-decoration: none; }
.wal-tab--active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Modals ─────────────────────────────────────────────────── */
.wal-modal { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; }
.wal-modal.wal-modal--open { display: flex; }

.wal-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }

.wal-modal-box {
    position: relative; background: #fff;
    border-radius: var(--radius-lg); width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.22);
    animation: modalIn .18s ease;
}

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

.wal-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.wal-modal-header h2 { font-size: 16px; font-weight: 700; }
.wal-modal-close-btn { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0 2px; }
.wal-modal-close-btn:hover { color: var(--text); }
.wal-modal-form { padding: 20px 24px; }
.wal-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border); }

/* ── My Sites — shared base styles ─────────────────────────── */
.wal-site-favicon { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: #f3f4f6; }

.wal-status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.wal-status-dot--active   { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.wal-status-dot--inactive { background: #9ca3af; }
.wal-status-dot--error    { background: var(--danger); }

.wal-site-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wal-site-url  { font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wal-site-url:hover { text-decoration: underline; }

/* ── Desktop ≥769px: table / list view ─────────────────────── */
@media (min-width: 769px) {

    /* Outer container becomes a table-like column */
    .wal-sites-grid {
        display: flex;
        flex-direction: column;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: var(--radius);
        box-shadow: var(--card-shadow);
        overflow: hidden;
    }

    /*
     * Desktop columns (4):
     *  Col A  48px   favicon
     *  Col B  flex:1 site name + url stacked
     *  Col C  80px   status
     *  Col D  200px  actions
     *
     * Header spans must have identical widths + gap to the card columns.
     */

    .wal-sites-list-header {
        display: flex;
        align-items: center;
        padding: 9px 20px;
        gap: 16px;
        border-bottom: 2px solid var(--border);
        background: var(--bg);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--text-muted);
    }
    .slh-favicon { width: 48px;  flex-shrink: 0; }
    .slh-name    { flex: 1;      min-width: 0; }
    .slh-url     { display: none; }           /* url is stacked under name, no own column */
    .slh-status  { width: 80px;  flex-shrink: 0; text-align: center; }
    .slh-actions { width: 200px; flex-shrink: 0; text-align: right; }

    /* Each card = a table row */
    .wal-site-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 10px 20px;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border);
        background: var(--card-bg);
        box-shadow: none;
        transition: background var(--transition);
    }
    .wal-site-card:last-child { border-bottom: none; }
    .wal-site-card:hover { background: var(--bg); transform: none; box-shadow: none; }

    /* Col A — favicon only (dot hidden, replaced by status label) */
    .wal-site-card-header {
        width: 48px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .wal-site-card .wal-status-dot { display: none; }

    /* Col B — name + url stacked */
    .wal-site-card-body {
        flex: 1;
        min-width: 0;
        display: block;       /* stack name above url */
    }
    .wal-site-name { font-size: 14px; margin-bottom: 2px; }

    /* Col C — status text label */
    .wal-site-status {
        width: 80px;
        flex-shrink: 0;
        font-size: 11px;
        font-weight: 600;
        text-align: center;
        text-transform: capitalize;
    }
    .wal-site-status--active   { color: var(--success); }
    .wal-site-status--inactive { color: #9ca3af; }
    .wal-site-status--error    { color: var(--danger); }

    /* Col D — action buttons */
    .wal-site-card-footer {
        width: 200px;
        flex-shrink: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
    }
    .wal-site-card-footer .wal-btn { flex: 0 0 auto; }
}

/* ── Mobile ≤768px: card grid view ─────────────────────────── */
@media (max-width: 768px) {
    .wal-sites-list-header { display: none; }

    .wal-sites-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .wal-site-card {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: var(--radius);
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        box-shadow: var(--card-shadow);
        transition: box-shadow var(--transition), transform var(--transition);
    }
    .wal-site-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); transform: translateY(-1px); }

    .wal-site-card-header { display: flex; align-items: center; justify-content: space-between; }
    .wal-site-card-body   { flex: 1; }
    .wal-site-card-footer { display: flex; gap: 8px; }
    .wal-site-card-footer .wal-btn { flex: 1; justify-content: center; }

    /* Hide text label on mobile — dot in header is enough */
    .wal-site-status { display: none; }
}

@media (max-width: 480px) {
    .wal-sites-grid { grid-template-columns: 1fr; }
}

/* ── Assignments Matrix ─────────────────────────────────────── */
.wal-matrix-user-col { min-width: 200px; }
.wal-matrix-site-col { min-width: 120px; text-align: center; max-width: 150px; }
.wal-matrix-site-name { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.wal-matrix-user-cell { min-width: 200px; }
.wal-matrix-cell { text-align: center; }
.wal-matrix-username { font-size: 13px; font-weight: 500; display: block; }
.wal-user-info { display: flex; align-items: center; gap: 10px; }

/* ── Toggle ─────────────────────────────────────────────────── */
.wal-toggle-label { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.wal-toggle-label input[type="checkbox"] { display: none; }
.wal-toggle-indicator {
    width: 20px; height: 20px; border-radius: 5px;
    border: 2px solid var(--input-border); background: #fff;
    transition: background var(--transition), border-color var(--transition);
    position: relative; display: block;
}
.wal-toggle-label input:checked + .wal-toggle-indicator { background: var(--primary); border-color: var(--primary); }
.wal-toggle-label input:checked + .wal-toggle-indicator::after {
    content: ''; position: absolute; left: 4px; top: 1px;
    width: 6px; height: 10px;
    border: 2px solid #fff; border-top: none; border-left: none;
    transform: rotate(45deg);
}

/* ── Checklist ─────────────────────────────────────────────── */
.wal-checklist-search-wrap { margin-bottom: 8px; }
.wal-input-sm { padding: 6px 10px; font-size: 13px; }
.wal-checklist-item--hidden { display: none !important; }
.wal-checklist { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
.wal-checklist-loading { padding: 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.wal-checklist-empty   { padding: 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.wal-assigned-summary  { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.wal-checklist-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; transition: background var(--transition); }
.wal-checklist-item:hover { background: #f9fafb; }
.wal-checkbox { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.wal-checklist-name { font-size: 13px; font-weight: 500; flex: 1; }
.wal-checklist-url { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* ── Pagination ─────────────────────────────────────────────── */
.wal-pagination { display: flex; gap: 4px; padding: 14px 16px; border-top: 1px solid var(--border); }
.wal-page-link { padding: 4px 10px; border-radius: 4px; font-size: 13px; color: var(--text); border: 1px solid var(--border); transition: background var(--transition); }
.wal-page-link:hover { background: var(--bg); text-decoration: none; }
.wal-page-link--active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Empty State ─────────────────────────────────────────────── */
.wal-empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.wal-empty-state p { margin-bottom: 16px; }

/* ── Notices ─────────────────────────────────────────────────── */
#wal-notices { position: fixed; bottom: 24px; right: 24px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.wal-toast { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15); animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: none; } }
.wal-toast--success { background: var(--success); }
.wal-toast--error   { background: var(--danger); }
.wal-toast--info    { background: var(--info); }

/* ── Site Info Page ─────────────────────────────────────────── */
.wal-si-back {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text-muted); margin-bottom: 2px;
}
.wal-si-back:hover { color: var(--text); text-decoration: none; }

/* Loading / Error states */
.wal-si-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 60px 20px; color: var(--text-muted); font-size: 14px;
}
.wal-si-spinner {
    display: inline-block; width: 22px; height: 22px; flex-shrink: 0;
    border: 3px solid rgba(108,99,255,.2); border-top-color: var(--primary);
    border-radius: 50%; animation: spin .7s linear infinite;
}
.wal-si-error {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.wal-si-error svg { color: var(--danger); }

/* Quick stats row */
.wal-si-quick-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 14px; margin-bottom: 20px;
}
@media (max-width: 900px) { .wal-si-quick-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .wal-si-quick-row { grid-template-columns: 1fr; } }

.wal-si-quick-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius); padding: 16px 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--card-shadow); border-left: 4px solid transparent;
}
.wal-si-quick-card--wp      { border-left-color: #3b82f6; }
.wal-si-quick-card--php     { border-left-color: #8b5cf6; }
.wal-si-quick-card--plugins { border-left-color: var(--primary); }
.wal-si-quick-card--updates { border-left-color: var(--warning); }

.wal-si-quick-icon { flex-shrink: 0; color: var(--text-muted); }
.wal-si-quick-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wal-si-quick-val  { font-size: 15px; font-weight: 700; }
.wal-si-quick-lbl  { font-size: 12px; }

/* Main grid */
.wal-si-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 16px; margin-bottom: 20px;
}
@media (max-width: 1100px) { .wal-si-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px)  { .wal-si-grid { grid-template-columns: 1fr; } }

/* Info table inside cards */
.wal-si-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wal-si-table th {
    text-align: left; padding: 9px 16px; width: 130px; white-space: nowrap;
    font-size: 11.5px; font-weight: 600; color: var(--text-muted);
    border-bottom: 1px solid var(--border); background: #fafafa;
    text-transform: uppercase; letter-spacing: .3px;
}
.wal-si-table td { padding: 9px 16px; border-bottom: 1px solid var(--border); }
.wal-si-table tr:last-child th,
.wal-si-table tr:last-child td { border-bottom: none; }

/* Badges */
.wal-si-badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.si-badge--ok   { background: #dcfce7; color: #166534; }
.si-badge--warn { background: #fef9c3; color: #854d0e; }
.si-badge--info { background: #dbeafe; color: #1e40af; }
.si-badge--off  { background: #f3f4f6; color: #6b7280; }

/* Content stats row */
.wal-si-stat-row {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.wal-si-stat-card {
    flex: 1; min-width: 80px;
    background: #f9fafb; border-radius: var(--radius);
    padding: 14px; text-align: center; border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 4px;
}
.wal-si-stat-num { font-size: 26px; font-weight: 700; line-height: 1; }
.wal-si-stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }

/* Plugins table */
.wal-si-plugin-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.wal-si-plugin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wal-si-plugin-table thead th {
    text-align: left; padding: 9px 14px; position: sticky; top: 0;
    background: #f9fafb; border-bottom: 2px solid var(--border);
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--text-muted);
}
.wal-si-plugin-table tbody td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wal-si-plugin-table tbody tr:last-child td { border-bottom: none; }
.wal-si-plugin-table tbody tr:hover { background: #fafafa; }
.wal-si-plugin-name { max-width: 280px; }

/* ── Plugin Updates Page ────────────────────────────────────── */
.wal-pu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .wal-pu-grid { grid-template-columns: 1fr; } }

.wal-pu-info-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wal-pu-info-table th { text-align: left; padding: 6px 12px 6px 0; color: var(--text-muted); font-weight: 600; font-size: 11.5px; white-space: nowrap; width: 130px; }
.wal-pu-info-table td { padding: 6px 0; }

.wal-pu-changelog { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.wal-pu-changelog strong { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); }
.wal-pu-changelog-body { margin-top: 8px; font-size: 13px; line-height: 1.6; }
.wal-pu-changelog-body ul { padding-left: 18px; margin: 6px 0; }

.wal-pu-steps { padding-left: 20px; font-size: 13px; line-height: 1.8; }
.wal-pu-steps li { margin-bottom: 6px; }
.wal-pu-steps code { font-size: 12px; }

.wal-input-file { padding: 6px 10px; cursor: pointer; }
.wal-textarea { resize: vertical; font-family: 'Courier New', monospace; font-size: 12px; }

/* ── My Sites Search Bar ────────────────────────────────────── */
.wal-my-sites-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.wal-my-sites-search-bar .wal-search-input { max-width: 360px; flex: 1; }
.wal-my-sites-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.wal-my-sites-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ── Modal Bulk Actions ──────────────────────────────────────── */
.wal-modal-bulk-actions {
    display: flex;
    gap: 8px;
    padding: 10px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

/* ── Misc ─────────────────────────────────────────────────── */
.wal-muted { color: var(--text-muted); }
.wal-link  { color: var(--primary); }

/* Login button spinner */
.wal-spinner-dot {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: spin .7s linear infinite; margin-right: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
