:root {
    --pt-orange: #F37021;
    --pt-blue: #1B3A6B;
    --pt-black: #1A1A1A;
}
body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f9;
    color: var(--pt-black);
    margin: 40px;
}
input, select, button, table {
    font-family: inherit;
}
.container {
    max-width: 950px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: auto;
}
.container.narrow {
    max-width: 420px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.mainnav {
    display: flex;
    align-items: center;
    gap: 20px;
}
.mainnav a {
    color: var(--pt-black);
    text-decoration: none;
    font-weight: bold;
    padding: 6px 4px;
    border-bottom: 3px solid transparent;
}
.mainnav a:hover {
    color: var(--pt-orange);
}
.mainnav a.active {
    color: var(--pt-blue);
    border-bottom-color: var(--pt-orange);
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo {
    height: 40px;
    width: auto;
}
.container.narrow .brand {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}
.container.narrow .logo {
    height: 56px;
}
h1, h2 {
    color: var(--pt-blue);
}
.brand h1 {
    margin: 0;
    font-size: 1.3em;
}
.section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-left: 5px solid var(--pt-blue);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
}
label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.9em;
    color: var(--pt-black);
}
input, select, button {
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
input[type="text"], input[type="password"], input[type="number"] {
    width: 100%;
    max-width: 280px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--pt-orange);
    box-shadow: 0 0 0 2px rgba(243, 112, 33, 0.25);
}
button {
    background-color: var(--pt-blue);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}
button:hover { background-color: var(--pt-orange); }
.link-btn {
    background: none;
    color: var(--pt-blue);
    border: none;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
    font-weight: normal;
}
.link-btn:hover { color: var(--pt-orange); }
.delete-btn { color: #dc3545; }
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}
th {
    background-color: var(--pt-black);
    color: white;
}
th a {
    color: white;
    text-decoration: none;
    white-space: nowrap;
}
th a:hover {
    color: var(--pt-orange);
}
code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
}
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.devices-table {
    table-layout: fixed;
    min-width: 650px;
}
.devices-table td, .devices-table th {
    overflow: hidden;
}
.devices-table td.truncate {
    white-space: nowrap;
    text-overflow: ellipsis;
}
.vlan-badge {
    display: inline-block;
    white-space: nowrap;
    background: rgba(243, 112, 33, 0.12);
    color: var(--pt-orange);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}
.vlan-badge.deny {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}
.vlan-badge.none {
    background: #eee;
    color: #888;
    font-weight: normal;
}
.pagination {
    display: flex;
    gap: 6px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.pagination a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--pt-blue);
    text-decoration: none;
    font-size: 0.9em;
}
.pagination a:hover {
    border-color: var(--pt-orange);
    color: var(--pt-orange);
}
.pagination a.active {
    background: var(--pt-blue);
    color: white;
    border-color: var(--pt-blue);
}
.pagination a.disabled {
    pointer-events: none;
    color: #bbb;
}
.inline-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.hint {
    font-size: 0.85em;
    color: #666;
}
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}
.success {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

@media (max-width: 700px) {
    body {
        margin: 10px;
    }
    .container {
        padding: 16px;
        border-radius: 6px;
    }
    .brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .mainnav {
        gap: 12px;
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .section {
        padding: 14px;
    }
    .inline-form {
        gap: 8px;
    }
    input[type="text"], input[type="password"], input[type="number"], select {
        max-width: 100%;
    }
    th, td {
        padding: 8px;
        font-size: 0.9em;
    }
}
