/* Digital-7 LCD Font for IP addresses */
@font-face {
    font-family: 'Digital-7';
    src: url('https://db.onlinewebfonts.com/t/b01a19cd4c9d7da42127f6d0e016c36b.woff2') format('woff2'),
         url('https://db.onlinewebfonts.com/t/b01a19cd4c9d7da42127f6d0e016c36b.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Modern pill header for Online + Sort */
.miners-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 8px;
    width: 100%;
}

.miners-header-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    border-radius: 18px;
    padding: 6px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    font-size: 14px;
    font-weight: 500;
}

.miners-pill-status {
    padding: 6px 14px;
}

.miners-pill-sort {
    padding: 4px 12px;
}

.miners-pill-info {
    padding: 6px 16px;
    gap: 16px;
}

.miners-pill-actions {
    padding: 4px 10px;
    gap: 4px;
    margin-left: auto;
}
.miners-header-pill .badge,
.miners-header-pill .badge-muted {
    background: #6b7280;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    padding: 2px 10px;
    margin: 0 2px;
}
.miners-header-pill .miners-header-divider {
    width: 1px;
    height: 18px;
    background: #d1d5db;
    margin: 0 12px;
    border-radius: 1px;
}
.miners-header-pill .miners-sort-label {
    color: #2563eb;
    font-size: 14px;
    font-weight: 600;
    margin-right: 4px;
}
.miners-header-pill .miners-sort-wrapper {
    margin-left: 0;
}

.miners-pill-info .global-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.miners-pill-info .global-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.miners-pill-info .global-value {
    font-size: 12px;
    color: #374151;
    font-weight: 600;
}

.miners-pill-actions .icon-btn-sm {
    width: 28px;
    height: 28px;
    padding: 4px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.miners-pill-actions .icon-btn-sm:hover {
    background: rgba(0, 0, 0, 0.08);
}

.miners-pill-actions .icon-btn-sm .btn-icon {
    width: 18px;
    height: 18px;
}

.miners-pill-actions .icon-btn-sm i {
    font-size: 14px;
    color: #6b7280;
}

/* ============== GLOBAL INFO BAR ============== */
.global-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 2px 12px;
    height: 24px;
    font-size: 11px;
    margin: -24px -24px 14px -24px;
}

.global-info-bar .global-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.global-info-bar .global-label {
    color: var(--text-muted) !important;
    font-weight: 500 !important;
    font-size: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.global-info-bar .global-value {
    color: var(--text) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}

.global-info-bar .global-value.mono {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

/* Smaller global-info-bar for nodes tab */
#tab-nodes .global-info-bar {
    height: 20px;
    padding: 1px 10px;
    font-size: 10px;
    gap: 12px;
    margin-bottom: 10px;
}

#tab-nodes .global-info-bar .global-label {
    font-size: 9px !important;
}

#tab-nodes .global-info-bar .global-value {
    font-size: 10px !important;
}

/* ============== BASE STYLES ============== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --secondary: #475467;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f2efe8;
    --bg-card: #ffffff;
    --bg-input: #f2efe8;
    --text: #0f172a;
    --text-muted: #667085;
    --border: #e7e4df;
    --radius: 14px;
}

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

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #f2efe8;
    color: var(--text);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

/* Prevent background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
    background: #f2efe8;
    overflow-x: hidden;
}

/* ============== FLASH MESSAGES ============== */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash {
    padding: 12px 20px;
    border-radius: var(--radius);
    animation: slideIn 0.3s ease;
    box-shadow: 0 12px 24px rgba(16, 24, 40, 0.12);
}

.flash-error {
    background: #fee4e2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.flash-warning {
    background: #fffaeb;
    color: #b54708;
    border: 1px solid #fedf89;
}

.flash-info {
    background: #e8f0ff;
    color: #1d4ed8;
    border: 1px solid #c7ddff;
}

.flash-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============== BUTTONS ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    background: #3b82f6;
    color: #ffffff;
    border: 1px solid #2563eb;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

/* Primary - Blue (Save, OK, Apply, Submit) */
.btn-primary {
    background: #3b82f6;
    color: #ffffff;
    border: 1px solid #2563eb;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.35);
}

/* Secondary - Gray (Less important actions) */
.btn-secondary {
    background: #6b7280;
    color: #ffffff;
    border: 1px solid #4b5563;
    box-shadow: 0 4px 10px rgba(107, 114, 128, 0.25);
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
    box-shadow: 0 6px 14px rgba(107, 114, 128, 0.35);
}

/* Warning - Amber/Orange (Caution actions) */
.btn-warning {
    background: #f59e0b;
    color: #ffffff;
    border: 1px solid #d97706;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
}

/* Danger - Red (Delete, Remove, destructive) */
.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: 1px solid #dc2626;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.35);
}

/* Success - Green (Confirm, positive) */
.btn-success {
    background: #22c55e;
    color: #ffffff;
    border: 1px solid #16a34a;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.25);
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.35);
}

/* Outline - White/Gray border (Cancel, Close, neutral) */
.btn-outline {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-outline:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    border: 1px solid #d1d5db;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon-only {
    padding: 6px 10px;
    gap: 6px;
    min-width: 34px;
}

.btn-icon-only .btn-icon {
    margin-right: 0;
}

.btn-symbol {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.btn-text {
    font-size: 10px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.btn-refresh-icon {
    padding: 6px 10px;
    min-width: 34px;
}

.btn-refresh-icon img {
    width: 18px;
    height: 18px;
    margin-right: 0;
    filter: brightness(0) invert(1);
}

.btn-cmd-icon {
    padding: 8px 10px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cmd-icon img {
    width: 18px;
    height: 18px;
    margin-right: 0;
    filter: none;
}

/* ============== FORMS ============== */
.form-group {
    margin-bottom: 16px;
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.label-hint {
    font-weight: 400;
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    transition: border 0.2s, box-shadow 0.2s;
    text-align: center;
}

/* Mobile-friendly datetime inputs */
input[type="datetime-local"] {
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    font-size: 15px;
    padding: 10px 14px;
    text-align: left;
    height: auto;
    line-height: 1.2;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

/* Password field with toggle */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    flex: 1;
    padding-right: 45px;
}

.password-field input::placeholder {
    color: var(--text);
    opacity: 0.8;
}

/* Hide browser's native password reveal button */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 5px;
}

.password-toggle::before {
    content: '👁';
}

.password-toggle.showing::before {
    content: '👁';
}

.password-toggle.showing {
    text-decoration: line-through;
    text-decoration-color: #ef4444;
    text-decoration-thickness: 3px;
}

.password-toggle:hover {
    opacity: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    height: 42px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/* ============== LOGIN PAGE ============== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.15);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #1d4ed8 0%, #0ea5e9 50%, #22c55e 100%);
}

.login-title {
    font-size: 30px;
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.login-form .btn {
    margin-top: 10px;
    display: block;
    margin-left: 5px;
    margin-right: 0;
}

/* ============== DASHBOARD ============== */
.dashboard {
    padding: 10px 0 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
}

.dashboard-brand-logo {
    height: 38px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.client-nickname {
    font-size: 28px;
    font-weight: 700;
    color: #3b82f6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 11;
}

.header-right a,
.header-right button {
    position: relative;
    z-index: 12;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge {
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 6px;
}

.badge.hidden {
    display: none;
}

.badge-muted {
    background: #e5e7eb;
    color: #6b7280;
}

.dashboard-main {
    max-width: 720px;
    margin: 0 auto;
}

.status-panel {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
    border: 1px solid var(--border);
}

.status-item {
    margin-bottom: 16px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-item label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.status-value {
    font-size: 18px;
    font-weight: 500;
}

.status-connected {
    color: var(--success);
}

.status-disconnected {
    color: var(--danger);
}

.status-loading {
    color: var(--text-muted);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.action-result {
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid transparent;
}

.action-result.success {
    background: #ecfdf3;
    color: #027a48;
    border-color: #abefc6;
}

.action-result.error {
    background: #fee4e2;
    color: #b42318;
    border-color: #fecdca;
}

.action-result.hidden {
    display: none;
}

/* ============== MODAL ============== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(16, 24, 40, 0.18);
}

.modal-small {
    max-width: 420px;
}

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

.modal-header h2 {
    font-size: 18px;
    flex: 1;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header-actions .btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.modal-header-actions .btn-icon:hover {
    background: var(--bg-input);
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #ffffff;
}

.modal-footer textarea {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    resize: none;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-footer textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-footer .btn {
    min-width: 80px;
    height: 44px;
}

/* Client messages modal specific */
#messages-modal .modal-body {
    background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
    scroll-behavior: auto;
    /* Instant scroll for better chat UX */
}

#messages-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#messages-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#messages-modal .modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

#messages-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============== MAGIC LINK MODAL ============== */
.magic-link-modal-compact {
    max-width: 420px;
}

.magic-link-modal-compact .modal-header h3 {
    font-size: 16px;
    margin: 0;
}

.magic-link-modal-compact .modal-body {
    padding: 16px;
}

.magic-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.magic-link-row:last-child {
    margin-bottom: 0;
}

.magic-link-row-actions {
    justify-content: center;
    gap: 12px;
}

.magic-link-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    font-family: monospace;
}

.magic-link-input:focus {
    outline: none;
    border-color: var(--primary);
}

.magic-link-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 8px 12px;
}

.magic-link-btn .btn-icon {
    font-size: 14px;
}

.magic-link-row-actions .btn {
    flex: 1;
    max-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.magic-link-no-link {
    text-align: center;
    padding: 16px 0;
}

.magic-link-no-link p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Mobile magic link modal */
@media (max-width: 480px) {
    .magic-link-modal-compact {
        width: 95%;
        max-width: none;
    }

    .magic-link-row {
        flex-wrap: wrap;
    }

    .magic-link-input {
        width: 100%;
        flex: none;
        margin-bottom: 8px;
    }

    .magic-link-btn {
        flex: 1;
        justify-content: center;
    }

    .magic-link-row-actions {
        width: 100%;
    }

    .magic-link-row-actions .btn {
        max-width: none;
    }
}

/* ============== MESSAGES ============== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 0;
}

.message {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 75%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.message:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 4px;
}

.message-client {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 12px;
    border-bottom-right-radius: 4px;
}

.message-admin {
    background: #ffffff;
    border: 1px solid var(--border);
    align-self: flex-start;
    margin-left: 12px;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    color: var(--text);
}

.message-time {
    font-size: 11px;
    color: rgba(15, 23, 42, 0.6);
    margin-top: 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-client .message-time {
    color: rgba(255, 255, 255, 0.85);
}

.message-date-divider {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.message-date-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.message-date-divider span {
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
    border: 1px solid var(--border);
}

/* ============== ADMIN PANEL ============== */
.admin-panel {
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
    margin-bottom: 4px;
}

/* Brand Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 2px;
    text-decoration: none;
}

.brand-logo-img {
    height: 44px;
    width: auto;
    max-width: 230px;
    object-fit: contain;
}

.login-brand {
    text-align: center;
    margin-bottom: 8px;
}

.login-brand-img {
    height: 52px;
    width: auto;
    max-width: 280px;
    margin: 0 auto;
    object-fit: contain;
}

.global-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(16, 24, 40, 0.05);
}

.miners-inline-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.miners-inline-info.miners-inline-center {
    margin-left: 0;
    margin-right: auto;
    flex: 1;
    justify-content: center;
}

.global-label {
    font-size: 9px;
    text-transform: none;
    letter-spacing: 0.2px;
    color: var(--text-muted);
}

.global-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-value.mono {
    font-family: monospace;
}

.global-sub {
    font-size: 8px;
    color: var(--text-muted);
}

.admin-header .header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.version-tag {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 0;
    vertical-align: middle;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(16, 24, 40, 0.08);
    transition: all 0.2s ease;
}

.icon-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.12);
    background: #e2e8f0;
}

.icon-btn:active {
    transform: translateY(0);
}

.icon-btn.icon-link {
    text-decoration: none;
}

.icon-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
}

.icon-btn[data-tip],
.btn[data-tip] {
    position: relative;
}

.icon-btn[data-tip]::after,
.btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.icon-btn[data-tip]::before,
.btn[data-tip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 20;
}

.icon-btn[data-tip]:hover::after,
.icon-btn[data-tip]:hover::before,
.btn[data-tip]:hover::after,
.btn[data-tip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.icon-btn[data-tip]:disabled::after,
.icon-btn[data-tip]:disabled::before,
.btn[data-tip]:disabled::after,
.btn[data-tip]:disabled::before {
    display: none;
}

.miner-action-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.miner-action-btn img {
    width: 20px;
    height: 20px;
}

.icon-btn-lg {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.icon-btn-lg img {
    width: 22px;
    height: 22px;
}

.icon-btn-xl {
    width: 46px;
    height: 46px;
    border-radius: 14px;
}

.icon-btn-xl img {
    width: 28px;
    height: 28px;
}

.admin-header .header-right .btn {
    border-radius: 10px;
    padding: 8px 16px;
    box-shadow: 0 4px 10px rgba(16, 24, 40, 0.06);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.admin-header .header-right .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.12);
}

.admin-header .header-right .btn-outline {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    color: #475569;
}

.admin-header .header-right .btn-outline:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.admin-user {
    color: var(--text-muted);
    margin-right: 16px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin: 6px 0;
}


.tabs-spacer {
    flex: 1;
}

.tab-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    color: #475569;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

.tab-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    color: currentColor;
}

.tab-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.tab-btn.active:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.tab-content {
    display: none;
    background: #ffffff;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tab-content.active {
    display: block;
}

/* ============== DATA TABLE ============== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-input);
}

.data-table tbody tr.selected {
    background: rgba(29, 78, 216, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.disabled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-badge.expired {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.loading {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* ============== CONTEXT MENU ============== */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.18);
    z-index: 1001;
}

.context-menu.hidden {
    display: none;
}

.context-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.context-item:hover {
    background: var(--bg-input);
}

.context-item.danger {
    color: var(--danger);
}

.context-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ============== ADMIN MESSAGES ============== */
.messages-panel {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    min-height: 500px;
    background: var(--bg);
    padding: 0;
}

.conversations-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow-y: auto;
    max-height: 600px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
    display: flex;
    flex-direction: column;
}

.conversations-search {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
    border-radius: var(--radius) var(--radius) 0 0;
}

.conversations-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    color: var(--text);
}

.conversations-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.conversation-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.conversation-item:last-child {
    border-bottom: none;
}

.conversation-item:hover {
    background: var(--bg-input);
}

.conversation-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-left: 3px solid var(--primary);
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.conversation-item.active .conversation-avatar {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.conversation-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.conversation-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.conversation-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.conversation-unread {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.messages-view {
    background: var(--bg-card);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
    overflow: hidden;
}

.messages-view .no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    padding: 40px;
    text-align: center;
}

.messages-view .no-selection::before {
    content: '💬';
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.messages-view .messages-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    gap: 12px;
}

.messages-view .messages-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.messages-view .messages-header-name {
    flex: 1;
}

.messages-view .messages-header-actions {
    position: relative;
    margin-left: auto;
}

.messages-menu-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.messages-menu-btn:hover {
    background: var(--bg-input);
    color: var(--text);
}

.messages-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.messages-menu.show {
    display: block;
}

.messages-menu-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s;
}

.messages-menu-item:hover {
    background: var(--bg-input);
}

.messages-menu-item.text-danger {
    color: var(--danger);
}

.messages-menu-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

.messages-view .messages-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
    background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
    scroll-behavior: smooth;
}

.messages-view .messages-body::-webkit-scrollbar {
    width: 6px;
}

.messages-view .messages-body::-webkit-scrollbar-track {
    background: transparent;
}

.messages-view .messages-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.messages-view .messages-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.messages-view .messages-input {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    background: #ffffff;
    align-items: flex-end;
}

.messages-view .messages-input textarea {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    resize: none;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.messages-view .messages-input textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.messages-view .messages-input .btn {
    padding: 10px 20px;
    min-width: 80px;
    height: 44px;
}

.text-danger {
    color: var(--danger);
}

/* ============== CLIENT CARDS (for mobile) ============== */
.clients-cards {
    display: none;
}

.client-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.client-card:active {
    transform: scale(0.98);
}

.client-card.selected {
    border-color: var(--primary);
    background: rgba(29, 78, 216, 0.05);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15);
}

.client-card-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 10px;
    gap: 6px;
    width: 100%;
    text-align: center !important;
}

