*, *::before, *::after { box-sizing: border-box; }
:root { 
    --bg: #f8fafc; --c-bg: #ffffff; --t: #0f172a; --tm: #64748b; --bd: #e2e8f0; 
    --hd: #1e293b; --ibg: #ffffff; --hov: #f1f5f9; --sh: rgba(0,0,0,0.08); --th: #f8fafc;
    --blue: #3b82f6; --green: #10b981; --yellow: #f59e0b; --red: #ef4444; --gray: #94a3b8;
    --anim: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
body.dark-mode { 
    --bg: #0f172a; --c-bg: #1e293b; --t: #f8fafc; --tm: #94a3b8; --bd: #334155; 
    --hd: #020617; --ibg: #0f172a; --hov: #334155; --sh: rgba(0,0,0,0.4); --th: #0f172a; 
}

html, body { width: 100%; min-height: 100vh; display: flex; flex-direction: column; background-color: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--t); overflow-x: hidden; transition: background-color var(--anim), color var(--anim); margin: 0; padding: 0; }

.hex-bg { background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0l20 10v20L20 40 0 30V10z' fill-rule='evenodd' stroke='%233b82f6' fill='none' stroke-opacity='0.06' stroke-width='1'/%3E%3C/svg%3E"); }
body.dark-mode .hex-bg { background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0l20 10v20L20 40 0 30V10z' fill-rule='evenodd' stroke='%23cbd5e1' fill='none' stroke-opacity='0.04' stroke-width='1'/%3E%3C/svg%3E"); }

::placeholder { color: var(--tm) !important; opacity: 1 !important; font-weight: 400 !important; }

/* FIX iOS AUTOFILL: Evita que el fondo y texto se vuelvan ilegibles al autocompletar contraseñas del iPhone */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--ibg) inset !important;
    -webkit-text-fill-color: var(--t) !important;
    transition: background-color 5000s ease-in-out 0s;
}

@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
.spinner.center { margin: 0 auto; display: block; }

.login-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px; position: relative; }
.login-header-fixed { position: absolute; top: 20px; right: 20px; display: flex; gap: 15px; align-items: center; z-index: 50; }
.login-card { width: 100%; max-width: 380px; background: var(--c-bg); padding: 40px 30px; border-radius: 12px; box-shadow: 0 10px 25px var(--sh); text-align: center; border-top: 4px solid var(--blue); transition: background var(--anim); animation: slideIn var(--anim); z-index: 10; margin-bottom: 40px; }
.login-card h1 { font-size: 22px; color: var(--t); margin-bottom: 5px; font-weight: 700; }
.login-card input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid var(--bd); border-radius: 8px; font-size: 14px; background: var(--ibg); color: var(--t); transition: var(--anim); }
.login-card input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.login-card button { width: 100%; background-color: var(--blue); color: white; border: none; padding: 14px; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; transition: var(--anim); display: flex; justify-content: center; align-items: center; min-height: 48px; }
.login-card button:hover:not(:disabled) { filter: brightness(1.1); }

.login-footer { position: absolute; bottom: 20px; text-align: center; font-size: 11px !important; color: var(--tm); line-height: 1.6; width: 100%; opacity: 0.8; }
.login-footer strong { color: var(--t); }

.version-badge { cursor: pointer; color: var(--tm); font-weight: 700; transition: var(--anim); display: inline-block; }
.version-badge:hover { color: var(--blue); text-decoration: underline; }

.header { background: var(--hd); color: white; padding: 15px 30px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; box-shadow: 0 4px 12px var(--sh); width: 100%; transition: background var(--anim); }
.header-left { display: flex; flex-direction: column; gap: 4px; }
.header-left h2 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; color: white; }
.header-left img { height: 28px; }
.top-telemetry { font-size: 11px; color: #94a3b8; display: flex; gap: 12px; font-weight: 500; align-items: center; margin-left: 40px;}
.top-telemetry span { display: flex; align-items: center; gap: 4px; }
.header-right { display: flex; align-items: center; gap: 15px; }
.btn-logout { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.1); padding: 8px 16px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; cursor:pointer; transition:var(--anim); gap: 6px; }
.btn-logout:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); }
.btn-logout svg { width: 16px; height: 16px; fill: currentColor; }

.theme-btn { display:inline-flex; align-items:center; justify-content:center; background:transparent; border:none; font-size:18px; cursor:pointer; padding:0; height:24px; transition: transform var(--anim); color: var(--tm); }
body.dark-mode .theme-btn { color: white; }
.header-right .theme-btn { color: white; } 
.theme-btn:hover { transform: scale(1.1); }
.flag-group { display: flex; gap: 10px; align-items: center; border-left: 1px solid var(--bd); padding-left: 15px; }
.header-right .flag-group { border-left-color: rgba(255,255,255,0.2); }

