* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

/* =========================
   Login
========================= */

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    width: 360px;
    max-width: calc(100vw - 32px);
    background: white;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.login-box h1 {
    margin-top: 0;
}

.login-box button {
    width: 100%;
    margin-top: 16px;
}

/* =========================
   Base elements
========================= */

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
}

input,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccd3dc;
    border-radius: 8px;
    font-size: 15px;
}

button,
.logout-btn {
    display: inline-block;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.logout-btn:hover {
    background: #374151;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.muted {
    color: #777;
}

.error,
.error-box {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
}

.error {
    margin-bottom: 12px;
}

.error-box {
    margin-top: 16px;
}

.hidden {
    display: none !important;
}

/* =========================
   Layout
========================= */

.topbar {
    background: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.topbar h1 {
    margin: 0;
}

.topbar p {
    margin: 4px 0 0;
}

.container {
    max-width: 1300px;
    margin: 24px auto;
    padding: 0 16px;
}

.card,
.setup-card,
.fixture-card,
.table-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.card h2 {
    margin-top: 0;
}

.page-subtitle {
    color: #64748b;
    margin-bottom: 24px;
}

/* =========================
   Buttons
========================= */

.button-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.danger-btn {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 700;
}

.danger-btn:hover {
    background: #b91c1c;
}

/* =========================
   Overview cards
========================= */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.summary-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.summary-card span {
    display: block;
    color: #666;
    margin-bottom: 8px;
}

.summary-card strong {
    font-size: 24px;
}

.simple-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* =========================
   Simple dashboard controls
========================= */

.compact-control-card {
    padding: 14px 18px;
}

.compact-control-card h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.compact-controls {
    display: grid;
    grid-template-columns: 1.15fr 0.75fr 1.45fr;
    gap: 28px;
    align-items: start;
}

.compact-box {
    padding: 0;
    border: none;
    background: transparent;
}

.compact-box h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
}

.compact-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compact-field label {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 2px;
}

.compact-field input {
    width: 100%;
    height: 38px;
    padding: 7px 10px;
    font-size: 14px;
}

.compact-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.compact-add-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.7fr 0.7fr;
    gap: 10px;
}

.compact-button-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.compact-button-row button,
.compact-button-row .logout-btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
}

.compact-control-card input,
.compact-control-card button,
.compact-control-card .logout-btn {
    max-width: 100%;
}

/* =========================
   Forms / setup
========================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr;
    gap: 16px;
    align-items: stretch;
}

.setup-inline-card {
    padding: 18px;
}

.setup-inline {
    display: grid;
    grid-template-columns: 1fr 1fr 0.9fr 0.7fr 0.8fr 1fr 1fr 1.4fr;
    gap: 12px;
    align-items: end;
}

.setup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setup-field label {
    font-weight: 700;
    font-size: 14px;
}

.setup-field input,
.setup-field select {
    height: 40px;
    width: 100%;
}

.setup-action-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.setup-action-card button,
.setup-button-field button {
    width: 100%;
    height: 42px;
    white-space: nowrap;
}

.readonly-box {
    margin-top: 6px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.setup-total-field .readonly-box {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   Fixture sections
========================= */

.fixture-box {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 14px;
    align-items: end;
}

.fixture-result {
    margin-top: 16px;
    background: #f9fafb;
    border: 1px dashed #ccd3dc;
    border-radius: 10px;
    padding: 14px;
}

.fixture-card {
    margin-bottom: 24px;
}

.fixture-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.fixture-header h2 {
    margin: 0;
}

.series-badge {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 9px 12px;
    font-weight: bold;
}

.fixture-search-grid {
    display: grid;
    grid-template-columns: 1fr auto 160px auto;
    gap: 12px;
}

.fixture-details,
.stats-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-box,
.status-box {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 12px;
}

.stat-box p,
.status-box p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.stat-box strong,
.status-box strong {
    display: block;
    margin-top: 5px;
}

.status-box {
    padding: 12px 16px;
}

