@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope/static/Manrope-ExtraLight.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope/static/Manrope-Light.ttf') format('truetype');
    font-weight: 350;
    font-style: normal;
    font-display: swap
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope/static/Manrope-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope/static/Manrope-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope/static/Manrope-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope/static/Manrope-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope/static/Manrope-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap
}

:root {
    font-family: 'Manrope', Inter, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #0f172a;
    --primary: #06b6ac;
    --primary-600: #0ea5a4;
    --accent: #0369a1;
    --muted: #475569;
    --bg: #f8fafc
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    padding: 24px;
    background: #f8fafc
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 8px 6px
}

h1 {
    font-size: 20px;
    margin: 0
}

/* Header refinements */
.header-meta {
    color: var(--muted);
    font-size: 13px
}

/* Login card and form styles */
.login-wrap {
    max-width: 480px;
    margin: 6rem auto;
    padding: 28px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #fbfeff);
    box-shadow: 0 10px 36px rgba(2, 6, 23, 0.08)
}

.login-wrap h1 {
    font-size: 22px;
    margin: 0 0 12px
}

.login-row {
    margin-bottom: 12px
}

.login-row label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted)
}

.login-row input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #e6eef3;
    background: #fff;
    font-size: 15px
}

.login-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px
}

.login-actions .iconBtn {
    width: auto;
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--primary-600);
    font-weight: 700;
    color: #fff
}

.login-actions .iconBtn svg {
    display: none
}

.login-actions .iconBtn.secondary {
    background: #475569
}

/* focus states for keyboard users */
button:focus-visible,
.iconBtn:focus-visible {
    outline: 3px solid rgba(6, 182, 172, 0.12);
    outline-offset: 2px
}

/* Compact icon buttons used across the app */
.iconBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 8px;
    background: var(--primary-600);
    color: #fff;
    border: none;
    line-height: 0
}

.iconBtn svg {
    width: 18px;
    height: 18px
}

/* Single-column layout: main only */
.layout {
    display: block;
    width: 100%;
}

.panel {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06)
}

/* Form rows */
form .row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-end
}

label {
    display: block;
    font-size: 13px;
    color: #334155;
    margin-bottom: 6px
}

/* Inputs */
input[type="text"],
input[type="url"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e6eef3;
    border-radius: 10px;
    background: #fbfdff;
    box-sizing: border-box;
    font-size: 14px;
    color: #0f172a
}

/* Remove arrows/spinners from number inputs across browsers for a cleaner look */
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;
}

/* Style buttons */
button {
    background: #0ea5a4;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

button.secondary {
    background: #64748b;
}

button.primary {
    background: #0ea5a4;
}

/* Button base styles for consistent sizing */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn.primary {
    background: #0ea5a4;
    color: white;
}

.btn.secondary {
    background: #64748b;
    color: white;
}

/* make the sidebar Add row button larger and more prominent */
#addEntryRow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
    padding: 0;
    background: #475569;
    color: #fff;
    border: none
}

/* Icon-only download button */
.iconBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 10px;
    background: #0ea5a4;
    color: #fff;
    border: none;
    line-height: 0
}

.iconBtn svg {
    width: 18px;
    height: 18px;
    display: block;
    margin: auto;
    transform: translateY(1px)
}

/* Month-level download button inside month card */
.downloadMonthBtn {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: #0369a1;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    display: inline-block
}

.downloadMonthBtn:hover {
    background: #075985
}

/* Years container */
#yearsContainer {
    display: flex;
    flex-direction: column;
    gap: 18px
}

.yearBlock h2 {
    margin: 0 0 12px 0;
    font-size: 18px
}

/* Details/summary for year collapsible blocks */
.yearDetails {
    padding: 0;
    border-radius: 12px;
    overflow: hidden
}

.yearDetails>summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(90deg, #a6cef5 0%, #e0f2fe 100%);
    border-radius: 12px
}

.yearSummaryLeft {
    display: flex;
    align-items: center;
    gap: 18px
}

.yearLabel {
    font-size: 26px;
    font-weight: 800;
    line-height: 1
}

.yearSummaryRight {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center
}

.yearDetails[open]>summary {
    border-bottom: none;
    border-radius: 12px 12px 0 0
}

