/* PalCon Locker - clean responsive CSS */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background: #000;
    color: #FF6A00;
    font-family: monospace;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
}

/* Header / navigation */
.site-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-img {
    height: 34px;
    width: auto;
    flex: 0 0 auto;
}

.logo-text {
    margin: 0;
    color: #FF6A00;
    font-size: 1.7rem;
    line-height: 1.05;
    font-weight: bold;
    white-space: nowrap;
}

.menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.menu a,
.menu a:visited {
    color: #FF6A00;
    background: #000;
    border: 1px solid #FF6A00;
    border-radius: 6px;
    padding: 7px 10px;
    text-decoration: none;
    line-height: 1.1;
}

.menu a:hover {
    color: #fff;
    border-color: #fff;
    text-decoration: underline;
}

.menu a.active,
.menu a.active:visited {
    color: #FF6A00;
    font-weight: bold;
    border-color: #FF6A00;
    box-shadow: 0 0 0 1px #FF6A00 inset;
}

/* Typography / links */
h1,
h2,
h3 {
    color: #FF6A00;
    line-height: 1.15;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }
p { line-height: 1.45; }

a,
a:visited {
    color: #FF6A00;
}

a:hover {
    color: #fff;
}

/* Buttons / forms */
a.button,
.button,
button,
input[type="submit"],
input[type="button"] {
    font: inherit;
    color: #FF6A00;
    background: #000;
    border: 1px solid #FF6A00;
    border-radius: 6px;
    padding: 7px 10px;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.1;
}

a.button:visited,
.button:visited {
    color: #FF6A00;
}

a.button:hover,
.button:hover,
button:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled),
input[type="button"]:hover:not(:disabled) {
    color: #fff;
    border-color: #fff;
    text-decoration: underline;
}

button:disabled,
input:disabled,
button[disabled] {
    color: rgba(255, 106, 0, 0.35);
    border-color: rgba(255, 106, 0, 0.35);
    background: rgba(255, 106, 0, 0.06);
    cursor: not-allowed;
}

input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
    max-width: 100%;
    font: inherit;
    color: #FF6A00;
    background: #000;
    border: 1px solid #FF6A00;
    border-radius: 4px;
    padding: 6px 8px;
}

input[type="checkbox"] {
    accent-color: #FF6A00;
}

/* Tables */
table,
.system-table,
.power-table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td,
.system-table th,
.system-table td,
.power-table th,
.power-table td {
    border: 1px solid #FF6A00;
    padding: 8px;
    text-align: left;
    vertical-align: top;
    position: relative;
}

table th,
.system-table th,
.power-table th {
    color: #FF6A00;
    font-weight: bold;
}

table a,
table a:visited,
.system-table a,
.system-table a:visited,
.power-table a,
.power-table a:visited {
    color: #FF6A00;
    text-decoration: none;
}

table a:hover,
.system-table a:hover,
.power-table a:hover {
    color: #fff;
    text-decoration: underline;
}

table tr:hover,
.system-table tr:hover,
.power-table tr:hover {
    background-color: rgba(255, 106, 0, 0.16);
}

td {
    word-break: break-word;
    overflow-wrap: anywhere;
}

td[data-label='Controlling Faction'] {
    max-width: 220px;
    white-space: normal;
}

.control-palcon {
    color: #FF6A00;
}

.control-other {
    color: #FF5C5C;
}

/* Freshness dots */
.dot-fresh,
.dot-stale,
.dot-old {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

.dot-fresh { background: green; }
.dot-stale { background: orange; }
.dot-old { background: red; }

/* Copy button */
.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    background: none;
    border: none;
    color: #FF6A00;
    cursor: pointer;
    font-size: 0.85em;
    line-height: 1;
    padding: 0;
    vertical-align: middle;
    transform: translateY(-1px);
}

.copy-button:hover svg {
    fill: #fff;
}

