<%@ page contentType="text/css; charset=UTF-8"%>

/* Plugin GetOLT */
.getolt-container {
	padding: 10px;
}
.getolt-error {
	color: #dc3545;
	padding: 20px;
	text-align: center;
	font-size: 14px;
}
.getolt-info {
	color: #6c757d;
	padding: 20px;
	text-align: center;
	font-size: 14px;
}
.getolt-onu-card {
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 15px;
	background: #fff;
}
.getolt-onu-header {
	background: #f8f9fa;
	padding: 10px 15px;
	border-bottom: 1px solid #ddd;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.getolt-onu-header-left {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.getolt-onu-header .getolt-mac {
	font-family: monospace;
	font-weight: bold;
	font-size: 14px;
}
.getolt-onu-header-left .getolt-update-time {
	font-size: 11px;
	color: #6c757d;
}
.getolt-onu-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
}
.getolt-update-time {
	font-size: 11px;
	color: #6c757d;
	cursor: help;
}
.getolt-onu-status {
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: bold;
}
.getolt-onu-status.getolt-online {
	background: #d4edda;
	color: #155724;
}
.getolt-onu-status.getolt-offline {
	background: #f8d7da;
	color: #721c24;
}
.getolt-onu-body {
	padding: 15px;
}
.getolt-onu-row {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -10px;
}
.getolt-onu-col {
	flex: 0 0 50%;
	padding: 0 10px;
	margin-bottom: 10px;
}
.getolt-onu-col.getolt-full {
	flex: 0 0 100%;
}
.getolt-onu-label {
	font-size: 11px;
	color: #6c757d;
	margin-bottom: 2px;
}
.getolt-onu-value {
	font-size: 13px;
	font-weight: 500;
}
.getolt-signal-good,
table.data td.getolt-signal-good {
	color: #28a745;
	font-weight: bold;
}
.getolt-signal-medium,
table.data td.getolt-signal-medium {
	color: #e6a000;
	font-weight: bold;
}
.getolt-signal-poor,
table.data td.getolt-signal-poor {
	color: #dc3545;
	font-weight: bold;
}
.getolt-signal-overexposed,
table.data td.getolt-signal-overexposed {
	color: #17a2b8;
	font-weight: bold;
}
.getolt-macs-list {
	font-family: monospace;
	font-size: 12px;
	max-height: 100px;
	overflow-y: auto;
	background: #f8f9fa;
	padding: 8px;
	border-radius: 4px;
}
.getolt-macs-list .getolt-mac-item {
	margin-bottom: 2px;
}
.getolt-neighbors-table {
	width: 100%;
	font-size: 12px;
	border-collapse: collapse;
}
.getolt-neighbors-table th,
.getolt-neighbors-table td {
	padding: 6px 8px;
	text-align: left;
	border-bottom: 1px solid #eee;
}
.getolt-neighbors-table th {
	background: #f8f9fa;
	font-weight: 600;
}
.getolt-neighbors-table .getolt-mac {
	font-family: monospace;
}
.getolt-contract-info {
	background: #e7f1ff;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 15px;
	font-size: 13px;
}
.getolt-contract-info span {
	margin-right: 20px;
}
.getolt-neighbors-table .getolt-target-row {
	background: #e9ecef;
	font-weight: 600;
}
.getolt-neighbors-table .getolt-target-row td {
	border-bottom: 2px solid #6c757d;
}
/* Signal-based row highlighting for neighbors */
.getolt-neighbors-table .getolt-signal-row-poor {
	background: #f8d7da;
}
.getolt-neighbors-table .getolt-signal-row-medium {
	background: #fff3cd;
}
.getolt-neighbors-table .getolt-signal-row-overexposed {
	background: #ffe5d0;
}
/* Refresh button styles */
.getolt-btn-refresh {
	background: #007bff;
	color: #fff;
	border: none;
	padding: 5px 12px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
	transition: background 0.2s;
}
.getolt-btn-refresh:hover {
	background: #0056b3;
}
.getolt-btn-refresh:disabled {
	background: #6c757d;
	cursor: not-allowed;
}
.getolt-btn-refresh .getolt-btn-port-num {
	background: rgba(255,255,255,0.3);
	padding: 2px 6px;
	border-radius: 3px;
	font-weight: bold;
	margin-left: 4px;
	display: inline-block;
	vertical-align: middle;
	line-height: 1;
}
/* Refresh status bar */
.getolt-refresh-status-bar {
	background: #e7f1ff;
	padding: 10px 15px;
	border-radius: 0 0 4px 4px;
	display: none;
	align-items: center;
	gap: 10px;
	border-top: 1px solid #b8daff;
}
.getolt-refresh-status-bar.getolt-active {
	display: flex;
}
.getolt-refresh-status-bar .getolt-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #007bff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: getolt-spin 1s linear infinite;
}
@keyframes getolt-spin {
	to { transform: rotate(360deg); }
}
.getolt-refresh-status-bar .getolt-status-text {
	flex: 1;
	font-size: 13px;
	color: #004085;
}
.getolt-refresh-status-bar.getolt-success {
	background: #d4edda;
	border-top-color: #c3e6cb;
}
.getolt-refresh-status-bar.getolt-success .getolt-status-text {
	color: #155724;
}
.getolt-refresh-status-bar.getolt-error {
	background: #f8d7da;
	border-top-color: #f5c6cb;
}
.getolt-refresh-status-bar.getolt-error .getolt-status-text {
	color: #721c24;
}
/* Reboot button styles */
.getolt-btn-reboot {
	background: #dc3545;
	color: #fff;
	border: none;
	padding: 5px 12px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
	transition: background 0.2s;
}
.getolt-btn-reboot:hover:not(:disabled) {
	background: #c82333;
}
.getolt-btn-reboot:disabled {
	background: #6c757d;
	cursor: not-allowed;
}
.getolt-btn-reboot.getolt-cooldown {
	background: #adb5bd;
	color: #495057;
	min-width: 120px;
}
/* Activation form styles */
.getolt-activation-section {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 15px;
}
.getolt-activation-section h4 {
	margin: 0 0 10px 0;
	font-size: 14px;
	font-weight: 600;
	color: #495057;
}
.getolt-activation-form {
	display: flex;
	gap: 10px;
	align-items: flex-end;
	flex-wrap: wrap;
}
.getolt-activation-form .getolt-form-group {
	flex: 1;
	min-width: 200px;
}
.getolt-activation-form label {
	display: block;
	font-size: 12px;
	color: #6c757d;
	margin-bottom: 4px;
}
.getolt-activation-form input[type="text"] {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-family: monospace;
	font-size: 14px;
	text-transform: uppercase;
}
.getolt-activation-form input[type="text"]:focus {
	border-color: #80bdff;
	outline: none;
	box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
.getolt-activation-form input[type="text"].getolt-is-invalid {
	border-color: #dc3545;
}
.getolt-btn-activate {
	background: #28a745;
	color: #fff;
	border: none;
	padding: 8px 20px;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
}
.getolt-btn-activate:hover:not(:disabled) {
	background: #218838;
}
.getolt-btn-activate:disabled {
	background: #6c757d;
	cursor: not-allowed;
}
.getolt-activation-status {
	width: 100%;
	padding: 10px;
	border-radius: 4px;
	font-size: 13px;
	margin-top: 10px;
	display: none;
}
.getolt-activation-status.getolt-active {
	display: block;
}
.getolt-activation-status.getolt-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}
.getolt-activation-status.getolt-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}
.getolt-activation-status.getolt-processing {
	background: #e7f1ff;
	color: #004085;
	border: 1px solid #b8daff;
}
/* Service selection modal */
.getolt-service-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.5);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 10000;
}
.getolt-service-modal-overlay.getolt-active {
	display: flex;
}
.getolt-service-modal {
	background: #fff;
	border-radius: 8px;
	width: 90%;
	max-width: 500px;
	max-height: 80vh;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.getolt-service-modal-header {
	background: #f8f9fa;
	padding: 15px 20px;
	border-bottom: 1px solid #dee2e6;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.getolt-service-modal-header h3 {
	margin: 0;
	font-size: 16px;
}
.getolt-service-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #6c757d;
	line-height: 1;
}
.getolt-service-modal-body {
	padding: 20px;
	max-height: 60vh;
	overflow-y: auto;
}
.getolt-service-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.getolt-service-list li {
	padding: 12px;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	margin-bottom: 8px;
	cursor: pointer;
	transition: all 0.2s;
}
.getolt-service-list li:hover {
	background: #e9ecef;
	border-color: #adb5bd;
}
.getolt-service-list li:last-child {
	margin-bottom: 0;
}
.getolt-service-list .getolt-service-title {
	font-weight: 500;
	margin-bottom: 4px;
}
.getolt-service-list .getolt-service-mac {
	font-family: monospace;
	font-size: 12px;
	color: #6c757d;
}
/* OLT Management page styles */
.getolt-status-ok {
	color: #155724;
	background: #d4edda;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: bold;
}
.getolt-status-error {
	color: #721c24;
	background: #f8d7da;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: bold;
}
.getolt-status-updating {
	color: #004085;
	background: #cce5ff;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: bold;
}
.getolt-status-new {
	color: #856404;
	background: #fff3cd;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: bold;
}
.getolt-signal-bad {
	color: #dc3545;
	font-weight: bold;
}
.getolt-signal-warn {
	color: #e6a000;
	font-weight: bold;
}
.getolt-ports-container,
.getolt-onus-container {
	padding: 5px;
}
.getolt-loading {
	padding: 10px;
	color: #6c757d;
	font-style: italic;
}

