:root,
[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #bb86fc;
    --success: #03dac6;
    --danger: #cf6679;
    --glass: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);
    --scrollbar-track: rgba(0, 0, 0, 0.22);
    --scrollbar-thumb: rgba(255, 255, 255, 0.18);
    --scrollbar-thumb-hover: rgba(187, 134, 252, 0.55);
}

[data-theme="light"] {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #121212;
    --text-secondary: #555555;
    --accent: #3b82f6;
    --success: #059669;
    --danger: #dc2626;
    --glass: rgba(0, 0, 0, 0.05);
    --border-light: rgba(0, 0, 0, 0.1);
    --scrollbar-track: rgba(0, 0, 0, 0.06);
    --scrollbar-thumb: rgba(0, 0, 0, 0.24);
    --scrollbar-thumb-hover: rgba(59, 130, 246, 0.55);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 6px;
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: 260px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-item:hover {
    background-color: var(--glass);
    color: var(--text-primary);
}

.sidebar-item.active {
    background-color: var(--glass);
    color: var(--accent);
    border-left-color: var(--accent);
}

.sidebar-item .icon {
    margin-right: 15px;
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--glass);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.main-content-area {
    flex: 1;
    height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 25px;
    position: relative;
}

@media (min-width: 901px) {
    .main-content-area.viewport-locked,
    .main-content-area:has(#view-analytics.active),
    .main-content-area:has(#view-database.active),
    .main-content-area:has(#view-config.active) {
        overflow-y: hidden;
    }
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sensors-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.sensor-card {
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.sensor-card h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 6px;
}

#device-selector button,
#db-device-selector button,
#config-device-selector button,
#btn-database-view {
    flex-shrink: 0;
    white-space: nowrap;
}

.main-content {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.column-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.column-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass);
}

.header-card {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #3700b3 0%, #6200ea 100%);
}

h1 {
    margin: 0;
    font-size: 1.5rem;
}

h2 {
    margin-top: 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.value-display {
    font-size: clamp(1.35rem, 1.8vw, 2.05rem);
    font-weight: 700;
    margin: 8px 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.value-display > span:first-child {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--danger);
    margin-right: 8px;
}

.status-on {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

.status-wait {
    background-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    animation: pulse 2s infinite;
}

.status-online {
    background-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.controls {
    display: flex;
    gap: 10px;
}

button {
    background: var(--glass);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

button:hover {
    background: rgba(255, 255, 255, 0.1);
}

button.primary {
    background: var(--accent);
    color: var(--text-primary);
    border: none;
}

button.primary:hover {
    opacity: 0.9;
}

button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

button.danger:hover {
    background: var(--danger);
    color: black;
}

/* Mobile optimization */
@media (max-width: 600px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .header-card {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* History Table */
#history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
    font-size: clamp(0.8rem, 1.45vh, 0.9rem);
    table-layout: auto;
}

#history-table th,
#history-table td {
    height: var(--db-row-h, calc((100vh - 332px) / 16));
    padding: 0 15px;
    box-sizing: border-box;
    vertical-align: middle;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

#history-table th {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* Chat Window */
.chat-window {
    min-height: 150px;
    height: auto;
    background: var(--glass);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 86%;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
}

.chat-message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--accent);
    color: #000;
}

.chat-message.ai {
    align-self: flex-start;
    background: #333;
    color: white;
}

.console-output {
    min-height: 200px;
    max-height: 500px;
    height: auto;
    overflow-y: auto;
    background: #000;
    color: #00ff00;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    white-space: pre-wrap;
}

/* =========================================================
   VECTOR BOARD MODAL STYLES
   ========================================================= */

.board-wrapper {
    display: flex;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
}

/* ETHERNET SHIELD */
.ethernet-shield {
    width: 540px;
    height: 470px;
    background-color: #8c8c8c;
    border: 2px solid #555;
    position: relative;
    padding: 20px;
    box-shadow: -10px 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.rj45-port {
    position: absolute;
    left: -40px;
    top: 175px;
    width: 80px;
    height: 100px;
    background-color: #d4d4d4;
    border: 2px solid #999;
    border-radius: 4px;
    box-shadow: -5px 5px 10px rgba(0, 0, 0, 0.3);
}

/* MEGA SENSOR SHIELD V2.4 */
.mega-shield {
    width: 460px;
    height: 450px;
    background-color: #d1d1d1;
    border: 2px solid #999;
    position: relative;
    padding: 30px;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* MEGA BARE BOARD */
.mega-bare-board {
    width: 835px;
    height: 510px;
    background-color: #d1d1d1;
    border: 2px solid #999;
    position: absolute;
    left: 85px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.board-wrapper .title {
    color: #222;
    font-weight: bold;
    font-size: 20px;
}

/* RZĘDY PINÓW - POZIOME KONTENERY */
.header-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
}

.pin-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    min-width: 16px;
    transition: transform 0.2s;
}

.pin-label {
    font-size: 10px;
    color: #333;
    font-weight: 800;
    margin-bottom: 2px;
    text-align: center;
}

.pin-hole {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
}

.pin-hole.black {
    background-color: #333;
}

.pin-hole.red {
    background-color: #e11d48;
}

.pin-hole.green {
    background-color: #10b981;
}

.pin-hole.blue {
    background-color: #3b82f6;
}

/* WERSJA KLIKALNA (Główna aktywacja) */
.pin-column.interactive {
    cursor: pointer;
}

/* Hover dla całej kolumny OPRÓCZ zablokowanych */
.pin-column.interactive:hover .pin-hole {
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
}

/* AKTYWNY STAN DLA CAŁEGO SŁUPKA (GND, VCC, SYGNAŁ) */
.pin-column.configured .pin-hole {
    background-color: #fbbf24 !important;
    border: 2px solid #000;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.pin-column.configured .pin-label {
    color: #d97706;
    transform: scale(1.1);
}

/* Stan Złożony (Fioletowy neon) */
.pin-column.configured.complex-mode .pin-hole {
    background-color: #c084fc !important;
    border: 2px solid #000;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
}

.pin-column.configured.complex-mode .pin-label {
    color: #c084fc;
}

.pin-column.selected-inspector .pin-hole {
    border: 2px dashed #00ffff !important;
    box-shadow: 0 0 10px #00ffff;
}

/* Klasa Zablokowanych Wtyków (Prądowe itd) */
.pin-column.blocked {
    opacity: 0.8;
}

/* --- Wcięcia dla rzędów Mega Shield --- */
.mega-digital-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-right: 120px;
    margin-top: 50px;
    position: relative;
}

.title-mega {
    position: absolute;
    top: -45px;
    right: 0;
    margin: 0;
    text-align: right;
}

.mega-analog-section {
    position: absolute;
    bottom: 30px;
    right: 150px;
}

/* --- KLASA GENERUJĄCA DWA RAZY WIĘKSZY ODSTĘP --- */
.extra-gap {
    margin-right: 12px;
}

/* --- KLASY DLA PIONOWYCH RZĘDÓW (BARE MEGA) --- */
.vertical-row {
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 2px !important;
}

.vertical-row .pin-column {
    flex-direction: row;
}

.vertical-row.rev-label .pin-column {
    flex-direction: row-reverse;
}

.vertical-row .pin-label {
    margin-bottom: 0;
    min-width: 25px;
    text-align: center;
    color: #999;
}

/* ETHERNET SECTIONS */
.eth-top-bars {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
}

.eth-bottom-bars {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

/* Toggle Switch dla Actuatorów */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--glass);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid var(--border-light);
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.slider {
    background-color: var(--success);
    border-color: var(--success);
}

.toggle-switch input:checked+.slider:before {
    transform: translateX(24px);
    background-color: #ffffff;
}

/* Analiza Danych View - Draggable Sensors & Interactive Chart Styles */
.sensor-drag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: grab;
    cursor: -webkit-grab;
    user-select: none;
    max-width: 100%;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sensor-drag-pill .sensor-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.sensor-drag-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transform: scale(1.02);
}

.sensor-drag-pill:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
    transform: scale(0.97);
}

.sensor-drag-pill.is-dragging {
    opacity: 0.4;
    border-style: dashed;
}

.sensor-drag-pill .drag-handle {
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
}

.sensor-drag-pill .sensor-device-tag {
    font-size: 0.72rem;
    color: var(--accent);
    background: rgba(187, 134, 252, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.analytics-chart-drop-area {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 160px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    padding: 12px;
    box-sizing: border-box;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.analytics-chart-drop-area.drag-over {
    border-color: var(--accent) !important;
    background: rgba(187, 134, 252, 0.08) !important;
    box-shadow: 0 0 25px rgba(187, 134, 252, 0.25);
}

.active-sensor-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: grab;
    cursor: -webkit-grab;
    user-select: none;
    transition: all 0.2s ease;
}

.active-sensor-badge:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.active-sensor-badge:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.active-sensor-badge .badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.active-sensor-badge .badge-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0 2px;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    margin-left: 4px;
    border-radius: 3px;
    transition: color 0.15s;
}

.active-sensor-badge .badge-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

.remove-dropzone {
    padding: 12px;
    text-align: center;
    border: 2px dashed #ef4444;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    user-select: none;
}

.remove-dropzone.drag-over {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    transform: scale(1.02);
}

.analytics-prompt-pill {
    transition: all 0.15s ease;
}

.analytics-prompt-pill:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent) !important;
}

/* Export View Styles */
@media (max-width: 960px) {
    .export-grid {
        grid-template-columns: 1fr !important;
    }
}

.export-device-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 14px;
    transition: all 0.2s ease;
}

.export-device-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.035);
}

