@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0b0f17;
    --bg-surface: #121827;
    --bg-surface-strong: #171f30;
    --stroke-subtle: rgba(255, 255, 255, 0.08);
    --stroke-strong: rgba(255, 255, 255, 0.14);
    --text-primary: #f2f6ff;
    --text-muted: #b3bdd3;
    --accent: #2aa3ff;
    --accent-strong: #00d4ff;
    --header-height: 85px;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(circle at top, rgba(42, 163, 255, 0.18), transparent 55%), var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-top: 40px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}



.section-title {
    text-align: center;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #fff;
}

.panel {
    position: relative;
    background: linear-gradient(180deg, #1a1f2e 0%, #0f1419 100%);
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 45%, rgba(0, 153, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.panel .container {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .section-title {
        font-size: 32px;
    }
}

/* General Admin Panel Styles */
.panel-card {
    transition: all 0.3s ease;
    border: 2px solid #2a3142;
    position: relative;
    overflow: hidden;
}

.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}
.panel-card > * {
    position: relative;
    z-index: 1;
}

.panel-card:hover {
    transform: translateY(-4px);
    border-color: #3f4a61;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.panel-card:hover::before {
    opacity: 1;
}

/* Make title flex to align icon and text */
.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f0f2f5;
}
.panel-title svg {
    color: #0099ff;
}


/* Status row styling */
.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background-color: rgba(15, 20, 25, 0.6);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #2a3142;
}
.status-label {
    font-weight: 500;
    color: #b0b3b8;
}

/* Specific button styles */
.btn svg {
    margin-right: 8px;
}
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}
.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}


/* Pulsing animation for online pill */
.pill-ok {
    position: relative;
    color: #e4e6eb;
    border-color: rgba(114, 240, 162, 0.32);
    background-color: rgba(114, 240, 162, 0.1);
}
.pill-ok::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 999px;
    background-color: rgba(114, 240, 162, 0.18);
    opacity: 0.15;
    z-index: -1;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}


/* Backup List Styles */
.backups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 5px;
}

.backup-item {
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    transition: background-color 0.2s;
}
.backup-item:hover {
    background-color: #1c2635;
}

.backup-item-name {
    font-weight: 500;
    color: #e4e6eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 15px;
    flex: 1;
}

.backup-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 180px;
}

.backup-item-date {
    color: #8a96a5;
    font-size: 13px;
    white-space: nowrap;
}

.backup-item-size {
    color: #b0b3b8;
    font-size: 12px;
    white-space: nowrap;
}

/* Deliver preset emoji and layout */
.deliver-emoji {
    display: inline-block;
    width: 22px;
    text-align: center;
    margin-right: 8px;
    font-size: 16px;
    line-height: 1;
}

.deliver-panels {
    margin-top: 8px;
}
.deliver-panel {
    display: none;
}
.deliver-option {
    background: rgba(15,20,25,0.6);
    border: 1px solid #232a35;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 78px;
}
.deliver-option label { display: flex; flex-direction: column; gap:6px; }
.deliver-title { display:flex; align-items:center; gap:8px; }
.deliver-option small { color: #9ea6b0; font-size: 13px; }
.deliver-plugin { display:flex; align-items:center; gap:6px; margin-top:6px; color:#b0b3b8; }
.deliver-option input[type="number"] {
    width: 72px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #2a3142;
    background: #0f1419;
    color: #e4e6eb;
    align-self: flex-end;
}

/* Modal overlay and content for deliver presets editor */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}
.modal .modal-content {
    background: #0c1116;
    border: 1px solid #232a35;
    padding: 18px;
    border-radius: 12px;
    width: min(40%, 448px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), inset 0 2px 8px rgba(255,255,255,0.02);
}
.modal .modal-content input,
.modal .modal-content textarea,
.modal .modal-content select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #2a3142;
    background: #071018;
    color: #e6eef6;
    margin-top: 6px;
    box-sizing: border-box;
}
.modal-open { overflow: hidden; }

/* Ensure preset edit grid inputs don't overflow */


/* Remove default browser spinner arrows from number inputs */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

@media (max-width: 860px) {
    .deliver-panel {
        grid-template-columns: 1fr;
    }
}

/* System Info Styles */
#system-info p {
    font-size: 14px;
    color: #b0b3b8;
    margin-bottom: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
#system-info strong {
    color: #e4e6eb;
    font-weight: 600;
}

.system-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0f1419;
    border: 1px solid #2a3142;
}

.system-info-label {
    color: #b0b3b8;
    font-size: 13px;
}

.system-info-value {
    color: #e4e6eb;
    font-weight: 600;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: nowrap;
}