/* «Массовая авария» — ТЗ #11, Этап 1 */
.getolt-incident-container {
	padding: 8px;
	font-size: 13px;
}
.getolt-incident-header {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 6px 0;
	border-bottom: 1px solid #ddd;
	margin-bottom: 8px;
}
.getolt-incident-city-empty {
	color: #6c757d;
	font-style: italic;
}
.getolt-incident-banner-error {
	background: #f8d7da;
	color: #721c24;
	padding: 8px;
	border-radius: 4px;
	margin: 8px 0;
}
.getolt-incident-loading,
.getolt-incident-empty,
.getolt-incident-summary-empty {
	padding: 8px;
	color: #6c757d;
	font-style: italic;
}
.getolt-incident-olts {
	margin: 8px 0;
}
.getolt-incident-olt-row {
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 6px 8px;
	margin: 4px 0;
}
.getolt-incident-olt-row label {
	display: flex;
	gap: 8px;
	align-items: center;
	cursor: pointer;
}
.getolt-incident-olt-ip {
	font-weight: bold;
	min-width: 110px;
}
.getolt-incident-olt-vendor,
.getolt-incident-olt-billing {
	color: #495057;
	min-width: 80px;
}
.getolt-incident-olt-stats {
	color: #6c757d;
	margin-left: auto;
}
.getolt-incident-ports {
	margin-top: 6px;
	padding: 6px;
	background: #f8f9fa;
	border-radius: 4px;
}
.getolt-incident-port-mode {
	margin-bottom: 4px;
}
.getolt-incident-port-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 4px;
}
.getolt-incident-port-item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 2px 4px;
	white-space: nowrap;
}
.getolt-incident-port-item .getolt-incident-port-num {
	min-width: 70px;
}
.getolt-incident-port-item .getolt-incident-port-onu {
	color: #6c757d;
}
.getolt-incident-summary {
	margin: 12px 0;
	padding: 10px;
	background: #e7f3ff;
	border-left: 3px solid #2c80c5;
	border-radius: 4px;
}
.getolt-incident-actions {
	margin-top: 10px;
}
.getolt-incident-btn-save,
.getolt-incident-btn-reload {
	padding: 4px 12px;
	cursor: pointer;
}

