/* =============================================================
   Absoluit User Hub — Master Dashboard Styles
   Clean Light Mode admin UI (Branded for Absoluit)
   ============================================================= */

:root {
    --uhm-bg: #f5f7f9;
    --uhm-bg-card: #ffffff;
    --uhm-bg-card-hover: #fcfcfc;
    --uhm-bg-input: #ffffff;
    --uhm-border: #dbe0eb;
    --uhm-border-focus: #F69320; /* Absoluit Orange */
    --uhm-text: #4a5568;
    --uhm-text-muted: #718096;
    --uhm-text-heading: #0C4DA2; /* Absoluit Blue */
    --uhm-primary: #F69320;      /* Absoluit Orange */
    --uhm-primary-hover: #e58210;
    --uhm-success: #38a169;
    --uhm-danger: #e53e3e;
    --uhm-danger-hover: #c53030;
    --uhm-warning: #ecc94b;
    --uhm-info: #3182ce;
    --uhm-radius: 10px;          /* Absoluit Style */
    --uhm-radius-sm: 8px;
    --uhm-shadow: 0 4px 12px rgba(0,0,0,0.05);
    --uhm-transition: all 0.2s ease;
    --uhm-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Base */
.wpuhm-wrap { font-family: var(--uhm-font); color: var(--uhm-text); max-width: 1400px; margin: 0; padding: 20px 20px 40px 0; }
.wpuhm-wrap * { box-sizing: border-box; }

/* Header */
.wpuhm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 28px 32px; background: linear-gradient(135deg, #1a1f2e 0%, #252b3d 100%); border-radius: var(--uhm-radius); border: 1px solid var(--uhm-border); }
.wpuhm-header h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--uhm-text-heading); display: flex; align-items: center; gap: 10px; }
.wpuhm-header h1 .dashicons { font-size: 28px; width: 28px; height: 28px; color: var(--uhm-primary); }
.wpuhm-subtitle { margin: 6px 0 0; color: var(--uhm-text-muted); font-size: 14px; }
.wpuhm-header-actions { display: flex; gap: 10px; }