.tps-value {
    font-weight: 700;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

.tps-good {
    color: #5ddf8d;
}

.tps-warn {
    color: #f2c04c;
}

.tps-bad {
    color: #ff7575;
}

.tps-unknown {
    color: #8a96a5;
}

.admin-alert {
    max-width: 1100px;
    margin: 20px auto 0;
}

.admin-role {
    margin-top: 6px;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.admin-players-list,
.admin-plugins-list,
.admin-skrypty-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-log-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.admin-log-tab {
    border: 1px solid #2a3142;
    background: #0f1419;
    color: #b0b3b8;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-log-tab:hover {
    border-color: #3f4a61;
    color: #fff;
}

.admin-log-tab.is-active {
    color: #fff;
    border-color: #0099ff;
    box-shadow: 0 0 0 2px rgba(0, 153, 255, 0.18);
}

.admin-log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.admin-logs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    max-height: 540px;
    overflow-y: auto;
    padding-right: 4px;
}

.server-events {
    margin-top: 12px;
}

.server-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    border: 1px solid #2a3142;
    background: #0f1419;
    max-height: 220px;
    overflow-y: auto;
}

.server-events-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #1f2430;
    font-size: 0.9em;
    color: #d1d8e0;
}

.server-events-list li:last-child {
    border-bottom: none;
}

.server-event-type {
    font-weight: 600;
}

.server-event-start .server-event-type {
    color: #7dd3ff;
}

.server-event-stop .server-event-type {
    color: #ff7a7a;
}

.admin-logs-raw {
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 12px;
    padding: 12px 14px;
    white-space: pre-wrap;
    font-size: 12px;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #d1d8e0;
}

.admin-log-row {
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 12px;
    padding: 12px 14px;
}

.admin-log-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}

.admin-log-time {
    color: #8a96a5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-log-type {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: rgba(0, 153, 255, 0.15);
    color: #7dd3ff;
    border: 1px solid rgba(0, 153, 255, 0.3);
}

.admin-log-type.log-chat {
    background: rgba(114, 240, 162, 0.12);
    color: #72f0a2;
    border-color: rgba(114, 240, 162, 0.3);
}

.admin-log-type.log-command {
    background: rgba(242, 192, 76, 0.12);
    color: #f2c04c;
    border-color: rgba(242, 192, 76, 0.3);
}

.admin-log-type.log-admin {
    background: rgba(255, 117, 117, 0.12);
    color: #ff9c9c;
    border-color: rgba(255, 117, 117, 0.3);
}

.admin-log-severity {
    font-size: 12px;
    font-weight: 600;
}

.admin-log-severity.warning {
    color: #f2c04c;
}

.admin-log-severity.error {
    color: #ff7575;
}

.admin-log-meta {
    margin-top: 6px;
    color: #b0b3b8;
    font-size: 12px;
}

.admin-log-message {
    margin-top: 8px;
    color: #e4e6eb;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-log-command {
    margin-top: 6px;
    color: #cfd6e1;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-player-row,
.admin-plugin-row,
.admin-skrypty-wiersz {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: #0f1419;
    border: 1px solid #2a3142;
}

@media (max-width: 768px) {
    .admin-player-row,
    .admin-plugin-row,
    .admin-skrypty-wiersz {
        flex-direction: column;
    }
    
    .admin-player-info {
        min-width: 100%;
        margin-bottom: 12px;
    }

    .admin-player-actions {
        width: 100%;
        justify-content: flex-start;
        min-width: 0;
    }
}

.admin-player-info {
    flex: 1;
    min-width: 220px;
}

.admin-player-name {
    font-weight: 600;
    color: #e4e6eb;
}

.admin-player-uuid {
    font-size: 12px;
    color: #8a96a5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    margin-top: 2px;
}

.admin-player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 12px;
    color: #b0b3b8;
    margin-top: 6px;
}

.admin-player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    min-width: 260px;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #2a3142;
}

.admin-plugin-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-plugin-name {
    font-weight: 600;
    color: #e4e6eb;
}

.admin-plugin-version {
    font-size: 12px;
    color: #8a96a5;
}

.admin-plugin-desc {
    font-size: 13px;
    color: #b0b3b8;
    line-height: 1.4;
    margin-top: 4px;
    max-width: 760px;
}

.admin-plugin-details {
    margin-top: 8px;
    color: #cfd6e1;
    font-size: 12px;
}