/* Power progress */
.progress-container {
    width: 100%;
    min-width: 150px;
    height: 28px;
    background: #111;
    border: 1px solid #FF6A00;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    min-width: 36px;
    background: #FF6A00;
    color: #000;
    font-weight: bold;
    text-align: center;
    line-height: 28px;
    white-space: nowrap;
}

.low-progress .progress-bar {
    background: #ffd000;
    color: #000;
}

.very-low-progress .progress-bar {
    background: #ff3333;
    color: #fff;
}

/* Media / charts */
img,
svg,
iframe {
    max-width: 100%;
}

.chart-container,
.chart-wrap,
.graph {
    width: 100%;
    max-width: 100%;
    min-height: 380px;
}

.chart-container canvas,
.chart-wrap canvas,
.graph canvas,
canvas#historyChart,
canvas[id*="chart"],
canvas[id*="Chart"] {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 360px;
}

@media (min-width: 801px) {
    .chart-container,
    .chart-wrap,
    .graph {
        height: 430px;
    }

    .chart-container canvas,
    .chart-wrap canvas,
    .graph canvas,
    canvas#historyChart,
    canvas[id*="chart"],
    canvas[id*="Chart"] {
        height: 430px !important;
    }
}

/* Mobile */
@media (max-width: 800px) {
    .container {
        max-width: none;
        padding: 10px 8px 80px;
        overflow-x: hidden;
    }

    .site-header {
        display: block;
        margin-bottom: 24px;
    }

    .logo-group {
        margin-bottom: 12px;
    }

    .logo-img {
        height: 30px;
    }

    .logo-text {
        font-size: 1.35rem;
        white-space: normal;
    }

    .menu {
        margin-left: 0;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .menu a,
    .menu a:visited {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 7px 6px;
        font-size: 0.82rem;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.45rem; }
    h3 { font-size: 1.12rem; }
    p { font-size: 0.92rem; }

    table,
    .system-table,
    .power-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        margin-bottom: 18px;
    }

    table th,
    table td,
    .system-table th,
    .system-table td,
    .power-table th,
    .power-table td {
        display: table-cell !important;
        padding: 7px 8px;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    table th:nth-child(2), table td:nth-child(2),
    .system-table th:nth-child(2), .system-table td:nth-child(2) {
        min-width: 115px;
    }

    table th:nth-child(5), table td:nth-child(5),
    .system-table th:nth-child(5), .system-table td:nth-child(5) {
        min-width: 165px;
    }

    table th:nth-child(6), table td:nth-child(6),
    .system-table th:nth-child(6), .system-table td:nth-child(6) {
        min-width: 130px;
    }

    table th:nth-child(9), table td:nth-child(9),
    .system-table th:nth-child(9), .system-table td:nth-child(9) {
        min-width: 150px;
    }

    .copy-button {
        position: static;
        transform: none;
        margin-left: 5px;
        padding: 0;
        border: 0;
    }

    .ops-tabs,
    .tabs,
    .tab-buttons,
    .button-row,
    form,
    .filters,
    .filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .ops-tabs a,
    .tabs a,
    .tab-buttons a,
    .button-row a,
    form button,
    form input[type="submit"],
    form input[type="button"] {
        max-width: 100%;
        white-space: normal;
    }

    .chart-container,
    .chart-wrap,
    .graph {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chart-container canvas,
    .chart-wrap canvas,
    .graph canvas,
    canvas#historyChart,
    canvas[id*="chart"],
    canvas[id*="Chart"] {
        min-width: 720px;
        height: 340px !important;
    }
}

@media (max-width: 430px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .logo-img {
        height: 28px;
    }

    .logo-text {
        font-size: 1.22rem;
    }

    .menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .menu a,
    .menu a:visited {
        font-size: 0.8rem;
        padding: 7px 6px;
    }

    h1 { font-size: 1.55rem; }
    h2 { font-size: 1.32rem; }

    table th,
    table td,
    .system-table th,
    .system-table td,
    .power-table th,
    .power-table td {
        font-size: 0.76rem;
        padding: 6px 7px;
    }
}


/* Native faction flags */
.native-badge {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    border: 1px solid #FF6A00;
    border-radius: 4px;
    color: #FF6A00;
    background: rgba(255, 106, 0, 0.08);
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
}

.muted {
    color: rgba(255, 106, 0, 0.65);
}

.flash {
    border: 1px solid #FF6A00;
    background: rgba(255, 106, 0, 0.08);
    color: #FF6A00;
    padding: 10px;
    margin: 12px 0;
    border-radius: 6px;
}

.control-section {
    border: 1px solid #FF6A00;
    padding: 12px;
    margin: 12px 0;
    border-radius: 6px;
    background: rgba(255, 106, 0, 0.04);
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
}

.native-system-picker select {
    min-width: 220px;
}

@media (max-width: 800px) {
    .native-system-picker,
    .native-system-picker select,
    .native-system-picker button {
        width: 100%;
    }
}

/* Locker Control / Ops tidy-up */
.flash,
.notice,
.alert,
.message,
.success-message {
    max-width: 980px;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 12px 0 18px;
}

.success-message,
.flash.success,
.message.success {
    border: 1px solid #00cc44;
    background: rgba(0, 180, 70, 0.12);
    color: #00ff66;
}

/* Make control pages breathe on desktop */
.container {
    max-width: 1280px;
}

.container > h1,
.container > h2 {
    margin-top: 26px;
    margin-bottom: 18px;
}

.container > p {
    max-width: 950px;
}

/* Control summary / admin forms */
form {
    margin: 8px 0;
}

label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 8px 4px 0;
}

input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
    min-height: 34px;
}

