:root{--bg:#f5f6f7;--panel:#fff;--line:#e5e9ec;--text:#273038;--muted:#7d8992;--teal:#3b9487;--teal2:#e9f5f3;--blue:#3876b8;--green:#2f9864;--red:#c55656;--amber:#bb8228;--sidebar:205px;--shadow:0 1px 2px rgba(20,31,38,.04)}
*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;background:var(--bg);color:var(--text);font-family:Arial,Helvetica,sans-serif;font-size:14px}.sidebar{position:fixed;left:0;top:0;bottom:0;width:var(--sidebar);background:#fff;border-right:1px solid #e5e8ea;z-index:20;transition:.2s}.brand{height:78px;display:flex;align-items:center;justify-content:center;flex-direction:column;border-bottom:1px solid #f1f2f3;color:#235c73}.brand-cloud{height:30px;line-height:24px;font-size:38px;filter:grayscale(.1)}.brand strong{font-size:12px;letter-spacing:2px;margin-top:1px}.brand small{font-size:7px;letter-spacing:1.8px;color:#8799a3}.sidebar nav{padding:14px 0}.section{display:block;padding:12px 10px 5px;font-size:9px;font-weight:bold;color:#9ba5ad;letter-spacing:.9px}.sidebar a{display:flex;gap:11px;align-items:center;text-decoration:none;color:#69747d;padding:11px 14px;border-left:4px solid transparent;transition:.15s}.sidebar a:hover,.sidebar a.active{background:linear-gradient(90deg,#e8f4f2,#fff);color:#337f75;border-left-color:#4aa394}.nav-ico{width:18px;text-align:center;font-size:16px;color:#6d777d}main{margin-left:var(--sidebar);min-height:100vh;padding-bottom:55px}.topbar{height:50px;background:#fff;display:flex;justify-content:space-between;align-items:center;padding:0 22px;border-bottom:1px solid #eee;position:sticky;top:0;z-index:10}.hamb{border:0;background:none;font-size:18px;cursor:pointer;color:#465159}.top-right{display:flex;align-items:center;gap:10px}.live-dot{width:8px;height:8px;border-radius:50%;background:#42aa70;box-shadow:0 0 0 3px #e7f5ed}.userbox{text-align:right;font-size:11px}.userbox small{display:block;color:#8c969d;font-size:9px}.logout{font-size:11px;text-decoration:none;color:#68747c;border-left:1px solid #ddd;padding-left:10px}.content{padding:18px 12px 70px;max-width:1900px;margin:auto}.page-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:0 0 14px;padding:0 2px}.page-head h1{font-size:17px;margin:0 0 3px}.page-head p{margin:0;color:var(--muted);font-size:12px}.head-actions{display:flex;gap:8px}.head-actions form{margin:0}.panel{background:#fff;border:1px solid var(--line);border-radius:3px;margin-bottom:16px;padding:14px;box-shadow:var(--shadow)}.compact-panel{padding:0}.compact-panel .table-wrap{padding:0}.panel h3{margin:0 0 4px;font-size:14px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:12px}.panel-head p{margin:3px 0 0}.btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;background:#428f83;color:#fff;border:1px solid #428f83;border-radius:3px;padding:8px 13px;cursor:pointer;text-decoration:none;font:inherit;font-size:12px}.btn:hover{filter:brightness(.97)}.btn.secondary{background:#5e7381;border-color:#5e7381}.btn.ghost{background:#fff;color:#56636c;border-color:#cfd7dc}.btn.danger-btn{background:#fff0f0;color:#aa4444;border-color:#e2b5b5}.btn-lg{width:100%;padding:11px}.fit{width:max-content}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:980px}th{text-align:left;background:#fff;padding:11px 9px;border-bottom:1px solid #7f8589;font-size:11px;white-space:nowrap}td{padding:10px 9px;border-bottom:1px solid #eceeef;background:#fafafa;font-size:11px;vertical-align:middle}tr:nth-child(even) td{background:#f4f4f4}.compact-panel tr:last-child td{border-bottom:0}.strong-code{font-weight:700;color:#24333b}.subline{display:block;font-size:9px;color:#8b959b;margin-top:3px}.health-detail{max-width:280px;color:#53616a}.empty{text-align:center!important;color:#8e989f;padding:28px!important}.actions{display:flex;gap:5px;align-items:center;white-space:nowrap}.actions form{margin:0}.mini{display:inline-flex;align-items:center;border:1px solid #d3dce3;background:#eaf1fb;padding:5px 7px;border-radius:3px;cursor:pointer;color:#356da8;text-decoration:none;font-size:10px}.mini.danger{color:#9a3333;background:#faeaea;border-color:#edd0d0}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.cards.six{grid-template-columns:repeat(6,1fr)}.card{background:#fff;border:1px solid #e4e8ea;padding:14px 16px;border-radius:4px;box-shadow:var(--shadow);position:relative;min-height:92px}.card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#70838f}.card.ok:before{background:var(--green)}.card.bad:before{background:var(--red)}.card.warn:before{background:var(--amber)}.card b{display:block;font-size:26px;margin:4px 0;color:#26343c}.card.ok b{color:var(--green)}.card.bad b{color:var(--red)}.card.warn b{color:var(--amber)}.card small,.card-label{color:#808b93;font-size:10px}.card-label{text-transform:uppercase;letter-spacing:.7px;font-weight:bold}.form{display:grid;gap:12px}.dialog-form{min-width:min(680px,82vw)}.form.wide{min-width:0}.form label{display:grid;gap:5px;font-weight:600;font-size:11px;color:#536069}.form input,.form textarea,.form select{padding:9px;border:1px solid #cfd6dc;border-radius:3px;font:inherit;background:#fff;color:#283239}.form textarea{resize:vertical}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.check{display:flex!important;grid-auto-flow:column;justify-content:start;align-items:center;font-weight:normal!important}.check input{width:auto}.bigcheck{min-height:38px;align-self:end}.test-switch{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:10px!important;padding:11px;border:1px solid #e1d2ae;border-radius:4px;background:#fff8e7;font-weight:normal!important}.test-switch input{width:auto;transform:scale(1.1)}.test-switch span{display:grid}.test-switch b{color:#835f1f}.test-switch small{font-weight:normal;color:#8a7958}.test-switch.inline{align-self:end;padding:7px 10px}.form fieldset{border:1px solid #e1e5e8;border-radius:4px;padding:12px}.form legend{font-size:10px;color:#75818a;padding:0 5px;font-weight:bold}.form details{border:1px solid #e1e5e8;border-radius:4px;padding:10px}.form summary{cursor:pointer;color:#56636b;font-size:11px;font-weight:bold;margin-bottom:8px}dialog{border:0;border-radius:6px;box-shadow:0 18px 60px rgba(0,0,0,.25);max-width:760px;padding:0}dialog::backdrop{background:rgba(25,35,42,.44)}.dialog-form{padding:18px}.dialog-head{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid #eceff0;padding-bottom:10px}.dialog-head h3{margin:0;font-size:15px}.dialog-head p{margin:4px 0 0;color:#859099;font-size:10px}.dialog-head button{border:0;background:none;font-size:21px;cursor:pointer;color:#68757d}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.status{display:inline-block;padding:4px 7px;border-radius:11px;font-size:9px;font-weight:bold;white-space:nowrap}.status.online{background:#dff4e8;color:#26764d}.status.offline{background:#f6dfdf;color:#a03b3b}.badge{display:inline-block;padding:4px 7px;border-radius:3px;font-size:9px;font-weight:bold;white-space:nowrap}.badge.demo{background:#fff0c7;color:#8f661f}.badge.live{background:#dff4e8;color:#24724b}.badge.neutral{background:#e8eef2;color:#586a76}.badge.large{padding:6px 9px}.pill{padding:4px 6px;border-radius:3px;background:#edf1f4;display:inline-block}.pill.success{background:#dff4e8;color:#2a6e4b}.pill.warning{background:#fff0c7;color:#835f1e}.pill.error{background:#f6dfdf;color:#943d3d}.ip-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:9px;margin:12px 0}.ip-choice{border:1px solid #d9dee2;padding:10px;border-radius:4px;display:grid!important;grid-template-columns:auto 1fr auto!important;align-items:center;gap:9px!important;background:#fff;font-weight:normal!important}.ip-choice.good{border-left:4px solid #42a66e}.ip-choice.down{border-left:4px solid #c45d5d}.ip-choice .pool-check{width:auto}.ip-main{display:grid}.ip-main small{font-size:9px;color:#777}.ip-main em{font-style:normal;font-weight:bold}.green{color:#2e8f61}.red{color:#b94747}.priority{display:grid;gap:3px}.priority small{font-size:8px;color:#89939a;text-transform:uppercase}.priority input{width:62px!important;padding:5px!important}.muted{color:var(--muted);font-size:10px}.flash,.notice{padding:10px 13px;margin-bottom:12px;border-radius:3px;border:1px solid #d6e9e0;background:#eaf6f0;font-size:11px}.flash.error,.notice.error{background:#fae8e8;border-color:#edcece;color:#8e3a3a}.notice.info{background:#edf5fa;border-color:#d4e5ef;color:#4b6879}.notice.warning{background:#fff6df;border-color:#ebd7a8;color:#765a1e}.notice.safe{background:#ecf7f1;border-color:#cce8da;color:#376a51}.countdown{font-family:Consolas,monospace;font-weight:bold;color:#3b708e;background:#edf4f8;padding:4px 6px;border-radius:3px;display:inline-block;min-width:62px;text-align:center}.countdown.paused{color:#8d6d2b;background:#fff3d8}.disabled-row{opacity:.55}.narrow-panel{max-width:760px}.empty-card{padding:24px;border:1px dashed #ccd4d9;color:#849098;text-align:center;border-radius:4px}.logs-table td:first-child{white-space:nowrap}footer{position:fixed;left:var(--sidebar);right:0;bottom:0;background:#fff;border-top:1px solid #eee;color:#9aa4ad;padding:14px 20px;font-size:10px;z-index:9;transition:.2s}
body.compact .sidebar{width:66px}body.compact main{margin-left:66px}body.compact footer{left:66px}body.compact .brand strong,body.compact .brand small,body.compact .sidebar a span:last-child,body.compact .section{display:none}body.compact .sidebar a{justify-content:center;padding:14px 0}body.compact .nav-ico{font-size:18px}
.login-page{min-height:100vh;background:linear-gradient(135deg,#f5f7f8,#eaf1f3);display:grid;place-items:center}.login-shell{width:min(780px,92vw);display:grid;grid-template-columns:1fr 1.15fr;background:#fff;border:1px solid #dde4e7;border-radius:8px;box-shadow:0 18px 55px rgba(46,65,75,.12);overflow:hidden}.login-brand{background:linear-gradient(160deg,#285e73,#3d9186);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:35px}.login-cloud{font-size:70px;line-height:60px}.login-brand h1{margin:12px 0 2px;font-size:26px;letter-spacing:.5px}.login-brand p{font-size:9px;letter-spacing:2px;opacity:.8}.login-card{padding:38px;display:grid;gap:13px}.login-card h2{margin:0;font-size:19px}.login-card p{margin:0 0 5px}.login-card label{display:grid;gap:6px;font-size:11px;font-weight:bold;color:#58666e}.login-card input{padding:10px;border:1px solid #cfd8dd;border-radius:3px;font:inherit}.demo-credentials{background:#fff7e4;border:1px solid #eed9a8;border-radius:3px;padding:9px;font-size:10px;color:#76581b}
@media(max-width:1200px){.cards.six{grid-template-columns:repeat(3,1fr)}.grid4{grid-template-columns:1fr 1fr}.grid3{grid-template-columns:1fr 1fr}}
@media(max-width:800px){:root{--sidebar:66px}.brand strong,.brand small,.sidebar a span:last-child,.section{display:none}.sidebar a{justify-content:center;padding:15px 0}.nav-ico{font-size:18px}footer{left:66px}.cards.six,.cards{grid-template-columns:1fr 1fr}.grid2,.grid3,.grid4{grid-template-columns:1fr}.page-head{align-items:flex-start;flex-direction:column}.head-actions{width:100%;flex-wrap:wrap}.login-shell{grid-template-columns:1fr}.login-brand{padding:22px}.login-cloud{font-size:44px}.login-brand h1{font-size:20px}.dialog-form{min-width:80vw}.ip-grid{grid-template-columns:1fr}}
.operator-table{min-width:1450px}.op-head{text-align:center}.operator-cell{text-align:center;min-width:120px}.operator-cell small{display:block;margin-top:4px;color:#89949b;font-size:8px}.op-status{display:inline-block;min-width:82px;padding:5px 7px;border-radius:12px;font-size:9px;font-weight:700}.op-status.online{background:#dff4e8;color:#217149}.op-status.offline{background:#f8dddd;color:#a23838}.op-status.unknown{background:#edf0f2;color:#7a858c}.agent-chip{display:inline-block;background:#fff;border:1px solid #cfe4d8;border-radius:12px;padding:4px 8px;margin:2px;font-size:9px}

/* tabela IP simplificada */
.operator-table-simple{min-width:1180px}
.operator-table-simple th,.operator-table-simple td{vertical-align:middle}
.operator-table-simple .operator-cell{min-width:118px}
.check-badge{display:inline-block;background:#e7f0f4;color:#4a626e;border-radius:3px;padding:4px 7px;font-size:9px;font-weight:700}
.last-check{white-space:nowrap;font-size:10px;color:#53616a}

.field-help{display:block;margin-top:6px;color:#77838f;font-size:12px}.dialog-actions .btn:disabled{opacity:.5;cursor:not-allowed}

/* ===== Digital_Team Rotation V3.7 ===== */
.brand-logo{max-width:54px;max-height:34px;object-fit:contain;margin-bottom:3px}.brand strong{font-size:10px;letter-spacing:1.5px}.brand small{font-size:7px}.lisbon-clock{font-family:Consolas,monospace;font-size:10px;color:#63717a;background:#f2f5f6;border:1px solid #e2e7e9;border-radius:3px;padding:5px 8px;white-space:nowrap}.theme-toggle{width:30px;height:30px;border:1px solid #d8e0e4;background:#fff;color:#53616a;border-radius:4px;cursor:pointer;font-size:16px}.countdown.processing{color:#7b6329;background:#fff3d8}.sortable-table th.sortable{cursor:pointer;user-select:none;padding-right:22px;position:relative}.sortable-table th.sortable:after{content:'⇅';position:absolute;right:7px;color:#a2abb1;font-size:10px}.sortable-table th.sort-asc:after{content:'▲';color:#3b9487}.sortable-table th.sort-desc:after{content:'▼';color:#3b9487}.select-col{width:38px;text-align:center!important}.select-col input{width:16px;height:16px;cursor:pointer}.bulk-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border:1px solid var(--line);padding:9px 12px;border-radius:3px 3px 0 0;font-size:11px}.bulk-actions{display:flex;gap:8px}.bulk-actions .btn:disabled{opacity:.45;cursor:not-allowed}.danger-solid{background:#b64d4d!important;border-color:#b64d4d!important;color:#fff!important}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.logo-preview-wrap{min-height:105px;display:flex;align-items:center;justify-content:center;background:#f6f8f9;border:1px dashed #ccd5da;border-radius:5px;margin:12px 0}.logo-preview{max-width:260px;max-height:90px;object-fit:contain}.logo-placeholder{font-size:58px;color:#2a6578}.inline-form{margin-top:9px}.theme-choice{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0}.dark-btn{background:#28323a;border-color:#28323a}.login-logo{max-width:190px;max-height:100px;object-fit:contain;margin-bottom:10px}.login-theme-toggle{position:fixed;right:18px;top:18px;z-index:50;width:38px;height:38px;border-radius:50%;border:1px solid #d5dde1;background:#fff;color:#3d4d56;cursor:pointer;font-size:19px;box-shadow:0 3px 12px rgba(0,0,0,.08)}

/* Dark mode */
html[data-theme="dark"]{--bg:#12171b;--panel:#1a2126;--line:#303941;--text:#e8edf0;--muted:#95a1aa;--shadow:0 1px 2px rgba(0,0,0,.22);color-scheme:dark}
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] .sidebar,html[data-theme="dark"] .topbar,html[data-theme="dark"] footer,html[data-theme="dark"] .panel,html[data-theme="dark"] .card,html[data-theme="dark"] .bulk-toolbar{background:#1a2126;border-color:#303941;color:#e8edf0}
html[data-theme="dark"] .brand{border-color:#2a3238;color:#72b8c8}html[data-theme="dark"] .brand small,html[data-theme="dark"] .section{color:#74828b}
html[data-theme="dark"] .sidebar a{color:#aab5bc}html[data-theme="dark"] .sidebar a:hover,html[data-theme="dark"] .sidebar a.active{background:linear-gradient(90deg,#1f3a39,#1a2126);color:#74c4b7;border-left-color:#4aa394}
html[data-theme="dark"] .nav-ico,html[data-theme="dark"] .hamb,html[data-theme="dark"] .logout{color:#aab5bc}html[data-theme="dark"] .topbar{border-color:#2b343b}
html[data-theme="dark"] .lisbon-clock{background:#11171b;border-color:#303a41;color:#a9b5bc}html[data-theme="dark"] .theme-toggle,html[data-theme="dark"] .login-theme-toggle{background:#242d33;border-color:#3b474f;color:#e9eef1}
html[data-theme="dark"] th{background:#1b2227;border-color:#4b555c;color:#dce3e7}html[data-theme="dark"] td{background:#171d21;border-color:#293239;color:#cbd4d9}html[data-theme="dark"] tr:nth-child(even) td{background:#1c2328}
html[data-theme="dark"] .strong-code,html[data-theme="dark"] code{color:#e7eef2}html[data-theme="dark"] .subline,html[data-theme="dark"] .last-check,html[data-theme="dark"] .health-detail{color:#87949c}
html[data-theme="dark"] .card b{color:#e8edf0}html[data-theme="dark"] .card small,html[data-theme="dark"] .card-label{color:#8e9ba4}
html[data-theme="dark"] .form label,html[data-theme="dark"] .login-card label{color:#bcc6cc}html[data-theme="dark"] .form input,html[data-theme="dark"] .form textarea,html[data-theme="dark"] .form select,html[data-theme="dark"] .login-card input{background:#11171b;border-color:#3a454d;color:#e7ecef}
html[data-theme="dark"] .form fieldset,html[data-theme="dark"] .form details{border-color:#303941}html[data-theme="dark"] .form summary{color:#aeb9c0}
html[data-theme="dark"] dialog{background:#1a2126;color:#e7ecef}html[data-theme="dark"] .dialog-head{border-color:#303941}html[data-theme="dark"] .dialog-head button{color:#bac4ca}
html[data-theme="dark"] .btn.ghost{background:#20282e;border-color:#3b464e;color:#c6d0d5}html[data-theme="dark"] .btn.danger-btn{background:#392426;border-color:#5c3639;color:#efa5aa}
html[data-theme="dark"] .mini{background:#202d3b;border-color:#34475a;color:#8eb9e5}html[data-theme="dark"] .mini.danger{background:#3a2426;border-color:#59363a;color:#e69a9e}
html[data-theme="dark"] .notice.info{background:#18272f;border-color:#29404d;color:#a9c4d1}html[data-theme="dark"] .notice.warning{background:#332c1d;border-color:#594a2a;color:#e2c986}html[data-theme="dark"] .notice.safe{background:#193028;border-color:#295140;color:#9fd2ba}html[data-theme="dark"] .notice.error,html[data-theme="dark"] .flash.error{background:#382326;border-color:#5c373b;color:#e5a1a6}
html[data-theme="dark"] .agent-chip{background:#15221e;border-color:#315343;color:#a7cfbc}html[data-theme="dark"] .op-status.unknown{background:#2b343a;color:#a7b0b6}
html[data-theme="dark"] .check-badge{background:#22333b;color:#b8ccd5}html[data-theme="dark"] .countdown{background:#1c303c;color:#84b9d7}html[data-theme="dark"] .countdown.processing,html[data-theme="dark"] .countdown.paused{background:#372f1f;color:#e0c77e}
html[data-theme="dark"] .test-switch{background:#332c1d;border-color:#594a2a}html[data-theme="dark"] .test-switch b{color:#e1c47a}html[data-theme="dark"] .test-switch small{color:#b3a57e}
html[data-theme="dark"] .logo-preview-wrap{background:#11171b;border-color:#3b464e}html[data-theme="dark"] .logo-placeholder{color:#6ba3b6}
html[data-theme="dark"] .login-page{background:linear-gradient(135deg,#0e1215,#172027)}html[data-theme="dark"] .login-shell{background:#1a2126;border-color:#303a41;box-shadow:0 18px 55px rgba(0,0,0,.35)}html[data-theme="dark"] .login-card{background:#1a2126}html[data-theme="dark"] .demo-credentials{background:#332c1d;border-color:#594a2a;color:#dec47f}
html[data-theme="dark"] .empty-card{border-color:#3c474e;color:#8a989f}
@media(max-width:900px){.settings-grid{grid-template-columns:1fr}.lisbon-clock{display:none}.bulk-toolbar{align-items:flex-start;flex-direction:column}.bulk-actions{width:100%;flex-wrap:wrap}}

/* V3.7 pairing PIN */
.pair-pin{font-size:34px;font-weight:800;letter-spacing:7px;text-align:center;padding:18px 14px;margin:14px 0;border:1px dashed var(--border,#cbd5e1);border-radius:8px;background:var(--soft,#f4f7f9);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.top-pin{display:block;margin-top:2px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.5px}
[data-theme="dark"] .pair-pin{background:#162028;border-color:#3c5260}

/* V3.7 filters and strict sorting */
.filter-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border:1px solid var(--line);padding:10px 12px;border-radius:3px;margin-bottom:8px}.filter-box{display:flex;align-items:center;gap:9px;font-size:11px;font-weight:700;color:#536069}.filter-box select{min-width:230px;padding:7px 9px;border:1px solid #cfd6dc;border-radius:3px;background:#fff;color:#283239}.filter-summary{font-size:10px;color:var(--muted)}html[data-theme="dark"] .filter-toolbar{background:#1a2126;border-color:#303941}html[data-theme="dark"] .filter-box{color:#bcc6cc}html[data-theme="dark"] .filter-box select{background:#11171b;border-color:#3a454d;color:#e7ecef}.operator-table tbody tr[style*="display: none"]{display:none!important}@media(max-width:800px){.filter-toolbar{align-items:flex-start;flex-direction:column}.filter-box{width:100%;display:grid}.filter-box select{width:100%;min-width:0}}

/* V3.7 */
.btn.warning-btn{background:#d58b28;border-color:#d58b28;color:#fff}
.op-status.partial{background:#fff0c7;color:#8b641d}
html[data-theme="dark"] .op-status.partial{background:#3a311b;color:#e7c66f}
html[data-theme="dark"] .btn.warning-btn{background:#9b6926;border-color:#9b6926;color:#fff}