.admin-plugin-detail {
    margin-top: 4px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.admin-plugin-detail-label {
    font-weight: 600;
    color: #f8fcff;
}

.admin-plugin-commands {
    margin: 6px 0 0 18px;
    padding: 0;
    list-style: disc;
    font-size: 11px;
    color: #dfe8f5;
}

.admin-plugin-commands li {
    margin: 2px 0;
}

.admin-skrypty-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-skrypty-nazwa {
    font-weight: 600;
    color: #e4e6eb;
}

.admin-skrypty-info {
    font-size: 12px;
    color: #8a96a5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-skrypty-akcje {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.admin-skrypty-edytor {
    width: 100%;
    resize: vertical;
    min-height: 260px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
}

.skrypty-nowe-toolbar-inline {
    margin-left: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.skrypty-nowe-body {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.skrypty-nowe-card {
    min-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
    padding-top: 8px;
    padding-bottom: 20px;
}

.skrypty-nowe-body {
    flex: 1;
    min-height: 460px;
    align-items: stretch;
}

.skrypty-nowe-tree-wrapper {
    width: 320px;
    max-width: 100%;
    min-height: 360px;
    height: 100%;
    max-height: none;
    border: 1px solid #2f2f2f;
    border-radius: 10px;
    padding: 8px 6px;
    background: #1e1e1e;
    overflow-y: auto;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.skrypty-nowe-tree-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #c5c5c5;
    margin: 2px 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.skrypty-nowe-tree-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.skrypty-nowe-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
    color: #c5c5c5;
    font-size: 10px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.skrypty-nowe-filter-label {
    line-height: 1;
}

.skrypty-nowe-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 34px;
    height: 18px;
    cursor: pointer;
    margin-right: 4px;
}

.skrypty-nowe-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.skrypty-nowe-toggle-slider {
    position: absolute;
    inset: 0;
    background: #2a2d2e;
    border: 1px solid #3c3c3c;
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.skrypty-nowe-toggle-slider::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    left: 2px;
    top: 2px;
    background: #9b9b9b;
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
}

.skrypty-nowe-toggle input:checked + .skrypty-nowe-toggle-slider {
    background: #094771;
    border-color: #0b5a8c;
}

.skrypty-nowe-toggle input:checked + .skrypty-nowe-toggle-slider::before {
    transform: translateX(16px);
    background: #ffffff;
}

.icon-btn {
    width: 22px;
    height: 22px;
    border: 1px solid transparent;
    background: transparent;
    color: #c5c5c5;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: #3c3c3c;
}

.icon-btn:active {
    transform: translateY(1px);
}

.skrypty-nowe-tree {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.skrypty-nowe-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 14px;
}

.skrypty-nowe-node {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.skrypty-nowe-node-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.skrypty-nowe-node-row:hover {
    background: #2a2d2e;
}

.skrypty-nowe-node-row.is-active {
    background: #094771;
}

.skrypty-nowe-node-row.is-drop-target {
    outline: 1px dashed rgba(0, 255, 170, 0.7);
    background: rgba(0, 255, 170, 0.05);
}

.skrypty-nowe-node-row.is-dragging {
    opacity: 0.6;
}

.skrypty-nowe-toggle-btn,
.skrypty-nowe-toggle-placeholder {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #c5c5c5;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.skrypty-nowe-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.skrypty-nowe-node-children.is-collapsed {
    display: none;
}

.skrypty-nowe-icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #c5c5c5;
}

.skrypty-nowe-node-label {
    flex: 1;
    word-break: break-word;
    font-weight: 500;
    color: #e5e5e5;
}

.skrypty-nowe-node-status {
    font-size: 11px;
    color: #9b9b9b;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.skrypty-nowe-node-row .skrypty-nowe-node-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.skrypty-nowe-node-children {
    margin-left: 6px;
    padding-left: 10px;
    position: relative;
}

.skrypty-nowe-node-children::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.skrypty-nowe-node-children .skrypty-nowe-node-row::before {
    content: '';
    position: absolute;
    left: 2px;
    width: 8px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    top: 50%;
    transform: translateY(-50%);
}

 .skrypty-nowe-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 280px;
}

#skrypty-nowe-name,
#skrypty_nowe-name {
    width: 100%;
    height: 30px !important;
    min-height: 30px !important;
    line-height: 30px !important;
    padding: 4px 10px !important;
    font-size: 13px;
}

.skrypty-nowe-editor-wrapper textarea {
    flex: 1;
    min-height: 420px;
    resize: vertical;
    font-size: 14px;
    padding: 14px;
    line-height: 1.4;
}

.skrypty-nowe-editor-code {
    display: flex;
    align-items: stretch;
    border: 1px solid #2a3142;
    border-radius: 10px;
    overflow: hidden;
    background: #1b1b1b;
    height: 900px;
}

.skrypty-nowe-editor-surface {
    position: relative;
    flex: 1;
    height: 100%;
    overflow: hidden;
}

.skrypty-nowe-autocomplete {
    position: absolute;
    left: 12px;
    top: 12px;
    min-width: 220px;
    max-width: 420px;
    max-height: 240px;
    overflow: auto;
    background: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 3;
    display: none;
    padding: 6px 0;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
}

.skrypty-nowe-autocomplete-item {
    padding: 6px 10px;
    color: #e5e5e5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.skrypty-nowe-autocomplete-item small {
    color: #9b9b9b;
    font-size: 11px;
}

.skrypty-nowe-autocomplete-item.is-active {
    background: #094771;
    color: #ffffff;
}

.skrypty-nowe-highlight {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 14px;
    overflow: auto;
    background: transparent;
    color: #d4d4d4;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    pointer-events: none;
    scrollbar-width: none;
}

.skrypty-nowe-highlight::-webkit-scrollbar {
    display: none;
}

.skrypty-nowe-highlight code {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: inherit;
    display: block;
}

.skrypty-nowe-line-numbers {
    min-width: 48px;
    padding: 14px 10px;
    background: #1b1b1b;
    border-right: 1px solid #2a3142;
    color: #858585;
    font-size: 14px;
    line-height: 1.4;
    font-family: Consolas, 'Courier New', monospace;
    text-align: right;
    user-select: none;
    pointer-events: none;
    overflow: hidden;
}

.skrypty-nowe-line-numbers-inner {
    white-space: pre;
    display: block;
    transform: translateY(0);
}

.skrypty-nowe-editor-code .skrypty-nowe-content-field {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 14px;
    line-height: 1.4;
    height: 100%;
    width: 100%;
    resize: none;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-family: Consolas, 'Courier New', monospace;
    color: transparent;
    caret-color: #d4d4d4;
    position: relative;
    z-index: 1;
}

.skrypty-nowe-editor-code .skrypty-nowe-content-field::selection {
    background: rgba(88, 166, 255, 0.35);
}

.economy-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.economy-metric-card {
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.economy-metric-label {
    font-size: 12px;
    color: #b0b3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.economy-metric-value {
    font-size: 20px;
    font-weight: 600;
    color: #d1f0ff;
}

.economy-richest {
    margin-top: 24px;
}

.economy-richest-list {
    margin-top: 12px;
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.economy-richest-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #e4e6eb;
}

.economy-order-section {
    margin-top: 24px;
}

.economy-status-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.economy-orders-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a3142;
}

.economy-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.economy-orders-table th,
.economy-orders-table td {
    padding: 10px 12px;
    font-size: 13px;
    color: #d0d6e1;
    text-align: left;
    border-bottom: 1px solid #1f2636;
}

.economy-orders-table tbody tr:last-child td {
    border-bottom: none;
}

.economy-online-filters {
    margin: 10px 0 12px;
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(220px, 1fr) 100px auto auto;
    gap: 8px;
    align-items: center;
}

.economy-online-filters .input {
    width: 100%;
}

.economy-online-export-row {
    margin: 0 0 12px;
    display: grid;
    grid-template-columns: auto minmax(180px, 220px) auto 110px auto auto;
    gap: 8px;
    align-items: center;
}

.economy-orders-table th[data-online-sort-key] {
    cursor: pointer;
    user-select: none;
}

.economy-online-actions {
    white-space: nowrap;
}

.economy-online-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.economy-online-details-pre {
    margin: 0;
    padding: 12px;
    border: 1px solid #2a3142;
    border-radius: 10px;
    background: #0f1419;
    color: #d0d6e1;
    font-size: 12px;
    line-height: 1.4;
    max-height: 52vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

#online-payment-details-modal .modal-card {
    position: relative;
    width: min(980px, 96vw);
    z-index: 1;
}

.economy-actions {
    margin-top: 24px;
}

.economy-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.economy-action-form {
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.economy-action-form .form-title {
    font-weight: 600;
    color: #e4e6eb;
    font-size: 14px;
}

.economy-action-status {
    margin-top: 14px;
    font-size: 13px;
    color: #7dd3ff;
}

.economy-action-form .input {
    background: #111622;
}

.economy-section {
    margin-top: 24px;
}

.economy-crate-grid,
.economy-market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.economy-crate-card,
.economy-market-card {
    border: 1px solid #1e2436;
    border-radius: 12px;
    padding: 12px 14px;
    background: #0f1419;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.economy-crate-card .title,
.economy-market-card .title {
    font-size: 13px;
    color: #7dd3ff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.economy-crate-card .value,
.economy-market-card .value {
    font-size: 20px;
    font-weight: 600;
    color: #d1f0ff;
}

.economy-inflation-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.economy-inflation-event {
    border: 1px solid #1e2436;
    border-radius: 10px;
    padding: 10px 12px;
    background: #0f1419;
    font-size: 13px;
    color: #d0d6e1;
}

.economy-inflation-event .meta {
    font-size: 12px;
    color: #8a96a5;
}
.economy-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.economy-control-card {
    border: 1px solid #1e2436;
    border-radius: 12px;
    padding: 12px 14px;
    background: #0f1419;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.control-hint {
    font-size: 12px;
    color: #8a96a5;
}

.admin-input-label {
    font-size: 12px;
    color: #b0b3b8;
    letter-spacing: 0.4px;
}

@media (max-width: 800px) {
    .economy-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .economy-online-filters {
        grid-template-columns: 1fr;
    }

    .economy-online-export-row {
        grid-template-columns: 1fr;
    }

    .economy-online-details-grid {
        grid-template-columns: 1fr;
    }

    .economy-actions-grid {
        grid-template-columns: 1fr;
    }
}

.plugin-guide-card {
    width: min(720px, 95vw);
}

.plugin-guide-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.plugin-guide-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plugin-guide-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.plugin-guide-status {
    width: fit-content;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.plugin-guide-summary {
    color: #cfd6e1;
    font-size: 14px;
    line-height: 1.5;
}

.plugin-guide-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plugin-guide-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #7dd3ff;
    font-weight: 600;
}

.plugin-guide-section-text {
    font-size: 14px;
    color: #d0d6e1;
    line-height: 1.5;
}

.plugin-guide-commands {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plugin-guide-commands li {
    border: 1px solid #1e2436;
    border-radius: 10px;
    padding: 10px 12px;
    background: #0f1419;
}

.plugin-guide-command {
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #6ee5ff;
    display: inline-block;
    margin-bottom: 2px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 18, 0.8);
}

.modal-content {
    background: #1a1f2e;
    border: 1px solid #2a3142;
    border-radius: 16px;
    padding: 20px 22px;
    width: min(900px, 95vw);
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Specific tweaks for plugin confirm modal: center single card and hide default close/backdrop */
#plugin-confirm-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 10, 18, 0.88); /* darker overlay */
    z-index: 11000;
}
#plugin-confirm-modal .modal-card {
    position: relative;
    width: min(820px, 96vw);
    max-width: 820px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
    z-index: 11001;
    display: flex;
    align-items: center;
    justify-content: center;
}
#plugin-confirm-modal .modal-content {
    width: auto;
    max-width: 96%;
    background: #0a0e12; /* even darker card background */
    border: 1px solid #15191d;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 42px 100px rgba(0,0,0,0.8);
    color: #e6eef6;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (max-width: 600px) {
    #plugin-confirm-modal .modal-card {
        width: calc(100% - 24px);
        max-width: none;
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #2a3142;
    background: #101521;
    color: #e4e6eb;
    font-size: 20px;
    cursor: pointer;
}

.modal-content {
    margin-top: 8px;
}

#player-profile-modal .modal-card {
    position: relative;
    width: min(1280px, 97vw);
    max-width: 1280px;
}

#player-profile-modal .modal-content {
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    padding: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-top: 0;
}

