/* Password fields using type=text to prevent browser autofill detection */
.password-field {
    -webkit-text-security: disc;
    text-security: disc;
}

:root {
    --primary: #5865f2;
    --primary-hover: #4752c4;
    --primary-glow: rgba(88, 101, 242, 0.4);
    --bg-dark: #1e1f22;
    --card-bg: rgba(43, 45, 49, 0.8);
    --sidebar-bg: rgba(30, 31, 34, 0.95);
    --text-main: #f2f3f5;
    --text-dim: #949ba4;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-bright: rgba(255, 255, 255, 0.15);
    --success: #23a55a;
    --danger: #f23f42;
    --input-bg: rgba(30, 31, 34, 0.6);
    --panel-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

[data-theme="light"] {
    --primary: #5865f2;
    --primary-hover: #4752c4;
    --primary-glow: rgba(88, 101, 242, 0.2);
    --bg-dark: #f2f3f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --sidebar-bg: rgba(227, 229, 232, 0.95);
    --text-main: #2e3338;
    --text-dim: #5c6068;
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-bright: rgba(0, 0, 0, 0.15);
    --success: #1e8a49;
    --danger: #da373c;
    --input-bg: rgba(255, 255, 255, 0.8);
    --panel-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

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

html { overflow-x: hidden; }

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

body::before {
    content: ''; position: fixed; inset: 0;
    background: 
        radial-gradient(circle at 0% 0%, rgba(88, 101, 242, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(35, 165, 90, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(88, 101, 242, 0.05) 0%, transparent 60%);
    opacity: 1; z-index: -1;
    filter: blur(80px);
}

.hidden { display: none !important; }

/* ─── Overlays (Login, 2FA enforcement) ──────────────────────────────────── */
.overlay {
    position: fixed; inset: 0; z-index: 900;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-dark); overflow-y: auto; padding: 20px;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

header {
    display: flex; flex-direction: column; gap: 12px;
    padding: 12px 40px; border-bottom: 1px solid var(--glass-border);
    background: var(--sidebar-bg); backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 100;
}

header > :first-child {
    display: flex; justify-content: space-between; align-items: center;
}

.logo { display: flex; align-items: center; gap: 15px; }
.header-logo { height: 42px; width: auto; filter: drop-shadow(0 0 8px rgba(255,255,255,0.1)); }
.login-logo { height: 80px; width: auto; margin-bottom: 24px; filter: drop-shadow(0 0 15px rgba(255,255,255,0.2)); }
.user-info { display: flex; align-items: center; gap: 12px; }

.search-container {
    max-width: 500px; position: relative; width: 100%;
    display: flex; justify-content: center;
}
#global-search, #structure-search {
    width: 100%; background: var(--input-bg); border: 1px solid var(--glass-border);
    padding: 10px 18px; border-radius: 10px; color: var(--text-main); outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
}
#global-search:focus, #structure-search:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px var(--primary-glow);
}

.main-nav { display: flex; gap: 6px; background: rgba(0,0,0,0.2); padding: 4px; border-radius: 12px; justify-content: center; }
.nav-item {
    background: transparent; color: var(--text-dim); border: none;
    padding: 8px 18px; cursor: pointer; border-radius: 8px;
    font-weight: 500; transition: all 0.2s ease;
    font-size: 0.9rem;
}
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 4px 12px var(--primary-glow); }
.nav-item:hover:not(.active) { background: rgba(255,255,255,0.05); color: white; }

main { padding: 40px; max-width: 1600px; margin: 0 auto; min-height: calc(100vh - 70px); }

.tab-content { display: none; animation: tabFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.tab-content.active { display: block; }

@keyframes tabFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}
.section-header .actions-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.section-header .search-container {
    max-width: 350px;
}
.welcome-section { margin-bottom: 30px; }

/* ─── Components ─────────────────────────────────────────────────────────── */

.glass-card {
    background: var(--card-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border); border-radius: 20px; padding: 24px;
    box-shadow: var(--panel-shadow);
    transition: border-color 0.3s ease;
}
.glass-card:hover { border-color: var(--glass-border-bright); }

/* Modals — visibility controlled by .hidden class in JS */

.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

input[type="text"], input[type="password"], input[type="number"], select.form-select, textarea {
    width: 100%; background: var(--input-bg); border: 1px solid var(--glass-border);
    padding: 12px 16px; border-radius: 12px; color: var(--text-main); outline: none;
    transition: all 0.2s ease; font-family: inherit; font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: rgba(255,255,255,0.08); box-shadow: 0 0 15px var(--primary-glow); }

.checkbox-group { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; cursor: pointer; transition: all 0.2s; padding: 8px; border-radius: 10px; }
.checkbox-group:hover { background: rgba(255,255,255,0.04); }
.checkbox-group input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.checkbox-group label { cursor: pointer; font-size: 0.9rem; line-height: 1.4; color: var(--text-main); }

.modal-actions { display: flex; gap: 12px; margin-top: 30px; border-top: 1px solid var(--glass-border); padding-top: 24px; justify-content: flex-end; }

.btn-primary {
    background: var(--primary); color: white; border: none; padding: 10px 24px;
    border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover { 
    background: var(--primary-hover);
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px var(--primary-glow); 
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255,255,255,0.08); color: white; border: 1px solid var(--glass-border);
    padding: 9px 18px; border-radius: 10px; cursor: pointer; transition: all 0.2s;
    text-decoration: none;
    display: flex; align-items: center; justify-content: center;
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); border-color: var(--glass-border-bright); }