.client-card-name {
    font-weight: 600;
    font-size: 16px;
    text-align: center !important;
    width: 100%;
}

.client-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}

.client-card-item {
    display: flex;
    flex-direction: column;
}

.client-card-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.client-card-value {
    color: var(--text);
    word-break: break-word;
    font-size: 13px;
}

.client-card-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.client-card-actions .btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 8px 12px;
    font-size: 12px;
}

/* ============== RESPONSIVE ============== */
/* Switch to cards sooner for tablets/phones */
@media (max-width: 1024px) {
    .clients-list .data-table {
        display: none;
    }

    .clients-cards {
        display: block;
    }
}

@media (max-width: 768px) {
    .client-card-value {
        font-size: 12px;
    }

    .container {
        padding: 12px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .messages-panel {
        grid-template-columns: 1fr;
    }

    .conversations-list {
        max-height: 200px;
    }

    /* Admin Panel Mobile */
    .admin-panel {
        padding: 10px;
    }

    .admin-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 12px;
        border-radius: 16px;
    }

    .admin-header h1 {
        font-size: 18px;
    }

    .brand-logo {
        justify-content: center;
    }

    .brand-logo-img {
        height: 36px;
        max-width: 190px;
    }

    .brand-logo {
        gap: 6px;
    }

    .version-tag {
        font-size: 10px;
        padding: 2px 6px;
    }

    .login-brand-img {
        height: 44px;
        max-width: 240px;
    }

    .dashboard-brand-logo {
        height: 34px;
        max-width: 180px;
    }

    .admin-header .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .admin-header .header-right .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .admin-header .icon-btn {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .admin-header .icon-btn img {
        width: 18px;
        height: 18px;
    }

    .admin-user {
        font-size: 13px;
        margin-right: 10px;
    }

    /* Dashboard Header Mobile */
    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 14px 12px;
        padding-bottom: 16px;
    }

    .dashboard-header .header-left {
        display: flex;
        justify-content: center;
        width: 100%;
        order: -2;
    }

    .dashboard-header .client-nickname {
        font-size: 22px;
        font-weight: 700;
        color: #3b82f6;
        order: -1;
    }

    .dashboard-header .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .dashboard-header .header-right .btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
    }

    .admin-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 12px 0;
        overflow: visible;
        padding-bottom: 0;
    }

    .tab-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        font-size: 13px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ssh-server-fields .form-row,
    .ssh-server-fields .form-row.three,
    .ssh-server-fields .form-row.four,
    .ssh-server-fields .form-row.five {
        grid-template-columns: 1fr;
    }

    .tab-content {
        padding: 14px;
    }

    .tab-content h2 {
        font-size: 17px;
        margin-bottom: 14px;
    }

    /* Cards already shown by 1024 breakpoint */

    /* Modal full width on mobile */
    .modal-content {
        width: 94%;
        max-width: none;
        max-height: 85vh;
        margin: 0;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Context menu mobile - action sheet style */
    .context-menu {
        position: fixed;
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        width: auto;
        border-radius: 16px;
        padding: 8px 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    }

    .context-item {
        padding: 16px;
        text-align: center;
        font-size: 16px;
        font-weight: 500;
    }

    .context-item:first-child {
        border-radius: 8px 8px 0 0;
    }

    .context-item:last-child {
        border-radius: 0 0 8px 8px;
    }

    .context-divider {
        margin: 8px 16px;
    }

    /* Messages panel mobile */
    .messages-view .messages-body {
        max-height: 220px;
    }

    .messages-view .messages-input {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .messages-view .messages-input textarea {
        min-height: 50px;
        font-size: 16px;
        /* Prevents iOS Safari auto-zoom on focus */
        width: 100%;
        box-sizing: border-box;
    }

    .messages-view .messages-input .btn {
        width: 100%;
    }

    /* Prevent iOS Safari zoom on all inputs/textareas */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Chat modal on mobile */
    .modal-footer {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .modal-footer textarea {
        font-size: 16px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .modal-footer .btn {
        width: 100%;
    }

    #messages-modal .modal-body {
        max-height: 50vh;
    }

    #messages-modal .modal-content {
        max-height: 85vh;
        width: 95%;
    }

    /* Login mobile */
    .login-container {
        padding: 16px;
    }

    .login-box {
        padding: 24px 20px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    /* Flash messages mobile */
    .flash-messages {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .flash {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Forms mobile */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    /* Buttons mobile */
    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .btn-large {
        padding: 14px 20px;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .admin-header h1 {
        font-size: 18px;
    }

    .tab-btn {
        min-width: 60px;
        padding: 8px 6px;
        font-size: 12px;
    }

    .client-card-body {
        grid-template-columns: 1fr;
    }

    .client-card-actions .btn {
        min-width: 100%;
    }
}

/* ============== ONLINE BADGE ============== */
.online-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #16a34a;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px #16a34a;
    animation: pulse-online 1.5s infinite;
}

@keyframes pulse-online {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px #16a34a;
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 16px #16a34a, 0 0 24px #16a34a;
    }
}

/* SSH Terminal Badge */
.ssh-badge {
    display: inline-block;
    background: #4ecca3;
    color: #0d0d0d;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* SSH Toggle Button (desktop table) */
.ssh-toggle-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ssh-toggle-btn.ssh-on {
    background: #22c55e;
    color: #fff;
}

.ssh-toggle-btn.ssh-on:hover {
    background: #16a34a;
}

.ssh-toggle-btn.ssh-off {
    background: #6b7280;
    color: #fff;
}

.ssh-toggle-btn.ssh-off:hover {
    background: #4b5563;
}

/* ============== SESSIONS ICON ============== */
.sessions-icon {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sessions-icon:hover {
    opacity: 1;
}

/* ============== MODAL ============== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* ============== SESSIONS TABLE ============== */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.sessions-table th,
.sessions-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.sessions-table th {
    background: var(--bg);
    font-weight: 600;
}

.sessions-table .success {
    color: var(--success);
}

.sessions-table .failed {
    color: var(--danger);
}

.session-status {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.session-status.online {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #027a48;
}

.session-status.offline {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* ============== ADMIN TERMINAL MODAL ============== */
.modal-terminal {
    max-width: 950px;
    width: 95%;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-terminal .modal-header {
    flex-shrink: 0;
    background: #1a1a2e;
    border-bottom: 1px solid #2d2d44;
}

.modal-terminal .modal-header h3 {
    color: #4ecca3;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.modal-terminal .modal-close {
    color: #888;
}

.modal-terminal .modal-close:hover {
    color: #fff;
}

.terminal-body {
    flex: 1;
    padding: 0 !important;
    overflow: hidden;
    background: #0d0d0d;
    max-height: none;
}

#admin-terminal,
#client-terminal {
    height: 100%;
    width: 100%;
}

#admin-terminal .xterm,
#client-terminal .xterm {
    height: 100%;
    padding: 8px;
}

/* Mobile terminal modal - 70% height, centered */
@media (max-width: 768px) {

    /* Parent modal: center content */
    #admin-terminal-modal.modal,
    #client-terminal-modal.modal {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    /* Terminal content: 70% of screen, centered */
    #admin-terminal-modal .modal-terminal,
    #client-terminal-modal .modal-terminal {
        width: calc(100% - 32px);
        height: 70vh;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 16px;
        margin: 0;
        display: flex;
        flex-direction: column;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    }

    /* Header: always visible at top */
    .modal-terminal .modal-header {
        padding: 14px 16px;
        min-height: 52px;
        background: #1a1a2e;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-radius: 16px 16px 0 0;
    }

    .modal-terminal .modal-header h3 {
        font-size: 15px;
        margin: 0;
    }

    /* Close button: large touch target */
    .modal-terminal .modal-close {
        font-size: 32px;
        padding: 8px;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: -8px;
        color: #aaa;
    }

    /* Terminal body fills remaining space */
    .modal-terminal .terminal-body {
        flex: 1;
        min-height: 0;
    }

    #admin-terminal .xterm,
    #client-terminal .xterm {
        padding: 4px;
    }
}

/* ============== COMMAND SHORTCUTS PANEL ============== */
.terminal-cmd-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1a1a2e;
    border-bottom: 1px solid #2d2d44;
    flex-shrink: 0;
}

.cmd-search-wrapper {
    flex: 1;
    position: relative;
}

.cmd-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #2d2d44;
    border-radius: 6px;
    background: #0d0d0d;
    color: #e0e0e0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.cmd-search::placeholder {
    color: #666;
}

.cmd-search:focus {
    outline: none;
    border-color: #4ecca3;
}

.cmd-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid #2d2d44;
    border-radius: 6px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cmd-dropdown.hidden {
    display: none;
}

.cmd-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #2d2d44;
    transition: background 0.15s;
}

.cmd-dropdown-item:last-child {
    border-bottom: none;
}

.cmd-dropdown-item:hover,
.cmd-dropdown-item.selected {
    background: #2d2d44;
}

.cmd-dropdown-item .cmd-name {
    color: #4ecca3;
    font-weight: 600;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.cmd-dropdown-item .cmd-preview {
    color: #888;
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cmd-dropdown-item .cmd-info {
    flex: 1;
    min-width: 0;
}

.cmd-dropdown-item .cmd-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cmd-action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.cmd-action-btn.cmd-run {
    background: #2d5a4a;
    color: #4ecca3;
}

.cmd-action-btn.cmd-run:hover {
    background: #4ecca3;
    color: #0d0d0d;
}

.cmd-action-btn.cmd-edit {
    background: #4a4a2d;
    color: #eccc4e;
}

.cmd-action-btn.cmd-edit:hover {
    background: #eccc4e;
    color: #0d0d0d;
}

.cmd-action-btn.cmd-delete {
    background: #5a2d2d;
    color: #ec4e4e;
}

.cmd-action-btn.cmd-delete:hover {
    background: #ec4e4e;
    color: #0d0d0d;
}

.btn-cmd {
    padding: 8px 12px;
    background: #2d2d44;
    border: 1px solid #3d3d54;
    border-radius: 6px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.15s;
    min-width: 38px;
}

.btn-cmd:hover {
    background: #3d3d54;
    border-color: #4ecca3;
    color: #4ecca3;
}

/* Shortcuts List (Manage Modal) */
.shortcuts-list {
    max-height: 400px;
    overflow-y: auto;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    background: var(--bg);
}

.shortcut-info {
    flex: 1;
}

.shortcut-name {
    font-weight: 600;
    color: var(--primary);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.shortcut-commands {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 60px;
    overflow: hidden;
}

.shortcut-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
}

.shortcuts-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

/* ============== SSH SERVERS LIST (Admin Panel) ============== */
.ssh-servers-list {
    margin-bottom: 12px;
}

.ssh-server-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--bg);
    overflow: hidden;
}

.ssh-server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.ssh-server-title {
    font-weight: 600;
    color: #000000;
}

.ssh-server-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ssh-default-badge {
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ssh-server-fields {
    padding: 12px;
}

.ssh-server-fields .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.ssh-server-fields .form-row.three {
    grid-template-columns: repeat(3, 1fr);
}

.ssh-server-fields .form-row.four {
    grid-template-columns: repeat(4, 1fr);
}

.ssh-server-fields .form-row.five {
    grid-template-columns: repeat(5, 1fr);
}

.ssh-server-fields .form-row.single {
    grid-template-columns: 1fr;
}

.ssh-server-fields .form-group {
    margin-bottom: 0;
}

.ssh-server-fields label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #000000;
}

.ssh-server-fields input[type="text"],
.ssh-server-fields input[type="number"],
.ssh-server-fields input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
}