.dashboard-container { flex: 1; width: 100%; max-width: 1300px; margin: 30px auto; padding: 0 20px; display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 25px; position: relative; }
.left-col { display: flex; flex-direction: column; gap: 25px; }
.right-col { display: flex; flex-direction: column; }
.card { background: var(--c-bg); border-radius: 16px; padding: 30px; box-shadow: 0 4px 15px var(--sh); border: 1px solid var(--bd); height: fit-content; transition: var(--anim); max-width: 100%; min-width: 0; }
.card h2 { font-size: 16px; color: var(--t); margin-bottom: 25px; border-bottom: 1px solid var(--bd); padding-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.card h2 svg { width: 20px; height: 20px; color: var(--tm); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--bd); padding-bottom: 15px; }
.search-wrapper { position: relative; width: 100%; max-width: 280px; margin-left: auto; }
.search-icon-svg { position: absolute; left: 12px; top: 12px; width: 16px; height: 16px; stroke: var(--tm); fill: none; stroke-width: 2; opacity: 0.7;}

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.metric-card { background: var(--hov); border: 1px solid var(--bd); border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 12px; transition: var(--anim); }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 6px 12px var(--sh); }
.metric-card.total { border-left: 4px solid var(--blue); }
.metric-card.online { border-left: 4px solid var(--green); }
.metric-card.offline { border-left: 4px solid var(--gray); }
.metric-card.cpu { border-left: 4px solid var(--yellow); }

.metric-icon { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; box-shadow: 0 2px 5px var(--sh); }
.metric-card.total .metric-icon { background: rgba(59,130,246,0.1); color: var(--blue); }
.metric-card.online .metric-icon { background: rgba(16,185,129,0.1); color: var(--green); }
.metric-card.offline .metric-icon { background: rgba(239,68,68,0.1); color: var(--red); }
.metric-card.cpu .metric-icon { background: rgba(245,158,11,0.1); color: var(--yellow); }
.metric-icon svg { width: 20px; height: 20px; stroke: currentColor; }

.metric-info { display: flex; flex-direction: column; gap: 2px; }
.metric-title { font-size: 10px; font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: 0.5px; }
.metric-val { font-size: 17px; font-weight: 800; color: var(--t); font-family: monospace; }

.stat-box { background: var(--hov); border-radius: 10px; padding: 15px; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 15px; border-left: 4px solid var(--blue); cursor: pointer; transition: var(--anim); }
.stat-box:hover { transform: translateY(-3px); box-shadow: 0 6px 12px var(--sh); }
.mon-stat { margin:0; padding:12px; cursor:default; box-shadow:none; transform:none; align-items: center; }
.mon-stat:hover { transform:none; box-shadow:none; filter:none; }
.mon-stat > div { display: flex; flex-direction: column; gap: 4px; width: 100%; } 
.stat-box-title { font-size: 11px; font-weight: 700; color: var(--tm); text-transform: uppercase; margin-bottom: 2px; display: block; }
.stat-box b { font-size: 13px; color: var(--t); font-family: monospace; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: var(--tm); text-transform: uppercase; margin-bottom: 8px; }
.form-control { width: 100%; padding: 12px; border: 1px solid var(--bd); border-radius: 8px; font-size: 14px; background: var(--ibg); color: var(--t); transition: var(--anim); }
.form-control:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.btn-submit { width: 100%; background-color: var(--green); color: white; border: none; padding: 14px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: var(--anim); min-height: 48px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.btn-submit svg { width: 18px; height: 18px; fill: currentColor; }
.btn-submit:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }

.alert-error { background-color: rgba(239, 68, 68, 0.1) !important; color: var(--red) !important; border: 1px solid rgba(239, 68, 68, 0.3) !important; padding: 12px !important; border-radius: 8px !important; font-size: 13px !important; margin-bottom: 20px !important; font-weight: 700 !important; text-align: center !important; display: block; }

.table-wrapper { width: 100%; border-radius: 12px; border: 1px solid var(--bd); overflow: hidden;}
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; background: var(--c-bg); }
tbody tr.main-row { position: relative; z-index: 1; transition: background-color var(--anim), opacity var(--anim); }
tbody tr.main-row:hover { background-color: var(--hov); z-index: 50; }

