/* assets/css/dashboard.css */

/* --- DEFINIÇÃO DE VARIÁVEIS DE TEMA --- */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --offline: #64748b;
    --radius: 12px;
    --transition-speed: 0.3s;
}

/* TEMA CLARO */
:root[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --chart-grid: rgba(0, 0, 0, 0.05);
    --chart-text: #64748b;
    --modal-overlay: rgba(255, 255, 255, 0.6);
    --donut-bg: #e2e8f0;
}

/* TEMA ESCURO (Padrão e-Monit) */
:root[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --chart-grid: rgba(255, 255, 255, 0.05);
    --chart-text: #cbd5e1;
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --donut-bg: #334155;
}

/* --- RESET E GERAL --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.container {
    width: 100%;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.p-10 {
    padding: 10px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

/* --- UTILITIES CORES TEXTO (Substituindo inlines) --- */
.color-success {
    color: var(--success) !important;
}

.color-warning {
    color: var(--warning) !important;
}

.color-danger {
    color: var(--danger) !important;
}

.color-primary {
    color: var(--primary) !important;
}

.color-offline {
    color: var(--offline) !important;
}

.color-muted {
    color: var(--text-muted) !important;
}

/* --- HEADER --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.header h1 span {
    color: var(--text-primary);
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.relative-mr-20 {
    position: relative;
    margin-right: 20px;
}

/* --- BOTÕES --- */
.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-voltar {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-voltar:hover {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

/* --- GRID & CARDS --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.hostname {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.host-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    opacity: 0.7;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editable-title {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s;
}

.editable-title:hover {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

/* --- STATUS DOT & PULSE ANIMATION --- */
.status-badge {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 4px var(--bg-card);
}

.status-badge::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        opacity: 1;
    }

    100% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
        opacity: 0;
    }
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
        opacity: 1;
    }

    100% {
        box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
        opacity: 0;
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
        opacity: 0;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        opacity: 0;
    }
}

.status-ok {
    border-top: 4px solid var(--success);
}

.status-ok .status-badge {
    background-color: var(--success);
}

.status-ok .status-badge::after {
    animation: pulse-green 3s infinite ease-out;
}

.status-warn {
    border-top: 4px solid var(--warning);
}

.status-warn .status-badge {
    background-color: var(--warning);
}

.status-warn .status-badge::after {
    animation: pulse-yellow 2s infinite ease-out;
}

.status-danger {
    border-top: 4px solid var(--danger);
}

.status-danger .status-badge {
    background-color: var(--danger);
}

.status-danger .status-badge::after {
    animation: pulse-red 1.5s infinite ease-in-out;
}

.status-offline {
    border-top: 4px solid var(--offline);
    opacity: 0.75;
}

.status-offline .status-badge {
    background-color: var(--offline);
    box-shadow: none;
}

.status-offline:hover {
    opacity: 1;
}

.offline-text {
    color: var(--danger);
    font-weight: 700;
    font-size: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.show-alerts {
    display: block !important;
}

/* Stats Rows */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- MINI CHARTS (CSS Vars Handled) --- */
.mini-chart-wrapper {
    display: flex;
    align-items: center;
}

.mini-donut {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* CSS Vars injetados do PHP: --donut-color, --donut-val */
    background: conic-gradient(var(--donut-color) var(--donut-val), var(--donut-bg) 0) !important;
}

.mini-donut-inner {
    width: 34px;
    height: 34px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Progress Bars */
.progress-track {
    width: 100%;
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    width: var(--progress-width, 0%);
    background: var(--progress-color, var(--primary)) !important;
}

/* IP Chips & SSH Actions */
.ip-chip {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: inline-flex;
    align-items: center;
}

.ssh-icon-btn {
    margin-left: 5px;
    cursor: pointer;
    color: var(--success);
}

/* IP Detail View */
.ip-container {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ip-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 5px;
}

.ip-chip-detail {
    font-size: 0.9rem;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.15);
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    color: var(--primary);
}

.ip-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Network Chart Container */
.net-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.net-chart-container {
    height: 76px;
    width: 100%;
    margin-bottom: 18px;
    position: relative;
    box-sizing: border-box;
    border: 1px solid transparent;
    background-color: transparent;
    border-radius: 8px;
    padding: 8px;
    transition: all 1s ease;
}

.net-info {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    z-index: 10;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

canvas.sparkline {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 45px !important;
    display: block;
    z-index: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.05));
}