#player-profile-content .panel-card + .panel-card {
    margin-top: 14px;
}

#player-profile-content .purchase-section-title {
    font-weight: 700;
    color: #eef4ff;
    margin-bottom: 8px;
}

#player-profile-content #panel-currency-balances {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

#player-profile-content .admin-profile-history-scroll {
    max-height: 360px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #2a3142;
    border-radius: 10px;
    background: rgba(10, 17, 33, 0.45);
}

#player-profile-content .admin-profile-history-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

#player-profile-content .admin-profile-history-card .profile-value {
    font-size: 14px;
    line-height: 1.35;
}

#player-profile-content .admin-profile-history-card .profile-label {
    line-height: 1.35;
}

#player-profile-content .admin-profile-history-empty {
    color: #b0b3b8;
    font-size: 13px;
    padding: 10px 12px;
}

@media (min-width: 1200px) {
    #player-profile-content .admin-profile-history-scroll {
        max-height: 460px; /* okolo 20 kafelkow (5 rzedow x 4 kolumny) */
    }
}

/* Deliver presets modal styles (default modal rules apply) */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.profile-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: #0f1419;
    border: 1px solid #2a3142;
}

.profile-label {
    font-size: 12px;
    color: #8a96a5;
}

.profile-value {
    font-size: 13px;
    color: #e4e6eb;
    margin-top: 4px;
    font-weight: 600;
}