/* Buttons */
.wpuhm-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border: none; border-radius: var(--uhm-radius-sm); font-family: var(--uhm-font); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--uhm-transition); text-decoration: none; line-height: 1.4; }
.wpuhm-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.wpuhm-btn-primary { background: var(--uhm-primary); color: #fff; }
.wpuhm-btn-primary:hover { background: var(--uhm-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,110,247,0.4); }
.wpuhm-btn-secondary { background: var(--uhm-bg-card); color: var(--uhm-text); border: 1px solid var(--uhm-border); }
.wpuhm-btn-secondary:hover { background: var(--uhm-bg-card-hover); color: #fff; }
.wpuhm-btn-danger { background: var(--uhm-danger); color: #fff; }
.wpuhm-btn-danger:hover { background: var(--uhm-danger-hover); color: #fff; transform: translateY(-1px); }
.wpuhm-btn-ghost { background: transparent; color: var(--uhm-text-muted); padding: 6px 10px; }
.wpuhm-btn-ghost:hover { color: var(--uhm-primary); background: rgba(79,110,247,0.1); }
.wpuhm-btn-danger-ghost:hover { color: var(--uhm-danger) !important; background: rgba(239,68,68,0.1) !important; }
.wpuhm-btn-sm { padding: 6px 12px; font-size: 12px; }
.wpuhm-btn-lg { padding: 14px 28px; font-size: 15px; }
.wpuhm-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Stats Grid */
.wpuhm-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.wpuhm-stat-card { background: var(--uhm-bg-card); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius); padding: 24px; display: flex; align-items: center; gap: 16px; transition: var(--uhm-transition); }
.wpuhm-stat-card:hover { border-color: var(--uhm-primary); transform: translateY(-2px); box-shadow: var(--uhm-shadow); }
.wpuhm-stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.wpuhm-stat-icon .dashicons { font-size: 24px; width: 24px; height: 24px; color: #fff; }
.wpuhm-stat-sites .wpuhm-stat-icon { background: linear-gradient(135deg, #4f6ef7, #7c3aed); }
.wpuhm-stat-online .wpuhm-stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.wpuhm-stat-offline .wpuhm-stat-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.wpuhm-stat-users .wpuhm-stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.wpuhm-stat-number { display: block; font-size: 28px; font-weight: 700; color: var(--uhm-text-heading); line-height: 1; }
.wpuhm-stat-label { display: block; font-size: 13px; color: var(--uhm-text-muted); margin-top: 4px; }

/* Sections */
.wpuhm-section { margin-bottom: 30px; }
.wpuhm-section-title { font-size: 18px; font-weight: 600; color: var(--uhm-text-heading); margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.wpuhm-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.wpuhm-section-header .wpuhm-section-title { margin-bottom: 0; }

/* Quick Actions */
.wpuhm-quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.wpuhm-action-card { background: var(--uhm-bg-card); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius); padding: 28px 24px; text-align: center; text-decoration: none; color: var(--uhm-text); transition: var(--uhm-transition); }
.wpuhm-action-card:hover { border-color: var(--uhm-primary); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(79,110,247,0.15); color: var(--uhm-text); }
.wpuhm-action-card .dashicons { font-size: 36px; width: 36px; height: 36px; color: var(--uhm-primary); margin-bottom: 12px; }
.wpuhm-action-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--uhm-text-heading); }
.wpuhm-action-card p { margin: 0; font-size: 13px; color: var(--uhm-text-muted); }

/* Sites Grid (Dashboard) */
.wpuhm-sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.wpuhm-site-card { background: var(--uhm-bg-card); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius); padding: 20px; transition: var(--uhm-transition); position: relative; }
.wpuhm-site-card:hover { border-color: var(--uhm-border-focus); box-shadow: var(--uhm-shadow); }
.wpuhm-site-status { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 5px; }
.wpuhm-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.wpuhm-status-online .wpuhm-status-dot, .wpuhm-status-dot-sm.wpuhm-status-online { background: var(--uhm-success); box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.wpuhm-status-offline .wpuhm-status-dot, .wpuhm-status-dot-sm.wpuhm-status-offline { background: var(--uhm-danger); box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.wpuhm-status-unknown .wpuhm-status-dot, .wpuhm-status-dot-sm.wpuhm-status-unknown { background: var(--uhm-text-muted); }
.wpuhm-status-online { color: var(--uhm-success); }
.wpuhm-status-offline { color: var(--uhm-danger); }
.wpuhm-status-unknown { color: var(--uhm-text-muted); }
.wpuhm-site-name { font-size: 16px; font-weight: 600; color: var(--uhm-text-heading); margin: 0 0 4px; }
.wpuhm-site-url { font-size: 13px; color: var(--uhm-text-muted); margin: 0 0 12px; word-break: break-all; }
.wpuhm-site-meta { display: flex; gap: 16px; font-size: 12px; color: var(--uhm-text-muted); }
.wpuhm-site-meta .dashicons { font-size: 14px; width: 14px; height: 14px; vertical-align: -2px; }
.wpuhm-site-ping { font-size: 11px; color: var(--uhm-text-muted); margin: 8px 0 0; }

/* Tables */
.wpuhm-table-wrap { overflow-x: auto; border-radius: var(--uhm-radius); border: 1px solid var(--uhm-border); }
.wpuhm-table { width: 100%; border-collapse: collapse; background: var(--uhm-bg-card); }
.wpuhm-table th { padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--uhm-text-muted); background: var(--uhm-bg-input); border-bottom: 1px solid var(--uhm-border); }
.wpuhm-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--uhm-border); vertical-align: middle; }
.wpuhm-table tbody tr:hover { background: var(--uhm-bg-card-hover); }
.wpuhm-table tbody tr:last-child td { border-bottom: none; }
.wpuhm-actions-cell { white-space: nowrap; display: flex; gap: 4px; }
.wpuhm-site-link { color: var(--uhm-primary); text-decoration: none; font-size: 13px; }
.wpuhm-site-link:hover { text-decoration: underline; }
.wpuhm-site-link .dashicons { font-size: 12px; width: 12px; height: 12px; vertical-align: 0; }

/* Status Badge */
.wpuhm-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.wpuhm-status-badge.wpuhm-status-online { background: rgba(34,197,94,0.1); color: var(--uhm-success); }
.wpuhm-status-badge.wpuhm-status-offline { background: rgba(239,68,68,0.1); color: var(--uhm-danger); }
.wpuhm-status-badge.wpuhm-status-unknown { background: rgba(136,145,165,0.1); color: var(--uhm-text-muted); }

/* Forms */
.wpuhm-form-card { background: var(--uhm-bg-card); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius); padding: 28px; margin-bottom: 24px; }
.wpuhm-form-card-large { padding: 32px; }
.wpuhm-form-section { margin-bottom: 28px; }
.wpuhm-form-section:last-child { margin-bottom: 0; }
.wpuhm-form-section-title { font-size: 16px; font-weight: 600; color: var(--uhm-text-heading); margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--uhm-border); display: flex; align-items: center; gap: 8px; }
.wpuhm-form-section-title .dashicons { color: var(--uhm-primary); }
.wpuhm-selected-count { font-size: 13px; font-weight: 400; color: var(--uhm-text-muted); margin-left: auto; }
.wpuhm-form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.wpuhm-form-row:last-child { margin-bottom: 0; }
.wpuhm-form-row-2 > .wpuhm-form-group { flex: 1; }
.wpuhm-form-row-3 > .wpuhm-form-group { flex: 1; }
.wpuhm-form-group { margin-bottom: 0; }
.wpuhm-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--uhm-text); margin-bottom: 6px; }
.wpuhm-form-group label .required { color: var(--uhm-danger); }
.wpuhm-form-group input[type="text"],
.wpuhm-form-group input[type="email"],
.wpuhm-form-group input[type="url"],
.wpuhm-form-group input[type="password"],
.wpuhm-form-group select,
.wpuhm-form-group textarea { width: 100%; padding: 10px 14px; background: var(--uhm-bg-input); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius-sm); color: var(--uhm-text); font-family: var(--uhm-font); font-size: 14px; transition: var(--uhm-transition); }
.wpuhm-form-group input:focus,
.wpuhm-form-group select:focus,
.wpuhm-form-group textarea:focus { outline: none; border-color: var(--uhm-border-focus); box-shadow: 0 0 0 3px rgba(79,110,247,0.15); }
.wpuhm-form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238891a5' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.wpuhm-input-group { display: flex; gap: 6px; }
.wpuhm-input-group input { flex: 1; }
.wpuhm-input-lg { padding: 14px 18px !important; font-size: 16px !important; }
.wpuhm-form-group-flex { display: flex; gap: 12px; flex: 1; }
.wpuhm-form-group-flex input { flex: 1; }
.wpuhm-textarea { width: 100%; padding: 12px 14px; background: var(--uhm-bg-input); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius-sm); color: var(--uhm-text); font-family: 'Consolas', monospace; font-size: 13px; resize: vertical; }
.wpuhm-textarea:focus { outline: none; border-color: var(--uhm-border-focus); }
.wpuhm-help-text { font-size: 13px; color: var(--uhm-text-muted); margin: 0 0 12px; }
.wpuhm-help-text code { background: var(--uhm-bg-input); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.wpuhm-form-actions { display: flex; gap: 12px; margin-top: 20px; }
.wpuhm-form-actions-sticky { padding-top: 20px; border-top: 1px solid var(--uhm-border); }
.wpuhm-filter-input { padding: 8px 14px !important; background: var(--uhm-bg-input) !important; border: 1px solid var(--uhm-border) !important; border-radius: var(--uhm-radius-sm) !important; color: var(--uhm-text) !important; font-size: 13px !important; width: 220px !important; }

/* Site Checkboxes */
.wpuhm-site-select-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.wpuhm-site-checkboxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; max-height: 400px; overflow-y: auto; padding: 4px; }
.wpuhm-site-checkbox { cursor: pointer; display: block; }
.wpuhm-site-checkbox input { display: none; }
.wpuhm-checkbox-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--uhm-bg-input); border: 2px solid var(--uhm-border); border-radius: var(--uhm-radius-sm); transition: var(--uhm-transition); }
.wpuhm-site-checkbox input:checked + .wpuhm-checkbox-card { border-color: var(--uhm-primary); background: rgba(79,110,247,0.08); }
.wpuhm-site-checkbox:hover .wpuhm-checkbox-card { border-color: var(--uhm-text-muted); }
.wpuhm-status-dot-sm { width: 8px; height: 8px; min-width: 8px; border-radius: 50%; }
.wpuhm-checkbox-name { font-weight: 600; font-size: 13px; color: var(--uhm-text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpuhm-checkbox-url { font-size: 11px; color: var(--uhm-text-muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

/* Empty State */
.wpuhm-empty-state { text-align: center; padding: 60px 20px; background: var(--uhm-bg-card); border: 1px dashed var(--uhm-border); border-radius: var(--uhm-radius); }
.wpuhm-empty-state .dashicons { font-size: 48px; width: 48px; height: 48px; color: var(--uhm-text-muted); margin-bottom: 16px; }
.wpuhm-empty-state h3 { margin: 0 0 8px; font-size: 18px; color: var(--uhm-text-heading); }
.wpuhm-empty-state p { margin: 0 0 20px; color: var(--uhm-text-muted); }

/* Results */
.wpuhm-results-section { margin-top: 24px; }
.wpuhm-results-list { display: flex; flex-direction: column; gap: 6px; }
.wpuhm-result-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--uhm-bg-card); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius-sm); }
.wpuhm-result-icon { font-size: 18px; width: 18px; height: 18px; }
.wpuhm-result-success .wpuhm-result-icon { color: var(--uhm-success); }
.wpuhm-result-failed .wpuhm-result-icon { color: var(--uhm-danger); }
.wpuhm-result-notfound .wpuhm-result-icon { color: var(--uhm-text-muted); }
.wpuhm-result-site { font-weight: 600; font-size: 14px; color: var(--uhm-text-heading); min-width: 200px; }
.wpuhm-result-message { font-size: 13px; color: var(--uhm-text-muted); }

/* Search Summary */
.wpuhm-search-summary { padding: 16px; background: var(--uhm-bg-input); border-radius: var(--uhm-radius-sm); margin-bottom: 16px; font-size: 14px; }
.wpuhm-search-summary strong { color: var(--uhm-text-heading); }

/* Found Sites List */
.wpuhm-found-sites-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.wpuhm-found-site-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--uhm-bg-input); border: 1px solid var(--uhm-border); border-radius: var(--uhm-radius-sm); }
.wpuhm-found-site-item input[type="checkbox"] { accent-color: var(--uhm-primary); width: 16px; height: 16px; }
.wpuhm-found-site-name { font-weight: 600; color: var(--uhm-text-heading); }
.wpuhm-found-site-role { font-size: 12px; color: var(--uhm-primary); background: rgba(79,110,247,0.1); padding: 2px 8px; border-radius: 10px; margin-left: auto; }