/* Бакеты сигнала ONU в саммари и на портах массовой аварии */
.getolt-incident-port-sig {
	display: inline-flex;
	gap: 4px;
	margin-left: 12px;
}
.getolt-incident-sig {
	display: inline-block;
	min-width: 22px;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 12px;
	text-align: center;
	font-weight: bold;
	color: #fff;
}
.getolt-incident-sig-over    { background: #6f42c1; }
.getolt-incident-sig-good    { background: #28a745; }
.getolt-incident-sig-medium  { background: #e6a000; }
.getolt-incident-sig-poor    { background: #dc3545; }
.getolt-incident-sig-nosig   { background: #6c757d; }

.getolt-incident-summary-row {
	display: flex;
	gap: 8px;
	align-items: baseline;
	padding: 2px 0;
}
.getolt-incident-summary-sig {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dashed #c5d8e8;
}
.getolt-incident-summary-sig-label {
	font-size: 13px;
}
.getolt-incident-summary-sig-hint {
	font-size: 11px;
	color: #6c757d;
	margin-left: auto;
}

.getolt-incident-add-location {
	margin: 8px 0 12px;
}
.getolt-incident-btn-add-location {
	background: #f1f3f5;
	border: 1px dashed #adb5bd;
	color: #495057;
	padding: 6px 14px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
}
.getolt-incident-btn-add-location:hover {
	background: #e9ecef;
}
.getolt-incident-add-location-form {
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 8px;
	background: #f8f9fa;
	border-radius: 4px;
}
.getolt-incident-add-location-input {
	flex: 1;
	padding: 5px 10px;
	border: 1px solid #ced4da;
	border-radius: 3px;
	font-size: 13px;
}
.getolt-incident-add-location-input:focus {
	border-color: #80bdff;
	outline: none;
}
.getolt-incident-btn-search-location,
.getolt-incident-btn-cancel-location {
	padding: 5px 12px;
	border: 1px solid #ced4da;
	border-radius: 3px;
	cursor: pointer;
	font-size: 13px;
	background: #fff;
}
.getolt-incident-btn-search-location {
	background: #007bff;
	color: #fff;
	border-color: #007bff;
}
.getolt-incident-btn-search-location:hover:not(:disabled) {
	background: #0056b3;
	border-color: #0056b3;
}
.getolt-incident-btn-search-location:disabled {
	background: #6c757d;
	border-color: #6c757d;
	cursor: not-allowed;
}

.getolt-incident-add-location-form {
	flex-direction: column;
	gap: 6px;
	align-items: stretch;
}
.getolt-incident-add-location-row {
	display: flex;
	gap: 6px;
	align-items: center;
}
.getolt-incident-add-location-suggestions {
	max-height: 220px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 3px;
	padding: 6px;
}
.getolt-incident-city-suggestion {
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 3px 4px;
	cursor: pointer;
	border-radius: 3px;
}
.getolt-incident-city-suggestion:hover {
	background: #f1f3f5;
}
.getolt-incident-add-location-hint,
.getolt-incident-add-location-empty {
	color: #6c757d;
	font-size: 12px;
	font-style: italic;
	padding: 4px 0;
}
.getolt-incident-add-location-actions {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
}

.getolt-incident-city-block {
	border-bottom: 1px dashed #e9ecef;
	padding: 2px 0;
}
.getolt-incident-city-block:last-child {
	border-bottom: none;
}
.getolt-incident-city-olts {
	margin: 4px 0 8px 24px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 6px;
	background: #f8f9fa;
	border-radius: 3px;
}
.getolt-incident-suggested-olt {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 3px 4px;
	cursor: pointer;
	border-radius: 3px;
	font-size: 12px;
}
.getolt-incident-suggested-olt:hover {
	background: #e9ecef;
}
.getolt-incident-suggested-dup {
	opacity: 0.55;
	cursor: not-allowed;
}

.getolt-incident-city-suggestion {
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 3px 4px;
	border-radius: 3px;
}
.getolt-incident-city-name {
	cursor: pointer;
	flex: 1;
}
.getolt-incident-city-name:hover {
	text-decoration: underline;
}

/* Запрет переноса колонки счётчика ONU в строках OLT (основной список и сжатые suggestion-строки) */
.getolt-incident-olt-stats {
	white-space: nowrap;
	flex-shrink: 0;
	margin-left: auto;
	min-width: 11em;
	text-align: right;
}
.getolt-incident-suggested-olt .getolt-incident-olt-vendor,
.getolt-incident-suggested-olt .getolt-incident-olt-billing {
	white-space: nowrap;
}

.getolt-incident-banner-error.getolt-incident-banner-success {
	background: #d4edda;
	color: #155724;
}

/* Сводка по сохранённому выбору («режим recap») */
.getolt-incident-recap {
	border: 1px solid #b8daff;
	background: #f3f9ff;
	border-radius: 4px;
	padding: 10px;
	margin: 8px 0 12px;
}
.getolt-incident-recap-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.getolt-incident-recap-row {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 4px 6px;
	background: #fff;
	border-radius: 3px;
}
.getolt-incident-recap-ports {
	color: #495057;
}
.getolt-incident-recap-total {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed #b8daff;
	font-size: 13px;
}
.getolt-incident-btn-edit,
.getolt-incident-btn-cancel-edit {
	margin-top: 8px;
	padding: 5px 14px;
	border: 1px solid #ced4da;
	background: #fff;
	border-radius: 3px;
	cursor: pointer;
	font-size: 13px;
}
.getolt-incident-btn-edit:hover,
.getolt-incident-btn-cancel-edit:hover {
	background: #f1f3f5;
}

/* Запрет переноса строк в таблице сводки */
.getolt-incident-recap-row,
.getolt-incident-recap-row > * {
	white-space: nowrap;
}
.getolt-incident-recap-ports {
	overflow: hidden;
	text-overflow: ellipsis;
}