.net-chart-container.glow-blue {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.08);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.net-chart-container.glow-purple {
    border-color: rgba(139, 92, 246, 0.5);
    background-color: rgba(139, 92, 246, 0.08);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* Last Seen */
.last-seen {
    margin-top: auto;
    padding-top: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-delete-small {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    padding: 6px;
    display: inline-flex;
}

.btn-delete-small:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    margin-top: 20px;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--text-muted);
}

/* Detail Summary & Charts */
.detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.sc-cpu::before {
    background: var(--danger);
}

.sc-ram::before {
    background: var(--primary);
}

.sc-disk::before {
    background: var(--success);
}

.summary-card h4 {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.summary-card .big-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-wrapper {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    height: 450px;
    position: relative;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    margin: auto;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease-out;
    color: var(--text-primary);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body p {
    color: var(--text-secondary);
}

.modal-body input,
.modal-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 1rem;
    margin: 15px 0 25px 0;
    outline: none;
    transition: all 0.2s;
}

.modal-body input:focus,
.modal-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-modal {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: opacity 0.2s;
    font-size: 0.9rem;
}

.btn-cancel {
    background: var(--bg-body);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    opacity: 0.8;
}

.btn-save {
    background: var(--success);
    color: #fff;
}

.btn-save:hover {
    opacity: 0.9;
}

/* --- ALERTAS / TOASTS --- */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.alert {
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out forwards;
    pointer-events: auto;
    font-size: 0.9rem;
    border-left: 5px solid rgba(0, 0, 0, 0.2);
}

.alert-success {
    background-color: var(--success, #10b981);
    color: white;
}

.alert-danger,
.alert-error {
    background-color: var(--danger, #ef4444);
    color: white;
}

.alert-warning {
    background-color: #f59e0b;
    color: white;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #60a5fa;
}

:root[data-theme="dark"] .alert-success {
    background-color: #064e3b;
    color: #d1fae5;
    border-color: #059669;
}

:root[data-theme="dark"] .alert-danger {
    background-color: #7f1d1d;
    color: #fee2e2;
    border-color: #b91c1c;
}

:root[data-theme="dark"] .alert-info {
    background-color: #1e3a8a;
    color: #dbeafe;
    border-color: #1d4ed8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.btn-close-alert {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    margin-left: 5px;
}

.btn-close-alert:hover {
    opacity: 1;
}

.btn-voltar,
.btn-icon,
.btn-modal,
button {
    cursor: pointer;
}

.filters-container button {
    cursor: pointer;
    transition: filter 0.2s;
}

.filters-container button:hover {
    filter: brightness(1.1);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.8) brightness(1.2) sepia(0.1);
}

:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.2);
}

input[type="date"] {
    color-scheme: dark;
}

:root[data-theme="light"] input[type="date"] {
    color-scheme: light;
}

.icon-spin {
    animation: girar-icone 1s linear infinite;
    display: inline-block !important;
}

@keyframes girar-icone {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* SSH Bar & Logic */
#ssh-login-bar,
#inline-ssh-login-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #444;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s;
    transform: translateY(0);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    height: 70px;
    box-sizing: border-box;
}

#ssh-login-bar::after,
#inline-ssh-login-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--text-muted);
    border-radius: 4px 4px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#ssh-login-bar button,
#inline-ssh-login-bar button {
    height: 38px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 6px;
    margin: 0;
    line-height: 1;
}

