.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.page-header p {
    color: #718096;
    font-size: 1rem;
}

.status-section {
    background: linear-gradient(135deg, #2b6cb0 0%, #1a4a7a 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.status-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

.status-value {
    font-size: 1.125rem;
    font-weight: 600;
}

.form-section {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1a202c;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3748;
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-secondary {
    background: #edf2f7;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #fc8181;
    color: white;
}

.btn-danger:hover {
    background: #f56565;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-area {
    margin: 1.5rem 0;
}

.message {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.message-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #38a169;
}

.message-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

.message-warning {
    background: #feebc8;
    color: #744210;
    border-left: 4px solid #ed8936;
}

.saved-connections {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.saved-connections h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1a202c;
    font-weight: 600;
}

.connection-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.connection-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.connection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.connection-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1a202c;
}

.connection-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-connected {
    background: #c6f6d5;
    color: #22543d;
}

.status-disconnected {
    background: #e2e8f0;
    color: #4a5568;
}

.status-error {
    background: #fed7d7;
    color: #742a2a;
}

.connection-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #4a5568;
}

.connection-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
}

.empty-state {
    color: #a0aec0;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

.ports-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.ports-table th {
    background: #f7fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

.ports-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.ports-table tr:hover {
    background: #f7fafc;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background: #feebc8;
    color: #744210;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-box {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.filter-select {
    padding: 0.625rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #4299e1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
}

.close-btn:hover {
    color: #4a5568;
}

.policy-validation {
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.policy-approved {
    background: #c6f6d5;
    border-left: 4px solid #38a169;
}

.policy-warning {
    background: #feebc8;
    border-left: 4px solid #ed8936;
}

.policy-blocked {
    background: #fed7d7;
    border-left: 4px solid #e53e3e;
}

.top-nav {
    background: #2d3748;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
    background: rgba(255, 255, 255, 0.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
}

.port-actions-cell {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
}

.power-control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.power-control-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    background: #f7fafc;
}

.power-control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.power-control-value {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.power-control-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.modal-content-sm {
    max-width: 420px;
}

.oob-section {
    margin-top: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.oob-section[open] {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    background: #ffffff;
}

.oob-section summary {
    cursor: pointer;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.oob-section summary::-webkit-details-marker {
    display: none;
}

.oob-section summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: #64748b;
    transition: transform 0.2s;
}

.oob-section[open] summary::after {
    content: "-";
}

.oob-section summary:hover {
    color: #0369a1;
}

.oob-body {
    padding: 0.25rem 1rem 1rem;
    border-top: 1px solid #e2e8f0;
}

.oob-hint {
    margin: 0.75rem 0 1rem;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

.oob-hint code {
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    color: #334155;
}

.file-preview {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #475569;
    min-height: 1.1em;
}