th { background: var(--th) !important; color: var(--tm); padding: 16px; text-align: left; position: sticky !important; top: 0 !important; z-index: 100 !important; border-bottom: 1px solid var(--bd); font-size: 12px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px;}
th.sortable { cursor: pointer; user-select: none; }
td { padding: 16px; border-bottom: 1px solid var(--bd); vertical-align: middle; color: var(--t); }

.sort-icon { display: inline-block; font-size: 14px; color: var(--tm); margin-left: 6px; opacity: 0.4; transition: var(--anim); vertical-align: baseline; }
th.sortable:hover .sort-icon { opacity: 1; color: var(--blue); }
.sort-icon.active { opacity: 1; color: var(--blue); font-weight: 900; transform: scale(1.2); }

.col-chk { width: 50px; text-align: center !important; }
.col-status { width: 140px; text-align: left !important; }
.col-ip { width: 160px; text-align: left !important; color: var(--tm) !important; font-size: 13px !important; font-family: monospace; }
.col-name { text-align: left !important; } 
.col-name b { font-size: 15px; color: var(--t); font-weight: 700; }
td.col-actions { width: auto; min-width: 250px; text-align: left !important; padding-right: 15px !important; white-space: nowrap; }

.action-group { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 8px !important; justify-content: flex-start; align-items: center; }

.badge { display: inline-flex; align-items: center; justify-content: center; flex-wrap: nowrap; white-space: nowrap; gap: 6px; padding: 5px 10px; border-radius: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.5px; transition: var(--anim); }
.badge-online { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.badge-offline { background: rgba(148,163,184,0.1); color: var(--gray); border: 1px solid rgba(148,163,184,0.2); }
.badge-tag { background: rgba(59,130,246,0.1); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); font-size: 10px; margin-top: 6px; display: inline-block; padding: 2px 8px; }

.dot-status { width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.dot-online { background-color: var(--green); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
.dot-offline { background-color: var(--gray); }

.paused-row { opacity: 0.5; background-color: rgba(0,0,0,0.02); filter: grayscale(100%); }
body.dark-mode .paused-row { background-color: rgba(255,255,255,0.02); }
.paused-row:hover { opacity: 0.7; }

.ip-flex { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; }

.btn-action { background: var(--c-bg); border: 1px solid var(--bd); border-radius: 8px; padding: 10px; cursor: pointer; color: var(--tm); display: flex; align-items: center; transition: var(--anim); }
.btn-action svg { width: 18px; height: 18px; fill: currentColor; }
.btn-action:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.1); transform: translateY(-1px); }
.btn-action.delete:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.1); }
.btn-action.edit:hover:not(:disabled) { border-color: var(--yellow); color: var(--yellow); background: rgba(245,158,11,0.1); }
.btn-action.info:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.1); }
.btn-action.toggle:hover:not(:disabled) { border-color: var(--gray); color: var(--t); background: var(--bd); }
.btn-action.play:hover:not(:disabled) { border-color: var(--green); color: var(--green); background: rgba(16,185,129,0.1); }
.btn-action:disabled { opacity: 0.3; cursor: not-allowed; }

.batch-bar { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); background: var(--c-bg); border: 1px solid var(--bd); box-shadow: 0 10px 30px var(--sh); border-radius: 12px; padding: 15px 25px; display: flex; gap: 15px; align-items: center; z-index: 1000; transition: bottom var(--anim); }
.batch-bar.visible { bottom: 25px; }
.batch-count { font-weight: 700; color: var(--t); font-size: 14px; background: var(--hov); padding: 5px 12px; border-radius: 20px; }

.dash-footer { display: block; width: 100%; text-align: center; font-size: 12px; color: var(--tm); padding: 30px 20px; margin-top: auto; border-top: 1px solid var(--bd); }

.modal-overlay { display: flex; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--anim), visibility var(--anim); position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-overlay.show-modal { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-card { background: var(--c-bg); width: 90%; max-width: 850px; border-radius: 24px; padding: 35px 30px; text-align: center; box-shadow: 0 25px 50px var(--sh); border-top: 6px solid var(--blue); max-height: 95vh; overflow-y: auto; transform: translateY(30px) scale(0.95); transition: transform var(--anim); }
.modal-card.small { max-width: 420px; padding: 30px 25px; overflow-x: hidden; word-wrap: break-word; }
.modal-overlay.show-modal .modal-card { transform: translateY(0) scale(1); }

.success-shield-anim { width: 75px !important; height: 75px !important; max-width: 75px !important; margin: 0 auto 15px auto; display: block; animation: scaleUp 0.6s cubic-bezier(0.17, 0.89, 0.32, 1.49); }
@keyframes scaleUp { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-actions-row { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; justify-content: center; margin-bottom: 0; }
.btn-modal { padding: 12px 18px; border-radius: 10px; border: none; font-weight: 700; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--anim); min-height: 48px; flex: 1; min-width: 120px; }
.btn-modal:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px);}
.btn-modal svg { width: 18px; height: 18px; fill: currentColor; display: block;}
.btn-block { width: 100% !important; margin-top: 12px !important; }