.profile-section {
    margin-top: 16px;
}

.profile-section-title {
    font-weight: 600;
    color: #e4e6eb;
    margin-bottom: 8px;
}

.profile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-list-item {
    font-size: 12px;
    color: #b0b3b8;
    padding: 8px 10px;
    border-radius: 8px;
    background: #0f1419;
    border: 1px solid #2a3142;
}

.admin-tab {
    border: 1px solid #2a3142;
    background: #0f1419;
    color: #b0b3b8;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-tab:hover {
    border-color: #0099ff;
    color: #ffffff;
}

.admin-tab.is-active {
    background: #1a1f2e;
    border-color: #0099ff;
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.25);
}

.admin-tab[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-tab-panels {
    max-width: 1300px;
    margin: 0 auto;
}

/* Generator budowli (opis) */
.generator-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.generator-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.generator-field-span {
    grid-column: 1 / -1;
}

.generator-description {
    min-height: 90px;
}

.generator-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.generator-preview {
    margin-top: 12px;
    border: 1px solid #2a3142;
    background: rgba(11, 16, 28, 0.75);
    border-radius: 12px;
    padding: 12px;
}

.generator-preview-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.generator-preview-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: #c9d2dd;
}

.generator-preview-item strong {
    color: #ffffff;
    font-weight: 600;
    text-align: right;
}

