/* Shared responsive polish and the Persian date picker. */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

.app-navbar .container {
    min-width: 0;
}

.navbar-brand {
    min-width: 0;
    white-space: nowrap;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: .75rem;
    flex: 0 0 auto;
}

.brand-copy {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-copy small {
    color: rgba(255, 255, 255, .65);
    font-size: .62rem;
    font-weight: 500;
}

.jalali-picker-wrap {
    position: relative;
    width: 100%;
}

.jalali-picker-wrap > input {
    padding-inline-end: 2.75rem !important;
    cursor: pointer;
    background-color: #fff !important;
}

.jalali-picker-trigger {
    position: absolute;
    inset-inline-end: .45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: .5rem;
    background: #eff6ff;
    color: #1d4ed8;
    z-index: 2;
}

.jalali-picker-trigger:hover,
.jalali-picker-trigger:focus-visible {
    background: #dbeafe;
}

.jalali-picker-popover {
    position: absolute;
    inset-inline-start: 0;
    top: calc(100% + .45rem);
    z-index: 1100;
    width: min(310px, calc(100vw - 2rem));
    padding: .85rem;
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}

.jalali-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

.jalali-picker-title {
    color: #0f172a;
    font-size: .9rem;
}

.jalali-nav,
.jalali-today {
    border: 1px solid #dbe3ef;
    border-radius: .55rem;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

.jalali-nav {
    width: 2rem;
    height: 2rem;
}

.jalali-today {
    display: block;
    width: 100%;
    margin-top: .75rem;
    padding: .4rem;
    color: #1d4ed8;
    background: #eff6ff;
    font-family: inherit;
    font-size: .8rem;
}

.jalali-weekdays,
.jalali-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .25rem;
    text-align: center;
}

.jalali-weekdays {
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    margin-bottom: .3rem;
}

.jalali-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: .55rem;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: .78rem;
    cursor: pointer;
}

button.jalali-day:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

button.jalali-day.selected {
    background: #1d4ed8;
    color: #fff;
}

button.jalali-day.today:not(.selected) {
    border-color: #f59e0b;
    color: #b45309;
    font-weight: 800;
}

.jalali-day.blank {
    cursor: default;
}

@media (max-width: 991.98px) {
    .app-navbar .navbar-collapse {
        padding-top: .75rem;
    }

    .app-navbar .navbar-nav {
        gap: .25rem !important;
    }

    .app-navbar .d-flex.align-items-center.gap-3 {
        align-items: stretch !important;
        flex-direction: column;
        gap: .6rem !important;
        padding: .75rem 0 .25rem;
    }

    .user-chip {
        display: block;
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: .9rem;
    }

    .main-shell {
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }

    .main-shell > .container {
        padding-inline: .75rem;
    }

    .card,
    .page-card,
    .info-card {
        border-radius: .9rem !important;
    }

    .card-body,
    .page-card,
    .info-card {
        padding: 1rem !important;
    }

    h1.h3 {
        font-size: 1.25rem;
    }

    .btn {
        min-height: 42px;
        padding-inline: .8rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive > .table {
        min-width: 650px;
    }

    .report-toolbar .card-body,
    .report-container {
        padding: 1rem !important;
    }

    .report-header {
        align-items: flex-start !important;
    }

    .report-actions {
        width: 100%;
    }

    .report-actions .btn,
    .report-actions .badge {
        flex: 1 1 auto;
        text-align: center;
    }

    .modal-dialog {
        margin: .6rem;
    }

    .modal-content {
        border-radius: 1rem;
    }

    .dashboard-stat-card .card-body {
        padding: .65rem .5rem !important;
    }

    .dashboard-stat-card .card-title {
        font-size: .68rem;
        margin-bottom: .15rem !important;
    }

    .dashboard-stat-card .display-6 {
        font-size: 1.15rem !important;
    }

    .dashboard-stat-card small {
        font-size: .65rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: .95rem;
    }

    .brand-logo {
        width: 32px;
        height: 32px;
    }

    .brand-copy small {
        display: none;
    }

    .section-head h2,
    .section-head h1 {
        padding-inline-start: .65rem;
    }

    .d-flex.flex-wrap.justify-content-between {
        align-items: stretch !important;
    }

    .d-flex.flex-wrap.justify-content-between > .btn,
    .d-flex.flex-wrap.justify-content-between > div > .btn {
        width: 100%;
    }

    .summary-row {
        flex-direction: column;
        gap: .2rem;
    }
}