.btn-ghost { background: transparent; color: var(--text-dim); border: none; cursor: pointer; transition: all 0.2s; padding: 6px 12px; border-radius: 6px; }
.btn-ghost:hover { color: white; background: rgba(255,255,255,0.05); }
.btn-ghost.danger:hover { color: white; background: var(--danger); }

/* ─── Devices Grid ───────────────────────────────────────────────────────── */

.device-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px; margin-top: 30px;
}

.device-card { 
    position: relative; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    cursor: default; 
    display: flex;
    flex-direction: column;
}
.device-card:hover { 
    border-color: var(--primary); 
    transform: translateY(-5px) scale(1.02); 
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px var(--primary-glow);
}

.device-status {
    position: absolute; top: 24px; right: 24px; width: 12px; height: 12px;
    border-radius: 50%; background: #333;
    border: 2px solid var(--card-bg);
}
.device-status.online {
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    animation: status-pulse 2s infinite;
}
/* Estado desconhecido: o hbbs não respondeu (reachable_known === false). Cinza neutro,
   nunca vermelho — não afirmamos offline sem dado. */
.device-status.unknown { background: #9aa0a6; }

@keyframes status-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.device-icon { 
    font-size: 2.5rem; 
    margin-bottom: 20px; 
    display: block; 
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.device-info h3 { 
    font-size: 1.25rem; 
    margin-bottom: 8px; 
    font-weight: 700;
    color: white;
}

.id-badge {
    font-family: 'JetBrains Mono', monospace; 
    color: var(--primary); 
    cursor: pointer; 
    font-size: 0.9rem;
    transition: color 0.2s;
    background: rgba(88,101,242,0.1);
    padding: 2px 8px;
    border-radius: 6px;
}
.id-badge:hover { color: white; background: var(--primary); }

.device-meta { 
    margin: 20px 0; 
    color: var(--text-dim); 
    font-size: 0.88rem; 
    display: grid; 
    gap: 8px; 
}
.device-meta .meta-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.03); padding-bottom: 4px; }
.device-meta b { 
    color: var(--text-main); 
    font-weight: 500; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.device-actions { display: flex; gap: 12px; margin-top: auto; padding-top: 15px; }
.device-actions .btn-primary, 
.device-actions .btn-secondary {
    flex: 1;
    font-size: 0.95rem;
    height: 44px;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.table-container { 
    padding: 0; 
    overflow-x: auto; 
    margin-top: 24px; 
    border-radius: 16px; 
    border: 1px solid var(--glass-border);
}

.modern-table { width: 100%; border-collapse: collapse; text-align: left; }
.modern-table thead { background: rgba(0,0,0,0.15); }
.modern-table th { 
    padding: 18px 24px; 
    color: var(--text-dim); 
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.modern-table td { 
    padding: 18px 24px; 
    border-bottom: 1px solid rgba(255,255,255,0.03); 
    vertical-align: middle;
}
.modern-table tr:hover { background: rgba(255,255,255,0.02); }
.modern-table td code { 
    background: rgba(0,0,0,0.4); 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 0.85rem; 
    color: var(--primary);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Tree Picker inside Profiles */
.groups-tree-picker {
    max-height: 320px; overflow-y: auto;
    background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 6px; margin-top: 8px;
}
.groups-tree-picker::-webkit-scrollbar { width: 4px; }
.groups-tree-picker::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.tp-row { display: flex; align-items: center; gap: 2px; }

.tp-toggle {
    background: none; border: none; color: rgba(255,255,255,0.2); cursor: pointer;
    font-size: 0.5rem; width: 18px; height: 18px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: color 0.15s;
}
.tp-toggle:hover { color: rgba(255,255,255,0.6); }

.tp-children {
    border-left: 1px solid rgba(255,255,255,0.08);
    margin-left: 12px; padding-left: 4px;
}

.tree-picker-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    cursor: pointer; flex: 1; padding: 5px 8px;
    border-radius: 7px; transition: background 0.12s;
    font-size: 0.84rem; font-weight: 400; color: var(--text-dim);
    min-height: 30px;
}
.tree-picker-row:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.tree-picker-row.tree-picker-parent-row { font-weight: 600; color: var(--text-main); }
.tree-picker-row.tree-picker-blocked {
    background: rgba(242,63,66,0.1);
    border-radius: 7px;
}
.tree-picker-row.tree-picker-blocked .tp-name { color: rgba(242,63,66,0.85); }

.tp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Custom checkbox ────────────────────────────────────────────────────── */
.tp-check-wrap { position: relative; width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.tree-picker-cb { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.tp-check-icon {
    width: 17px; height: 17px;
    border: 1.5px solid rgba(255,255,255,0.15); border-radius: 5px;
    background: transparent; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.55rem; font-weight: 900; color: transparent;
}
.tree-picker-row:hover .tp-check-icon { border-color: rgba(255,255,255,0.35); }
.tp-check-icon.tp-check-active {
    background: var(--danger); border-color: var(--danger); color: white;
}
.tp-check-icon.tp-check-active::before { content: '✕'; }

/* ─── Modals ─────────────────────────────────────────────────────────────── */

.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center; z-index: 3000;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}
.modal-content {
    width: 95%; max-width: 600px; max-height: 90vh; overflow-y: auto;
    padding: 32px; border-radius: 24px;
    background: var(--card-bg);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--glass-border-bright);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.company-member-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.company-member-list::-webkit-scrollbar { width: 3px; }
.company-member-list::-webkit-scrollbar-track { background: transparent; }
.company-member-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-content h3 { margin-bottom: 25px; font-size: 1.5rem; color: white; }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; color: var(--text-dim); font-size: 0.85rem; font-weight: 500; }
.input-group input {
    width: 100%; background: var(--input-bg); border: 1px solid var(--glass-border);
    padding: 12px 16px; border-radius: 10px; color: var(--text-main); outline: none;
    transition: all 0.2s; font-size: 0.95rem;
}
.input-group input:focus { border-color: var(--primary); background: rgba(255,255,255,0.05); }

#edit-id-static {
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 1px;
}

.checkbox-group { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; cursor: pointer; user-select: none; }
.checkbox-group input { cursor: pointer; width: 18px; height: 18px; accent-color: var(--primary); }

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

/* ─── Custom Dropdown (Premium Select) ───────────────────────────────────── */

.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}
.cs-trigger {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 18px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.custom-select:hover .cs-trigger { border-color: var(--glass-border-bright); background: rgba(255,255,255,0.05); }
.custom-select.active .cs-trigger { border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }

.cs-options {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border-bright);
    border-radius: 12px;
    overflow: hidden;
    z-index: 1000;
    box-shadow: var(--panel-shadow);
    display: none;
    animation: dropdownOpen 0.2s ease;
}
@keyframes dropdownOpen { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.custom-select.active .cs-options { display: block; }

.cs-option {
    padding: 10px 18px;
    font-size: 0.9rem;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cs-option:hover { background: rgba(255,255,255,0.08); color: white; }
.cs-option.selected { background: var(--primary); color: white; }

/* ─── Tree View (Legacy) ─────────────────────────────────────────────────────────── */

.tree-container { padding: 24px; min-height: 500px; }
.tree-node { margin-left: 20px; border-left: 1px solid rgba(255, 255, 255, 0.05); padding-left: 10px; }
.tree-children { display: none; }
.tree-node.expanded > .tree-children { display: block; animation: slideDown 0.2s ease-out; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.tree-item {
    display: flex; align-items: center; padding: 8px 12px; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; user-select: none; margin-bottom: 4px;
}
.tree-item:hover { background: rgba(255, 255, 255, 0.06); }
.tree-item.folder { color: #4ade80; font-weight: 600; font-size: 0.95rem; }
.tree-item.folder.level-0 { color: #818cf8; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.03); margin-top: 10px; padding: 12px; }

.tree-toggle { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; transition: transform 0.2s; color: var(--text-dim); }
.tree-node.expanded > .tree-item .tree-toggle { transform: rotate(90deg); }

.tree-actions { display: none; gap: 6px; margin-left: auto; }
.tree-item:hover .tree-actions { display: flex; }

.btn-tree {
    background: rgba(255,255,255,0.1); border: none; color: white; padding: 4px 10px;
    border-radius: 6px; font-size: 0.75rem; cursor: pointer; transition: all 0.2s;
}
.btn-tree:hover { background: var(--primary); }

/* ─── Miller Columns ───────────────────────────────────────────────────────────── */

.miller-container {
    min-height: 600px;
    padding: 0;
    overflow: hidden;
}

.miller-columns-container {
    display: flex;
    height: 600px;
    background: rgba(0,0,0,0.1);
}

.miller-column {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    max-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.miller-column.column-active {
    flex: 1;
    width: auto;
    min-width: 280px;
    max-width: 400px;
    overflow: visible;
    border-right: 1px solid rgba(255,255,255,0.1);
    opacity: 1;
    pointer-events: auto;
}

.miller-column.column-active:last-child {
    border-right: none;
}

.miller-column-notes.column-active {
    min-width: 320px;
    max-width: 380px;
}

.column-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-header h3 {
    margin: 0;
    font-size: 1.1em;
    flex: 1;
}

.btn-back {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
}

.column-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.column-list::-webkit-scrollbar {
    width: 6px;
}

.column-list::-webkit-scrollbar-track {
    background: transparent;
}

.column-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.column-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

.miller-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.miller-item:hover {
    background: rgba(255,255,255,0.08);
    border-left-color: #60a5fa;
}

.miller-item.selected {
    background: rgba(96, 165, 250, 0.15);
    border-left-color: #60a5fa;
}

.miller-item-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.miller-item-content {
    flex: 1;
    min-width: 0;
}

.miller-item-title {
    font-weight: 500;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.miller-item-subtitle {
    font-size: 0.8em;
    color: rgba(226, 232, 240, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.miller-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.miller-item:hover .miller-item-actions {
    opacity: 1;
}

.miller-item-actions .btn-tree {
    padding: 4px 8px;
    font-size: 0.85em;
}

.column-footer {
    padding: 8px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85em;
    color: rgba(226, 232, 240, 0.6);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-miller-add {
    padding: 4px 10px;
    font-size: 0.78rem;
    background: rgba(88, 166, 255, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-miller-add:hover {
    background: rgba(96, 165, 250, 0.25);
    border-color: #60a5fa;
}

.miller-empty {
    padding: 24px 16px;
    text-align: center;
    color: rgba(226, 232, 240, 0.5);
    font-style: italic;
}

/* ── Notes Panel (Column 4) ─────────────────────────────── */
.miller-column-notes {
    min-width: 320px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    background: rgba(15, 20, 35, 0.6);
    border-left: 1px solid rgba(96, 165, 250, 0.25);
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

.note-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.note-author {
    font-weight: 600;
    font-size: 0.8rem;
    color: #60a5fa;
    flex-shrink: 0;
}

.note-date {
    font-size: 0.72rem;
    color: var(--text-dim);
    flex: 1;
}

.btn-note-delete {
    background: none;
    border: none;
    color: rgba(255,100,100,0.5);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.btn-note-delete:hover { color: #f87171; }

.note-body {
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.notes-input-area {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.notes-input-area textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    padding: 8px 10px;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.notes-input-area textarea:focus {
    outline: none;
    border-color: rgba(96,165,250,0.5);
}

.notes-send-btn {
    align-self: flex-end;
    padding: 6px 18px;
    font-size: 0.85rem;
}

.peer-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    flex-shrink: 0;
    display: inline-block;
}
.peer-status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}
/* Estado desconhecido (hbbs não respondeu): cinza neutro, nunca vermelho. */
.peer-status-dot.unknown { background: #9aa0a6; }

/* Responsive */
@media (max-width: 1024px) {
    .miller-column {
        max-width: none;
        min-width: 200px;
    }

    .miller-columns-container {
        height: 500px;
    }

    .miller-container {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    /* ── Layout base: padding lateral apertado pra caber em iPhone ──────── */
    header {
        padding: 10px 12px;
    }
    header > :first-child {
        flex-wrap: wrap;
        gap: 8px;
    }
    .logo { gap: 8px; }
    .logo h1 { font-size: 1.1rem; }
    .header-logo { height: 32px; }
    .user-info {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 0.85rem;
    }
    .user-info .btn-ghost { padding: 4px 8px; font-size: 0.8rem; }

    /* Abas em fila com scroll horizontal próprio em vez de empurrar layout */
    .main-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .nav-item { flex-shrink: 0; padding: 8px 14px; font-size: 0.85rem; }

    main { padding: 16px; }

    .section-header { gap: 12px; margin-bottom: 18px; }
    .welcome-section { margin-bottom: 18px; }
    .welcome-section h2 { font-size: 1.2rem; }
    .welcome-section p { font-size: 0.85rem; }

    .glass-card { padding: 14px; border-radius: 14px; }

    .miller-columns-container {
        flex-direction: column;
        height: auto;
    }

    /* Especificidade casada com .miller-column.column-active pra vencer o cascade
       desktop (flex:1 + height:auto), que no Safari iOS colapsa para height:0
       quando o pai flex-column não tem altura explícita. */
    .miller-column,
    .miller-column.column-active {
        flex: none;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .miller-column:not(.column-active) {
        height: 0;
        min-height: 0;
        max-height: 0;
    }

    /* O Safari iOS não trata min-height/height:auto de um flex-column como altura
       "definida", então o filho .column-list (flex:1) colapsava pra 0 e a lista
       sumia inteira — só o footer (flex-shrink:0) com a contagem "33 redes"
       continuava aparecendo. No mobile a coluna vira block e a própria lista
       controla o scroll via max-height, sem depender da resolução de altura do
       flexbox que quebra no iOS. */
    .miller-column.column-active,
    .miller-column-notes.column-active {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .column-list {
        flex: none;
        height: auto;
        min-height: 0;
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .column-header {
        padding: 12px;
    }

    .column-header h3 {
        font-size: 1em;
    }

    .miller-item {
        padding: 10px 12px;
    }
}

/* Badges */
.badge-admin  { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; background: rgba(242,63,66,0.18); color: #f23f42; border: 1px solid rgba(242,63,66,0.3); }
.badge-manager { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; background: rgba(245,158,11,0.18); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.badge-profile { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 600; background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.25); }
.role-badge { padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }
.role-pdv { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.role-concentrador { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.role-servidor { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }

/* Old select overrides to avoid "cru" look while custom select logic is being built */
select.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' 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 12px center;
    background-size: 16px;
    padding-right: 40px !important; }

/* ─── Role Checkboxes (inline checkbox groups) ───────────────────────────── */
.role-checkboxes { display: flex; gap: 16px; flex-wrap: wrap; }
.check-item {
    display: flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 0.9rem; color: var(--text-main);
}
.check-item input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px; flex-wrap: wrap; }
.pg-btn {
    background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); color: var(--text-dim);
    padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.pg-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); color: white; }
.pg-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.pg-btn:disabled { opacity: 0.3; cursor: default; }
.pg-info { color: var(--text-dim); font-size: 0.8rem; margin-right: 8px; }
.pg-ellipsis { color: var(--text-dim); padding: 0 4px; }

/* ─── Compact variants ────────────────────────────────────────────────────── */
.input-group.compact { margin-bottom: 12px; }
.input-group.compact label { margin-bottom: 4px; font-size: 0.78rem; }
.input-group.compact input { padding: 9px 14px; font-size: 0.9rem; }

.section-label {
    color: var(--text-dim); font-size: 0.75rem; font-weight: 700;
    letter-spacing: 0.8px; margin-bottom: 12px;
    border-bottom: 1px solid var(--glass-border); padding-bottom: 6px;
}

.actions-left { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions-right { display: flex; gap: 12px; align-items: center; margin-left: auto; }
.flex-spacer { flex: 1; }

/* ─── Profile Modal Header ────────────────────────────────────────────────── */
.modal-header-row {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 28px; padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}
.modal-header-row h3 { margin-bottom: 2px; }
.modal-header-icon {
    font-size: 1.4rem; width: 48px; height: 48px; flex-shrink: 0;
    background: rgba(88,101,242,0.15); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.modal-subtitle { color: var(--text-dim); font-size: 0.8rem; margin: 0; }

/* ─── Form Sections ──────────────────────────────────────────────────────── */
.form-section { margin-bottom: 22px; }
.form-section-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--text-dim); margin-bottom: 10px;
}
.form-hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 8px; }

/* ─── Toggle Cards ───────────────────────────────────────────────────────── */
.toggle-card {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 8px;
    cursor: pointer; transition: all 0.2s; user-select: none;
}
.toggle-card:hover { background: rgba(255,255,255,0.06); border-color: var(--glass-border-bright); }
.toggle-card-icon { font-size: 1.1rem; flex-shrink: 0; }
.toggle-card-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toggle-card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.toggle-card-desc { font-size: 0.78rem; color: var(--text-dim); }
.toggle-switch-wrap { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-knob {
    position: absolute; inset: 0; border-radius: 24px;
    background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border);
    transition: all 0.25s;
}
.toggle-knob::before {
    content: ''; position: absolute;
    width: 18px; height: 18px; left: 2px; top: 2px;
    border-radius: 50%; background: rgba(255,255,255,0.4); transition: all 0.25s;
}
.toggle-switch-wrap input:checked ~ .toggle-knob { background: var(--primary); border-color: var(--primary); }
.toggle-switch-wrap input:checked ~ .toggle-knob::before { transform: translateX(20px); background: white; }

/* ─── Device Type Grid ───────────────────────────────────────────────────── */
.device-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.device-type-card {
    position: relative; display: flex; flex-direction: column;
    align-items: center; gap: 6px; padding: 16px 12px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    border-radius: 12px; cursor: pointer; transition: all 0.2s;
    text-align: center; user-select: none;
}
.device-type-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.device-type-card:hover { background: rgba(255,255,255,0.07); border-color: var(--glass-border-bright); }
.device-type-card:has(input:checked) { background: rgba(242,63,66,0.12); border-color: rgba(242,63,66,0.4); }
.dtc-icon { font-size: 1.5rem; }
.dtc-name { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.dtc-badge {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    padding: 2px 8px; border-radius: 20px;
    background: rgba(242,63,66,0.2); color: #f23f42;
    opacity: 0; transition: opacity 0.2s;
}
.device-type-card:has(input:checked) .dtc-badge { opacity: 1; }

/* ─── Company Chips (multi-select checkboxes) ────────────────────────────── */
.company-chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0; }
.company-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    border: 1px solid var(--glass-border);
    cursor: pointer; font-size: 0.84rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}
.company-chip:hover { border-color: var(--accent); }
.company-chip-active {
    background: rgba(242,63,66,0.13);
    border-color: rgba(242,63,66,0.5);
    color: #f23f42;
    font-weight: 600;
}
.company-chip-cb { display: none; }

/* Aviso de conexão (reenquadra o prompt "Abrir SwitchDesk?" do navegador) */
.connect-hint {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 380px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border-bright);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-main);
    z-index: 9999;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.connect-hint.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.connect-hint-icon { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
.connect-hint-body { display: flex; flex-direction: column; gap: 5px; font-size: 13px; line-height: 1.45; }
.connect-hint-body strong { color: var(--text-main); }
.connect-hint-body span { color: var(--text-dim); }
.connect-hint-fallback { margin-top: 2px; }
.connect-hint-fallback a { color: var(--primary); font-weight: 600; text-decoration: none; }
.connect-hint-fallback a:hover { text-decoration: underline; }
.connect-hint-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.connect-hint-close:hover { color: var(--text-main); }

/* ─── Terminal SSH no painel + cofre (07/10/2026, terminal.go) ─────────────── */
.terminal-modal { max-width: 1100px; width: 96%; padding: 18px 20px; display: flex; flex-direction: column; max-height: 92vh; overflow: hidden; }
.terminal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.terminal-head-right { display: flex; align-items: center; gap: 12px; }
.term-sub { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.term-status { color: var(--text-dim); font-size: 0.85rem; min-height: 1.3em; margin-bottom: 8px; }
.term-status.err { color: var(--danger); }
.term-status.ok { color: var(--success); }
.term-timer { font-family: Consolas, "Cascadia Mono", monospace; color: var(--text-dim); font-size: 0.9rem; }
.term-timer.warn { color: var(--danger); font-weight: 700; }
#term-box { flex: 1; min-height: 380px; height: 62vh; background: #000; border-radius: 10px; padding: 8px; border: 1px solid var(--glass-border); }
#term-box .xterm { height: 100%; }
.cofre-box { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--glass-border-bright); border-radius: 10px; }
.cofre-box textarea { width: 100%; font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.8rem; resize: vertical; }
.cofre-status { color: var(--text-dim); font-size: 0.8rem; margin-top: 4px; min-height: 1.1em; }
.cofre-status b { color: var(--text-main); }
.cofre-inline { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }
.cofre-link { color: var(--danger); cursor: pointer; text-decoration: underline; margin-left: 8px; font-size: 0.8rem; }

/* Organização: badge ⚠ no próprio dispositivo desatualizado (antes só no subtítulo, que truncava) */
/* 10/11/2026: "!" = PC sem SSH + chave */
.miller-outdated-badge { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; margin-left:6px; background:#e53935; color:#fff; border-radius:50%; padding:0; font-size:0.72rem; font-weight:800; line-height:1; vertical-align:middle; }

/* Ao vivo — mural de técnicos (um cartão por técnico, sessões empilhadas) */
.live-summary { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:14px; color:var(--text-dim); font-size:0.9rem; }
.live-summary b { color:var(--text); }
.live-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(290px, 1fr)); gap:14px; align-items:start; }
.live-card { background:var(--card-bg); border:1px solid var(--glass-border); border-radius:12px; padding:12px 14px; }
.live-card.live-idle { opacity:0.55; }
.live-card.live-busy { border-color:#f0b429; }
.live-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.live-head .live-name { font-weight:700; font-size:1rem; }
.live-head .live-count { font-size:0.75rem; color:var(--text-dim); }
.live-card.live-busy .live-count { color:#f0b429; font-weight:700; }
.live-sess { display:flex; align-items:center; gap:8px; padding:6px 0; border-top:1px dashed var(--glass-border); font-size:0.85rem; }
.live-sess:first-of-type { border-top:none; }
.live-dot { width:9px; height:9px; border-radius:50%; background:#57f287; flex:none; box-shadow:0 0 6px #57f287; }
.live-dot.live-ssh { background:#60a5fa; box-shadow:0 0 6px #60a5fa; border-radius:2px; }
.live-dot.live-pending { background:#f0b429; box-shadow:none; }
.live-sess .live-dev { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.live-sess .live-dev small { color:var(--text-dim); margin-left:4px; }
.live-sess .live-dur { color:var(--text-dim); font-variant-numeric:tabular-nums; flex:none; }
.live-sess .btn-follow { padding:2px 8px; font-size:0.75rem; flex:none; }
.live-idle-txt { color:var(--text-dim); font-size:0.8rem; }

/* Botões VPN / PC / DB por máquina + janelinha (credentials.go) */
.btn-cred { margin-left: 2px; }
.btn-cred.has-cred, .btn-rust-run.has-cred, .btn-rust-trigger.has-cred { color: #57f287; box-shadow: inset 0 0 0 1px #57f287; }
.cred-modal { max-width: 560px; }
.cred-msg { display: none; margin-bottom: 12px; font-size: 0.85rem; font-weight: 600; }
.cred-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.cred-row input { flex: 1; min-width: 0; }
.cred-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cred-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; justify-content: flex-end; }
.cred-actions .btn-secondary:first-child { margin-right: auto; }
.cred-danger { color: var(--danger); }
.cred-cands { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cred-cand { font-size: 0.8rem; padding: 4px 10px; }
.cred-empty, .cred-note, .cred-meta { color: var(--text-dim); font-size: 0.8rem; line-height: 1.5; }
.cred-note { margin-top: 12px; }
.cred-meta { margin-top: 10px; }

/* Botões VPN/PC/DB: não podem empurrar o NOME do cliente para fora da linha */
.miller-item:has(.btn-cred) { flex-wrap: wrap; row-gap: 6px; }
.miller-item:has(.btn-cred) .miller-item-content { flex: 1 1 120px; min-width: 120px; }
.miller-item-actions:has(.btn-cred) { flex: 1 1 100%; flex-wrap: wrap; padding-left: 28px; }
/* 21/10/2026: busca da aba Gestão (Empresas, Perfis, Usuários) */
.gestao-search { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 24px; }
.gestao-search input { flex: 1 1 320px; max-width: 560px; padding: 10px 14px; border-radius: 10px; font-size: 0.95rem; color: inherit; background: var(--glass-bg, rgba(255,255,255,0.05)); border: 1px solid var(--glass-border, rgba(255,255,255,0.12)); }
.gestao-search input:focus { outline: none; border-color: #60a5fa; }
.gestao-search-info { font-size: 0.85rem; color: var(--text-dim, rgba(226,232,240,0.6)); }
/* 21/10/2026: nome da máquina inteiro em cima (quebra linha, sem "…") e os botões de acesso numa linha embaixo */
.miller-item[data-device-id] { flex-wrap: wrap; row-gap: 6px; align-items: flex-start; }
.miller-item[data-device-id] .miller-item-content { flex: 1 1 0; min-width: 0; }
.miller-item[data-device-id] .miller-item-title,
.miller-item[data-device-id] .miller-item-subtitle { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.miller-item[data-device-id] .peer-status-dot { margin-top: 6px; }
.miller-item[data-device-id] .miller-item-actions { flex: 1 1 100%; flex-wrap: wrap; padding-left: 28px; }
.device-actions { flex-wrap: wrap; }
.device-actions .cred-break { flex-basis: 100%; height: 0; padding: 0; margin: -6px 0 0; }
.device-actions .btn-secondary.btn-cred { flex: 1 1 22%; height: 36px; font-size: 0.85rem; }
/* "Juntar com outro PC" na janelinha VPN/PC/DB */
.cred-merge-bar { display: flex; justify-content: flex-end; margin: -14px 0 10px; }
.cred-merge { border: 1px dashed var(--glass-border-bright, rgba(255,255,255,0.2)); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.cred-merge .cred-cands { flex-direction: column; align-items: stretch; }
.cred-merge .cred-cand { text-align: left; }

/* Aviso de máquina desatualizada (13/10/2026) — faixa fixa no topo enquanto o técnico estiver conectado nela */
.update-nag { position: fixed; top: 0; left: 0; right: 0; z-index: 10000; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 16px; background: #b45309; color: #fff; font-weight: 600; font-size: 0.95rem; box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.update-nag span { flex: 1 1 320px; }
.update-nag a, .update-nag button { color: #b45309; background: #fff; border: 0; border-radius: 6px; padding: 6px 12px; font-weight: 700; text-decoration: none; cursor: pointer; font-size: 0.9rem; }
.update-nag .update-nag-info { flex: 1 1 100%; font-weight: 500; font-size: 0.88rem; opacity: 0.95; }

/* Janela grande de PCs desatualizados (21/10/2026) */
.update-modal-ov { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,0.65); }
.update-modal { width: min(680px, 100%); max-height: 90vh; overflow-y: auto; background: #1f2937; color: #fff; border: 4px solid #f59e0b; border-radius: 14px; padding: 22px 26px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.update-modal h2 { margin: 0 0 10px; font-size: 1.7rem; color: #fbbf24; }
.update-modal p { margin: 0 0 14px; font-size: 1.1rem; line-height: 1.45; }
.update-modal-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.update-modal-list li { padding: 8px 12px; background: rgba(255,255,255,0.07); border-radius: 8px; font-size: 0.98rem; }
.update-modal-list li.update-modal-now { background: rgba(245,158,11,0.28); border: 1px solid #f59e0b; }
.update-modal-acoes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.update-modal-acoes button, .update-modal-acoes a { background: #fff; color: #92400e; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 700; text-decoration: none; cursor: pointer; font-size: 0.95rem; }
.update-modal-acoes .update-modal-ok { margin-left: auto; background: #f59e0b; color: #111827; font-size: 1.05rem; padding: 10px 26px; }

/* 25/10/2026: dados capturados pela skill, na lista em colunas (cada informação na sua linha) */
.mc-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px; border: 1px solid rgba(226, 232, 240, 0.2); border-radius: 6px; background: rgba(226, 232, 240, 0.04); color: rgba(226, 232, 240, 0.75); font-size: 0.85em; cursor: pointer; }
.mc-toggle .mc-arrow { font-size: 1.1em; }
.mc-toggle:hover { color: rgba(226, 232, 240, 0.9); border-color: rgba(226, 232, 240, 0.35); }
.mc-arrow { display: inline-block; transition: transform 0.15s; }
.mc-wrap.open .mc-arrow { transform: rotate(90deg); }
.mc-wrap:not(.open) .miller-item-capture { display: none; }
.miller-item-capture { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 1px; margin-top: 5px; font-size: 0.72em; line-height: 1.35; }
.miller-item-capture .mc-l { color: rgba(226, 232, 240, 0.45); }
.miller-item-capture .mc-v { color: rgba(226, 232, 240, 0.85); font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.update-modal .update-modal-trava { background: rgba(239,68,68,0.22); border: 1px solid #ef4444; border-radius: 8px; padding: 10px 12px; font-weight: 700; }
/* Filtros da Gestão (01/11/2026): empresa / grupo / nível de acesso valem para os três blocos */
.gestao-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.gestao-filtros select { min-width: 200px; max-width: 100%; }
/* Lista aberta dos filtros/selects (01/11/2026): as opções herdavam a letra clara do tema e o Windows desenhava a
   lista com fundo branco — só dava para ler o item sob o mouse. Fundo e letra seguem o tema (escuro/claro). */
select option, select optgroup { background-color: var(--bg-dark); color: var(--text-main); }

/* 10/11/2026: aviso de TELA CHEIA "Atualizacao obrigatoria" (substitui a janela que listava os PCs desatualizados) */
.update-obrig-ov { position: fixed; inset: 0; z-index: 10002; display: flex; align-items: center; justify-content: center; padding: 24px; background: #7f1d1d; color: #fff; overflow-y: auto; }
.update-obrig { width: min(900px, 100%); text-align: center; }
.update-obrig h1 { margin: 0 0 14px; font-size: clamp(2rem, 6vw, 4rem); letter-spacing: 0.04em; color: #fff; }
.update-obrig-sub { margin: 0 0 24px; font-size: clamp(1.1rem, 2.4vw, 1.6rem); line-height: 1.4; font-weight: 600; }
.update-obrig-pc { margin: 0 auto 14px; padding: 14px 18px; max-width: 720px; background: rgba(0,0,0,0.28); border: 2px solid #fecaca; border-radius: 12px; }
.update-obrig-nome { font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 800; }
.update-obrig-det { margin-top: 4px; font-size: 1rem; opacity: 0.92; }
.update-obrig-passos { margin: 22px auto; padding-left: 1.4em; max-width: 720px; text-align: left; font-size: 1.1rem; line-height: 1.5; }
.update-obrig-passos li { margin-bottom: 6px; }
.update-obrig-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 22px; }
.update-obrig-acoes button, .update-obrig-acoes a { background: #fff; color: #7f1d1d; border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 800; font-size: 1rem; text-decoration: none; cursor: pointer; }
.update-obrig-acoes .update-obrig-principal { background: #fde047; color: #111827; font-size: 1.1rem; }
.update-obrig-adiar { background: transparent; color: #fecaca; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 0.95rem; }