.btn-modal.ok { background: var(--green); color: white; }
.btn-modal.confirm { background: var(--red); color: white; }
.btn-modal.save { background: var(--yellow); color: white; }
.btn-modal.download { background: var(--blue); color: white; } 
.btn-modal.copy { background: var(--green); color: white; } 
.btn-modal.qr { background: #8b5cf6; color: white; } 

.btn-modal.cancel { background: var(--hov); color: var(--t); border: 1px solid var(--bd); }
.btn-modal.cancel:hover:not(:disabled) { filter: none; background: var(--bd); transform: translateY(-1px); }
body.dark-mode .btn-modal.cancel:hover:not(:disabled) { background: #475569; border-color: #64748b; }

.qr-box { background: var(--hov); border: 2px dashed var(--bd); padding: 10px; border-radius: 16px; margin: 10px auto; display: inline-block; }
.qr-box img { width: 220px; height: 220px; } 

.changelog-list { text-align: left; background: var(--hov); padding: 20px; border-radius: 12px; border: 1px solid var(--bd); margin-bottom: 0; max-height: 50vh; overflow-y: auto; }
.changelog-item { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dashed var(--bd); }
.cl-version { display:flex; align-items:center; gap:8px; font-weight: 700; color: var(--t); margin-bottom: 4px; font-size: 14px;}
.cl-desc { font-size: 13px; color: var(--tm); line-height: 1.5; }

.name-wrapper { position: relative; width: max-content; }
.info-panel { display: block; position: absolute; top: 100%; left: 0; margin-top: 10px; background: var(--c-bg); border: none; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; padding: 15px; font-size: 12px; color: var(--tm); text-align: left; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-5px); transition: all var(--anim); width: max-content; box-shadow: 0 10px 25px var(--sh); z-index: 999; }
.info-panel.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.info-row { display: flex; justify-content: space-between; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--bd); gap: 25px; white-space: nowrap !important; }
.info-row span { white-space: nowrap !important; flex-shrink: 0; }
.info-row:last-child { border: none; padding:0; margin:0;}
.info-val { font-weight: 700; color: var(--t); font-family: monospace; font-size: 13px; text-align: right; }

.log-table { width: 100%; text-align: left; font-size: 13px; border-collapse: collapse; }
.log-table th, .log-table td { padding: 10px; border-bottom: 1px solid var(--bd); }
.log-table th { font-weight: 700; color: var(--tm); position: sticky; top:0; background: var(--hov); z-index: 10; font-size: 11px; text-transform: uppercase;}

.conf-area { width:100%; height:260px; font-family:monospace; font-size:13px; padding:15px; border-radius:12px; border:1px solid var(--bd); background:var(--ibg); color:var(--t); resize:none; line-height:1.5;}

.chart-container { position: relative; height: 180px; width: 100%; margin-top: 20px; overflow: hidden; display:flex; justify-content:center; }
.peer-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: var(--blue); border-radius: 4px; }

.mobile-td, .mobile-dot, .mobile-info-row { display: none; } 