.generator-preview-empty {
    color: #9ea6b0;
    font-size: 14px;
}

.generator-hint {
    margin-top: 8px;
    color: #9ea6b0;
    font-size: 13px;
}

.generator-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.generator-blocks-empty {
    color: #9ea6b0;
    font-size: 13px;
    margin-top: 6px;
}

.generator-block-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(42, 163, 255, 0.12);
    border: 1px solid rgba(42, 163, 255, 0.35);
    color: #e4e6eb;
    font-size: 12px;
    font-weight: 600;
}

.generator-block-pill span {
    color: #9cc7ff;
    font-weight: 700;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 900px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.is-active {
    display: block;
}

.admin-tab-panel .panel-grid {
    max-width: 1300px;
}

.input {
    flex: 1;
    min-width: 180px;
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 10px;
    padding: 10px 12px;
    color: #e4e6eb;
    font-size: 14px;
}

.input:focus {
    outline: none;
    border-color: #0099ff;
}

/* TitanGuard: wyrównane kolumny dla checków */
.tg-check-row {
    display: grid;
    grid-template-columns: 160px 140px 190px 170px 170px minmax(180px, 1fr);
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.tg-check-header {
    margin-top: 10px;
    opacity: 0.9;
}
.tg-check-row .input {
    min-width: 0;
    width: 100%;
}
.tg-check-row .panel-desc {
    margin: 0;
}
@media (max-width: 980px) {
    .tg-check-header {
        display: none;
    }
    .tg-check-row {
        grid-template-columns: 1fr;
    }
}

.tg-wykrycia-box {
    margin-top: 10px;
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 10px;
    padding: 10px 12px;
    color: #e4e6eb;
    font-size: 12.5px;
    line-height: 1.35;
    max-height: 320px;
    overflow: auto;
    white-space: pre;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Anti-Xray (Paper/Purpur): prosty układ formularza */
.ax-form-grid {
    display: grid;
    grid-template-columns: 190px minmax(220px, 1fr);
    gap: 8px;
    align-items: center;
}
.ax-form-grid .panel-desc {
    margin: 0;
}
.ax-textarea {
    min-height: 120px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
@media (max-width: 980px) {
    .ax-form-grid {
        grid-template-columns: 1fr;
    }
}

.skrypty-nowe-name-field {
    font-size: 14px;
    max-height: 36px;
    line-height: 20px;
    padding: 10px 12px;
}

.skrypty-nowe-content-field {
    min-height: 320px;
    max-height: 100%;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.media-upload-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
}

.media-upload-filename {
    color: #b0b3b8;
    font-size: 13px;
    min-height: 20px;
    display: flex;
    align-items: center;
}

.media-upload-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

@media (max-width: 900px) {
    .media-upload-row {
        grid-template-columns: 1fr;
    }
}

.admin-users-list {
    display: grid;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #2a3142;
    border-radius: 10px;
    background: #0f1419;
}

.admin-user-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-weight: 700;
    color: #fff;
}

.admin-user-uuid {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    color: #8a96a5;
}

.admin-role-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-user-operator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #b0b3b8;
}

.admin-user-operator-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-role-select {
    background: #1a1f2e;
    border: 1px solid #2a3142;
    border-radius: 8px;
    color: #e4e6eb;
    padding: 6px 8px;
    font-size: 13px;
}

.admin-users-empty {
    color: #b0b3b8;
    font-size: 13px;
}

.admin-zakladki-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.admin-zakladki-controls {
    margin-top: 12px;
}

.admin-zakladki-all {
    background: #121820;
}

.admin-zakladki-item {
    display: grid;
    grid-template-columns: 1fr 48px;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #2a3142;
    border-radius: 10px;
    background: #0f1419;
    color: #e4e6eb;
    font-size: 13px;
}

.admin-zakladki-item span {
    text-align: left;
}

.admin-zakladki-item input {
    accent-color: #00d4ff;
    justify-self: end;
}

.admin-zakladki-meta {
    color: #8a96a5;
    font-size: 12px;
}

.admin-console-input {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

.admin-console-output {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #2a3142;
    border-radius: 10px;
    background: #0f1419;
    max-height: 220px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    color: #b0b3b8;
    white-space: pre-wrap;
}

.admin-console-entry {
    margin-bottom: 10px;
}

.admin-console-history {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.admin-console-history button {
    background: #1a1f2e;
    border: 1px solid #2a3142;
    color: #e4e6eb;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.admin-console-history button:hover {
    border-color: #3c475c;
}

/* Shop Management Styles */
.shop-products-table-wrap {
    overflow-x: auto;
}

.shop-price-input {
    text-align: right;
}

.shop-tiers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.shop-user-discounts-list {
    margin-top: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a3142;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #b0b3b8;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #00d4ff;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 32px;
}

.btn-sm svg {
    flex-shrink: 0;
}

.btn-success {
    background: #00c853;
    color: #fff;
}

.btn-success:hover {
    background: #00b84a;
}

.btn-danger {
    background: #ff4444;
    color: #fff;
}

.btn-danger:hover {
    background: #ee3333;
}

/* Product Editor Modal Styles */
#product-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.product-editor-modal {
    background: #1a1f2e;
    border-radius: 16px;
    width: 100%;
    max-width: 1120px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#product-editor-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #2a3142;
}

#product-editor-modal .modal-header h2 {
    font-size: 24px;
    color: #fff;
    font-weight: 700;
}

#product-editor-modal .modal-close {
    background: transparent;
    border: none;
    color: #b0b3b8;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
}

#product-editor-modal .modal-close:hover {
    background: #2a3142;
    color: #fff;
}

