.admin-panel {
    /* Structural shell + .panel-shell--child-overlay handle layout/backdrop */
    /* (backdrop is delegated to the .admin-overlay child element) */
    z-index: 9999;
}

.admin-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, var(--modal-overlay-darkness));
    backdrop-filter: blur(var(--modal-overlay-blur));
}

.admin-content {
    background: linear-gradient(135deg, var(--panel-bg-start) 0%, var(--panel-bg-end) 100%);
    padding: 1.75rem 2rem;
    width: 96%;
    max-width: 1400px;
    max-height: 92vh;
    gap: 0;
    display: flex;
    flex-direction: column;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-border);
    gap: 1.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    min-width: 0;
}

.admin-header-title {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.admin-title-prefix {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--accent-color);
    opacity: 0.6;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.admin-header-stats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-header-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    white-space: nowrap;
}

.admin-header-stat.stat--pending {
    border-color: var(--warning-color);
    background: rgba(var(--warning-color-rgb), 0.08);
}

.admin-header-stat.stat--banned {
    border-color: var(--danger-color);
    background: rgba(var(--danger-color-rgb), 0.08);
}

.admin-header-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-family: 'Courier New', monospace;
}

.admin-header-stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====================
   USER GRID TOOLBAR
   ==================== */
.user-grid-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.user-grid-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
    line-height: 1;
}

.user-grid-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.75rem 0.45rem 2rem;
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.user-grid-search:focus {
    outline: none;
    border-color: var(--highlight-color);
    background: var(--surface-focus);
}

.user-grid-search::placeholder { color: var(--text-muted); }

.user-grid-filters {
    display: flex;
    align-items: center;
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.grid-filter-btn {
    padding: 0.45rem 0.8rem;
    background: transparent;
    border: none;
    border-right: 1px solid var(--surface-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    font-family: inherit;
}

.grid-filter-btn:last-child { border-right: none; }
.grid-filter-btn:hover { background: var(--surface-1); color: var(--text-primary); }
.grid-filter-btn.active { background: var(--highlight-color); color: var(--text-primary); }

.grid-tool-btn {
    padding: 0.45rem 0.85rem;
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.grid-tool-btn:hover {
    background: var(--control-hover);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

/* Restart-section still uses .filter-btn */
.filter-btn {
    padding: 0.6rem 1.2rem;
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: 7px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
}

.filter-btn:hover {
    background: var(--control-hover);
    border-color: var(--accent-color);
}

.filter-btn.active {
    background: var(--highlight-color);
    border-color: var(--highlight-color);
    color: var(--text-primary);
}

/* ====================
   USER DATA GRID
   ==================== */
.user-grid-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    background: var(--surface-1);
    min-height: 0;
}

.user-grid-container::-webkit-scrollbar { width: 7px; height: 7px; }
.user-grid-container::-webkit-scrollbar-track { background: transparent; }
.user-grid-container::-webkit-scrollbar-thumb { background: var(--surface-border-strong); border-radius: 4px; }

.user-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.user-grid thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.user-grid thead tr {
    background: var(--surface-subtle);
    border-bottom: 2px solid var(--surface-border);
}

/* Column resize handle */
.user-grid thead th {
    position: relative;
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-secondary);
    white-space: nowrap;
    user-select: none;
    border-right: 1px solid var(--surface-border);
}

.col-resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    transition: background 0.1s;
    z-index: 1;
}

.col-resizer:hover,
.col-resize-active .col-resizer {
    background: var(--highlight-color);
    opacity: 0.6;
}

/* During resize: freeze cursor globally and suppress text selection */
.col-resize-active { cursor: col-resize !important; }
.col-resize-active * { user-select: none !important; cursor: col-resize !important; }

.user-grid thead th:last-child { border-right: none; }

.user-grid thead th.sortable {
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
}

.user-grid thead th.sortable:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sort-indicator {
    font-size: 0.65rem;
    opacity: 0.35;
    margin-left: 0.25rem;
    transition: opacity 0.15s;
}

.sort-indicator.active {
    opacity: 1;
    color: var(--highlight-color);
}

/* Column widths */
.col-avatar      { width: 46px; text-align: center; }
.col-username    { min-width: 110px; width: 14%; }
.col-display-name{ min-width: 110px; width: 17%; }
.col-role        { width: 85px; }
.col-status      { width: 78px; }
.col-last-login  { width: 105px; }
.col-actions     { min-width: 150px; text-align: right; }

/* Table rows */
.user-row td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--surface-border);
    vertical-align: middle;
}

