#np-app {
    border: 1px solid #ddd;
    padding: 16px;
    margin: 0 auto 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.np-header h2 {
    margin: 0 0 4px;
    font-size: 1.4 rem;
}

.np-header p {
    margin: 0 0 12px;
    color: #666;
}

.np-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.np-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.np-btn-filter {
    min-width: 90px;
}

.np-nav-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.np-nav-btn {
    width: 34px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.np-nav-btn__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.np-nav-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.np-current-price,
.np-cheap-intervals,
.np-period-info {
    border: 1px solid #d7e0e8;
    background: #f8fbfe;
    color: #233444;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 1 rem;
    line-height: 1.35;
}

.np-current-price {
    flex: 1;
    min-width: 220px;
}

.np-current-price-up {
    border-color: #e5b6b6;
    background: #fff5f5;
    color: #b42318;
}

.np-current-price-down {
    border-color: #bfe1cc;
    background: #f2fbf5;
    color: #1d7a44;
}

.np-current-price-flat {
    border-color: #d7e0e8;
    background: #f8fbfe;
    color: #233444;
}

.np-current-price-value-badge {
    display: inline-block;
    min-width: 84px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    text-align: center;
    background: var(--np-current-price-badge-bg, #e1e8ef);
    color: var(--np-current-price-badge-fg, #1f2933);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.np-cheap-intervals {
    margin-bottom: 8px;
}

.np-period-info {
    margin-bottom: 10px;
}

.np-emphasis-red {
    font-weight: 700;
    text-decoration-line: underline;
    text-decoration-color: #c62828;
    text-decoration-thickness: 3px;
    text-underline-offset: 3px;
}

.np-filters-modal[hidden] {
    display: none;
}

.np-filters-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.np-filters-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
}

.np-filters-panel {
    position: relative;
    z-index: 1;
    width: min(940px, 96vw);
    max-height: 86vh;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #c9d5df;
    background: #ffffff;
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.24);
    padding: 14px;
}

.np-upgrade-modal[hidden] {
    display: none;
}

.np-upgrade-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.np-upgrade-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 24, 35, 0.52);
}

.np-upgrade-panel {
    position: relative;
    z-index: 1;
    width: min(720px, 96vw);
    max-height: 86vh;
    overflow: auto;
    border-radius: 14px;
    border: 1px solid #b7d5e7;
    background:
        radial-gradient(circle at top right, rgba(44, 138, 201, 0.16), transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.34);
    padding: 16px;
}

.np-upgrade-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.np-upgrade-header h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #17384c;
}

.np-upgrade-close {
    border: 1px solid #b7c4cf;
    background: #f5f8fb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
}

.np-upgrade-close:hover {
    background: #e9f2f8;
}

.np-upgrade-close:focus-visible {
    outline: 2px solid #6ba6cf;
    outline-offset: 2px;
}

.np-upgrade-close__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.np-upgrade-close__icon svg {
    width: 18px;
    height: 18px;
}

.np-upgrade-close__icon path {
    fill: none;
    stroke: #1f2933;
    stroke-width: 2;
    stroke-linecap: round;
}

.np-upgrade-lead {
    margin: 0 0 8px;
    color: #1e3345;
    line-height: 1.45;
}

.np-upgrade-lead-muted {
    margin-top: 2px;
    color: #3b5165;
    font-weight: 600;
}

.np-upgrade-list {
    margin: 0;
    padding-left: 20px;
    color: #1d3347;
    line-height: 1.5;
}

.np-upgrade-list li {
    margin: 5px 0;
}

.np-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.np-filters-header h3 {
    margin: 0;
    font-size: 1.5 rem;
}

#np-filters-close {
    border: 1px solid #b7c4cf;
    background: #f5f8fb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
}

#np-filters-close::before,
#np-filters-close::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 70%;
    background-color: rgb(31, 41, 51);
    top: 15%;
    left: 50%;
    transform-origin: center;
}