/* Loading / Spinner */
.wpuhm-loading-section { text-align: center; padding: 60px 20px; }
.wpuhm-spinner { width: 40px; height: 40px; border: 3px solid var(--uhm-border); border-top-color: var(--uhm-primary); border-radius: 50%; animation: wpuhm-spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes wpuhm-spin { to { transform: rotate(360deg); } }

/* Progress Bar */
.wpuhm-progress-section { margin: 20px 0; }
.wpuhm-progress-bar-wrap { height: 6px; background: var(--uhm-border); border-radius: 3px; overflow: hidden; }
.wpuhm-progress-bar { height: 100%; background: linear-gradient(90deg, var(--uhm-primary), #7c3aed); border-radius: 3px; width: 0; transition: width 0.3s ease; }
.wpuhm-progress-text { font-size: 13px; color: var(--uhm-text-muted); margin-top: 8px; text-align: center; }

/* Toast Notifications */
.wpuhm-toast { position: fixed; top: 40px; right: 20px; z-index: 999999; padding: 14px 20px; border-radius: var(--uhm-radius-sm); font-family: var(--uhm-font); font-size: 14px; font-weight: 500; color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,0.3); transform: translateX(120%); transition: transform 0.3s ease; max-width: 400px; }
.wpuhm-toast.wpuhm-toast-show { transform: translateX(0); }
.wpuhm-toast-success { background: var(--uhm-success); }
.wpuhm-toast-error { background: var(--uhm-danger); }
.wpuhm-toast-info { background: var(--uhm-info); }

/* User Sites Tags */
.wpuhm-site-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.wpuhm-site-tag { font-size: 11px; padding: 2px 8px; background: rgba(79,110,247,0.1); color: var(--uhm-primary); border-radius: 10px; white-space: nowrap; }
.wpuhm-role-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.wpuhm-role-administrator { background: rgba(239,68,68,0.1); color: var(--uhm-danger); }
.wpuhm-role-editor { background: rgba(79,110,247,0.1); color: var(--uhm-primary); }
.wpuhm-role-author { background: rgba(245,158,11,0.1); color: var(--uhm-warning); }
.wpuhm-role-subscriber { background: rgba(136,145,165,0.1); color: var(--uhm-text-muted); }

/* Responsive */
@media (max-width: 1200px) {
    .wpuhm-stats-grid, .wpuhm-quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .wpuhm-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .wpuhm-stats-grid, .wpuhm-quick-actions { grid-template-columns: 1fr; }
    .wpuhm-form-row { flex-direction: column; }
    .wpuhm-form-group-flex { flex-direction: column; }
    .wpuhm-site-checkboxes { grid-template-columns: 1fr; }
    .wpuhm-section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Spinner Animation for AJAX requests */
.wpuhm-spin-icon {
    animation: wpuhm-spin 0.8s linear infinite;
}
@keyframes wpuhm-spin {
    to {
        transform: rotate(360deg);
    }
}