.ssh-server-fields select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
}

/* Force all text in SSH server cards to be black */
.ssh-server-row,
.ssh-server-row * {
    color: #000000;
}

.ssh-server-row .btn,
.ssh-server-row .ssh-default-badge {
    color: #ffffff;
}

.ssh-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

/* ============== CONTROL ROW (Client Dashboard) ============== */
.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

/* Hidden on desktop, used for mobile row break */
.mobile-row-break {
    display: none;
}

/* Divider between control elements - removed, no longer used */

.server-dropdown {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: none;
    border-radius: 50px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.server-dropdown:focus {
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Control buttons - tab-btn style (matching miner tabs) */
.ctrl-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ctrl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ctrl-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ctrl-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* All ctrl-btn SVG icons */
.ctrl-btn img {
    width: 20px;
    height: 20px;
    transition: all 0.2s ease;
}

/* Terminal - dark style (active-like) */
.ctrl-terminal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.ctrl-terminal img {
    filter: brightness(0) saturate(100%) invert(54%) sepia(14%) saturate(456%) hue-rotate(182deg) brightness(88%) contrast(86%);
}

.ctrl-terminal:not(:disabled) {
    border-color: #22c55e;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.2);
}

.ctrl-terminal:not(:disabled) img {
    filter: brightness(0) saturate(100%) invert(75%) sepia(54%) saturate(449%) hue-rotate(87deg) brightness(98%) contrast(88%);
}

.ctrl-terminal:not(:disabled):hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

/* Connection Method Toggle Button (WS/SSH) - single button that toggles */
.conn-toggle-btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #ffffff;
    border: none;
    min-width: 60px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conn-toggle-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.conn-toggle-btn:active {
    transform: translateY(0);
}

/* WS mode - indigo/purple */
.conn-toggle-btn.ws {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.conn-toggle-btn.ws:hover {
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

/* SSH mode - green */
.conn-toggle-btn.ssh {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.conn-toggle-btn.ssh:hover {
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.5);
}

/* Disabled state - grayed out */
.conn-toggle-btn.disabled,
.conn-toggle-btn:disabled {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3);
    cursor: not-allowed;
    opacity: 0.7;
}

.conn-toggle-btn.disabled:hover,
.conn-toggle-btn:disabled:hover {
    transform: none;
    filter: none;
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3);
}

/* Refresh - blue active style */
.ctrl-refresh {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.ctrl-refresh:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

/* Refresh icon - white for blue background */
.ctrl-refresh img {
    filter: brightness(0) invert(1);
}

/* Restart - orange active style */
.ctrl-restart {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    border-color: #ea580c;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.ctrl-restart:hover:not(:disabled) {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.5);
}

/* Restart icon - white for orange background */
.ctrl-restart img {
    filter: brightness(0) invert(1);
}

@media (max-width: 768px) {

    .ssh-server-fields .form-row,
    .ssh-server-fields .form-row.three,
    .ssh-server-fields .form-row.four,
    .ssh-server-fields .form-row.five,
    .ssh-server-fields .form-row.single {
        grid-template-columns: 1fr;
    }

    .control-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Hide divider on mobile */
    .control-row .control-divider {
        display: none;
    }

    /* Row 1: Dropdown + SSH toggle */
    .server-dropdown {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        order: 1;
    }

    .conn-toggle-btn {
        flex-shrink: 0;
        order: 2;
    }

    /* Line break after SSH toggle - forces row 2 */
    .mobile-row-break {
        display: block;
        flex-basis: 100%;
        height: 0;
        order: 3;
    }

    /* Row 2: Refresh, Restart on left, Terminal on right */
    .ctrl-refresh {
        order: 4;
    }

    .ctrl-restart {
        order: 5;
    }

    .ctrl-terminal {
        order: 6;
        margin-left: auto;
        /* Push terminal to the right */
    }

    .ctrl-btn {
        flex: none;
    }
}

@media (max-width: 768px) {
    .terminal-cmd-panel {
        padding: 10px 12px;
        gap: 8px;
        min-height: 48px;
        flex-shrink: 0;
        background: #1a1a2e;
        border-bottom: 1px solid #2d2d44;
    }

    .cmd-search {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    .btn-cmd {
        padding: 10px 14px;
        font-size: 16px;
        min-width: 44px;
        min-height: 44px;
    }

    .shortcut-item {
        flex-direction: column;
    }

    .shortcut-actions {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============== CLIENT CARD V2 (with SSH boxes) ============== */
.clients-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 8px;
    gap: 16px;
    padding: 16px;
    align-items: start;
}

.client-card-v2 {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    margin: 0;
}

.client-card-v2:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.client-card-v2.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.card-header-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-btns-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-sep {
    color: var(--border);
    font-size: 14px;
    margin: 0 2px;
}

.card-nickname {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.card-drag-handle {
    color: var(--text-muted);
    font-size: 16px;
    cursor: grab;
    user-select: none;
    padding: 2px 4px;
    border-radius: 6px;
}

.card-drag-handle:active {
    cursor: grabbing;
}

.client-card-v2.dragging {
    opacity: 0.6;
}

.client-card-v2.card-ghost {
    opacity: 0.4;
}

.client-card-v2.card-chosen {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.client-card-v2.card-dragging {
    opacity: 0.8;
}

.user-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
    pointer-events: none;
    vertical-align: middle;
    object-fit: cover;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}

.status-text.online {
    color: #4ade80;
}

.status-text.offline {
    color: #9ca3af;
}

.status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
    }
}

.status-dot.offline {
    background: #9ca3af;
}

.online-badge {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-actions .notify-btn {
    margin-right: 0;
    padding: 0;
}

.card-btn,
.card-session-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.card-btn:hover,
.card-session-btn:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

.card-session-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

/* iOS Toggle Switch */
.ios-toggle {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 16px;
    cursor: pointer;
}

.ios-toggle .toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #4b5563;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked+.toggle-slider {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.toggle-input:checked+.toggle-slider:before {
    transform: translateX(12px);
}

.card-note {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

/* Profile Boxes Container (client SSH/WS/SH profiles) */
.profile-boxes-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
}

.profile-box {
    background: #f0f8ff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 10px 12px;
    width: 100%;
    min-width: 0;
    flex: none;
    transition: all 0.15s;
    color: #000000;
}

.profile-box:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #f8f8f8;
}

.profile-box.profile-box-expired {
    opacity: 0.6;
    border-color: #ef4444;
}

.profile-box.has-ws {
    border-left: 3px solid #3b82f6;
}

/* Profile Box Row 1: icon, name, separator, days, copy button */
.profile-box-row1 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

/* WebSocket Row */
.profile-box-row-ws {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    margin-bottom: 4px;
    font-size: 13px;
}

.ws-icon {
    font-size: 13px;
}

.ws-ip-link {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 11px;
    color: #000000;
}

.ws-ip-link.clickable {
    color: #000000;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.ws-ip-link.clickable:hover {
    color: #333333;
    text-decoration-style: solid;
}

.ws-rate {
    margin-left: auto;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: #059669;
    font-weight: 500;
    background: #d1fae5;
    padding: 1px 6px;
    border-radius: 4px;
}

.ws-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
}

.ws-status.ws-online {
    color: #22c55e;
}

.ws-status.ws-offline {
    color: #94a3b8;
}

/* Offline text styling for IP display */
.ws-ip-link.ws-offline-text,
.ws-offline-text {
    color: #ef4444;
    font-style: italic;
}

/* IP display styling: primary (black), secondary (gray) */
.ip-primary {
    color: #000000;
}

.ip-secondary {
    color: #6b7280;
}

.ip-separator {
    color: #9ca3af;
}

.ws-btn {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.ws-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ws-btn.ws-on img {
    filter: none;
}

.ws-btn.ws-off img {
    filter: grayscale(100%) opacity(0.5);
}

.profile-icon {
    font-size: 13px;
}

/* Profile Box Row 2: ip:port, copy, actions on right */
.profile-box-row2 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-box-name {
    font-weight: 600;
    font-size: 14px;
    color: #000000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-box-sep {
    color: #000000;
    font-size: 14px;
}

.profile-box-icon {
    width: 24px;
    height: 20px;
    border-radius: 4px;
}

/* Small button icons */
.btn-icon-sm {
    width: 24px;
    height: 20px;
    display: block;
    border-radius: 4px;
}

.profile-box-days {
    color: #000000;
    font-weight: 500;
    font-size: 13px;
}

.profile-box-miner-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 9px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-box-spacer {
    flex: 1;
}

/* Legacy - can be removed */
.profile-box-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #000000;
}

.profile-copy-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.profile-copy-btn:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

.expired-text {
    color: #c0392b;
    font-weight: 500;
}

.profile-box-ip {
    font-size: 11px;
    color: #000000;
    font-family: 'Monaco', 'Menlo', monospace;
    margin-bottom: 8px;
}

/* IP row with clickable link and copy button */
.profile-box-ip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.profile-ip-link {
    font-size: 11px;
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', monospace;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    transition: color 0.15s;
}

.profile-ip-link:hover {
    color: #374151;
    text-decoration-style: solid;
}

.copy-ip-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.copy-ip-btn:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

.profile-box-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* Copy SSH Modal - Modern Design */
.copy-ssh-modal-content {
    width: 420px;
    max-width: 95vw;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.copy-ssh-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.copy-ssh-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.copy-ssh-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.copy-ssh-title {
    flex: 1;
    min-width: 0;
}

.copy-ssh-title h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.copy-ssh-title p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.copy-ssh-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.copy-ssh-close svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.copy-ssh-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.copy-ssh-close:hover svg {
    color: var(--text);
}

.copy-ssh-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.copy-ssh-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-ssh-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.copy-ssh-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.copy-ssh-field input::placeholder {
    color: var(--text-muted);
}

.copy-ssh-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(99, 102, 241, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.copy-ssh-toggle-text {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.toggle-switch-label {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: all 0.25s ease;
}

.toggle-switch-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch-label input:checked+.toggle-switch-slider {
    background: var(--primary);
}

.toggle-switch-label input:checked+.toggle-switch-slider::before {
    transform: translateX(20px);
}

.copy-ssh-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-ssh-targets {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
}

.copy-ssh-target {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.copy-ssh-target:hover {
    background: rgba(99, 102, 241, 0.04);
}

.copy-ssh-target:has(input:checked) {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.copy-ssh-target input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.copy-ssh-target label {
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    flex: 1;
    font-weight: 500;
}

.copy-ssh-result {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.copy-ssh-result.success {
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.copy-ssh-result.error {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.copy-ssh-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #f8fafc;
}

.copy-ssh-btn-cancel {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-ssh-btn-cancel:hover {
    background: var(--bg-input);
    border-color: #94a3b8;
}

.copy-ssh-btn-confirm {
    flex: 1.5;
    padding: 12px 20px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.copy-ssh-btn-confirm svg {
    width: 18px;
    height: 18px;
}

.copy-ssh-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.copy-ssh-btn-confirm:active {
    transform: translateY(0);
}

/* Profile action buttons - small icons/text */
.terminal-btn {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    padding: 0;
    width: 24px;
    height: 23px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.terminal-btn img {
    width: 24px;
    height: 23px;
}

/* WS and SH text buttons */
.wsc-btn,
.sshc-btn {
    border: none;
    outline: none;
    box-shadow: none;
    padding: 0;
    width: 24px;
    height: 20px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* WS button colors */
.wsc-btn.wsc-on {
    background: #28a745;
    color: white;
}

.wsc-btn.wsc-off {
    background: #6c757d;
    color: #ccc;
}

/* SH button colors */
.sshc-btn.sshc-on {
    background: #17a2b8;
    color: white;
}

.sshc-btn.sshc-off {
    background: #6c757d;
    color: #ccc;
}

.terminal-btn:hover,
.wsc-btn:hover,
.sshc-btn:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

/* Icon ON states - full color */
.terminal-btn.terminal-on img,
.notify-btn.notify-on img {
    filter: none;
}

/* Icon OFF states - grayscale */
.terminal-btn.terminal-off img,
.notify-btn.notify-off img {
    filter: grayscale(100%) opacity(0.5);
}

/* Notify button - icon style (no background) */
.notify-btn {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.notify-btn:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

/* Disabled button states - No SSH credentials */
.terminal-btn.terminal-disabled,
.sshc-btn.sshc-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.terminal-btn.terminal-disabled:hover,
.sshc-btn.sshc-disabled:hover {
    transform: none;
}

.terminal-btn.terminal-disabled img {
    filter: grayscale(100%) opacity(0.5);
}

.sshc-btn.sshc-disabled {
    background: #6c757d;
    color: #999;
}

/* No SSH text styling */
.no-ssh-text {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

.no-ssh-link {
    cursor: default;
    pointer-events: none;
}

/* Disabled WS button state - No miner linked */
.wsc-btn.wsc-disabled {
    cursor: not-allowed;
    opacity: 0.4;
    background: #6c757d;
    color: #999;
}

.wsc-btn.wsc-disabled:hover {
    transform: none;
}

/* No WS text styling */
.no-ws-text {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

/* SSH Connection Icon (replaces SH button) */
.sshc-icon {
    font-size: 16px;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

.sshc-icon.sshc-on {
    opacity: 1;
}

.sshc-icon.sshc-on:hover {
    transform: scale(1.2);
}

.sshc-icon.sshc-off {
    opacity: 0.5;
    filter: grayscale(50%);
}

.sshc-icon.sshc-off:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.sshc-icon.sshc-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* WebSocket Connection Icon (replaces WS button) */
.wsc-icon {
    font-size: 16px;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

.wsc-icon.wsc-on {
    opacity: 1;
}

.wsc-icon.wsc-on:hover {
    transform: scale(1.2);
}

.wsc-icon.wsc-off {
    opacity: 0.5;
    filter: grayscale(50%);
}

.wsc-icon.wsc-off:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.wsc-icon.wsc-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.expiring-soon {
    color: #f97316;
    font-weight: 500;
}

.no-ssh {
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px;
    text-align: center;
    width: 100%;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.card-footer-left,
.card-footer-group {
    display: flex;
    gap: 2px;
    align-items: center;
}

.card-footer-sep {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.card-footer .notify-btn {
    margin-right: 0;
    padding: 10px 14px;
    font-size: 16px;
}

.card-footer .card-action-btn {
    padding: 8px 10px;
}

.card-action-btn {
    flex: 0;
    padding: 10px 14px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: none;
}

.card-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.card-action-btn.btn-danger {
    background: transparent;
    box-shadow: none;
}

.card-action-btn.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.card-action-btn.btn-message {
    background: transparent;
    box-shadow: none;
}

.card-action-btn.btn-message:hover {
    background: rgba(139, 92, 246, 0.15);
}

/* SSH Server Form - datetime inputs */
.ssh-server-fields input[type="datetime-local"] {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
}

@media (max-width: 768px) {
    .clients-cards-grid {
        column-width: auto;
        column-count: 1;
        padding: 12px;
    }

    .profile-boxes-container {
        flex-direction: column;
    }

    .profile-box {
        min-width: 100%;
    }
}

/* ============== MODERN SETTINGS DESIGN ============== */
.settings-modern {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

/* Accordion Section */
.settings-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.settings-section:hover {
    border-color: var(--border-hover, rgba(255, 255, 255, 0.15));
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.settings-section-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.section-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15), rgba(0, 242, 254, 0.08));
    border-radius: 12px;
    flex-shrink: 0;
}

.section-title {
    flex: 1;
    min-width: 0;
}

.section-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.section-chevron {
    font-size: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.settings-section.open .section-chevron {
    transform: rotate(90deg);
}

.settings-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
}

.settings-section.open .settings-section-body {
    max-height: 500px;
    padding: 0 20px 20px;
}

/* Modern Form Styles */
.settings-form-modern {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-field {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field-short {
    flex: 0 0 130px;
    min-width: 100px;
}

.form-field-wide {
    flex: 2;
    min-width: 180px;
}

.form-field-file {
    flex: 1;
    min-width: 140px;
}

.form-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field input[type="text"],
.form-field input[type="password"] {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15);
}

.form-field input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* File Upload Modern */
.file-upload-modern {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-modern:hover {
    border-color: var(--primary);
    background: rgba(79, 172, 254, 0.05);
}

.file-upload-modern input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-modern .file-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* Password field adjustments */
.form-field .password-field {
    width: 100%;
}

.form-field .password-field input {
    padding: 10px 40px 10px 14px;
    font-size: 14px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.form-actions-split {
    justify-content: space-between;
}

/* Telegram Config Modern */
.telegram-config-modern {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
}

.form-row-telegram {
    display: flex;
    gap: 12px;
}

/* Notify Chips */
.notify-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notify-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: var(--text);
}

.notify-chip:hover {
    border-color: var(--primary);
    background: rgba(79, 172, 254, 0.08);
}

.notify-chip input[type="checkbox"] {
    display: none;
}

.notify-chip:has(input:checked) {
    background: rgba(79, 172, 254, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.notify-chip-with-input input[type="number"] {
    width: 45px;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    text-align: center;
}

/* SSH Keys List Modern */
.ssh-keys-list-modern {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.ssh-keys-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 8px 0;
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* Toggle in header */
.settings-section-header .ios-toggle {
    margin-right: 8px;
    transform: scale(0.9);
}

/* Config Subsection Accordion (nested inside settings-section) */
.config-subsection {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.config-subsection:last-of-type {
    margin-bottom: 16px;
}

.config-subsection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.config-subsection-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.subsection-chevron {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    width: 14px;
}

.config-subsection.open .subsection-chevron {
    transform: rotate(90deg);
}

.subsection-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.config-subsection-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    padding: 0 14px;
}

.config-subsection.open .config-subsection-body {
    max-height: 800px;
    padding: 0 14px 14px;
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-field label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-field input,
.config-field select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg, rgba(0, 0, 0, 0.3));
    color: var(--text);
    font-size: 13px;
}

.config-field input:focus,
.config-field select:focus {
    outline: none;
    border-color: var(--accent);
}

.config-field.config-field-wide {
    grid-column: 1 / -1;
}

.subsection-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Wider max-height for default config section */
.settings-section[data-section="default-config"].open .settings-section-body {
    max-height: 1200px;
}

/* ============== SETTINGS MOBILE RESPONSIVE ============== */
@media (max-width: 700px) {
    .settings-modern {
        padding: 0;
        gap: 10px;
    }

    .settings-section {
        border-radius: 14px;
    }

    .settings-section-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .section-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
        border-radius: 10px;
    }

    .section-title h3 {
        font-size: 15px;
    }

    .section-subtitle {
        font-size: 12px;
    }

    .settings-section-body {
        padding: 0 16px;
    }

    .settings-section.open .settings-section-body {
        padding: 0 16px 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .form-field,
    .form-field-short,
    .form-field-wide,
    .form-field-file {
        flex: 1;
        min-width: 100%;
    }

    .form-row-telegram {
        flex-direction: column;
    }

    .telegram-config-modern {
        padding: 12px;
    }

    .notify-options {
        gap: 6px;
    }

    .notify-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .form-actions-split {
        flex-direction: row;
    }

    .form-actions-split .btn {
        flex: 1;
    }

    .settings-section-header .ios-toggle {
        transform: scale(0.8);
    }
}

/* Keep some legacy styles for compatibility */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 900px;
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.settings-card-wide {
    grid-column: 1 / -1;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.settings-icon {
    font-size: 18px;
}

.settings-card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.settings-form-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group-compact label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group-compact input[type="text"],
.form-group-compact input[type="password"],
.form-group-compact input[type="file"] {
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.form-group-compact .password-field input {
    padding: 8px 10px;
    font-size: 13px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
}

.ios-toggle-sm {
    transform: scale(0.85);
    margin-left: auto;
}

.telegram-config-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
}

.telegram-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.telegram-events-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.telegram-events-row .btn {
    margin-left: auto;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.checkbox-inline span {
    color: var(--text);
}

.ssh-keys-list-compact {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.ssh-keys-empty {
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 700px) {
    .container {
        padding: 12px 8px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .settings-card {
        padding: 12px;
        border-radius: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .settings-card-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .settings-card-header h3 {
        font-size: 14px;
    }

    .settings-icon {
        font-size: 16px;
    }

    .settings-form-compact {
        width: 100%;
        box-sizing: border-box;
    }

    .form-group-compact {
        width: 100%;
        box-sizing: border-box;
    }

    .form-group-compact input[type="text"],
    .form-group-compact input[type="password"],
    .form-group-compact input[type="file"] {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 10px;
        font-size: 14px;
    }

    .telegram-config-compact {
        padding: 10px;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .telegram-fields-row {
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .telegram-events-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .telegram-events-row .checkbox-inline {
        width: auto;
        flex-shrink: 0;
    }

    /* Best zero checkbox + number inline */
    .telegram-events-row .checkbox-inline:has(#notify-best-zero) {
        display: flex;
        align-items: center;
    }

    .telegram-events-row input[type="number"] {
        width: 55px !important;
        min-width: 55px;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .telegram-events-row .btn {
        margin-left: auto;
        width: auto;
        margin-top: 0;
        flex-shrink: 0;
    }

    .form-group-compact label {
        font-size: 10px;
    }

    .settings-form-compact .btn {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 12px 16px;
        font-size: 14px;
    }

    .password-field {
        width: 100%;
        box-sizing: border-box;
    }

    .password-field input {
        width: 100%;
        box-sizing: border-box;
    }

    .ssh-keys-list-compact {
        font-size: 11px;
        width: 100%;
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-break: break-all;
    }

    /* SSH key item mobile layout */
    .ssh-key-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
    }

    .ssh-key-info {
        flex: 1 1 calc(100% - 70px);
        min-width: 0;
    }

    .ssh-key-actions {
        flex-shrink: 0;
    }

    .ssh-key-actions .btn {
        white-space: nowrap;
        padding: 4px 10px;
        font-size: 12px;
        min-width: 50px;
    }

    .ios-toggle-sm {
        transform: scale(0.8);
    }
}

/* Legacy settings-section-old (keep for compatibility) */
.settings-section-old {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    max-width: 600px;
}

.settings-section-old h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-form .form-group {
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.toggle-label span {
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.checkbox-label span {
    color: var(--text);
}

.telegram-config {
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
    margin-top: 8px;
}

.telegram-config h4 {
    margin: 16px 0 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.telegram-config.hidden {
    display: none;
}

/* SSH Keys Settings */
.ssh-keys-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.ssh-key-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.ssh-key-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ssh-key-name {
    font-weight: 600;
    color: var(--text);
}

.ssh-key-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.ssh-key-fp {
    font-family: monospace;
}

.ssh-keys-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 10px;
}

/* iOS Toggle Switch */
.ios-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.ios-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ios-toggle input:checked+.toggle-slider {
    background: linear-gradient(135deg, #10b981, #059669);
}

.ios-toggle input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

/* Toggle pending state - disabled while waiting for status */
.ios-toggle.toggle-pending {
    opacity: 0.8;
    pointer-events: none;
}

/* Keep green color when toggle is ON during pending */
.ios-toggle.toggle-pending.pending-on .toggle-slider {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

/* Keep gray color when toggle is OFF during pending */
.ios-toggle.toggle-pending.pending-off .toggle-slider {
    background-color: #4b5563 !important;
}

.ios-toggle.toggle-pending .toggle-slider:before {
    /* Hide the knob during countdown */
    opacity: 0;
}

/* Countdown display ON the toggle slider (centered) */
.ios-toggle.toggle-pending .toggle-slider[data-countdown]::after {
    content: attr(data-countdown);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    z-index: 10;
}

@keyframes toggle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Button pending state */
.btn-pending {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    background: #6366f1 !important;
}

/* Restart button specific pending state - RED/ORANGE color */
.node-restart-btn.btn-pending {
    background: #ef4444 !important;
    opacity: 1 !important;
}

/* Countdown display ON the pending button (centered) - override tooltip ::after */
.btn-pending[data-countdown]::after,
.icon-btn.btn-pending[data-countdown]::after,
.icon-btn.btn-pending[data-tip][data-countdown]::after,
.node-restart-btn.btn-pending[data-countdown]::after {
    content: attr(data-countdown) !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: white !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
    z-index: 100 !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    white-space: normal !important;
    pointer-events: none !important;
}

/* Hide tooltip arrow during pending */
.btn-pending[data-countdown]::before,
.icon-btn.btn-pending[data-countdown]::before,
.icon-btn.btn-pending[data-tip][data-countdown]::before,
.node-restart-btn.btn-pending[data-countdown]::before {
    display: none !important;
    opacity: 0 !important;
}

/* Hide icon during countdown */
.btn-pending .btn-icon,
.btn-pending img {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Section Header with inline button */
.section-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
}

/* Add Button (transparent, inline) */
.add-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.add-btn img {
    width: 40px;
    height: 40px;
}

.add-btn:hover {
    transform: scale(1.1);
}

.add-btn:active {
    transform: scale(0.95);
}

/* Keep FAB styles for backwards compat but hidden */
.fab-btn {
    display: none;
}

/* Large Modal for Client Form */
.modal-large {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .fab-btn {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 28px;
    }

    .modal-large {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
}

/* ============== MOBILE VIRTUAL KEYBOARD TOOLBAR ============== */
.vkey-toolbar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    background: #1a1a2e;
    border-bottom: 1px solid #333;
}

.vkey-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: center;
}

.vkey-btn {
    padding: 6px 10px;
    min-width: 32px;
    border: 1px solid #444;
    border-radius: 6px;
    background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.1s;
    flex-shrink: 1;
}

.vkey-btn:active {
    background: linear-gradient(135deg, #4ecca3 0%, #38a169 100%);
    transform: scale(0.95);
}

.vkey-btn.vkey-mod {
    background: linear-gradient(135deg, #3d3d5c 0%, #2d2d44 100%);
}

.vkey-btn.vkey-mod.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
}

.vkey-btn.vkey-danger:active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ef4444 100%);
}

/* ============== DROPDOWN MENU ============== */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 160px;
    overflow: hidden;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-item:disabled:hover {
    background: none;
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.miner-action-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.miner-action-menu .dropdown-row {
    display: flex;
    gap: 4px;
    padding: 4px;
}

.miner-action-menu .dropdown-item-half {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 4px;
}

.menu-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Magic link dropdown icons */
#magic-link-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.85;
}

.dropdown-item.text-danger .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(36%) sepia(93%) saturate(1352%) hue-rotate(331deg) brightness(91%) contrast(101%);
}

/* Magic link button indicator */
.magic-link-btn {
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.2s;
}

.magic-link-btn.has-link {
    opacity: 1;
    filter: none;
    color: #10b981;
}

.magic-link-btn:hover {
    opacity: 0.8;
}

/* ============== TOAST NOTIFICATION ============== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============== MINERS TAB ============== */
.miners-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 4px;
    padding: 0 4px;
}

.miners-toolbar-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Unified Miner Toolbar Button Style */
.miners-toolbar .icon-btn,
.miners-toolbar .btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(16, 24, 40, 0.1);
    transition: all 0.2s ease;
}

.miners-toolbar .icon-btn:hover,
.miners-toolbar .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.15);
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.miners-toolbar .icon-btn:active,
.miners-toolbar .btn:active {
    transform: translateY(0);
}

.miners-toolbar .icon-btn img,
.miners-toolbar .btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Broadcast button in section header - same style */
.miners-section-header .broadcast-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(16, 24, 40, 0.1);
    transition: all 0.2s ease;
    font-size: 0;
}

.miners-section-header .broadcast-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.15);
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.miners-section-header .broadcast-btn img {
    width: 22px;
    height: 22px;
}

.miners-section {
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 24, 40, 0.05);
}

.miners-section-online {
    border-left: 4px solid #22c55e;
}

.miners-section-offline {
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
}

.miners-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 8px;
}

.miners-header-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.miners-inline-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.miners-inline-sep {
    font-size: 12px;
    color: var(--text-muted);
}

.miners-section-header h3 {
    font-size: 14px;
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.miners-section-online .miners-section-header h3 {
    color: #15803d;
}

.miners-section-offline .miners-section-header h3 {
    color: #475569;
}

.miners-section-online .miners-inline-label {
    color: #22c55e;
}

.miners-broadcast-group {
    display: flex;
    gap: 8px;
}

.miners-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 0 2px;
    align-items: flex-start;
    align-content: flex-start;
}

.miners-grid .miner-card {
    flex: 0 0 calc(25% - 9px);
    min-width: 240px;
    max-width: 320px;
}

.miners-grid-offline .miner-card {
    opacity: 0.7;
    filter: grayscale(0.1);
}

.miner-card {
    position: relative;
    background: #f0f8ff;
    border-radius: var(--radius);
    padding: 12px;
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
}

.miner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.miner-card.paused {
    opacity: 0.7;
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
}

.miner-card.is-linked {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-card) 100%);
    border-color: rgba(59, 130, 246, 0.35);
}

.miner-card.is-linked:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

.miner-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.miner-linked-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.miner-linked-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.miner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.miner-id {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.miner-drag-handle {
    color: var(--text-muted);
    font-size: 14px;
    cursor: grab;
    user-select: none;
}

.miner-drag-handle:active {
    cursor: grabbing;
}

.miner-card.card-ghost {
    opacity: 0.4;
}

.miner-card.card-chosen {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.miner-card.card-dragging {
    opacity: 0.8;
}

.miner-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.miner-status.status-online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.miner-status.status-paused {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.miner-status.status-pausing,
.miner-status.status-restarting {
    background: #f59e0b;
    animation: pulse 1.2s infinite;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.miner-status.status-stopped {
    background: #94a3b8;
    box-shadow: 0 0 6px rgba(148, 163, 184, 0.4);
}

.miner-status.status-connecting {
    background: #6b7280;
    animation: pulse 1.5s infinite;
}

.miner-status.status-offline {
    background: #9ca3af;
}

.miner-status.status-unknown {
    background: #6b7280;
}

.miner-bot-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.miner-beta-badge {
    position: absolute;
    bottom: -2px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #22c55e;
    border-radius: 3px;
    padding: 0 3px;
    line-height: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Miners Sort Dropdown */

.miners-header-divider {
    margin: 0 10px;
    color: #111;
    font-weight: 700;
    font-size: 18px;
    opacity: 1;
    letter-spacing: 0.5px;
}

.miners-sort-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
}

.miners-sort-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
}


.miners-sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 28px 4px 10px;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(59,130,246,0.10);
    transition: all 0.16s cubic-bezier(.4,0,.2,1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 110px;
}

.miners-sort-select:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.miners-sort-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}

.miners-sort-select option {
    background: #2563eb;
    color: #fff;
    padding: 7px 10px;
    font-size: 13px;
}

.miner-delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

.miner-delete-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15);
}

.client-user-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.miner-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.miner-name.editable-name {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s, color 0.2s;
}

.miner-name.editable-name:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.miner-state {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.miner-state--mining {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.25);
}

.miner-state--updating {
    background: rgba(6, 182, 212, 0.12);
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.3);
}

.miner-state--stale {
    background: rgba(139, 0, 0, 0.25);
    color: #6B0000;
    border-color: rgba(139, 0, 0, 0.6);
    animation: pulse-warning 1.5s ease-in-out infinite;
    font-weight: 700;
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.miner-state--paused {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.3);
}

.miner-state--pausing,
.miner-state--restarting,
.miner-state--resuming,
.miner-state--stopping {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.miner-state--stopped {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.35);
}

.miner-state--offline {
    background: rgba(148, 163, 184, 0.2);
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.4);
}

.miner-state--connecting,
.miner-state--unknown {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.3);
}

.miner-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.miner-quick {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
}

.quick-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.miner-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.miner-details details {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 8px;
}

.miner-details summary {
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.miner-pre {
    margin: 6px 0 0;
    font-family: monospace;
    font-size: 11px;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.miner-errors-pre {
    max-height: 200px;
    overflow-y: auto;
}

/* Errors container (uses divs instead of pre for colored lines) */
.miner-errors-container {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-top: 8px;
}

/* Miner Notes section */
.miner-notes-container {
    padding: 8px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-top: 8px;
}

.miner-notes-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    padding: 8px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
}

.miner-notes-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.miner-notes-textarea::placeholder {
    color: var(--text-muted);
}

.miner-notes-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    min-height: 16px;
}

/* Node Details section (same as miner-details) */
.node-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.node-details details {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 8px;
}

.node-details summary {
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Node Config section */
.node-config-section {
    margin-bottom: 4px;
}

.node-config-pre {
    padding: 8px;
    background: var(--bg-input);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    margin: 8px 0 0 0;
    max-height: 150px;
    overflow-y: auto;
}

/* Node Notes section (same as miner notes) */
.node-notes-container {
    padding: 8px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-top: 8px;
}

.node-notes-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 150px;
    padding: 8px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
}

.node-notes-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.node-notes-textarea::placeholder {
    color: var(--text-muted);
}

.node-notes-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    min-height: 16px;
}

/* Success badge (green) - no errors */
.success-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #22c55e;
    border-radius: 9px;
    margin-left: 6px;
    vertical-align: middle;
}

.errors-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #ef4444;
    border-radius: 9px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Clear errors button */
.clear-errors-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 2px 4px;
    margin-left: auto;
    float: right;
    font-size: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    vertical-align: middle;
}

.clear-errors-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Warning badge (orange/amber) */
.warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #f59e0b;
    border-radius: 9px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Critical badge (dark red/purple) */
.critical-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #dc2626;
    border-radius: 9px;
    margin-left: 6px;
    vertical-align: middle;
    animation: pulse-critical 1.5s infinite;
}

@keyframes pulse-critical {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Error line colors */
.error-line {
    padding: 2px 4px;
    margin: 1px 0;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.error-critical {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
    font-weight: 600;
    border-left: 3px solid #dc2626;
}

.error-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-left: 3px solid #ef4444;
}

.error-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-left: 3px solid #f59e0b;
}

.error-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-left: 3px solid #22c55e;
}

.no-errors {
    color: var(--text-muted);
    font-style: italic;
}

.quick-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.quick-box.full {
    grid-column: 1 / -1;
}

.quick-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}

.quick-value {
    color: var(--text);
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.quick-value.time-stale {
    color: #6B0000;
    font-weight: 700;
    background: rgba(139, 0, 0, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    animation: pulse-warning 1.5s ease-in-out infinite;
}

.quick-block-value {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-ip-value {
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-best {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(34, 197, 94, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.quick-best .quick-value {
    color: #16a34a;
}

.quick-best-value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Compact mode - hide everything except Best Zero */
.miners-compact .quick-row {
    display: none !important;
}

.miners-compact .miner-details {
    display: none !important;
}

.miners-compact .miner-actions {
    margin-top: 8px;
}

.miner-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.metric-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.metric-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.temp-warm {
    color: #f59e0b;
}

.temp-hot {
    color: #f87171;
}

.temp-critical {
    color: #dc2626;
}

.miner-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 4px;
}

.miner-card.is-offline {
    opacity: 0.7;
}

.miner-ip {
    font-family: monospace;
    font-size: 10px;
    overflow-wrap: anywhere;
}

.miner-version {
    opacity: 0.7;
    font-size: 10px;
}

.miner-actions {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.miner-actions .icon-btn {
    margin: 0;
    flex: 1;
    width: 100%;
}

.miner-actions-inline {
    justify-content: flex-start;
    gap: 8px;
}

.miner-actions-inline .icon-btn {
    flex: 0 0 auto;
    width: 34px;
}

.broadcast-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 34px;
    border-radius: 10px;
}

.broadcast-btn .btn-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.miner-actions .btn {
    flex: 1;
    min-width: 60px;
    padding: 5px 8px;
    font-size: 11px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.miner-actions .btn:hover:not(:disabled) {
    background: #fde68a;
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.btn-xs {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .miners-toolbar {
        flex-wrap: wrap;
    }

    /* Miners section header on mobile - match Nodes */
    #tab-miners .section-header {
        padding: 8px 0;
    }

    .miners-broadcast-group {
        flex-wrap: wrap;
    }

    .miners-grid {
        flex-direction: column;
        align-items: center;
    }

    .miners-grid .miner-card {
        flex: 0 0 auto;
        width: 95%;
        max-width: 350px;
    }
}

/* Miner Config Modal Overlay */
.miner-config-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.miner-config-modal {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

.miner-config-header {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.miner-config-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.miner-config-miner-name {
    font-size: 12px;
    opacity: 0.85;
    margin-left: auto;
    margin-right: 10px;
}

.miner-config-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.miner-config-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.miner-config-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
}

.miner-config-section {
    margin-bottom: 14px;
}

.miner-config-section:last-child {
    margin-bottom: 0;
}

.miner-config-section h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.miner-config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.miner-config-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.miner-config-field label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: help;
    position: relative;
}

.miner-config-field label[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #1e293b;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 4px;
}

.miner-config-field input,
.miner-config-field select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.miner-config-field input:focus,
.miner-config-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.miner-config-field input[type="number"] {
    font-family: monospace;
}

.miner-config-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--bg-secondary);
}

.miner-config-btn-cancel {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.miner-config-btn-cancel:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.miner-config-btn-reset {
    padding: 8px 16px;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    background: transparent;
    color: #f59e0b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.miner-config-btn-reset:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: #fbbf24;
}

.miner-config-btn-save {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.miner-config-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Wider modal for 3-tab layout */
.miner-config-modal-wide {
    max-width: 600px;
}

/* MEM_CFG Toggle at Top */
.miner-config-mem-toggle {
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.05));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.miner-config-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.miner-config-toggle-label input[type="checkbox"] {
    display: none;
}

.miner-config-toggle-slider {
    position: relative;
    width: 38px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    transition: background 0.25s;
}

.miner-config-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.miner-config-toggle-label input:checked+.miner-config-toggle-slider {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.miner-config-toggle-label input:checked+.miner-config-toggle-slider::after {
    transform: translateX(18px);
}

.miner-config-toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.miner-config-toggle-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Tab Navigation */
.miner-config-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
}

.miner-config-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.miner-config-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.miner-config-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.miner-config-tab i {
    font-size: 11px;
}

/* Tab Content */
.miner-config-tab-content {
    display: none;
}

.miner-config-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Grid adjustments for wide fields */
.miner-config-grid-single {
    grid-template-columns: 1fr;
}

.miner-config-field-wide {
    grid-column: 1 / -1;
}

.miner-config-input-mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
    font-size: 12px !important;
    letter-spacing: -0.3px;
}

/* Info Box for cfgU tab */
.miner-config-info-box {
    margin-top: 16px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.04));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.miner-config-info-box>i {
    color: var(--primary);
    font-size: 16px;
    margin-top: 2px;
}

.miner-config-info-box strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.miner-config-info-box p {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Section header with icon */
.miner-config-section h4 i {
    margin-right: 6px;
    opacity: 0.7;
}

@media (max-width: 500px) {
    .miner-config-grid {
        grid-template-columns: 1fr;
    }
}

/* Config Profiles Section */
.miner-config-profiles {
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(168, 85, 247, 0.04));
    border-top: 1px solid var(--border);
}

.miner-config-profiles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

.miner-config-profiles-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.miner-config-profiles-header h4 i {
    color: #8b5cf6;
}

.miner-config-profiles-hint {
    font-size: 10px;
    color: var(--text-muted);
}

.miner-config-profiles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.miner-config-profiles-empty {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
}

.miner-config-profile-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text);
    position: relative;
}

.miner-config-profile-item.is-current {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.08));
}

.miner-config-profile-item.is-current::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    background: #8b5cf6;
    border-radius: 50%;
}

.miner-config-profile-name {
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.miner-config-profile-actions {
    display: flex;
    gap: 4px;
    margin-left: 4px;
}

.miner-config-profile-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.15s;
}

.miner-config-profile-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.miner-config-profile-btn.btn-apply {
    color: #10b981;
}

.miner-config-profile-btn.btn-apply:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.miner-config-profile-btn.btn-current {
    color: #8b5cf6;
}

.miner-config-profile-btn.btn-current:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.miner-config-profile-btn.btn-delete {
    color: #ef4444;
}

.miner-config-profile-btn.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Save Profile Button */
.miner-config-btn-profile {
    padding: 8px 14px;
    border: 1px solid #8b5cf6;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.05));
    color: #8b5cf6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.miner-config-btn-profile:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.1));
    transform: translateY(-1px);
}

/* Save Profile Modal */
#save-profile-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.save-profile-modal {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 20px;
    width: 340px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.save-profile-header {
    padding: 24px 24px 16px;
    text-align: center;
}

.save-profile-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.save-profile-icon i {
    font-size: 24px;
    color: white;
}

.save-profile-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
}

.save-profile-header p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

.save-profile-body {
    padding: 0 24px 20px;
}

.save-profile-field {
    margin-bottom: 16px;
}

.save-profile-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 8px;
}

.save-profile-field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    font-size: 14px;
    color: #f1f5f9;
    transition: all 0.2s;
    box-sizing: border-box;
}

.save-profile-field input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.save-profile-field input::placeholder {
    color: #64748b;
}

.save-profile-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
}

.save-profile-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.save-profile-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #f1f5f9;
}

.save-profile-toggle-hint {
    font-size: 11px;
    color: #94a3b8;
}

.save-profile-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.save-profile-toggle input {
    display: none;
}

.save-profile-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    transition: all 0.25s;
}

.save-profile-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.25s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.save-profile-toggle input:checked+.save-profile-toggle-slider {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.save-profile-toggle input:checked+.save-profile-toggle-slider::before {
    transform: translateX(20px);
}

.save-profile-footer {
    padding: 16px 24px 20px;
    display: flex;
    gap: 10px;
}

.save-profile-btn-cancel {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.save-profile-btn-cancel:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #f1f5f9;
}

.save-profile-btn-save {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.save-profile-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* ============== LINK MINER MODAL - REDESIGNED ============== */

/* Modal structure - clean scroll behavior */
#link-miner-modal .modal-content {
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
}

#link-miner-modal .modal-header {
    flex-shrink: 0;
    padding: 20px 24px 16px;
    border-bottom: none;
    background: var(--bg-card);
}

#link-miner-modal .modal-header h3 {
    margin: 0 0 8px;
    font-size: 1.25em;
}

#link-miner-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 24px;
    background: var(--bg-card);
}

/* Miner info - horizontal layout */
.link-miner-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: var(--text-muted);
}

.link-miner-uuid {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: all;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.link-miner-uuid:hover {
    background: var(--primary);
    color: white;
}

.link-miner-uuid::after {
    content: '📋';
    font-size: 0.85em;
}

/* Miner Identity Modal - Modern Design */
.id-modal {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 20px;
    padding: 28px;
    width: 340px;
    max-width: 90vw;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.id-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.id-modal-close:hover {
    color: #f87171;
    transform: scale(1.1);
}

.id-card {
    margin-bottom: 8px;
}

.id-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.id-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.id-icon-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.id-icon-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.id-title {
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: 0.3px;
}

.id-input-group {
    display: flex;
    gap: 8px;
}

.id-input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s;
}

.id-input-group input::placeholder {
    color: #64748b;
}

.id-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.id-input-mono {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 12px !important;
}

.id-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.id-btn-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.id-btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.id-btn-orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.id-btn-orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.id-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 20px 0;
}

.id-uuid-box {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 14px;
}

.id-uuid-box:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.id-uuid-box span {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    color: #c4b5fd;
    word-break: break-all;
}

.id-copy-icon {
    color: #8b5cf6;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 10px;
}

.id-sub-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.id-hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 10px;
    text-align: center;
}

/* Info Grid for Identity Modal */
.id-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.id-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.id-info-label {
    font-size: 12px;
    color: #64748b;
}

.id-info-value {
    font-size: 12px;
    color: #e2e8f0;
    font-family: 'Monaco', 'Consolas', monospace;
}

.id-icon-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.id-icon-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Toggle Switch for Identity Modal */
.id-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    margin-left: auto;
}