.product-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px 30px 0 30px;
}

.product-editor-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 20px;
    align-items: start;
}

.product-editor-form .form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-editor-form .form-row label {
    margin-bottom: 0;
}

/* Deliver section spans full width (outside grid) */
.deliver-controls,
.deliver-tabs,
.deliver-panels {
    width: 100%;
}

/* Elements that should span both columns */
.product-editor-form .form-row-span,
.product-editor-form .media-upload-row,
.product-editor-form label:has(input[type="checkbox"]) {
    grid-column: 1 / -1;
}

/* Make inputs full width of their grid cell */
.product-editor-form input[type="text"],
.product-editor-form input[type="number"],
.product-editor-form select,
.product-editor-form textarea {
    width: 100%;
    box-sizing: border-box;
}

/* On small screens fall back to single column */
@media (max-width: 1200px) {
    .product-editor-form {
        grid-template-columns: 1fr;
    }
}

.product-editor-form label {
    font-size: 14px;
    font-weight: 600;
    color: #e4e6eb;
    margin-bottom: -8px;
}

.product-editor-form .input,
.product-editor-form select,
.product-editor-form textarea {
    width: 100%;
    background: #0f1419;
    border: 1px solid #2a3142;
    border-radius: 10px;
    padding: 10px 12px;
    color: #e4e6eb;
    font-size: 14px;
    font-family: inherit;
}

  .product-editor-form textarea {
      resize: vertical;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 13px;
  }

  .product-editor-form textarea#product-edit-features {
      min-height: 220px;
      line-height: 1.5;
      font-size: 13px;
  }

  .deliver-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
  }

  .deliver-tab {
      background: #0c111c;
      border: 1px solid #1f2435;
      border-radius: 999px;
      padding: 6px 14px;
      color: #b0b3b8;
      font-size: 13px;
      cursor: pointer;
  }

  .deliver-tab.is-active {
      color: #fff;
      border-color: #2b6cb0;
      background: rgba(0, 153, 255, 0.15);
  }

  .deliver-panels {
      display: grid;
      gap: 16px;
  }

  .deliver-panel {
      display: none;
  }

  .deliver-panel.is-active {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
  }

/* Ensure deliver options inside product editor/modal are multi-column when space allows */
.product-editor-modal .deliver-panel.is-active {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        grid-auto-flow: row !important;
        gap: 12px !important;
        width: 100% !important;
}

.product-editor-modal .deliver-option {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        min-width: 0 !important; /* prevent intrinsic min-width from breaking grid */
}

/* Ensure checkboxes and qty inputs don't force wide intrinsic sizes */
.product-editor-modal .deliver-option input[type="number"],
.product-editor-modal .deliver-option input[type="text"] {
        max-width: 100% !important;
        box-sizing: border-box !important;
}