.user-row:last-child td { border-bottom: none; }

.user-row:hover td { background: rgba(255, 255, 255, 0.03); }

.user-row.row-pending td    { background: rgba(var(--warning-color-rgb), 0.04); }
.user-row.row-pending:hover td { background: rgba(var(--warning-color-rgb), 0.07); }
.user-row.row-banned td     { background: rgba(var(--danger-color-rgb), 0.04); }
.user-row.row-banned:hover td  { background: rgba(var(--danger-color-rgb), 0.07); }
.user-row.row-current td    { background: rgba(var(--success-color-rgb), 0.04); }
.user-row.row-current:hover td { background: rgba(var(--success-color-rgb), 0.07); }

/* Cell content */
.row-avatar {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.row-avatar--initials {
    background: linear-gradient(135deg, var(--highlight-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.65rem;
    color: var(--text-primary);
}

.cell-username {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.cell-display-name { color: var(--text-primary); font-size: 0.875rem; }
.cell-display-name--empty { color: var(--text-muted); }

.cell-time {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.cell-you {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.35rem;
    background: var(--success-color);
    color: var(--color-on-success);
    border-radius: 3px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    align-self: center;
    flex-shrink: 0;
}

/* Cell badges */
.cell-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid;
    white-space: nowrap;
}

.cell-badge--approved  { background: rgba(var(--success-color-rgb), 0.15); border-color: var(--success-color);   color: var(--success-color); }
.cell-badge--pending   { background: rgba(var(--warning-color-rgb), 0.15); border-color: var(--warning-color);   color: var(--warning-color); }
.cell-badge--banned    { background: rgba(var(--danger-color-rgb),  0.15); border-color: var(--danger-color);    color: var(--danger-color); }
.cell-badge--role-user    { background: rgba(var(--text-secondary-rgb), 0.1);    border-color: rgba(var(--text-secondary-rgb), 0.4); color: var(--text-muted); }
.cell-badge--role-admin   { background: rgba(var(--highlight-color-rgb), 0.15); border-color: var(--highlight-color); color: var(--highlight-color); }
.cell-badge--role-headmin { background: rgba(var(--warning-color-rgb), 0.15);   border-color: var(--warning-color);   color: var(--warning-color); }

/* ====================
   ROW ACTION BUTTONS
   ==================== */
.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
}

.ra-btn {
    padding: 0.28rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.12s;
    white-space: nowrap;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ra-btn--success { background: var(--success-color); border-color: var(--success-color); color: var(--color-on-success); }
.ra-btn--success:hover { background: var(--success-color-light); }

.ra-btn--accent { background: rgba(var(--highlight-color-rgb), 0.15); border-color: var(--highlight-color); color: var(--highlight-color); }
.ra-btn--accent:hover { background: rgba(var(--highlight-color-rgb), 0.28); }

.ra-btn--warning { background: rgba(var(--warning-color-rgb), 0.15); border-color: var(--warning-color); color: var(--warning-color); }
.ra-btn--warning:hover { background: rgba(var(--warning-color-rgb), 0.28); }

.ra-btn--danger { background: var(--danger-color); border-color: var(--danger-color); color: var(--text-primary); }
.ra-btn--danger:hover { background: var(--danger-color-light); }

.ra-btn--default { background: var(--surface-1); border-color: var(--surface-border); color: var(--text-secondary); }
.ra-btn--default:hover { background: var(--control-hover); border-color: var(--accent-color); color: var(--text-primary); }

/* Size modifier for modal/section buttons */
.ra-btn--lg { padding: 0.5rem 1.1rem; font-size: 0.82rem; }

/* Overflow / more dropdown */
.ra-more { position: relative; }

.ra-more-trigger {
    padding: 0.28rem 0.45rem;
    background: transparent;
    border: 1px solid var(--surface-border);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: all 0.12s;
    font-family: inherit;
}

.ra-more-trigger:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

.ra-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 3px);
    /* Force a fully-opaque surface so items never look transparent */
    background: var(--panel-bg-start, #16162a);
    border: 1px solid var(--surface-border-strong);
    border-radius: 6px;
    min-width: 148px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ra-dropdown.open { display: flex; }

.ra-item {
    padding: 0.5rem 0.8rem;
    /* Items inherit opaque parent background; set explicit to stay readable */
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--surface-border);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    transition: background 0.1s;
    white-space: nowrap;
    font-family: inherit;
    opacity: 1;
}

.ra-item:last-child { border-bottom: none; }
.ra-item:hover { background: rgba(255,255,255,0.07); }
.ra-item--danger { color: var(--danger-color); }
.ra-item--danger:hover { background: rgba(var(--danger-color-rgb), 0.12); }

.user-grid-loading,
.user-grid-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.loading-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid var(--surface-border-strong);
    border-top-color: var(--highlight-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.permission-modal-overlay {
    background: var(--overlay-darker);
    z-index: 10001;
}

.permission-modal {
    background: linear-gradient(135deg, var(--panel-bg-start) 0%, var(--panel-bg-end) 100%);
    padding: 1.75rem 2rem;
    max-width: 480px;
    width: 94%;
}

/* === Permissions console redesign === */
.perm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 1.1rem;
}

.perm-header-title {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.perm-header-user {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--highlight-color);
    font-weight: 600;
}

.perm-grid {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1.25rem;
}

.perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    gap: 1rem;
    transition: border-color 0.12s;
}

.perm-row:hover { border-color: var(--accent-color); }

.perm-row-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.perm-row-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.perm-row-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Toggle switch */
.perm-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.perm-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.perm-toggle-track {
    width: 38px;
    height: 21px;
    background: var(--surface-border-strong);
    border-radius: 11px;
    display: flex;
    align-items: center;
    padding: 2px;
    box-sizing: border-box;
    transition: background 0.18s;
}

.perm-toggle-thumb {
    width: 17px;
    height: 17px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.18s, background 0.18s;
    flex-shrink: 0;
}

.perm-toggle input:checked ~ .perm-toggle-track { background: var(--success-color); }
.perm-toggle input:checked ~ .perm-toggle-track .perm-toggle-thumb {
    transform: translateX(17px);
    background: #fff;
}

.perm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-border);
}

