/* App-level rules only. Every screen is built from ZiePie components, which carry their own
   styles in _content/ZiePie.Blazor/css/ziepie.css (loaded first). Add a rule here only for
   page-level layout no component covers, and write it with the package's tokens
   (var(--space-4), var(--text-secondary), var(--border-subtle), ...), never raw values.
   README, "Design system". */

/* FocusOnNavigate moves focus to the page's h1 after navigation; it is not an interactive
   element, so it gets no focus ring. */
h1:focus {
    outline: none;
}

/* Support ticket messages are plain text typed by people: keep their line breaks and wrap long
   unbroken strings (pasted URLs, error ids) inside the card. */
.ticket-message-body {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* The framework's last-resort error strip (circuit failures outside any ZpErrorBoundary), in
   both layouts: MainLayout and EmptyLayout render it. Hidden until the framework shows it. */
#blazor-error-ui {
    background: var(--warning-soft);
    border-top: 1px solid var(--warning);
    bottom: 0;
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
    color: var(--warning-text);
    display: none;
    font: var(--type-body-sm);
    left: 0;
    padding: var(--space-2-5) var(--space-5);
    position: fixed;
    width: 100%;
    z-index: 1100;
}

    #blazor-error-ui .reload {
        color: var(--text-link);
        font-weight: var(--weight-medium);
        margin-left: var(--space-2);
    }

    #blazor-error-ui .dismiss {
        background: none;
        border: 0;
        color: inherit;
        cursor: pointer;
        font-size: var(--text-lg);
        position: absolute;
        right: var(--space-3);
        top: var(--space-1-5);
    }

/* Navigation rail: a thin, visible scrollbar on the dark rail (a hidden one gave no sign the
   menu scrolls, tester item 15), and a divider above the Support / footer navigation section. */
.zp-shell__navscroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.zp-shell__navfoot:not(:empty) {
    border-top: 1px solid var(--nav-border);
    padding-top: var(--space-2-5, 10px);
}

.zp-shell--light .zp-shell__navfoot:not(:empty) {
    border-top-color: var(--border-subtle);
}

/* Universal border-box sizing: ZiePie tokens/base.css provides a minimal reset that does not
   set a global border-box rule. Standardize border-box globally so that full-width controls
   and padded items (such as <a> links styled as .zp-btn, cards, and stacks) strictly fit
   within their containers without horizontal overflow. Elements requiring content-box
   (.zp-timeline__dot, .zp-hn__value) override this via component-specific class selectors. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Ensure buttons, links styled as buttons, and stack items fit within card bounds */
.zp-btn,
.zp-ibtn {
    box-sizing: border-box;
    max-width: 100%;
}

.zp-card {
    box-sizing: border-box;
}

.zp-card__body {
    box-sizing: border-box;
    min-width: 0;
}

.zp-stack {
    box-sizing: border-box;
    min-width: 0;
}

.zp-stack > * {
    max-width: 100%;
}

/* Card list rows (e.g. Expiring soon, Form submissions, Setup checklist):
   Prevent horizontal overflow when a row has a title link on the left and a
   badge, date, or status on the right. Badges and date codes must stay intact
   without shrinking or wrapping, while the link takes the available space and wraps
   or truncates gracefully within card bounds. */
.zp-card .zp-inline {
    max-width: 100%;
}

.zp-card .zp-inline > .zp-badge,
.zp-card .zp-inline > .zp-text--code,
.zp-card .zp-inline > .zp-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.zp-card .zp-inline > .zp-link {
    min-width: 0;
    flex: 1 1 auto;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Dashboard prayer times card: clean 2-column tabular alignment for Adhan and Iqamah times */
.dashboard-prayer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-width: 0;
}

.dashboard-prayer-name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-prayer-times {
    display: grid;
    grid-template-columns: 76px 64px;
    gap: var(--space-3);
    align-items: center;
    flex-shrink: 0;
}

/* A time never breaks between the clock and AM/PM: "12:04 PM" stays on one line. */
.dashboard-prayer-time {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    text-align: right;
    min-width: 0;
    white-space: nowrap;
}

/* Dashboard setup checklist: clean 2-column tabular layout (Task on left, Status/Action on right) */
.dashboard-checklist {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
}

.dashboard-checklist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 32px;
}

.dashboard-checklist-task {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    line-height: 1.35;
}

.dashboard-checklist-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    white-space: nowrap;
}

.dashboard-checklist-action .zp-link {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
}

.dashboard-checklist-action .zp-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.dashboard-checklist-action .zp-badge {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Dashboard expiring soon card: clean tabular alignment for title, date, and time */
.dashboard-expiring {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
}

.dashboard-expiring-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 32px;
}

.dashboard-expiring-title {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
}

.dashboard-expiring-title .zp-link {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.dashboard-expiring-times {
    display: grid;
    grid-template-columns: 76px 66px;
    gap: var(--space-2);
    align-items: center;
    flex-shrink: 0;
}

.dashboard-expiring-date {
    display: inline-flex;
    align-items: center;
    font: var(--type-code);
    color: var(--text-secondary);
    white-space: nowrap;
}

.dashboard-expiring-time {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    text-align: right;
    font: var(--type-code);
    color: var(--text-secondary);
    white-space: nowrap;
}

.dashboard-expiring-badge {
    flex-shrink: 0;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
}



/* DataGrid actions: ensure actions cell content remains contained and does not protrude
   past the table or card container boundary */
.zp-dg__td--actions {
    overflow: hidden;
}

.zp-dg__actions {
    max-width: 100%;
    justify-content: flex-end;
}

/* Tooltip text contrast: In the ZiePie design tokens, --bg-inverse is #0B0F1E and --text-inverse
   resolves to --ink (#0B0F1E), causing tooltips (such as disabled button reason pills) to render
   dark ink text on a dark ink background (making it appear as an empty black box).
   Setting color to white ensures the explanation text is crisp, legible, and clearly readable. */
.zp-tip {
    color: #FFFFFF;
}

/* Shell user menu: open upwards (dropup) above the sidebar footer trigger so it is not
   clipped by the bottom viewport edge on short or standard screens. */
.zp-shell__user .zp-menu__panel,
.zp-shell__user .zp-menu__panel--start,
.zp-shell__user .zp-menu__panel--end {
    top: auto;
    bottom: calc(100% + 6px);
    animation: zp-menu-dropup-in var(--duration-base, 150ms) var(--ease-out, ease-out);
}

@keyframes zp-menu-dropup-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shell user metadata (e.g. long email address): wrap onto the next line at the
   sidebar boundary instead of truncating with an ellipsis. */
.zp-shell__usermeta {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    line-height: 1.35;
}

/* Code screen (VerifyOtp): "Resend code" is greyed out while its countdown runs. Applies only
   once ziepie.js is driving the countdown (data-zp-on), so without JavaScript the button stays
   usable; the server-side cooldown is the control either way. */
.otp-resend:has(.zp-countdown[data-zp-on]:not(.zp-countdown--expired)) .zp-btn {
    opacity: 0.5;
    pointer-events: none;
}