@media (max-width: 768px) { 
    .dashboard-container { display: flex !important; flex-direction: column !important; width: 100vw !important; padding: 15px !important; margin: 0 !important; overflow-x: hidden !important; } 
    .left-col, .right-col { display: contents; } 
    #formAdd-card { order: 1; } #peersList-card { order: 2; margin-top: 20px; } #status-card { order: 3; margin-top: 20px; }
    
    .top-telemetry { display: none !important; } 
    .hide-mobile { display: none !important; } 
    .card { padding: 20px 15px; border-radius: 16px; width: 100%; overflow: hidden; min-width: 0; } 
    
    .header { padding: 15px; flex-direction: row !important; align-items: center !important; justify-content: space-between; }
    .header-left h2 { font-size: 18px !important; }
    .logout-text { display: none; }
    
    .card-header { flex-direction: column !important; align-items: flex-start !important; gap: 15px !important; }
    .search-wrapper { width: 100% !important; max-width: 100% !important; }
    
    .table-wrapper { overflow-x: auto !important; overflow-y: hidden !important; border: 1px solid var(--bd) !important; border-radius: 12px !important; }
    table { table-layout: fixed; width: 100%; }
    
    .mobile-td { display: table-cell !important; }
    .mobile-dot { display: inline-block !important; }
    
    .col-chk { width: 35px !important; text-align: center !important; padding: 12px 0 !important; }
    .col-status { width: 85px !important; text-align: center !important; padding: 12px 2px !important; white-space: nowrap !important; } 
    .col-ip { width: 100px !important; padding: 12px 0 12px 10px !important; overflow: hidden; font-size: 11px !important;}
    td.col-name { width: auto !important; padding-right: 5px !important; }
    .col-chev { width: 50px !important; text-align: center !important; padding: 12px 5px !important; }
    th, td { white-space: normal !important; padding: 12px 4px !important; font-size: 13px !important; }
    
    .btn-chevron { width: 40px; height: 40px; border-radius: 10px; background: var(--c-bg); border: 1px solid var(--bd); color: var(--tm); display: flex; align-items: center; justify-content: center; padding: 0; margin: 0 auto; }
    .mobile-info-content { padding: 15px !important; background: transparent !important; margin: 0 !important; width: 100%; border-bottom: none !important; }
    
    .mobile-stats { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; margin: 0 auto 15px auto !important; padding: 15px !important; background: var(--hov) !important; border-radius: 12px !important; border: 1px solid var(--bd) !important; }
    .mobile-stats div { display: flex; flex-direction: column; gap: 4px; }
    .mobile-stats .lbl { font-size: 10px; font-weight: 700; color: var(--tm); text-transform: uppercase; }
    .mobile-stats b { font-size: 12px; font-family: monospace; color: var(--t); }
    
    .mobile-big-actions { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; gap: 10px !important; width: 100%; max-width: 280px; margin: 0 auto; }
    .mobile-big-actions .btn-action { width: 44px !important; height: 44px !important; }
    
    .modal-card { padding: 25px 15px !important; border-radius: 20px !important;}
    .modal-card h3 { font-size: 18px !important; margin-bottom: 10px !important;}
    
    .success-shield-anim { width: 60px !important; height: 60px !important; max-width: 60px !important; margin: 0 auto 10px auto !important; }
    
    .qr-box { padding: 8px !important; margin: 5px auto 10px auto !important; border-radius: 12px !important;}
    .qr-box img { width: 160px !important; height: 160px !important; } 
    .conf-area { height: 120px !important; font-size: 10px !important; padding: 10px !important; border-radius: 10px !important;}
    
    .modal-actions-row { gap: 8px !important; margin-bottom: 0 !important; }
    .btn-modal { padding: 10px 12px !important; min-height: 40px !important; font-size: 12px !important; border-radius: 8px !important;}
    .btn-block { margin-top: 8px !important; }
    .changelog-list { margin-bottom: 0 !important; }
    
    .batch-bar { width: 95%; flex-direction: row; gap: 8px; padding: 10px; bottom: -150px; flex-wrap: wrap; justify-content: center; }
    .batch-bar.visible { bottom: 15px; } 
    .dash-footer { padding: 20px 10px; font-size: 11px; margin-top: 20px; }
}
/* FIX PLAY: Evitar que el boton Play se estire */
@media (max-width: 768px) {
    .batch-bar .btn-action.play { flex: 0 1 auto !important; min-width: 44px !important; }
}



/* FIX CUADRÍCULA 2x2: Botones y textos idénticos */
.dashboard-container { gap: 10px !important; }
@media (max-width: 768px) {
    #peersList-card, #status-card { margin-top: 10px !important; }
    
    .batch-bar { 
        display: grid !important; 
        grid-template-columns: 1fr 1fr !important; 
        gap: 10px !important; 
        padding: 12px !important; 
    }
    .batch-count, .batch-bar button { 
        width: 100% !important; 
        height: 48px !important; 
        margin: 0 !important; 
        display: flex !important; 
        justify-content: center !important; 
        align-items: center !important; 
        font-size: 13px !important;
        border-radius: 10px !important;
    }
}

/* ESTADOS (Rojo=Parado, Gris=Pausa) */
.metric-card.paused { border-left: 4px solid var(--tm); }
.metric-card.paused .metric-icon { background: rgba(100,116,139,0.1); color: var(--tm); }
.metric-card.cpu { grid-column: 1 / -1; }
.dot-offline { background-color: var(--red); box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.dot-paused { background-color: var(--tm); }
.badge-offline { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.2); }
.badge-paused { background: rgba(100,116,139,0.1); color: var(--tm); border-color: rgba(100,116,139,0.2); }