.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--surface-border);
    flex-shrink: 0;
    margin-top: 1rem;
}

.admin-tabs .tab {
    padding: 0.6rem 1.4rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: -1px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-family: inherit;
}

.admin-tabs .tab:hover { color: var(--text-primary); }

.admin-tabs .tab.active {
    color: var(--highlight-color);
    border-bottom-color: var(--highlight-color);
}

.admin-tabs .tab.hidden { display: none; }

.admin-tab-body {
    display: grid;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    margin-top: 1rem;
}

.admin-tab-body > .tab-panel {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s;
}

.admin-tab-body > .tab-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Users tab: grid container manages its own scrolling */
.tab-panel[data-tab="users"] { overflow: hidden; }

/* Restart tab: content scrolls at panel level */
.tab-panel[data-tab="restart"] { overflow-y: auto; padding-right: 0.25rem; }

.restart-section,
.scheduled-restarts-section {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex-shrink: 0;
}

.restart-header,
.scheduled-restarts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--surface-border);
}

.restart-header h3,
.scheduled-restarts-header h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

.restart-role-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.restart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.restart-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.restart-field label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.restart-field input,
.restart-field textarea,
.restart-field select {
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--surface-border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    transition: border-color 0.15s, background 0.15s;
}

.restart-field input:focus,
.restart-field textarea:focus,
.restart-field select:focus {
    outline: none;
    border-color: var(--highlight-color);
    background: var(--surface-focus);
}