.id-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.id-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.id-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2px;
    background: #64748b;
    border-radius: 50%;
    transition: all 0.3s;
}

.id-toggle input:checked+.id-toggle-slider {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.id-toggle input:checked+.id-toggle-slider:before {
    transform: translateX(20px);
    background: white;
}

/* Sub-toggle row for nested options */
.id-sub-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.id-sub-toggle-row .id-sub-label {
    margin-bottom: 0;
    font-size: 11px;
}

/* Small toggle variant */
.id-toggle.id-toggle-small {
    width: 38px;
    height: 20px;
}

.id-toggle.id-toggle-small .id-toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 2px;
}

.id-toggle.id-toggle-small input:checked+.id-toggle-slider:before {
    transform: translateX(16px);
}

/* Create New Client - compact card */
.link-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 0;
}

.link-section-header {
    font-weight: 600;
    font-size: 0.85em;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.link-section-header i {
    font-size: 0.9em;
}

/* Form inputs - unified style */
.link-new-client-form .form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.link-new-client-form .form-control,
.link-add-profile-row .form-control-sm,
#link-filter-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.link-new-client-form .form-control:focus,
.link-add-profile-row .form-control-sm:focus,
#link-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.link-new-client-form .form-control::placeholder,
.link-add-profile-row .form-control-sm::placeholder,
#link-filter-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Buttons - unified compact style */
.link-new-client-form .btn,
.link-add-profile-row .btn,
.link-profile-item .btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.link-new-client-form .btn-success,
.link-add-profile-row .btn-success {
    background: var(--success);
    color: white;
}

.link-new-client-form .btn-success:hover,
.link-add-profile-row .btn-success:hover {
    filter: brightness(1.1);
}

/* Divider - subtle but visible */
.link-divider {
    display: flex;
    align-items: center;
    margin: 16px 0 12px;
    color: var(--text-muted);
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.link-divider::before,
.link-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.link-divider span {
    padding: 0 12px;
}

/* Filter input - search bar style */
#link-filter-input {
    width: 100%;
    margin-bottom: 12px;
    background: var(--bg-input);
}

/* Clients list - NO overlay, natural flow */
.link-clients-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Client group - minimal borders */
.link-client-group {
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.link-client-group:hover {
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.link-client-group.expanded {
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Client header - clickable row */
.link-client-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.link-client-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Toggle arrow - transforms on expand */
.link-client-toggle {
    color: var(--text-muted);
    font-size: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 4px;
    transition: transform 0.2s, background 0.15s;
    flex-shrink: 0;
}

.link-client-group.expanded .link-client-toggle {
    transform: rotate(90deg);
    background: var(--primary);
    color: white;
}

/* Client name */
.link-client-name {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Profile count badge */
.link-client-count {
    font-size: 0.75em;
    color: var(--text-muted);
    flex-shrink: 0;
    padding: 3px 8px;
    background: var(--bg-card);
    border-radius: 6px;
}

/* Expanded profiles - pushes content, no overlay */
.link-client-profiles {
    background: var(--bg-card);
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Add new profile row */
.link-add-profile-row {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(59, 130, 246, 0.04);
    border: 1px dashed rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    margin-bottom: 4px;
    align-items: center;
}

.link-add-profile-row .form-control-sm {
    padding: 8px 12px;
    font-size: 13px;
}

/* Profile item - flat design */
.link-profile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-input);
    border-radius: 6px;
    transition: background 0.1s;
}

.link-profile-item:hover {
    background: rgba(99, 102, 241, 0.06);
}

.link-profile-item.link-profile-current {
    background: rgba(34, 197, 94, 0.1);
}

.link-profile-item.link-profile-linked {
    opacity: 0.5;
    pointer-events: none;
}

.link-profile-info {
    flex: 1;
    min-width: 0;
}

.link-profile-name {
    font-weight: 500;
    font-size: 0.9em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges - compact */
.link-profile-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.link-profile-badges .badge {
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Profile action buttons */
.link-profile-item .btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.link-profile-item .btn-primary {
    background: var(--primary);
    color: white;
}

.link-profile-item .btn-danger {
    background: var(--danger);
    color: white;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.dropdown-divider {
    height: 0;
    margin: 6px 0;
    border: none;
    border-top: 1px solid var(--border);
}

/* Miner Link Tooltip */
.miner-tooltip-popup {
    position: fixed;
    z-index: 9999;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

.miner-tooltip-popup strong {
    color: var(--primary);
}

.miner-tooltip-popup ul {
    list-style: disc;
    margin: 0;
    padding-left: 16px;
}

.miner-tooltip-popup li {
    margin: 2px 0;
}


/* Star icon styling for Config Profiles */
.miner-config-profile-btn.btn-current i {
    color: #cbd5e1;
    /* Gray/Slate-300 by default */
    transition: color 0.2s;
}

.miner-config-profile-item.is-current .miner-config-profile-btn.btn-current i {
    color: #eab308;
    /* Gold/Yellow-500 when active */
}

.miner-config-profile-item.is-current .miner-config-profile-btn.btn-current {
    border-color: #fde047;
    background-color: #fefce8;
}

/* Current Profile Container Styling */
.miner-config-current-profile-container {
    margin-bottom: 2px;
}

.miner-config-profile-current-wrapper {
    background: rgba(59, 130, 246, 0.08);
    /* Very light blue tint */
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    padding: 2px;
}

.current-profile-label {
    font-size: 10px;
    font-weight: 600;
    color: #3b82f6;
    /* Blue */
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 2px;
}

/* Add margin to list to separate from current */
.miner-config-profiles-list {
    margin-top: 10px;
}

/* Header Flexbox */
.miner-config-profiles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    min-height: 40px;
}

.miner-config-profiles-header h4 {
    margin: 0;
}

/* Current Profile in Header Styling */
.miner-config-current-profile-container {
    flex: 0 0 auto;
}

.miner-config-profile-current-wrapper {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.current-profile-label {
    font-size: 9px;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
    margin-bottom: 2px;
    margin-right: 2px;
}

/* Compact Profile Item in Header */
.miner-config-profile-current-wrapper .miner-config-profile-item {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    width: auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.miner-config-profile-current-wrapper .miner-config-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.miner-config-profile-current-wrapper .miner-config-profile-actions {
    display: flex;
    gap: 4px;
}

/* Make buttons smaller in header */
.miner-config-profile-current-wrapper .miner-config-profile-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 12px;
}

/* Edit icon styling */
.miner-config-profile-btn.btn-edit i {
    color: #94a3b8;
    /* Slate-400 */
    transition: color 0.2s;
}

.miner-config-profile-btn.btn-edit:hover i {
    color: #3b82f6;
    /* Blue-500 */
}

/* ============== NODES TAB ============== */
.nodes-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 4px;
    padding: 0 4px;
}

.nodes-inline-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nodes-toolbar-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nodes-toolbar-btns .icon-btn.spinning img {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Node System Logs Bar - Scrolling Ticker */
.node-system-logs {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 10px;
    margin-bottom: 14px;
    height: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.node-log-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    padding-right: 6px;
    border-right: 1px solid var(--border);
}

.node-log-message {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

.node-log-message::-webkit-scrollbar {
    display: none;  /* Chrome/Safari */
}

/* Individual log items */
.node-log-message .log-item {
    padding: 0 4px;
}

/* Time is always black */
.node-log-message .log-time {
    color: #000000;
}

/* Message text colored by type */
.node-log-message .log-item.log-info .log-msg {
    color: #3b82f6;
}

.node-log-message .log-item.log-success .log-msg {
    color: #22c55e;
}

.node-log-message .log-item.log-error .log-msg {
    color: #ef4444;
}

.node-log-message .log-item.log-warning .log-msg {
    color: #f59e0b;
}

/* Separator between messages */
.node-log-message .log-sep {
    color: var(--border);
    padding: 0 2px;
    opacity: 0.6;
}

.node-log-counter {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    font-family: 'Monaco', 'Menlo', monospace;
    min-width: 20px;
    text-align: center;
}

.nodes-section {
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 24, 40, 0.05);
}

.nodes-section-online {
    border-left: 4px solid #22c55e;
}

.nodes-section-offline {
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
}

.nodes-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 8px;
    padding: 0 4px;
}

.nodes-header-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    border-radius: 18px;
    padding: 6px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    font-size: 14px;
    font-weight: 500;
}

.nodes-header-pill .badge,
.nodes-header-pill .badge-success,
.nodes-header-pill .badge-muted {
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    padding: 2px 10px;
    margin: 0 2px;
}

.nodes-header-pill .badge-success {
    background: #86efac;
    color: #166534;
}

.nodes-header-pill .badge-muted {
    background: #6b7280;
}

.nodes-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 8px;
    width: 100%;
}

.nodes-pill-status {
    padding: 6px 14px;
}

.nodes-pill-actions {
    padding: 4px 10px;
    gap: 4px;
    margin-left: auto;
}

.nodes-pill-actions .icon-btn-sm {
    width: 28px;
    height: 28px;
    padding: 4px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.nodes-pill-actions .icon-btn-sm:hover {
    background: rgba(0, 0, 0, 0.08);
}

.nodes-pill-actions .icon-btn-sm .btn-icon {
    width: 18px;
    height: 18px;
}

.nodes-pill-actions .icon-btn-sm i {
    font-size: 14px;
    color: #6b7280;
}

/* Nodes compact mode */
.nodes-compact .node-card {
    padding: 8px 10px;
}

.nodes-compact .node-quick,
.nodes-compact .node-block-separator,
.nodes-compact .node-miners-section,
.nodes-compact .node-block-info,
.nodes-compact .node-details,
.nodes-compact .node-actions {
    display: none;
}

.nodes-compact .node-top {
    margin-bottom: 4px;
}

.nodes-compact .node-address-row {
    font-size: 12px;
}

.nodes-inline-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.nodes-section-online .nodes-inline-label {
    color: #22c55e;
}

.nodes-section-offline .nodes-inline-label {
    color: #475569;
}

.nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    padding: 4px 0 2px;
}

.nodes-grid-offline .node-card {
    opacity: 0.7;
    filter: grayscale(0.1);
}

/* Node Delete Button (for offline nodes) */
.node-delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

.node-delete-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15);
}

/* Offline Node Card Layout */
.node-card.offline {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.3);
}

.node-card.offline .node-card-header {
    padding: 0 0 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    margin-bottom: 8px;
}

.node-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-status-indicator.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.node-status-indicator.offline {
    background: #9ca3af;
}

.node-card.offline .node-name {
    font-weight: 600;
    font-size: 14px;
    color: #6b7280;
}

.node-card.offline .node-address {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.node-card.offline .node-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.node-card.offline .node-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.node-card.offline .stat-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.node-card.offline .stat-value {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* Node Card - Miner-style design */
.node-card {
    position: relative;
    background: #f0f8ff;
    border-radius: var(--radius);
    padding: 12px;
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
}

.node-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Node drag handle for sorting */
.node-drag-handle {
    color: var(--text-muted);
    font-size: 14px;
    cursor: grab;
    user-select: none;
    margin-right: 4px;
}

.node-drag-handle:hover {
    color: var(--text-secondary);
}

.node-drag-handle:active {
    cursor: grabbing;
}

/* Node card drag states */
.node-card.card-ghost {
    opacity: 0.4;
}

.node-card.card-chosen {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.node-card.card-dragging {
    opacity: 0.8;
}

.node-card.is-offline {
    opacity: 0.7;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.3);
}

/* Node Card Header */
.node-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.node-power-toggle {
    flex-shrink: 0;
}

.node-id {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.node-tree-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.node-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.node-beta-badge {
    position: absolute;
    bottom: -2px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #22c55e;
    border-radius: 3px;
    padding: 0 3px;
    line-height: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.node-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,0.5);
}

.node-status-dot.syncing {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245,158,11,0.5);
}

.node-status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239,68,68,0.4);
}

.node-status-dot.unknown {
    background: #9ca3af;
}

/* Node type icon (replaces status dot) */
.node-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.node-type-icon svg {
    width: 18px;
    height: 18px;
}

.node-type-icon.online {
    color: #22c55e;
}

.node-type-icon.syncing {
    color: #f59e0b;
}

.node-type-icon.offline {
    color: #ef4444;
}

.node-type-icon.unknown {
    color: #9ca3af;
}

.node-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-name.editable-node-name {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s, color 0.2s;
}

.node-name.editable-node-name:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.node-name.editable-offline-node-name {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s, color 0.2s;
}

.node-name.editable-offline-node-name:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Address row */
.node-address-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: relative;
}