/* Responsive: reduce number of columns on smaller viewports */
@media (max-width: 1200px) {
    .deliver-panel.is-active,
    .product-editor-modal .deliver-panel.is-active {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 800px) {
    .deliver-panel.is-active,
    .product-editor-modal .deliver-panel.is-active {
        grid-template-columns: 1fr !important;
    }
}

  .deliver-option {
      background: #0c111c;
      border: 1px solid #1f2435;
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 8px;
  }

  .deliver-option .deliver-plugin {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: #8aa8c6;
  }

  .deliver-option .deliver-plugin input[type="checkbox"] {
      accent-color: #2ecc71;
  }

  .deliver-option input[type="number"] {
      width: 70px;
      border-radius: 8px;
      border: 1px solid #2a3142;
      background: #050a14;
      color: #fff;
      padding: 4px 8px;
  }

  .deliver-option label {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 13px;
      color: #b0b3b8;
  }

  .deliver-option .deliver-title {
      display: flex;
      align-items: center;
      gap: 8px;
  }

  .deliver-option label strong {
      font-size: 14px;
      color: #e4e6eb;
      font-weight: 600;
  }

  .deliver-option .deliver-title input[type="checkbox"] {
      margin-top: 0;
  }

  .deliver-option small {
      color: #8aa8c6;
  }

  .feature-presets {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 10px;
      margin-bottom: 12px;
  }

  .feature-option {
      background: #0c111c;
      border: 1px solid #1f2435;
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      align-items: flex-start;
      gap: 8px;
  }

  .feature-option input[type="checkbox"] {
      margin-top: 4px;
  }

  .feature-option span {
      font-size: 13px;
      color: #b0b3b8;
      line-height: 1.4;
  }

  .feature-option span strong {
      color: #e4e6eb;
      display: block;
      font-size: 14px;
      margin-bottom: 4px;
  }

.product-editor-form .input:focus,
.product-editor-form select:focus,
.product-editor-form textarea:focus {
    outline: none;
    border-color: #0099ff;
}

/* Sort indicators for shop table */
th.sorted-asc::after,
th.sorted-desc::after {
    content: '';
    display: inline-block;
    margin-left: 6px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}
th.sorted-asc::after {
    border-bottom: 7px solid #00d4ff;
}
th.sorted-desc::after {
    border-top: 7px solid #00d4ff;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-actions .btn {
    flex: 1;
}

  .product-editor-preview {
      position: sticky;
      top: 20px;
      height: fit-content;
      align-self: flex-start;
      background: linear-gradient(180deg, #070b16 0%, #0b1321 100%);
      border: 1px solid #1f2435;
      border-radius: 24px;
      padding: 28px 30px 32px;
      box-shadow: 0 22px 60px rgba(5, 8, 20, 0.65);
      overflow: visible;
      max-height: calc(100vh - 80px);
      overflow-y: auto;
  }

.preview-label {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

  .preview-container {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        min-height: auto;
        display: block;
        box-shadow: none;
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

  .preview-container .product-card {
        width: 100%;
    }

.form-message {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid #00c853;
    color: #00ff66;
}

.form-message.error {
    display: block;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff6666;
}

@media (max-width: 1200px) {
    .product-editor-grid {
        grid-template-columns: 1fr;
    }

    .product-editor-preview {
        position: static;
        order: 0;
    }
}

.crate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.crate-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.crate-form-grid .input,
.crate-form-grid select,
.crate-form-grid textarea {
    width: 100%;
}

.crate-form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.crate-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #b0b3b8;
    font-size: 13px;
}

.crate-span-2 {
    grid-column: span 2;
}

.crate-textarea {
    min-height: 80px;
    resize: vertical;
}

.crate-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border: 1px solid #2a3142;
    border-radius: 12px;
}

@media (max-width: 800px) {
    .crate-span-2 {
        grid-column: span 1;
    }
}
.skrypty-nowe-card .panel-title {
    font-size: 20px;
    gap: 8px;
}

.skrypty-nowe-toolbar-inline {
    gap: 6px;
}

@media (max-width: 768px) {
    body[data-page="admin"] #page-content {
        padding-top: 40px !important;
    }

    .section-title {
        display: none;
    }

    .panel > .container {
        width: 100%;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        backdrop-filter: none !important;
    }

    .admin-tabs {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        gap: 10px;
        margin: 10px 0 15px 0;
        padding: 0 14px;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .admin-tabs::-webkit-scrollbar {
        height: 0;
        width: 0;
        display: none;
    }

    .admin-tab {
        flex: 0 0 auto;
        min-width: max-content;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .panel-grid {
        padding: 0 10px;
    }
}