.yearDetails .monthsGrid {
    padding: 12px;
    border-top: 1px solid transparent;
    background: linear-gradient(90deg, #a6cef5 0%, #e0f2fe 100%);
    border-radius: 0 0 12px 12px
}

/* enlarge badge inside the summary for better balance */
.yearSummaryLeft .countBadge {
    padding: 6px 12px;
    font-size: 15px;
    margin-left: 14px
}

/* simple arrow indicator using pseudo-element on summary */
.yearDetails>summary::marker {
    display: none
}

/* SVG chevron rotate instead of pseudo-element */
.yearSummaryRight svg {
    transition: transform .12s ease;
    color: var(--muted)
}

.yearDetails[open] .yearSummaryRight svg {
    transform: rotate(90deg)
}

.yearSummaryRight {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 8px
}

/* small numeric badge used for counts */
.countBadge {
    display: inline-block;
    background: #eef6f6;
    color: #0b6b68;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    margin-left: 10px;
    font-size: 13px
}

/* months layout */
:root {
    --col-gap: 20px
}

.monthsGrid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    width: 100%;
    align-items: start;
}

.monthCard{
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(2, 6, 23, 0.04);
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Remove hover effects for month cards */
.monthCard {
    outline: 1px solid transparent;
}

.monthCard:focus-within {
    outline-color: rgba(6, 182, 172, 0.18);
}

/* Progressive breakpoints: 6,5,4,3,2,1 columns */
@media (max-width: 1600px) {
    .monthsGrid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1360px) {
    .monthsGrid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .monthsGrid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .monthsGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .monthsGrid {
        grid-template-columns: 1fr;
    }
}

/* Progressive responsive styles for mobile */
@media (max-width: 768px) {
    .monthCard {
        padding: 10px;
    }
    
    body {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .linkItem {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    body {
        padding: 8px;
    }
    
    .banner-date-badge {
        font-size: 10px;
        padding: 1px 4px;
        height: 14px;
    }
}

/* Responsive button layout for header controls */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet layout: Keep flexbox but wrap items */
    main > div:first-child {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }
    
    /* Filter takes full width on first row */
    label[for="operatorFilter"] {
        flex-basis: 100% !important;
        width: 100%;
        margin-bottom: 4px;
        order: 1;
    }
    
    select#operatorFilter {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: none !important;
        margin-bottom: 8px;
        margin-left: 0 !important;
        order: 2;
    }
    
    /* Buttons share the next row equally */
    #openUploadModalBtn {
        flex: 1 !important;
        margin-left: 0 !important;
        margin-right: 4px !important;
        order: 3;
    }
    
    #syncBannersBtn {
        flex: 1 !important;
        margin-left: 0 !important;
        margin-right: 4px !important;
        order: 4;
    }
    
    #organizeBannersBtn {
        flex: 1 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        order: 5;
    }
}

@media (max-width: 768px) {
    /* Mobile layout: stack everything vertically */
    main > div:first-child {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    
    /* Filter section */
    label[for="operatorFilter"] {
        margin-bottom: 4px;
    }
    
    select#operatorFilter {
        width: 100% !important;
        max-width: none !important;
        margin-bottom: 8px;
    }
    
    /* Stack buttons vertically on mobile */
    #openUploadModalBtn,
    #syncBannersBtn,
    #organizeBannersBtn {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 4px;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    #organizeBannersBtn {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    /* Even smaller buttons on very small screens */
    button.btn,
    button.primary, 
    button.secondary {
        font-size: 13px;
        padding: 8px 12px;
    }
}

.monthCard h3{
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

/* Month header separator: keep header visually distinct from content */
.month-card-header{
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(14, 42, 66, 0.04);
}
.month-card-header h3{margin:0}

/* Month header styles - no longer collapsible */
.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin: 0 0 8px 0;
    border-bottom: 1px solid rgba(14, 42, 66, 0.04);
    padding-bottom: 8px;
}

.month-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.monthCard .linksList{padding-top:4px}

.linksList {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
}

/* layout each link row as two columns: title (flexible) + actions (auto) */
.linkRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}

.linkMeta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.4;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #e2e8f0;
}

.banner-title-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.banner-operator {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    opacity: 0.8;
}

.banner-date-range {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    margin-top: 1px;
}