#np-filters-close::before {
    transform: translateX(-50%) rotate(45deg);
}

#np-filters-close::after {
    transform: translateX(-50%) rotate(-45deg);
}

.np-controls-popup {
    margin-bottom: 0;
}

.np-backfill-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2e8ef;
}

.np-backfill-status {
    font-size: 0.92rem;
    color: #4f5964;
}

.np-backfill-status-error {
    color: #b42318;
}

.np-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.np-group label {
    font-weight: 600;
    margin-right: 4px;
}

.np-btn {
    border: 1px solid #ccc;
    background: #f7f7f7;
    color: #1f2933;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1 rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.np-btn:hover {
    background: #eceff2;
}

.np-btn:focus-visible {
    outline: 2px solid #7aa8c8;
    outline-offset: 1px;
}

.np-btn.np-active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.np-date-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.np-date-trigger {
    border: 1px solid #ccc;
    background: linear-gradient(180deg, #ffffff 0%, #f3f7fa 100%);
    width: 36px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.np-date-trigger:hover {
    border-color: #7ca9c9;
    box-shadow: 0 2px 5px rgba(0, 115, 170, 0.12);
}

.np-date-trigger:active {
    transform: translateY(1px);
}

.np-date-trigger:focus-visible {
    outline: 2px solid #6ba6cf;
    outline-offset: 2px;
}

.np-date-trigger__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.np-date-trigger__icon svg {
    width: 18px;
    height: 18px;
    fill: #3f5e73;
}

.np-date-trigger.np-active {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.22);
    background: #eef7fc;
}

.flatpickr-day.np-has-data-day {
    position: relative;
    font-weight: 700;
    color: #0a5f7c;
}

.flatpickr-day.np-has-data-day::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 3px;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #1ea3d8;
}

.flatpickr-day.np-locked-day {
    pointer-events: auto !important;
    cursor: not-allowed;
    color: #8f98a3 !important;
    background: #f4f7fa;
    border-color: #dce4eb;
}

.flatpickr-day.np-locked-day::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 3px;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #9ba8b6;
}

.np-status {
    margin-bottom: 8px;
    font-size: 1rem;
    color: #555;
}

.np-time-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 0 0 10px;
    font-size: 1 rem;
    color: #4f5964;
}

.np-time-line {
    white-space: nowrap;
}

.np-refresh-line {
    color: #5a6470;
}

.np-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1 rem;
}

.np-table th,
.np-table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
    text-align: right;
}

.np-table th:first-child,
.np-table td:first-child {
    text-align: left;
}

.np-table thead th {
    background: #f0f0f0;
}

.np-table-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.np-table-columns .np-table {
    margin: 0;
}

.np-day-prefix {
    color: #8f98a3;
}

.np-day-prefix-tomorrow {
    color: #b6bcc3;
}

/* Krāsu kodējums */
.np-price-green td:nth-child(2),
.np-price-green td:nth-child(3) {
    color: #27ae60;
}

.np-price-yellow td:nth-child(2),
.np-price-yellow td:nth-child(3) {
    color: #f1c40f;
}

.np-price-red td:nth-child(2),
.np-price-red td:nth-child(3) {
    color: #e74c3c;
}

/* Esošās stundas izcelšana */
.np-current {
    background: rgba(52, 152, 219, 0.12);
}

/* Responsivitāte */
@media (max-width: 600px) {
    .np-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .np-top-row {
        flex-direction: column;
        align-items: stretch;
    }

    .np-current-price {
        min-width: 0;
    }

    .np-filters-panel {
        width: 100%;
        max-height: 92vh;
        padding: 12px;
    }

    .np-upgrade-panel {
        width: 100%;
        max-height: 92vh;
        padding: 12px;
    }

    .np-time-line {
        white-space: normal;
    }
}

@media (max-width: 1199px) {
    .np-table-columns {
        grid-template-columns: 1fr;
    }
}