textarea {
    width: 100%;
    max-width: 720px;
    min-height: 140px;
}

/* Buttons should stay PalCon styled even inside odd forms */
button,
input[type="submit"],
input[type="button"],
a.button,
.button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Sector/filter links used on Locker Control */
.sector-links,
.sector-nav,
.control-nav,
.filter-links,
.native-sector-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 20px;
}

.sector-links a,
.sector-nav a,
.control-nav a,
.filter-links a,
.native-sector-tabs a {
    color: #FF6A00;
    border: 1px solid #FF6A00;
    border-radius: 6px;
    padding: 7px 10px;
    text-decoration: none;
    background: rgba(255, 106, 0, 0.04);
}

.sector-links a:hover,
.sector-nav a:hover,
.control-nav a:hover,
.filter-links a:hover,
.native-sector-tabs a:hover {
    color: #fff;
    border-color: #fff;
}

/* If the sector links are plain anchors directly after the Watchlist Actions heading, make them less cramped */
h1 + form + a,
h2 + form + a,
form + a {
    margin-right: 8px;
    line-height: 2;
}

/* Dashboard/card helpers used by newer control/native pages */
.control-card,
.control-panel,
.health-card,
.native-system-card,
.sector-card,
.ops-card {
    border: 1px solid #FF6A00;
    border-radius: 8px;
    background: rgba(255, 106, 0, 0.035);
    padding: 14px;
    margin: 14px 0;
}

.control-grid,
.health-grid,
.ops-grid,
.native-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin: 14px 0 22px;
}

.control-stat,
.health-stat,
.ops-stat {
    border: 1px solid rgba(255, 106, 0, 0.75);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 106, 0, 0.035);
}

.control-stat strong,
.health-stat strong,
.ops-stat strong {
    display: block;
    font-size: 1.45rem;
    margin-top: 4px;
}

/* Native flags AJAX feedback */
.save-status,
.ajax-status {
    margin-left: 8px;
    font-weight: bold;
}

.save-status.ok,
.ajax-status.ok,
.saved-ok {
    color: #00ff66;
}

.save-status.error,
.ajax-status.error,
.saved-error {
    color: #ff4444;
}

/* Desktop tables on control pages */
.control-table,
.admin-table,
.native-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 24px;
}