.node-addr-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.node-addr {
    color: var(--text);
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.node-addr-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

.node-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.node-copy-btn:hover {
    opacity: 1;
}

/* Note row */
.node-note-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 8px;
}

.node-note-text {
    font-size: 11px;
    color: #854d0e;
    font-style: italic;
}

.node-note-edit {
    background: none;
    border: 1px solid #ca8a04;
    color: #ca8a04;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.node-note-edit:hover {
    background: #ca8a04;
    color: #fff;
}

/* Error row */
.node-error-row {
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
}

/* Quick stats section */
.node-quick {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
}

.node-quick-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.node-quick-row.three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.node-quick-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.node-quick-box.full-width {
    flex: 1;
    width: 100%;
    grid-column: 1 / -1;
}

.node-time-box,
.node-sync-box,
.node-mempool-box,
.node-network-box,
.node-peers-box,
.node-height-box {
    background: rgba(236, 72, 153, 0.10);
    border-color: rgba(236, 72, 153, 0.25);
}

.node-quick-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}

.node-quick-value {
    color: var(--text);
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.node-quick-value.highlight {
    color: #2563eb;
}

.node-quick-value.warning {
    color: var(--warning);
}

/* Miners section */
.node-miners-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.node-miners-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.node-miners-value {
    color: #4338ca;
    font-size: 14px;
    font-weight: 700;
}

/* Connected miners tags - row under nickname like miner linked row */
.node-connected-miners {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 8px 0;
    padding: 4px 8px;
}

.node-connected-label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.node-miner-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.node-miner-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    padding: 1px 6px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    border-radius: 8px;
    font-weight: 500;
}