.suggested-box {
    margin-top: 16px;
    background: #fffbeb;
    color: #92400e;
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
}

.suggested-box button {
    margin-left: 10px;
    background: #b45309;
}

/* =========================
   Series cards / details
========================= */

.series-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.series-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #f9fafb;
}

.series-card h3 {
    margin-top: 0;
}

.series-card p {
    margin: 6px 0;
}

.series-info-grid,
.series-details-grid {
    display: grid;
    gap: 12px;
}

.series-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 12px 0;
}

.series-info-grid p {
    margin: 0;
}

.series-details-grid {
    grid-template-columns: repeat(3, 1fr);
}

.series-controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

/* =========================
   Tables
========================= */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f9fafb;
}

.table-title {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 0;
    font-weight: bold;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.summary-box {
    margin-top: 24px;
}

/* =========================
   Status / row colors
========================= */

.status-pending {
    color: #b45309;
    font-weight: bold;
}

.status-ready,
.status-open,
.profit-positive {
    color: #22c55e;
    font-weight: 700;
}

.status-open,
.status-busy {
    font-weight: 800;
    text-transform: uppercase;
}

.status-busy,
.profit-negative {
    color: #ef4444;
    font-weight: 700;
}

.status-ready {
    color: #047857;
}

.progress-inline {
    color: #60a5fa;
    font-weight: 700;
}

tr.current-try,
.selected-current {
    background: #eef6ff;
    font-weight: bold;
}

tr.max-try {
    background: #fff7e6;
}

.selected-max {
    background: #ecfccb;
    font-weight: bold;
}

.selected-target {
    background: #ffedd5;
    font-weight: bold;
}

.row-won {
    background: #dcfce7;
}

.row-lost {
    background: #fee2e2;
}

/* =========================
   Simple rows / older helpers
========================= */

.filter-row,
.settings-row,
.section-header-row {
    display: flex;
    gap: 14px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-row > div,
.settings-row > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* =========================
   Responsive
========================= */

@media (max-width: 1100px) {
    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .setup-inline {
        grid-template-columns: repeat(4, 1fr);
    }

    .compact-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .compact-box {
        padding: 12px;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background: #f9fafb;
    }
}

@media (max-width: 1000px) {
    .setup-grid,
    .tables-grid,
    .fixture-details,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .fixture-search-grid,
    .fixture-box {
        grid-template-columns: 1fr;
    }

    .series-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .button-row,
    .two-col,
    .three-col {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .form-grid,
    .series-grid,
    .summary-grid,
    .series-details-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 700px) {
    .container {
        margin: 12px auto;
        padding: 0 8px;
    }

    .card {
        padding: 12px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .summary-grid,
    .setup-inline {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 14px;
    }

    .summary-card strong {
        font-size: 21px;
    }

    .compact-control-card {
        padding: 12px;
    }

    .compact-control-card h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .compact-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .compact-box {
        padding: 12px;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background: #f9fafb;
    }

    .compact-box h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .compact-two-cols,
    .compact-add-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .compact-field label {
        font-size: 14px;
    }

    .compact-field input {
        width: 100%;
        height: 44px;
        font-size: 16px;
        padding: 10px 12px;
    }

    .compact-button-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 12px;
    }

    .compact-button-row button,
    .compact-button-row .logout-btn {
        width: 100%;
        min-height: 44px;
        font-size: 15px;
        padding: 10px 12px;
        text-align: center;
    }

    .fixture-details {
        grid-template-columns: 1fr;
    }

    th,
    td {
        padding: 8px;
        font-size: 13px;
    }
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-header-row h2 {
    margin: 0;
    line-height: 1;
}

.section-header-row button {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .section-header-row {
        align-items: stretch;
    }

    .section-header-row button {
        width: auto;
        height: 40px;
    }
}

/* Controls: compact card layout on mobile/tablet */
@media (max-width: 700px) {
    .compact-controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .compact-box {
        padding: 10px;
        border-radius: 12px;
        background: #f9fafb;
        border: 1px solid #e5e7eb;
    }

    .compact-box h3 {
        font-size: 13px;
        margin: 0 0 8px;
        line-height: 1.2;
    }

    .compact-two-cols,
    .compact-add-grid {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .compact-field label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .compact-field input {
        height: 34px;
        font-size: 13px;
        padding: 6px 8px;
    }

    .compact-button-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        margin-top: 8px;
    }

    .compact-button-row button,
    .compact-button-row .logout-btn {
        width: 100%;
        min-height: 34px;
        font-size: 12px;
        padding: 7px 8px;
        text-align: center;
    }
}

/* Mobile: controls one under another for better visibility */
@media (max-width: 700px) {
    .compact-controls {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .compact-box {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .compact-box h3 {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }

    .compact-two-cols,
    .compact-add-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .compact-field label {
        font-size: 14px !important;
    }

    .compact-field input {
        height: 44px !important;
        font-size: 16px !important;
        padding: 10px 12px !important;
    }

    .compact-button-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin-top: 12px !important;
    }

    .compact-button-row button,
    .compact-button-row .logout-btn {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 15px !important;
        padding: 10px 12px !important;
    }
}

/* Mobile: controls stacked, but dates side by side */
@media (max-width: 700px) {
    .compact-controls {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .compact-two-cols {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .compact-add-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .compact-field input {
        height: 44px !important;
        font-size: 16px !important;
    }
}

/* Mobile: overview cards in 2 columns */
@media (max-width: 700px) {
    .summary-grid,
    .simple-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .summary-card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .summary-card span {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }

    .summary-card strong {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }
}

/* Better readability for In-play and Finished game tables */
.games-table {
    table-layout: auto;
}

.games-table th,
.games-table td {
    vertical-align: middle;
}

/* Keep money columns on one line: Odds, Stake, Return, Profit */
.games-table th:nth-child(5),
.games-table th:nth-child(6),
.games-table th:nth-child(7),
.games-table th:nth-child(8),
.games-table td:nth-child(5),
.games-table td:nth-child(6),
.games-table td:nth-child(7),
.games-table td:nth-child(8) {
    white-space: nowrap;
    text-align: right;
}

/* Specific widths */
.games-table th:nth-child(5),
.games-table td:nth-child(5) {
    min-width: 65px;
}

.games-table th:nth-child(6),
.games-table td:nth-child(6),
.games-table th:nth-child(7),
.games-table td:nth-child(7),
.games-table th:nth-child(8),
.games-table td:nth-child(8) {
    min-width: 90px;
}

/* Date, Time, Fixture ID */
.games-table th:nth-child(1),
.games-table td:nth-child(1) {
    white-space: nowrap;
    min-width: 95px;
}

.games-table th:nth-child(2),
.games-table td:nth-child(2) {
    white-space: nowrap;
    min-width: 65px;
}

.games-table th:nth-child(3),
.games-table td:nth-child(3) {
    white-space: nowrap;
    min-width: 90px;
}

/* Match column gets more room */
.games-table th:nth-child(4),
.games-table td:nth-child(4) {
    min-width: 190px;
}

/* Finished table FTG column */
.finished-games-table th:nth-child(9),
.finished-games-table td:nth-child(9) {
    white-space: nowrap;
    text-align: center;
    min-width: 55px;
}

/* Mobile: Add Fixture ID, Odds, Stake next to each other */
@media (max-width: 700px) {
    .compact-add-grid {
        display: grid !important;
        grid-template-columns: 1.4fr 0.8fr 0.8fr !important;
        gap: 8px !important;
    }

    .compact-add-grid .compact-field {
        width: 100% !important;
        min-width: 0 !important;
    }

    .compact-add-grid input {
        width: 100% !important;
        min-width: 0 !important;
        height: 40px !important;
        font-size: 14px !important;
        padding: 8px 8px !important;
    }

    .compact-add-grid label {
        font-size: 12px !important;
        white-space: nowrap !important;
    }
}

.settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    z-index: 9999;
}

.settings-modal-card {
    width: 100%;
    max-width: 360px;
    background: white;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.settings-modal-header h2 {
    margin: 0;
}

.settings-modal-header button {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
}

/* PC: controls with Add Fixture first and Date Filter second */
@media (min-width: 701px) {
    .compact-controls {
        grid-template-columns: 1.6fr 1fr !important;
        gap: 18px !important;
        align-items: start !important;
    }

    .compact-control-card {
        padding: 16px 18px !important;
    }

    .compact-control-card h2 {
        margin-bottom: 12px !important;
    }

    .compact-box {
        padding: 12px !important;
        border-radius: 12px !important;
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
    }

    .compact-add-grid {
        grid-template-columns: 1.5fr 0.7fr 0.7fr !important;
        gap: 10px !important;
    }

    .compact-two-cols {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .compact-button-row {
        margin-top: 10px !important;
    }
}

/* Mobile: Settings and Logout same size, next to each other */
@media (max-width: 700px) {
    .topbar .button-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .topbar .button-row button,
    .topbar .button-row .logout-btn {
        width: 100% !important;
        height: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 12px !important;
        font-size: 14px !important;
        text-align: center !important;
    }
}

/* Settings and Logout same size on all screen sizes */
.topbar .button-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    align-items: center !important;
}

.topbar .button-row button,
.topbar .button-row .logout-btn {
    width: 120px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* On mobile, let them use the full available width */
@media (max-width: 700px) {
    .topbar .button-row {
        width: 100% !important;
    }

    .topbar .button-row button,
    .topbar .button-row .logout-btn {
        width: 100% !important;
    }
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-weight: 600;
    cursor: pointer;
}

.remember-row input {
    width: auto;
    margin: 0;
}

.remember-row span {
    font-size: 14px;
}

/* Fixture lookup result inside Add Fixture box */
.compact-box .fixture-details {
    margin-top: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-box .error-box {
    margin-top: 12px;
}

@media (max-width: 700px) {
    .compact-box .fixture-details {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .compact-box .fixture-details .stat-box {
        padding: 8px !important;
    }

    .compact-box .fixture-details .stat-box p {
        font-size: 11px !important;
    }

    .compact-box .fixture-details .stat-box strong {
        font-size: 13px !important;
    }
}

/* Fix vertical alignment for Current Month button */
.compact-button-row button,
.compact-button-row .logout-btn {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Date filter buttons: make links identical to Apply Filter */
.date-filter-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}

.date-filter-buttons button,
.date-filter-buttons .filter-action-btn {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #111827 !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 14px !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.date-filter-buttons button:hover,
.date-filter-buttons .filter-action-btn:hover {
    background: #374151 !important;
}

@media (max-width: 700px) {
    .date-filter-buttons {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile date filter buttons layout */
@media (max-width: 700px) {
    .date-filter-buttons {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .date-filter-buttons button[type="submit"] {
        grid-column: 1 / -1 !important;
    }

    .date-filter-buttons .filter-action-btn {
        width: 100% !important;
    }
}

/* Overview: 4 cards on PC, 2 cards on mobile */
.simple-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 700px) {
    .simple-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .summary-card {
        padding: 12px !important;
    }

    .summary-card span {
        font-size: 12px !important;
    }

    .summary-card strong {
        font-size: 17px !important;
        line-height: 1.2 !important;
    }
}

.export-xlsx-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    background: #111827;
    color: white;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.export-xlsx-btn:hover {
    background: #374151;
}

@media (max-width: 700px) {
    .desktop-only {
        display: none !important;
    }
}

.finished-header-row {
    align-items: center;
}

.finished-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.finished-limit-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.finished-limit-form label {
    margin: 0;
    font-size: 14px;
}

.finished-limit-form select {
    width: auto;
    min-width: 80px;
    height: 38px;
    padding: 0 10px;
}

@media (max-width: 700px) {
    .finished-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .finished-actions {
        margin-left: auto;
    }

    .finished-limit-form label {
        display: none;
    }

    .finished-limit-form select {
        height: 36px;
        min-width: 70px;
        font-size: 13px;
    }
}