.banner-buttons {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}

.banner-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(6, 182, 172, 0.3);
}

.meta-separator {
    display: block;
    text-align: center;
    color: #d1d5db;
    font-size: 10px;
    margin: 2px 0;
    opacity: 0.7;
}

/* Edit Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body .form-field {
    margin-bottom: 16px;
}

.modal-body .form-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.modal-body .form-field input,
.modal-body .form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body .form-field input:focus,
.modal-body .form-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 172, 0.1);
}

.modal-body .form-field select[multiple] {
    min-height: 100px;
}

/* Checkbox styling */
.modal-body .checkbox-field input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.2);
}

.modal-body .checkbox-field label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    margin-bottom: 0;
}

/* Upload method tabs */
.upload-method-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.tab-btn.active {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

.upload-section.hidden {
    display: none;
}

.modal-body textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 172, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px 24px 24px;
    border-top: 1px solid #f1f5f9;
    background: white;
}

.modal-footer .btn {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 80px;
}

.modal-footer .btn.primary {
    background: #0ea5e9;
    color: white;
}

.modal-footer .btn.primary:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.modal-footer .btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

.modal-footer .btn.secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.modal-footer .btn.delete {
    background: #ef4444;
    color: white;
}

.modal-footer .btn.delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.modal-footer .btn.edit {
    background: #06b6d4;
    color: white;
}

.modal-footer .btn.edit:hover {
    background: #0891b2;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
    }
}

.linkRow a {
    color: #0369a1;
    text-decoration: none;
    font-size: 14px;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    max-width: none
}

.linkRow a.wrap {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal
}

.linkActions {
    margin-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto
}

/* icon buttons: make equal square, center icon, and provide comfortable hit area */
.iconBtn,
.deleteBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    background: #0ea5a4;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: none;
    font-size: 16px;
    line-height: 1
}

.iconBtn.secondary {
    background: #475569
}

.deleteBtn {
    background: #ef4444
}

.iconBtn svg {
    width: 18px;
    height: 18px;
    display: block
}

.meta {
    font-size: 12px;
    color: #475569
}

.empty {
    color: #94a3b8;
    font-size: 13px
}

footer {
    margin-top: 18px;
    font-size: 12px;
    color: #64748b
}

.row>div {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 0;
    justify-content: flex-start;
    align-items: flex-start;
}

/* New helper classes for moved inline styles */
.smallHeading {
    font-size: 14px;
    margin: 0 0 8px 0
}

.formCol {
    flex: 1
}

.mb8 {
    margin-bottom: 8px
}

.formActions {
    display: flex;
    gap: 8px
}

.tip {
    margin-top: 12px;
    font-size: 13px;
    color: #475569
}

.mt8 {
    margin-top: 8px
}

.linkItem {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 1px 3px rgba(2, 6, 23, 0.03);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    min-height: 40px;
    word-break: break-word;
    transition: border-color 0.2s ease;
    position: relative;
    width: 100%;
    font-size: 13px;
}

.banner-date-badge {
    position: absolute;
    top: -6px;
    left: 4px;
    background: #0ea5e9;
    color: white;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    line-height: 1.2;
    height: 12px;
    z-index: 1;
}

.linkItem:hover {
    border-color: var(--primary);
}

/* Light green background for checked files */
.linkItem.checked {
    background: #f0fdf4;
}

.monthCountBadge {
    background: #f1f8ff;
    color: #064e75
}

/* Batch rows: simple vertical layout */
#entriesContainer .batch-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 0;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e6eef3;
    border-radius: 12px;
    background: #fbfdff;
}

.batch-row .batch-title {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6eef3;
    background: white;
    font-size: 14px;
}

.batch-row .form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.batch-row .form-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.batch-row .form-field input,
.batch-row .form-field select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e6eef3;
    background: white;
    font-size: 13px;
}

.batch-row .form-field select[multiple] {
    min-height: 80px;
}

.batch-row .dropZone {
    padding: 16px;
    border: 2px dashed #e6eef3;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
    margin-bottom: 16px;
}

.batch-row .dropZone:hover {
    border-color: var(--primary);
}

.batch-row .dropZone.dragover {
    border-color: var(--primary);
    background: rgba(6, 182, 172, 0.05);
}