.export-sensor-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.export-sensor-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.export-sensor-item.selected {
    background: rgba(187, 134, 252, 0.08);
    border-left-color: var(--accent);
}

/* =========================================================
   VIEWPORT-FITTED ANALYTICS, CONFIG & PAGINATED DATABASE VIEWS
   ========================================================= */

@media (min-width: 901px) {
    #view-analytics.active {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    #view-analytics > .dashboard {
        flex: 1;
        min-height: 0;
        gap: 14px;
    }

    #view-analytics .header-card {
        flex-shrink: 0;
        padding: 14px 20px;
    }

    #view-analytics .main-content {
        flex: 1;
        min-height: 0;
        grid-template-rows: minmax(0, 1fr);
        gap: 16px;
    }

    #view-analytics .column-left,
    #view-analytics .column-right {
        min-height: 0;
        height: 100%;
    }

    #view-analytics .column-left > .card,
    #view-analytics .column-right > .card {
        padding: 16px;
    }

    #view-config.active {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    #view-config > .header-card {
        flex-shrink: 0;
        padding: 14px 20px;
        margin-bottom: 12px !important;
    }

    #view-config > .card:nth-of-type(2) {
        flex-shrink: 0;
        padding: 12px 20px;
        margin-bottom: 12px !important;
    }

    #view-config > .modal-content-wide {
        flex: 1;
        min-height: 0 !important;
        box-sizing: border-box;
    }
}

#chat-window-analytics {
    min-height: 0 !important;
    overflow-x: hidden;
}

#view-database.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 12px;
    overflow: hidden;
    box-sizing: border-box;
}

#view-database .db-header-card {
    flex-shrink: 0;
    padding: 14px 20px;
}

#view-database .db-selector-card {
    flex-shrink: 0;
    padding: 12px 20px;
}

#view-database .db-table-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 20px;
    box-sizing: border-box;
}

.db-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    min-height: 34px;
}

.db-records-badge {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    padding: 2px 9px;
    border-radius: 12px;
    font-weight: 500;
}

.db-records-badge:empty {
    display: none;
}

.db-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.db-page-btn {
    min-width: 32px;
    height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.db-page-btn:hover {
    background: rgba(187, 134, 252, 0.18);
    border-color: var(--accent);
    color: #ffffff;
}

.db-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #121212;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(187, 134, 252, 0.35);
    cursor: default;
}

.db-page-ellipsis {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0 3px;
    user-select: none;
    opacity: 0.7;
}