.restart-field textarea {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}

.restart-meta {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    background: var(--surface-muted);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--surface-border);
    border-left: 3px solid var(--highlight-color);
}

.restart-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.restart-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
    grid-column: 1 / -1;   /* span full grid row inside .add-scheduled-restart-form */
}

.scheduled-restarts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
}

/* ======================================================
   Networking Tab
   ====================================================== */

.tab-panel[data-tab="networking"] { overflow-y: auto; padding-right: 0.25rem; }

.network-section {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.network-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--surface-border);
}

.network-header h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

.network-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.network-domain-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    font-family: var(--font-mono, 'Fira Code', 'Cascadia Code', monospace);
    flex-wrap: wrap;
}

.net-label {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.net-sep {
    color: var(--surface-border);
    margin: 0 0.25rem;
}

/* Results list */
.network-check-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.network-check-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--surface-border);
    background: var(--surface-0, rgba(0, 0, 0, 0.15));
    transition: border-color 0.15s;
}

.network-check-row.net-ok  { border-left: 3px solid var(--success-color, #4caf50); }
.network-check-row.net-fail { border-left: 3px solid var(--danger-color, #ef5350); }

.net-icon {
    font-size: 1.1rem;
    font-weight: 700;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}
.net-icon.net-ok   { color: var(--success-color, #4caf50); }
.net-icon.net-fail { color: var(--danger-color, #ef5350); }

.net-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.net-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.net-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.net-detail {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: var(--font-mono, 'Fira Code', 'Cascadia Code', monospace);
    text-align: right;
    max-width: 50%;
    word-break: break-all;
}

/* Placeholder / loading / error */
.network-placeholder {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.network-error {
    padding: 1rem;
    color: var(--danger-color, #ef5350);
    background: rgba(239, 83, 80, 0.08);
    border: 1px solid rgba(239, 83, 80, 0.25);
    border-radius: 6px;
    font-size: 0.85rem;
}

.scheduled-restart-item {
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    transition: border-color 0.12s;
}

.scheduled-restart-item:hover {
    border-color: var(--accent-color);
}

.scheduled-restart-item.recurring {
    border-color: var(--highlight-color);
    background: rgba(var(--highlight-color-rgb), 0.04);
}

.scheduled-restart-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.scheduled-restart-time {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.scheduled-restart-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.scheduled-restart-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.2rem;
}

.scheduled-restart-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(var(--highlight-color-rgb), 0.2);
    border: 2px solid var(--highlight-color);
    color: var(--highlight-color);
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-scheduled-restart-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface-muted);
    border-radius: 12px;
    border: 2px dashed var(--surface-border-strong);
    margin-top: 0.5rem;
}

.add-scheduled-restart-form.hidden {
    display: none;
}

.recurring-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.recurring-options label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.recurring-options input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--highlight-color);
}

.no-scheduled-restarts {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
}

@media (max-width: 1024px) {
    .col-display-name { display: none; }
    .col-last-login { display: none; }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 1.25rem;
        width: 98%;
        max-height: 95vh;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-header-left { flex-wrap: wrap; gap: 0.75rem; }

    .user-grid-search-wrap { max-width: none; flex: 1 1 100%; }

    .col-role   { display: none; }
}

@media (max-width: 480px) {
    .admin-content { padding: 0.875rem; }
    .grid-filter-btn { padding: 0.4rem 0.55rem; font-size: 0.68rem; }
}