.batch-row .dropZone .dropInner {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
}

.batch-row .batch-filename {
    font-size: 13px;
    color: var(--accent);
    text-align: center;
    margin-top: 4px;
}

.batch-row .remove-row {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

.batch-row .remove-row:hover {
    background: #dc2626;
}

@media (max-width:560px) {
    #entriesContainer .batch-row {
        margin-bottom: 16px;
        padding: 12px;
    }
}

/* helper classes used by JS */
.month-card-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .period-row, .fleet-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .period-label, .fleet-label {
        text-align: left;
        min-width: auto;
        margin-top: 0;
/* helper classes used by JS */
    }
.month-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.month-card-header-right {
    display: flex;
    gap: 8px;
    align-items: center
}

.hidden {
    display: none !important
}

/* filename preview visuals */
.batch-row .batch-filename {
    font-size: 13px;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

/* Dropzone / upload widget */
.dropZone {
    position: relative;
    border: 2px dashed #cfeff0;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fbffff
}

.dropZone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer
}

.dropZone .dropInner {
    color: #0b6b68;
    font-size: 14px
}

.dropZone.dragover {
    background: #ecfffe;
    border-color: #06b6ac
}

@media (max-width:1200px) {
    /* Month cards should always be full width containers */
    .monthCard {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width:720px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 0
    }

    body {
        padding: 16px
    }

    .panel {
        padding: 0px
    }

    .monthCard {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
}

/* When the sidebar is hidden (read-only / client-only mode), let main span the full width */
.layout>aside.hidden~main {
    grid-column: 1 / -1;
}

/* Smooth layout transition when sidebar toggles */
main {
    transition: all .18s ease;
}

/* debug helper styles left for manual use */
.debug-active .monthCard {
    outline: 3px dashed rgba(6, 182, 172, 0.35);
    /* teal dashed */
    box-shadow: 0 6px 24px rgba(6, 182, 172, 0.06), 0 0 0 6px rgba(6, 182, 172, 0.06);
    border-color: rgba(6, 182, 172, 0.25);
    transform: translateY(-4px);
    transition: transform .15s ease, box-shadow .15s ease, outline .15s ease;
}

/* Banner Info Modal specific styles */
.banner-info {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.info-section {
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #0ea5e9;
}

.info-section:not(:last-child) {
    margin-bottom: 20px;
}

.info-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section p {
    margin: 6px 0;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
    padding-left: 4px;
}

.info-section p:first-of-type {
    color: #0f172a;
    font-weight: 600;
}

.info-section p strong {
    display: none; /* Hide the "Date:", "Fleet:" labels since we have section headers */
}

/* Simplify the modal content spacing */
.modal-content {
    position: relative;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.modal-title-container {
    flex: 1;
}

.modal-header h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

.modal-subtitle {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin: 0;
    display: none;
}

.modal-date-range {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
    margin: 2px 0 0 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    display: none;
}

.modal-body {
    padding: 16px 24px 24px 24px;
}

/* Banner title styling */
.banner-title {
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.banner-title:hover {
    color: #1f2937;
}

/* File Preview Section Styles */
.file-preview-section {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f9fafb;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-loading p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.preview-content {
    position: relative;
    min-height: 200px;
}

.preview-type {
    width: 100%;
}

.preview-type.hidden {
    display: none;
}

/* Text Preview */
#textPreview {
    padding: 16px;
    background: #ffffff;
}

#textContent {
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
    background: none;
    border: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Image Preview */
#imagePreview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: #ffffff;
}

#imageContent {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Video Preview */
#videoPreview {
    padding: 16px;
    background: #ffffff;
    display: flex;
    justify-content: center;
}

#videoContent {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
}

/* Unsupported File Type */
#unsupportedPreview {
    padding: 40px 20px;
    text-align: center;
    background: #ffffff;
}

.unsupported-message {
    color: #6b7280;
}

.unsupported-message p {
    margin: 8px 0;
    font-size: 14px;
}

.unsupported-message p:first-child {
    font-weight: 500;
    color: #374151;
}

/* Modal Navigation Styles */
.modal-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 16px;
}

.nav-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #1f2937;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #9ca3af;
}

.file-position {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    min-width: 60px;
    text-align: center;
}