#ssh-login-bar label,
#inline-ssh-login-bar label {
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin-right: 5px;
    display: flex;
    align-items: center;
    height: 38px;
}

#ssh-login-bar.ssh-collapsed,
#inline-ssh-login-bar.ssh-collapsed {
    transform: translateY(calc(-100% + 5px));
    border-bottom: 1px solid transparent;
    background: rgba(30, 30, 30, 0.0);
}

#ssh-login-bar.ssh-collapsed::after,
#inline-ssh-login-bar.ssh-collapsed::after {
    opacity: 0.5;
    height: 5px;
}

#ssh-login-bar.ssh-collapsed:hover::after,
#inline-ssh-login-bar.ssh-collapsed:hover::after {
    opacity: 1;
    background-color: var(--primary);
    height: 6px;
}

#ssh-login-bar.ssh-collapsed:hover,
#inline-ssh-login-bar.ssh-collapsed:hover {
    transform: translateY(0);
    background: rgba(30, 30, 30, 0.95);
    border-bottom: 1px solid #444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ssh-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 38px;
}

.ssh-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    font-size: 0.9rem;
    z-index: 2;
}

#ssh-user-input,
#inline-ssh-user {
    height: 100%;
    line-height: normal;
    padding: 0 15px 0 35px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2d2d2d;
    color: white;
    outline: none;
    width: 200px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    margin: 0;
}

#ssh-user-input:focus,
#inline-ssh-user:focus {
    border-color: var(--primary);
}

.ssh-select {
    height: 100%;
    line-height: normal;
    padding: 0 10px 0 35px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2d2d2d;
    color: white;
    outline: none;
    min-width: 150px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    margin: 0;
    cursor: pointer;
}

.ssh-select:focus {
    border-color: var(--primary);
}

.ssh-select option {
    background: #2d2d2d;
    color: white;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--primary);
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .detail-summary {
        grid-template-columns: 1fr;
    }

    .btn-voltar {
        flex-grow: 1;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .last-seen span {
        font-size: 0.75rem;
    }
}

/* --- NOVAS CLASSES --- */
.logo-icon-large {
    font-size: 3rem;
    color: var(--primary);
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.9em;
    opacity: 0.6;
    font-weight: 300;
    letter-spacing: 1px;
}

.logo-title {
    font-weight: 700;
}

.edit-icon {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-left: 5px;
}

.header-update-wrapper {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 15px;
}

.user-menu-container {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 12px 5px 5px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-wrapper {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    font-weight: bold;
    font-size: 0.8rem;
    color: white;
    line-height: 1;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-chevron {
    font-size: 0.7rem;
    margin-left: 5px;
    opacity: 0.7;
}

/* Menu de Alertas Refatorado */
.alerts-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 400px !important;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 10px;
}

.badge-alert {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
}

.alert-item-empty {
    cursor: default;
    opacity: 0.7;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-item-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: default;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 15px;
}

.alert-item-icon {
    margin-top: 4px;
    font-size: 16px;
}

.alert-item-content {
    display: flex;
    flex-direction: column;
}

.alert-item-title {
    font-size: 14px;
    color: var(--text-color);
    font-weight: bold;
}

.alert-item-hostname {
    font-size: 11px;
    opacity: 0.6;
    font-weight: normal;
}

.alert-item-status {
    font-size: 12px;
}

.alert-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.alert-footer-link {
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
}

.js-alert-link {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.js-alert-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    /* Fundo leve ao passar o mouse */
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    width: 250px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-primary);
}

.user-dropdown-email {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-dropdown-footer {
    border-top: 1px solid var(--border-color);
}

.user-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--danger);
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.card-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.drag-handle-icon {
    cursor: grab;
    opacity: 0.4;
    padding: 5px;
}