.node-miner-more {
    font-size: 11px;
    padding: 2px 6px;
    color: #6b7280;
    font-style: italic;
}

/* Block info separator */
.node-block-separator {
    border-top: 1px dashed var(--border);
    margin: 10px 0;
}

.node-block-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.node-block-info .node-quick-box {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.node-block-info .node-quick-box.full-width {
    flex: 1 1 100%;
    width: 100%;
}

.node-block-info .node-quick-value.mono {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* Actions */
.node-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
}

.node-actions .icon-btn {
    width: 100%;
    height: 38px;
    flex: 1;
}

.node-actions .icon-btn img {
    width: 20px;
    height: 20px;
}

.node-actions-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.node-actions-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.node-action-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-action-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.node-action-btn .btn-icon {
    width: 20px;
    height: 20px;
}

/* Clickable miner count */
.node-miners-value.clickable {
    cursor: pointer;
    color: var(--accent-blue);
    text-decoration: underline;
}

.node-miners-value.clickable:hover {
    color: var(--accent-blue-hover, #2563eb);
}

/* Miner IPs Popup - Modern Style */
.miner-ips-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.miner-ips-popup-content {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    min-width: 320px;
    max-width: 420px;
    max-height: 70vh;
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

.miner-ips-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.miner-ips-popup-title {
    font-weight: 600;
    font-size: 15px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.miner-ips-popup-title::before {
    content: '🖥️';
    font-size: 18px;
}

.miner-ips-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 18px;
    color: white;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.miner-ips-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.miner-ips-popup-body {
    padding: 0;
    max-height: 350px;
    overflow-y: auto;
}

.miner-ip-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s;
}

.miner-ip-row:hover {
    background: var(--bg-hover, rgba(59, 130, 246, 0.08));
}

.miner-ip-row:last-child {
    border-bottom: none;
}

.miner-ip-num {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-family: inherit;
}

.miner-ip-addr {
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.miner-ip-row:hover .miner-ip-addr {
    color: var(--accent-blue);
}

/* Empty state */
.miner-ips-popup-body.empty {
    padding: 30px 20px;
    text-align: center;
}

.miner-ip-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.miner-ip-empty-icon {
    font-size: 40px;
    opacity: 0.7;
}

.miner-ip-empty-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.miner-ip-node-addr {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
    padding: 14px 28px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    letter-spacing: 0.5px;
    text-align: center;
    margin: 8px auto;
}

/* Legacy nc- styles - kept for backwards compat */
.nc-miners-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nc-miners-label {
    font-size: 12px;
    color: #4338ca;
}

.nc-miners-value {
    font-size: 14px;
    font-weight: 700;
    color: #4338ca;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* Actions */
.nc-actions {
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.nc-actions-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.nc-actions-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Legacy styles kept for backwards compat */
.node-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.node-status-icon {
    font-size: 14px;
}

.node-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-status-dot.online { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.node-status-dot.offline { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.node-status-dot.syncing { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.node-status-dot.unknown { background: #9ca3af; }

.node-card-address {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 10px;
}

.node-note {
    padding: 0 16px 12px;
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.node-error {
    padding: 8px 16px 10px;
    font-size: 12px;
    color: #dc2626;
    background: #fef2f2;
    border-top: 1px solid #fecaca;
    border-bottom: 1px solid #fecaca;
}

.node-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #f0f0f0;
    border-top: 1px solid #f0f0f0;
}

.node-stat {
    background: #fafafa;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.node-stat .stat-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 500;
}

.node-stat .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    font-family: 'SF Mono', Monaco, monospace;
}

.node-card-miners {
    display: flex;
    justify-content: space-around;
    padding: 10px 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    font-size: 13px;
    color: #4338ca;
}

.node-card-miners strong {
    font-weight: 700;
}

.node-card-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px 14px;
}

.node-action-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.node-action-btn:hover {
    background: #e5e7eb;
}
}

.node-stat-value.highlight { color: #2563eb; }
.node-stat-value.success { color: #16a34a; }
.node-stat-value.warning { color: #f59e0b; }

.node-miners-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e0e7ff;
}

.node-miners-stat {
    background: #eff6ff;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.node-miners-stat .node-stat-label {
    color: #6366f1;
}

.node-miners-stat .node-stat-value {
    color: #4338ca;
    font-size: 16px;
}

.node-actions {
    padding: 8px 0;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.node-actions-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 24px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.node-actions-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* Node Action Menu */
.node-action-menu {
    position: absolute;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.node-action-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.node-action-menu .dropdown-item:hover {
    background: #f3f4f6;
}

.node-action-menu .dropdown-item.danger {
    color: #ef4444;
}

.node-action-menu .dropdown-item.danger:hover {
    background: #fef2f2;
}

/* Form row 2 columns */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Modal medium size */
.modal-medium {
    max-width: 480px;
}

/* ===== Agent Card Styles ===== */
.agent-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    margin-bottom: 16px;
    color: #fff;
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.agent-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.agent-status-dot.online { 
    background: #22c55e; 
    box-shadow: 0 0 12px rgba(34,197,94,0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 8px rgba(34,197,94,0.5); }
    50% { box-shadow: 0 0 16px rgba(34,197,94,0.8); }
}

.agent-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.agent-version {
    font-size: 12px;
    color: #94a3b8;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.agent-info {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 13px;
}

.agent-ip {
    color: #94a3b8;
    font-family: 'SF Mono', Monaco, monospace;
}

.agent-nodes-count {
    color: #22c55e;
    font-weight: 500;
}

.agent-timing {
    display: flex;
    justify-content: space-between;
    padding: 0 16px 12px;
    font-size: 11px;
    color: #64748b;
}

.agent-nodes-list {
    background: rgba(0,0,0,0.2);
    padding: 12px;
}

.no-agent-nodes {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    padding: 8px;
}

/* ===== New Agent Node Card Styles ===== */
.agent-node-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    color: #374151;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.agent-node-card:last-child {
    margin-bottom: 0;
}

.agent-node-card.offline {
    opacity: 0.8;
    background: #fafafa;
    border-color: #ddd;
}

.node-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.node-status-icon {
    font-size: 14px;
}

.node-name-text {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

.node-address-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.node-address-text {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    color: #6b7280;
    flex: 1;
}

.node-copy-rpc-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.node-copy-rpc-btn:hover {
    background: #f3f4f6;
}

.node-note-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: #f9fafb;
    border-radius: 6px;
}

.node-note-text {
    font-size: 12px;
    color: #6b7280;
    flex: 1;
}

.node-note-text.note-empty {
    font-style: italic;
    color: #9ca3af;
}

.node-edit-btn {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.node-edit-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.node-stats-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 12px 0;
}

.node-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    margin-bottom: 12px;
}

.node-stat-item {
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

.stat-label {
    color: #6b7280;
}

.stat-value {
    font-weight: 600;
    color: #111827;
    font-family: 'SF Mono', Monaco, monospace;
}

.node-miners-row {
    display: flex;
    gap: 24px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: 8px;
    margin-bottom: 12px;
}

.miners-stat {
    font-size: 13px;
    color: #374151;
}

.miners-stat strong {
    color: #059669;
    font-weight: 700;
}

.node-actions-row {
    display: flex;
    justify-content: flex-end;
}

.node-actions-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.node-actions-btn:hover {
    background: #e5e7eb;
}

.node-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    display: none;
    z-index: 100;
}

.node-actions-menu.show {
    display: block;
}

.node-actions-menu a {
    display: block;
    padding: 10px 14px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.node-actions-menu a:hover {
    background: #f3f4f6;
}

.node-actions-menu a:first-child {
    border-radius: 8px 8px 0 0;
}

.node-actions-menu a:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown {
    position: relative;
}

/* Legacy styles - keep for backward compatibility */
.agent-node-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    color: #374151;
}

.agent-node-item:last-child {
    margin-bottom: 0;
}

.agent-node-item.offline {
    opacity: 0.7;
    background: #f8fafc;
}

.agent-node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.agent-node-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.agent-node-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.agent-node-item.online .agent-node-status {
    background: #dcfce7;
    color: #16a34a;
}

.agent-node-item.offline .agent-node-status {
    background: #fee2e2;
    color: #dc2626;
}

.agent-node-address {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.agent-node-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.agent-node-stats span {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 6px;
}

/* ===== Nodes Mobile Styles ===== */
@media (max-width: 768px) {
    .nodes-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 4px 0;
    }

    .node-card {
        border-radius: 12px;
    }

    .node-card-header {
        padding: 12px 14px 8px;
    }

    .node-name {
        font-size: 15px;
    }

    .node-card-address {
        padding: 0 14px 8px;
    }

    .node-address {
        font-size: 12px;
    }

    .node-note {
        padding: 0 14px 10px;
        font-size: 11px;
    }

    .node-error {
        padding: 8px 14px;
        font-size: 11px;
    }

    .node-stats {
        gap: 1px;
    }

    .node-stat {
        padding: 8px 12px;
    }

    .node-stat-label {
        font-size: 10px;
    }

    .node-stat-value {
        font-size: 13px;
    }

    .node-miners-stat {
        padding: 8px 12px;
    }

    .node-miners-stat .node-stat-value {
        font-size: 14px;
    }

    .node-actions {
        padding: 10px 14px;
    }

    .node-actions-btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }

    /* Node action menu mobile - action sheet style */
    .node-action-menu {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        width: auto !important;
        border-radius: 16px;
        min-width: auto;
    }

    .node-action-menu .dropdown-item {
        padding: 14px 20px;
        font-size: 15px;
        justify-content: center;
    }

    /* Form row 2 columns - stack on mobile */
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Modal medium on mobile */
    .modal-medium {
        max-width: none;
        width: 94%;
    }

    /* Nodes section header on mobile */
    #tab-nodes .section-header {
        padding: 8px 0;
    }
}