:root { font-family: Inter, system-ui, sans-serif; color: #172033; background: #f3f6fa; }
* { box-sizing: border-box; }
body { margin: 0; text-transform: uppercase; }
header { height: 60px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: #0f172a; color: white; }
header strong { font-size: 21px; margin-right: 12px; }
header span { color: #94a3b8; font-size: 13px; }
.user-badge { padding: 6px 9px; border-radius: 999px; background: #1e293b; color: #cbd5e1; }
.logout-form { margin: 0; }
.logout-form button { padding: 8px 10px; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions a { padding: 8px 10px; border-radius: 6px; color: white; background: #1e293b; text-decoration: none; font-size: 12px; }
main { height: calc(100vh - 60px); display: grid; grid-template-columns: 355px 1fr; }
aside { background: white; overflow-y: auto; border-right: 1px solid #dbe2ea; z-index: 500; }
.map-area { position: relative; min-width: 0; min-height: 0; }
#map { height: 100%; }
.location-search { position: absolute; z-index: 800; top: 12px; left: 50%; transform: translateX(-50%); display: flex; width: min(620px, calc(100% - 120px)); padding: 6px; border-radius: 9px; background: white; box-shadow: 0 2px 12px #0004; }
.location-search input { margin: 0; border: 0; outline: 0; }
.location-search button { white-space: nowrap; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #e2e8f0; }
.tab { border: 0; border-radius: 0; padding: 14px; background: white; color: #64748b; }
.tab.active { color: #0f766e; border-bottom: 3px solid #0f766e; }
.panel { display: none; padding: 16px; }
.panel.active { display: block; }
.hint { margin: 0 0 14px; padding: 10px; border-radius: 7px; background: #ecfeff; color: #155e75; font-size: 13px; }
.point-search { margin-bottom: 16px; padding-bottom: 15px; border-bottom: 1px solid #e2e8f0; }
.point-search > label { margin-bottom: 5px; }
.point-search > small { display: block; min-height: 16px; margin-top: 5px; color: #64748b; }
.filter-label { margin-top: 10px; }
.point-search select { margin-top: 0; }
.filter-grid { gap: 7px; }
.map-filters { margin-bottom: 16px; padding: 12px; border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; }
.map-filters > strong { display: block; margin-bottom: 8px; color: #075985; font-size: 13px; }
.map-filters label { margin-bottom: 5px; }
.map-filters small { display: block; min-height: 16px; margin-top: 5px; color: #0369a1; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > span { position: absolute; left: 11px; z-index: 1; color: #64748b; font-size: 22px; line-height: 1; transform: rotate(-20deg); pointer-events: none; }
.search-field input { margin: 0; padding-left: 36px; padding-right: 38px; }
.search-field input:focus { border-color: #0f766e; outline: 3px solid #ccfbf1; }
.search-clear { position: absolute; right: 5px; width: 30px; height: 30px; padding: 0; border-radius: 50%; background: transparent; color: #64748b; font-size: 21px; }
.search-clear:hover { background: #e2e8f0; color: #172033; }
label { display: block; margin-bottom: 11px; color: #475569; font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: white; color: #172033; }
textarea { resize: vertical; }
#parentPointHint { display: block; margin-top: 5px; color: #64748b; font-weight: 500; }
.client-details { margin: 0 0 12px; padding: 12px; border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; }
.client-details > strong { display: block; margin-bottom: 9px; color: #075985; font-size: 13px; }
.signal-good { color: #15803d; }
.signal-warning { color: #b45309; }
.signal-critical { color: #b91c1c; }
button { border: 0; border-radius: 7px; padding: 10px 14px; cursor: pointer; color: white; background: #0f766e; font-weight: 650; }
button:disabled { cursor: wait; opacity: .65; }
.save-status { margin: 10px 0 0; padding: 9px 11px; border-radius: 7px; font-size: 12px; font-weight: 650; }
.save-status.success { background: #dcfce7; color: #166534; }
.save-status.error { background: #fee2e2; color: #b91c1c; }
.save-status.saving { background: #e0f2fe; color: #075985; }
button.secondary { padding: 8px 12px; background: #334155; }
.form-actions { display: flex; gap: 8px; }
.form-actions button { flex: 1; }
.route-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; padding: 10px; border-radius: 8px; background: #f0fdfa; }
.route-tools .extend { background: #0369a1; }
.route-tools small { grid-column: 1 / -1; color: #0f766e; font-weight: 650; }
.hidden { display: none !important; }
body[data-role="consulta"] .requires-write,
body[data-role="consulta"] .port-assignment,
body[data-role="consulta"] .splitter-form,
body[data-role="consulta"] .splice-form,
body[data-role="consulta"] .edit,
body[data-role="consulta"] .delete { display: none !important; }
body[data-role="tecnico"] .delete { display: none !important; }

.login-page { min-height: 100vh; background: radial-gradient(circle at top, #164e63, #0f172a 62%); }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-card { width: min(410px, 100%); padding: 30px; border-radius: 16px; background: white; box-shadow: 0 24px 70px #02061780; }
.login-card h1 { margin: 25px 0 4px; }
.login-card > p { margin: 0 0 20px; color: #64748b; }
.login-card > button { width: 100%; margin-top: 6px; }
.login-brand { display: flex; flex-direction: column; }
.login-brand strong { color: #0f766e; font-size: 25px; }
.login-brand span { color: #64748b; font-size: 13px; }
.login-error { margin-bottom: 15px; padding: 10px; border-radius: 7px; background: #fee2e2; color: #991b1b; }
.users-page { min-height: 100vh; background: #f3f6fa; }
.users-shell { display: grid; height: auto; max-width: 1180px; margin: 0 auto; padding: 28px 18px; grid-template-columns: 360px 1fr; gap: 20px; }
.users-card { align-self: start; padding: 22px; border: 1px solid #dbe2ea; border-radius: 12px; background: white; }
.users-card h1 { margin-top: 0; font-size: 20px; }
.user-form button { width: 100%; }
.role-help { color: #64748b; font-size: 12px; line-height: 1.6; }
.user-row { display: grid; grid-template-columns: minmax(150px, 1fr) 140px minmax(150px, 1fr) 80px auto; gap: 9px; align-items: center; padding: 11px 0; border-bottom: 1px solid #e2e8f0; }
.user-row strong, .user-row small { display: block; }
.user-row small { color: #64748b; }
.user-row select, .user-row input { margin: 0; }
.active-user { display: flex; align-items: center; gap: 5px; margin: 0; }
.active-user input { width: auto; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.list { margin-top: 18px; border-top: 1px solid #e2e8f0; }
.list-details { margin-top: 14px; }
.list-details > summary { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; color: #334155; cursor: pointer; font-size: 13px; font-weight: 700; text-align: center; list-style: none; }
.list-details > summary::-webkit-details-marker { display: none; }
.list-details > summary::before { content: '▾'; display: inline-block; margin-right: 7px; transition: transform .15s ease; }
.list-details:not([open]) > summary::before { transform: rotate(-90deg); }
.list-details[open] > summary { border-color: #99f6e4; background: #f0fdfa; color: #0f766e; }
.list-details .list { margin-top: 8px; }
.item { padding: 12px 2px; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e2e8f0; }
.item strong { display: block; font-size: 14px; }
.item small { color: #64748b; }
.item .topology-path { display: block; margin-top: 3px; color: #0f766e; }
.point-result-main { display: flex; flex: 1; min-width: 0; align-items: center; gap: 9px; padding: 3px; background: transparent; color: #172033; text-align: left; }
.point-result-main:hover strong { color: #0f766e; text-decoration: underline; }
.result-icon { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--result-color); color: white; font-size: 11px; font-weight: 800; }
.empty-search { margin: 14px 0; padding: 12px; border-radius: 7px; background: #f8fafc; color: #64748b; font-size: 13px; text-align: center; }
.item-buttons { display: flex; align-items: center; gap: 5px; }
.item-buttons button { padding: 5px 8px; }
.edit { color: #1d4ed8; background: #dbeafe; }
.fibers { color: #047857; background: #d1fae5; }
.ports { color: #6d28d9; background: #ede9fe; }
.splices { color: #0e7490; background: #cffafe; }
.delete { align-self: center; color: #b91c1c; background: #fee2e2; }
dialog { width: min(720px, 94vw); max-height: 85vh; border: 0; border-radius: 12px; box-shadow: 0 20px 50px #0005; }
dialog::backdrop { background: #0f172a99; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fiber-row { display: grid; grid-template-columns: 48px 120px 1fr; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid #e2e8f0; }
#toast { position: fixed; z-index: 2000; right: 18px; bottom: 18px; padding: 11px 15px; border-radius: 8px; color: white; background: #172033; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; }
#toast.show { opacity: 1; transform: none; }
.point-marker-wrap { background: none; border: 0; }
.point-marker { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 3px solid white; border-radius: 50% 50% 50% 8px; background: var(--marker-color); box-shadow: 0 3px 9px #0f172a66; color: white; transform: rotate(-45deg); transition: transform .15s ease, filter .15s ease; }
.point-marker::after { content: ''; position: absolute; inset: 3px; border: 1px solid #ffffff55; border-radius: inherit; }
.point-marker svg { position: relative; z-index: 1; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: rotate(45deg); }
.point-marker.status-projeto { border-color: #fef3c7; }
.point-marker.status-implantado { border-color: #bfdbfe; }
.point-marker.status-certificado { border-color: #bbf7d0; }
.point-marker.status-manutencao { border-color: #fecaca; }
.leaflet-marker-icon:hover .point-marker { filter: brightness(1.12); transform: rotate(-45deg) scale(1.08); }
.popup-tip { display: block; margin-top: 7px; padding-top: 6px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 11px; }
.popup-action { display: block; width: 100%; margin-top: 8px; padding: 7px 9px; font-size: 12px; }
.dialog-head > div small { display: block; margin-top: 3px; color: #64748b; }
.port-assignment { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: end; padding: 12px; border-radius: 9px; background: #f8fafc; }
.port-assignment label { margin: 0; }
.port-assignment .save-status { grid-column: 1 / -1; }
.ports-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.port-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid #e2e8f0; border-radius: 8px; }
.port-row.occupied { border-color: #fecaca; background: #fff7f7; }
.port-row.free { background: #f0fdf4; }
.port-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #334155; color: white; font-weight: 800; }
.port-row strong, .port-row small { display: block; }
.port-row small { color: #64748b; }
.free-badge { padding: 4px 7px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 11px; font-weight: 700; }
.fusion-panel { margin-top: 14px; border: 1px solid #ddd6fe; border-radius: 9px; overflow: hidden; }
.fusion-panel > summary { padding: 11px 13px; background: #f5f3ff; color: #5b21b6; cursor: pointer; font-weight: 750; }
.splitter-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; border-bottom: 1px solid #e2e8f0; }
.splitter-form label { margin: 0; }
.splitter-form button { align-self: end; }
.splitter-form .save-status { grid-column: 1 / -1; }
.fusion-diagram { padding: 12px; background: #fafafa; }
.splitter-diagram { display: grid; grid-template-columns: minmax(120px, 1fr) 32px 120px 2fr; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 9px; background: white; }
.fusion-input strong, .fusion-input small, .splitter-node strong, .splitter-node small { display: block; }
.fusion-input small, .splitter-node small { color: #64748b; }
.fiber-swatch { display: inline-block; width: 13px; height: 13px; margin-right: 5px; border: 1px solid #94a3b8; border-radius: 50%; background: var(--fiber-color); vertical-align: -2px; }
.fusion-link { height: 3px; background: #7c3aed; }
.splitter-node { padding: 9px; border-radius: 8px; background: #ede9fe; text-align: center; }
.splitter-node .delete { margin-top: 6px; padding: 4px 7px; font-size: 10px; }
.fusion-outputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.fusion-output { padding: 5px; border-radius: 5px; background: #dcfce7; color: #166534; text-align: center; }
.fusion-output.used { background: #dbeafe; color: #1d4ed8; }
.fusion-output span, .fusion-output small { display: block; }
.fusion-output span { font-weight: 800; }
.splice-dialog { width: min(1380px, 98vw); }
.splice-form { display: grid; grid-template-columns: 2fr 90px 140px 2fr 90px; gap: 8px; align-items: end; margin-bottom: 12px; padding: 11px; border-radius: 9px; background: #f8fafc; }
.splice-form label { margin: 0; }
.splice-form .save-status { grid-column: 1 / -1; }
.splice-notes { grid-column: 1 / 5; }
.splice-form-actions { display: flex; gap: 6px; }
.splice-form-actions button { flex: 1; white-space: nowrap; }
.splice-metadata { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; padding-top: 8px; border-top: 1px solid #dbe2ea; }
.splice-metadata label { margin: 0; }
.splice-toolbar { display: flex; justify-content: flex-end; gap: 6px; margin: 0 0 8px; }
.splice-toolbar button { padding: 7px 10px; font-size: 12px; }
.splitter-output-config { grid-column: 1 / -1; padding: 10px; border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; }
.splitter-output-config > strong { display: block; margin-bottom: 8px; color: #075985; font-size: 13px; }
.splitter-output-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 7px; }
.splitter-output-row { display: grid; grid-template-columns: 38px 125px minmax(150px, 1.4fr) 135px minmax(140px, 1fr); gap: 7px; align-items: center; padding: 7px; border: 1px solid #dbeafe; border-radius: 7px; background: white; }
.splitter-output-row strong { color: #0e7490; text-align: center; }
.splitter-output-row select, .splitter-output-row input { margin: 0; }
.splitter-output-row .child-ratio.hidden, .splitter-output-row .target-cable.hidden, .splitter-output-row .target-fiber.hidden { display: none; }
.splice-canvas { min-height: 240px; overflow: auto; border: 1px solid #cbd5e1; border-radius: 9px; background: #e9eef5; }
.splice-canvas svg { display: block; width: 100%; min-width: 1050px; }
.splice-canvas.zoomed svg { width: var(--splice-zoom, 100%); }
.splice-canvas .empty-search { color: #64748b; background: white; }
.splice-graphic { cursor: pointer; outline: none; }
.splice-graphic:hover path, .splice-graphic:focus path { filter: drop-shadow(0 0 3px #0f766e88); stroke-width: 7; }
.splice-graphic:hover .splice-terminal, .splice-graphic:focus .splice-terminal { fill: #ecfeff; stroke: #0f766e; stroke-width: 2; }
.splice-sheet { fill: white; stroke: #cbd5e1; stroke-width: 1.5; }
.splice-title { fill: #0f172a; font: 800 22px Inter, sans-serif; }
.splice-subtitle { fill: #64748b; font: 13px Inter, sans-serif; }
.splice-column-head { fill: #e2e8f0; stroke: #94a3b8; }
.splice-column-title { fill: #334155; font: 750 12px Inter, sans-serif; letter-spacing: .5px; }
.splice-terminal { fill: #f8fafc; stroke: #94a3b8; transition: .15s; }
.splice-fiber-dot { stroke: #475569; stroke-width: 1.5; }
.splice-cable-name { fill: #0f172a; font: 700 12px Inter, sans-serif; }
.splice-fiber-name { fill: #475569; font: 11px Inter, sans-serif; }
.splice-position { fill: #e0f2fe; stroke: #0369a1; stroke-width: 2; }
.splice-position-text { fill: #0c4a6e; font: 800 11px Inter, sans-serif; }
.splice-type-label { fill: #475569; font: 700 9px Inter, sans-serif; letter-spacing: .3px; }
.splitter-symbol { fill: #cffafe; stroke: #0e7490; stroke-width: 2.5; }
.splitter-symbol-title { fill: #0e7490; font: 800 17px Inter, sans-serif; }
.splitter-symbol-subtitle { fill: #155e75; font: 700 9px Inter, sans-serif; letter-spacing: .5px; }
.splice-legend-box { fill: #f8fafc; stroke: #94a3b8; stroke-dasharray: 5 4; }
.splice-legend-title { fill: #0f172a; font: 750 12px Inter, sans-serif; }
.splice-legend-text { fill: #334155; font: 11px Inter, sans-serif; }
.splice-label { fill: #e2e8f0; font: 12px Inter, sans-serif; }
.splice-heading { fill: #22d3ee; font: 700 12px Inter, sans-serif; letter-spacing: 1px; }
.splice-list { margin-top: 10px; }
.splice-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 8px 2px; border-bottom: 1px solid #e2e8f0; }
.splice-row-actions { display: flex; gap: 5px; }
.splice-row.status-planejada { border-left: 4px solid #94a3b8; padding-left: 8px; }
.splice-row.status-ativa { border-left: 4px solid #16a34a; padding-left: 8px; }
.splice-row.status-reserva { border-left: 4px dashed #f59e0b; padding-left: 8px; }
.splice-row.status-defeito { border-left: 4px solid #dc2626; padding-left: 8px; background: #fff7f7; }
.splice-row strong, .splice-row small { display: block; }
.splice-row small { color: #64748b; }
.inventory-dialog { width: min(820px, 94vw); }
.inventory-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.inventory-card { padding: 13px; border: 1px solid #dbeafe; border-radius: 9px; background: #eff6ff; }
.inventory-card strong, .inventory-card span { display: block; }
.inventory-card strong { color: #1d4ed8; font-size: 20px; }
.inventory-card span { margin-top: 3px; color: #475569; font-size: 12px; }
.inventory-section { margin-top: 14px; }
.inventory-section h3 { margin: 0 0 7px; font-size: 14px; }
.inventory-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inventory-table th, .inventory-table td { padding: 8px 9px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.inventory-table th { background: #f8fafc; color: #475569; }
.inventory-table th:last-child, .inventory-table td:last-child { text-align: right; }
.inventory-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 600px) { .port-assignment { grid-template-columns: 1fr; } .port-assignment .save-status { grid-column: 1; } .ports-list { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .splitter-form { grid-template-columns: 1fr 1fr; } .splitter-diagram { grid-template-columns: 1fr; } .fusion-link { width: 3px; height: 22px; margin: auto; } }
@media (max-width: 800px) { .splice-form { grid-template-columns: 1fr 1fr; } .splice-notes { grid-column: 1 / -1; } }
@media (max-width: 900px) { .splitter-output-grid { grid-template-columns: 1fr; } .splitter-output-row { grid-template-columns: 34px 1fr 1fr; } .splitter-output-row input { grid-column: 2 / -1; } }
@media (max-width: 900px) { .splice-metadata { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .inventory-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { main { display: flex; flex-direction: column-reverse; } aside { height: 46%; } .map-area { height: 54%; } #map { height: 100%; } header span, .header-actions a { display: none; } .fiber-row { grid-template-columns: 40px 100px 1fr; } .location-search { width: calc(100% - 75px); left: auto; right: 8px; transform: none; } }
@media (max-width: 760px) { .users-shell { display: grid; grid-template-columns: 1fr; padding: 14px; } .user-row { grid-template-columns: 1fr 1fr; } .user-row > div, .user-row > input { grid-column: 1 / -1; } }