.host-title-wrapper {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.host-title-text {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.host-icon-small {
    opacity: 0.7;
}

.stat-detail-row {
    font-size: 0.75rem;
    opacity: 0.8;
}

.temp-badge {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

.stat-storage-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
}

.disk-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.disk-wrapper {
    width: 100%;
}

.disk-row {
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.disk-header-flex {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.disk-empty-msg {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.text-download {
    color: #3b82f6;
}

.text-upload {
    color: #8b5cf6;
}

.stat-ip-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-top: 5px;
}

.ip-list-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-disk-header {
    text-align: center;
    margin-bottom: 15px;
}

.detail-disk-icon {
    color: var(--success);
    font-size: 1.5rem;
}

.detail-disk-title {
    display: inline-block;
    margin-left: 10px;
}

.detail-disk-item {
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.detail-disk-flex {
    display: flex;
    justify-content: space-between;
}

.detail-disk-wrapper {
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.flex-space-between {
    display: flex;
    justify-content: space-between;
}

.filters-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.input-date {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 6px;
    outline: none;
}

.btn-filter-action {
    height: 38px;
    background: var(--primary);
    color: white;
    border: none;
}

.btn-clear-action {
    height: 38px;
}

.filter-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 5px;
}

.btn-export-excel {
    height: 38px;
    background: #107c41;
    color: white;
    border: none;
}

.btn-export-pdf {
    height: 38px;
    background: #b30b00;
    color: white;
    border: none;
}

.section-title {
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-wrapper {
    padding: 0;
    overflow: hidden;
    background: #000;
    height: 500px;
    position: relative;
}

.terminal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

.terminal-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #555;
}

.terminal-icon-large {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.terminal-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2000;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background-color: #000 !important;
}

.btn-terminal-fullscreen {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2002;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.btn-terminal-fullscreen:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.terminal-fullscreen #inline-ssh-login-bar {
    z-index: 2001;
    width: 100%;
    border-radius: 0;
    top: 0;
}

.terminal-fullscreen .terminal-iframe {
    height: 100% !important;
    width: 100% !important;
}

.modal-title-danger {
    color: var(--danger);
}

.delete-host-name {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.delete-warning-text {
    font-size: 0.8rem;
    margin-top: 10px;
}

.btn-confirm-delete {
    background-color: var(--danger);
    color: white;
}

.ssh-modal-content {
    max-width: 2000px;
    width: 95%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.ssh-modal-body {
    flex-grow: 1;
    padding: 0;
    overflow: hidden;
    background: #000;
    position: relative;
}

.ssh-placeholder-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #555;
}

.ssh-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.ssh-modal-footer {
    padding: 15px;
}

.os-row {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-start;
}

.os-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.os-text i {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.os-name-container {
    margin-bottom: 10px;
}

.os-label {
    margin-right: 5px;
}

.os-chip-detail {
    border-color: var(--border-color);
    color: var(--text-primary);
}

.mt-10-mb-0 {
    margin-top: 10px;
    margin-bottom: 0;
}

/* ========================================= */
/* --- LAYOUT COMPACTO (LISTA/TABELA) --- */
/* ========================================= */

.layout-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* Menos arredondado para cara de lista */
    padding: 12px 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 20px;
    position: relative;
}

.card-compact:hover {
    transform: translateX(6px);
    /* Efeito de slide ao invés de pular pra cima */
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

/* Modificadores de Borda do Status no Compacto (na lateral esquerda) */
.card-compact.status-ok {
    border-left: 5px solid var(--success);
}

.card-compact.status-warn {
    border-left: 5px solid var(--warning);
}

.card-compact.status-danger {
    border-left: 5px solid var(--danger);
}

.card-compact.status-offline {
    border-left: 5px solid var(--offline);
    opacity: 0.75;
}

.card-compact:hover.status-ok {
    border-left-color: var(--success);
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    border-bottom-color: var(--primary);
}

.compact-col {
    display: flex;
    align-items: center;
}

/* 1. Área Info (Arrastar, Status, Título) */
.compact-main-info {
    width: 25%;
    min-width: 200px;
    gap: 15px;
    overflow: hidden;
}

.compact-drag {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compact-title-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compact-title-wrap .hostname {
    font-size: 1.05rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-text-compact {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    opacity: 0.8;
    margin-top: 4px;
}

/* 2. Área de Recursos (CPU, RAM, DISCO) */
.compact-metrics {
    width: 25%;
    min-width: 200px;
    justify-content: space-around;
    gap: 10px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.metric-item i {
    opacity: 0.5;
    font-size: 0.85rem;
}

/* 3. Área de Rede (Sparkline Pequeno) */
.compact-network {
    position: relative;
    width: 20%;
    min-width: 150px;
    height: 40px;
    border-radius: 6px;
    background: transparent;
    padding: 2px;
}

.net-text-compact {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    position: absolute;
    width: calc(100% - 10px);
    z-index: 2;
    top: -2px;
    font-weight: 600;
}

canvas.sparkline-compact {
    width: 100%;
    height: 25px !important;
    position: absolute;
    bottom: 2px;
    left: 0;
}

/* 4. Ações e IPs (Direita) */
.compact-actions {
    flex-grow: 1;
    justify-content: flex-end;
    gap: 20px;
}

.compact-time-delete {
    display: flex;
    align-items: center;
    gap: 15px;
}

.last-seen-compact {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Responsividade do Layout Compacto */
@media (max-width: 1200px) {
    .card-compact {
        flex-wrap: wrap;
        gap: 15px;
    }

    .compact-main-info {
        width: 40%;
    }

    .compact-actions {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
        order: 4;
    }
}

@media (max-width: 768px) {
    .compact-main-info {
        width: 100%;
        order: 1;
    }

    .compact-metrics {
        width: 100%;
        justify-content: flex-start;
        gap: 20px;
        order: 2;
    }

    .compact-network {
        width: 100%;
        height: 45px;
        order: 3;
    }

    canvas.sparkline-compact {
        height: 30px !important;
    }
}

/* ========================================= */
/* --- LAYOUT GRID (BLOCOS RESUMIDOS) ---    */
/* ========================================= */

.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.card-grid {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    /* Voltei o padding de 20px em todos os lados */
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.card-grid:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.card-grid.status-ok {
    border-top: 4px solid var(--success);
}

.card-grid.status-warn {
    border-top: 4px solid var(--warning);
}

.card-grid.status-danger {
    border-top: 4px solid var(--danger);
}

.card-grid.status-offline {
    border-top: 4px solid var(--offline);
    opacity: 0.75;
}

.cg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cg-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.cg-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg-os {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -10px;
}

.cg-metrics {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0;
    background: rgba(0, 0, 0, 0.02);
    /* Fundo leve para separar as métricas do card */
    border-radius: 8px;
}

:root[data-theme="dark"] .cg-metrics {
    background: rgba(255, 255, 255, 0.02);
}

.cg-metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Reutilizando as roscas, porém minimizadas */
.cg-metric-item .mini-donut {
    width: 45px;
    height: 45px;
}

.cg-metric-item .mini-donut-inner {
    width: 35px;
    height: 35px;
    font-size: 0.75rem;
}

.cg-disk-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-height: 115px;
    /* Permite mostrar até ~3 discos confortavelmente */
    overflow-y: auto;
    /* Adiciona scroll se a máquina tiver muitos discos */
    padding-right: 5px;
}

/* Customização leve do scrollbar interno para não poluir o layout */
.cg-disk-wrapper::-webkit-scrollbar {
    width: 4px;
}

.cg-disk-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.cg-network-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding-top: 15px;
    margin-top: auto;
    /* Empurra sempre para a borda inferior do card */
    border-top: 1px solid var(--border-color);
    /* Cria uma linha divisória limpa */
}