/* ==========================================================================
   My leave: layout only. Tab group, tiles, chips, buttons, fields, callouts and the dialogs come from components/ui.css and Web Awesome.
   The sick-report row above the list is styled in sick-reports.css.
   ========================================================================== */
@layer app-pages {

    /* An element that carries the hidden attribute must stay hidden even though a chip sets its own display */
    #viewMyLeave .ui-chip[hidden] { display: none; }
    #ml2Error:not([hidden]), #ml2FormError:not([hidden]), #ml2RejectError:not([hidden]), #ml2CancelError:not([hidden]) { margin: 0 0 1rem; }
    #ml2MineLoading:not([hidden]), #ml2DecideLoading:not([hidden]), #ml2AllLoading:not([hidden]) { margin: 0 0 1rem; }
    .my-leave-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
    .my-leave-section { margin: 1.5rem 0 0.5rem; }
    #ml2PanelMine .ui-filter-bar,
    #ml2PanelDecide .ui-filter-bar { grid-template-columns: minmax(11rem, 18rem); }

    /* Balance tiles: one per leave type that has a yearly balance */
    .my-leave-tiles:empty { display: none; }
    .my-leave-allkinds { margin: 0 0 1rem; }
    .my-leave-comment { overflow-wrap: anywhere; }
    /* The review of a waiting request: the person, then facts with an icon each, the reason, and the comments */
    .my-leave-review-head { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; }
    .my-leave-review-who { display: flex; flex-direction: column; min-width: 0; }
    .my-leave-review-who b { font-size: 1.125rem; }
    .my-leave-avatar {
        flex: none;
        display: inline-grid;
        place-items: center;
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        background: var(--d26-accent-soft);
        color: var(--d26-accent);
        font-size: 0.75rem;
        font-weight: 700;
    }
    .my-leave-avatar--big { width: 3rem; height: 3rem; font-size: 1rem; }
    .my-leave-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.625rem; margin: 0 0 1rem; }
    .my-leave-fact {
        display: flex;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 0.75rem;
        border: 1px solid var(--d26-line);
        border-radius: var(--d26-radius-card);
        background: var(--d26-card);
        min-width: 0;
    }
    .my-leave-fact-icon {
        flex: none;
        display: inline-grid;
        place-items: center;
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 50%;
        background: var(--d26-accent-soft);
        color: var(--d26-accent);
    }
    .my-leave-fact-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; overflow-wrap: anywhere; }
    .my-leave-fact-label { color: var(--d26-ink-2); font-size: 0.8125rem; }
    .my-leave-fact-main { font-weight: 600; }
    .my-leave-fact--wait { background: var(--d26-wait-bg); border-color: transparent; }
    .my-leave-fact--wait .my-leave-fact-icon { background: var(--d26-card); color: var(--d26-wait-fg); }
    .my-leave-fact--bad { background: var(--d26-bad-bg); border-color: transparent; }
    .my-leave-fact--bad .my-leave-fact-icon { background: var(--d26-card); color: var(--d26-bad-fg); }
    .my-leave-reason { margin: 0 0 1rem; padding: 0.75rem 1rem; border-left: 0; border: 1px solid var(--d26-line); border-radius: var(--d26-radius-card); background: var(--d26-surface); }
    .my-leave-reason p { margin: 0.25rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
    .my-leave-preview-warn { display: block; margin-top: 0.375rem; color: var(--d26-wait-fg); font-weight: 600; }
    /* The state of a request at the top of its preview, and the three steps of the form */
    .my-leave-status { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: var(--d26-radius-card); }
    .my-leave-status > div { display: flex; flex-direction: column; min-width: 0; }
    .my-leave-status-icon { flex: none; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--d26-card); font-size: 1.125rem; }
    .my-leave-status--ok { background: var(--d26-ok-bg); color: var(--d26-ok-fg); }
    .my-leave-status--wait { background: var(--d26-wait-bg); color: var(--d26-wait-fg); }
    .my-leave-status--bad { background: var(--d26-bad-bg); color: var(--d26-bad-fg); }
    .my-leave-status--draft { background: var(--d26-draft-bg); color: var(--d26-draft-fg); }
    .my-leave-status .ui-sub { color: inherit; }
    .my-leave-step { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0; font-size: 1rem; }
    .my-leave-step:first-child { margin-top: 0; }
    .my-leave-step-num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--d26-accent); color: var(--d26-card); font-size: 0.8125rem; font-weight: 700; }
    /* The attachment: the file button of the medical claim, with the file of the request listed under it */
    .my-leave-files { align-items: flex-start; }
    .my-leave-file-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
    .my-leave-file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.875rem; overflow-wrap: anywhere; }
    .my-leave-file-list i { color: var(--d26-accent); }
    .my-leave-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
    .my-leave-conditions { margin: 0 0 1rem; }
    .my-leave-review-title { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; font-size: 1rem; }
    .my-leave-review-title > i { color: var(--d26-accent); }
    .my-leave-review-comments { margin: 0 0 1rem; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
    .my-leave-comment-row { display: flex; gap: 0.625rem; align-items: flex-start; padding: 0.625rem 0.75rem; border: 1px solid var(--d26-line); border-radius: var(--d26-radius-card); background: var(--d26-card); }
    .my-leave-comment-body { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
    .my-leave-comment-none { display: flex; gap: 0.5rem; align-items: center; color: var(--d26-ink-2); }
    .my-leave-allkinds[hidden] { display: none; }
    .my-leave-tile { flex: 1 1 14rem; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding: 0.875rem 1rem; }
    /* A balance that is used up or not set up: a tinted tile with a word and an icon inside it (never a coloured edge) */
    .my-leave-tile--warn { background: var(--d26-wait-bg); border-color: color-mix(in srgb, var(--d26-wait-fg) 45%, transparent); }
    .my-leave-tile .ui-tile-count { font-size: 1.5rem; }
    .my-leave-tile .ui-sub { margin: 0; }

    /* The request rows */
    .my-leave-list { padding-top: 0.25rem; padding-bottom: 0.25rem; }
    .my-leave-row { padding: 0.75rem 0; gap: 0.5rem 0.875rem; }
    .my-leave-row:last-child { border-bottom: 0; }
    .my-leave-row > .ui-chip { flex: 0 0 auto; }
    .my-leave-row .ui-sub { overflow-wrap: anywhere; }
    .my-leave-reason { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }    /* two lines; the whole reason is the tooltip */
    [aria-busy="true"] { opacity: 0.55; transition: opacity 0.15s ease; }
    .my-leave-decided { margin-top: 1rem; }
    #ml2AllCount { margin: 0 0 0.75rem; }
    .my-leave-datebox {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 3rem;
        padding: 0.25rem 0.5rem;
        background: var(--d26-surface);
        border: 1px solid var(--d26-line);
        border-radius: var(--d26-radius-control);
        line-height: 1.2;
    }
    .my-leave-datebox b { font-size: 1.125rem; }
    .my-leave-datebox span { font-size: 0.75rem; color: var(--d26-ink-2); }
    .my-leave-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
    @media (max-width: 640px) {
        .my-leave-actions { width: 100%; margin-left: 0; }
    }

    /* The live day count in the form */
    .my-leave-preview { margin: 0; padding: 0.5rem 0.75rem; background: var(--d26-accent-soft); border: 1px solid var(--d26-accent); border-radius: var(--d26-radius-control); color: var(--d26-accent-hover); font-size: 0.875rem; }
    .my-leave-preview:empty { display: none; }
    .my-leave-preview--bad { background: var(--d26-wait-bg); border-color: var(--d26-wait-fg); color: var(--d26-wait-fg); }

    /* The native file picker, laid out like the other fields */
}