/* Mobile tuning for control pages */
@media (max-width: 800px) {
    .container > h1,
    .container > h2 {
        margin-top: 22px;
    }

    label {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
    }

    input[type="text"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        width: 100%;
    }

    button,
    input[type="submit"],
    input[type="button"],
    a.button,
    .button {
        width: auto;
        max-width: 100%;
    }

    .sector-links,
    .sector-nav,
    .control-nav,
    .filter-links,
    .native-sector-tabs {
        gap: 7px;
    }

    .sector-links a,
    .sector-nav a,
    .control-nav a,
    .filter-links a,
    .native-sector-tabs a {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }
}
.copy-btn {
    background: none;
    border: none;
    color: #FF6A00;
    cursor: pointer;
    margin-left: 4px;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    vertical-align: middle;
    transition: color 0.15s ease;
}

.copy-btn:hover {
    color: #ffffff;
}
.delta-pos {
    color: lime;
    font-weight: bold;
}

.delta-neg {
    color: red;
    font-weight: bold;
}

.delta-zero {
    color: yellow;
}
.system-table,
.system-table * {
    cursor: default;
}

.system-table a,
.system-table button {
    cursor: pointer;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.stat-value {
    color: #FF6A00;
    font-size: 1.6rem;
    font-weight: bold;
}
.pmf-badge {
    display: inline;
    width: auto;
    height: auto;
    margin-left: 4px;
    background: none;
    border: none;
    color: #FF6A00;
    font-size: 0.85em;
    vertical-align: middle;
}
.control-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.worker-status-note {
    border: 1px solid #0077cc;
    color: #d8f0ff;
    background: rgba(0, 40, 70, 0.45);
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 32px;
}

.control-main-stack {
    display: block;
}

.control-main-stack > * {
    margin-bottom: 24px;
}
.support-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.support-card {
    border: 1px solid #FF6A00;
    border-radius: 10px;
    padding: 14px;
    background: rgba(255, 106, 0, 0.08);
    text-align: center;
}

.support-medal {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.support-system {
    font-weight: bold;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.support-system a {
    color: #FF6A00;
    text-decoration: none;
}

.support-system a:hover {
    color: #fff;
    text-decoration: underline;
}

.support-score {
    font-size: 1.6rem;
    font-weight: bold;
}

.support-label,
.support-events {
    opacity: 0.8;
    font-size: 0.85rem;
}
.support-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}

.support-card-warning {
    background: rgba(255, 0, 0, 0.08);
    border-color: #ff4444;
}

@media (max-width: 800px) {
    .support-sections {
        grid-template-columns: 1fr;
    }
}
/* Support section */
.muted { color: #d98b4a; }
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.support-card, .ticket-card, .kb-item, .status-card { border: 1px solid #FF6A00; background: rgba(255,106,0,0.06); padding: 16px; color: #FF6A00; text-decoration: none; }
.support-card:hover { background: rgba(255,106,0,0.18); color: #fff; }
.support-icon { font-size: 2rem; }
.support-card h3 { margin: 8px 0; }
.kb-item { margin-bottom: 10px; }
.kb-item summary { cursor: pointer; font-weight: bold; }
.support-form label, .ticket-admin-form label { display: block; margin: 12px 0; }
.support-form input, .support-form select, .support-form textarea,
.ticket-admin-form input, .ticket-admin-form select, .ticket-admin-form textarea { width: 100%; box-sizing: border-box; background: #050505; color: #FF6A00; border: 1px solid #FF6A00; padding: 8px; font-family: monospace; }
button { background: #FF6A00; color: #000; border: 1px solid #FF6A00; padding: 8px 12px; cursor: pointer; font-family: monospace; font-weight: bold; }
button:hover { background: #FF6A00; color: #000; border-color: #FF6A00; }
.notice { border: 1px solid #FF6A00; padding: 10px; margin: 10px 0; }
.notice.success { color: #4AF04A; border-color: #4AF04A; }
.notice.error { color: #FF5C5C; border-color: #FF5C5C; }
.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.status-card strong, .status-card span { display: block; }
.ticket-card { margin: 16px 0; }
.ticket-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ticket-status { border: 1px solid currentColor; padding: 3px 8px; white-space: nowrap; }
.status-open { color: #FFA500; }
.status-in_progress { color: #64B5FF; }
.status-waiting_user { color: #E6D450; }
.status-resolved { color: #4AF04A; }
.status-closed { color: #999; }
.filter-links a { color: #FF6A00; }
.kb-item a {
    color: #FF6A00;
    text-decoration: underline;
    font-weight: bold;
}

.kb-item a:hover {
    color: #ffffff;
}
/* Knowledge Base */
.kb-list {
    margin-bottom: 25px;
}

.kb-item {
    margin-bottom: 10px;
    border: 1px solid #FF6A00;
    border-radius: 6px;
    padding: 12px 16px;
    background: rgba(255,106,0,0.05);
    font-size: 1rem;
}

.kb-item summary {
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    color: #FF6A00;
    padding: 6px 0;
}

.kb-item summary:hover {
    color: #fff;
}

.kb-body {
    margin-top: 12px;
}

.kb-body p,
.kb-body li {
    color: #FF6A00;
    font-size: 1.05rem;
    line-height: 1.65;
}

.kb-body h4 {
    color: #FF6A00;
    font-size: 1.05rem;
    margin: 18px 0 8px;
}

.kb-body ul,
.kb-body ol {
    margin: 10px 0 18px 22px;
    padding-left: 18px;
}

.kb-body li {
    margin-bottom: 6px;
}

.kb-body strong {
    color: #FF6A00;
}

.kb-body a {
    color: #FF6A00;
    text-decoration: underline;
    font-weight: bold;
}

.kb-body a:hover {
    color: hsl(0, 0%, 100%);
    .kb-body {
    margin-top: 15px;
    color: #FF6A00;
    font-size: 1.2rem;
    line-height: 1.8;
}

.kb-body p {
    font-size: inherit;
    line-height: inherit;
    margin: 15px 0;
}

.kb-body li {
    font-size: inherit;
    line-height: inherit;
    margin-bottom: 10px;
}

.kb-body h4 {
    font-size: 1.25rem;
    margin: 22px 0 10px;
    color: #FF6A00;
}

.kb-body ul,
.kb-body ol {
    margin: 15px 0 20px 30px;
}

.kb-body a {
    color: #FF6A00;
    font-weight: bold;
}
/* Keep Locker Control buttons orange on hover */
body .control-dashboard-card button:hover,
body .control-dashboard-card .button:hover,
body .control-dashboard-card a button:hover,
body .control-section button:hover,
body .control-panel button:hover,
body .locker-control button:hover {
    background: #FF6A00 !important;
    border-color: #FF6A00 !important;
    color: #000 !important;
    filter: brightness(1.15);
}
/* Keep normal buttons orange on hover */
button:hover,
a button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #FF6A00 !important;
    border-color: #FF6A00 !important;
    color: #000 !important;
    filter: brightness(1.15);
}

/* Locker Control dashboard buttons */
.control-dashboard-card button:hover,
.control-dashboard-card .card-action button:hover {
    background-color: #FF6A00 !important;
    background: #FF6A00 !important;
    border-color: #FF6A00 !important;
    color: #000 !important;
    box-shadow: 0 0 10px rgba(255,106,0,0.45);
}

.env-banner {
    background: #b71c1c;
    color: #fff;
    text-align: center;
    padding: 9px 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 13px;
    border-bottom: 2px solid rgba(255,255,255,0.25);
}

/* Locker Control dashboard layout tidy-up */
.control-dashboard {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.control-dashboard-card.queue-status-card {
    grid-column: span 2;
}

@media (max-width: 1000px) {
    .control-dashboard {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

    .control-dashboard-card.queue-status-card {
        grid-column: span 2;
    }
}

@media (max-width: 650px) {
    .control-dashboard {
        grid-template-columns: 1fr;
    }

    .control-dashboard-card.queue-status-card {
        grid-column: span 1;
    }
}
