* {
    font-family:Quicksand;
}

/* ---------- App shell: sidebar (desktop) + top/bottom bars (mobile) ---------- */

.app-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

/* Below md there's no sidebar, just a top bar stacked above the page content
   — without this the top bar and main content sit side by side as row-flex
   siblings instead of stacking. */
@media (max-width: 767.98px) {
    .app-shell {
        flex-direction: column;
    }
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 1.25rem 1rem;
    border-right: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    gap: 1.25rem;
}

.sidebar-brand {
    font-weight: 700;
    letter-spacing: .04em;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--bs-body-color);
    margin-bottom: .25rem;
}

.sidebar-search {
    position: relative;
}

.sidebar-search .dropdown-menu,
.sidebar-search .list-group {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
}

.sidebar-nav,
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.sidebar-section-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-secondary-color);
    padding: 0 .75rem;
    margin-bottom: .25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: .92rem;
}

.sidebar-link:hover,
.sidebar-link:focus {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.sidebar-link.active {
    background-color: var(--bs-primary, #0d6efd);
    color: var(--bs-white, #fff);
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-empty-hint {
    padding: 0 .75rem;
    font-size: .85rem;
    color: var(--bs-secondary-color);
    font-style: italic;
}

.sidebar-footer {
    margin-top: auto;
}

.app-topbar {
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-main {
    flex: 1;
    min-width: 0;
    padding-bottom: 4.5rem;
}

.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: space-around;
    background-color: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    padding: .35rem 0;
    z-index: 1030;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    font-size: .68rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
    padding: .25rem .5rem;
}

.bottom-nav-link i {
    font-size: 1.2rem;
}

.bottom-nav-link.active {
    color: var(--bs-primary, #0d6efd);
}

@media (min-width: 768px) {
    .app-main {
        padding-bottom: 1.5rem;
    }
}
/* ---------- Buttons: enabled must never read as disabled ---------- */

/* Outline (ghost) buttons carry secondary-but-active actions all over the
   app; Bootstrap's default grey text/border makes them look inert. Give
   them body-colour text and a solid border so "enabled" is unambiguous. */
.btn-outline-secondary {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-secondary-color);
}

/* Actually-disabled controls are unmistakably inert: washed out, and the
   cursor says so. */
.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: auto;
}

/* django-money renders a money field as an amount input with a currency
   select stacked underneath, which reads as two unrelated fields. Join them
   into one input-group-style row: amount grows, currency hugs its right edge.
   The label (legend) and any help text keep their own full-width lines. */
#div_id_guarantee fieldset,
#div_id_per_diem fieldset {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
#div_id_guarantee fieldset legend,
#div_id_per_diem fieldset legend,
#div_id_guarantee fieldset .form-text,
#div_id_per_diem fieldset .form-text {
    flex-basis: 100%;
}
#div_id_guarantee fieldset input,
#div_id_per_diem fieldset input {
    flex: 1 1 auto;
    width: auto;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
#div_id_guarantee fieldset select,
#div_id_per_diem fieldset select {
    flex: 0 0 auto;
    width: auto;
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ---------- Event day sheet ---------- */

:root {
    --ds-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --ds-hair: var(--bs-border-color, #dee2e6);
    --ds-muted: var(--bs-secondary-color, #6c757d);
    --ds-mine-bg: rgba(251, 240, 190, .5);
    --ds-mine-edge: #c9971c;
}

.ds-band {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ds-muted);
    text-decoration: none;
}
.ds-band:hover { text-decoration: underline; }

.ds-time {
    font-family: var(--ds-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--ds-muted);
}

.ds-section { margin-top: 2.25rem; }

.ds-section-label {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ds-muted);
    border-bottom: 1px solid var(--ds-hair);
    padding-bottom: .45rem;
    margin-bottom: .9rem;
}

table.ds-itinerary { width: 100%; }
table.ds-itinerary td {
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--ds-hair);
    vertical-align: top;
}
table.ds-itinerary td.ds-when { width: 9rem; }

tr.ds-mine td { background: var(--ds-mine-bg); }
tr.ds-mine td.ds-when { box-shadow: inset 3px 0 0 var(--ds-mine-edge); }
tr.ds-mine td.ds-when .ds-time {
    color: var(--bs-body-color, #212529);
    font-weight: 600;
}

/* Rows not concerning the member are greyed + italic via an inline style on
   the row itself (see planner/event.html), so a cached stylesheet can never
   hide the treatment. */

.ds-you {
    font-family: var(--ds-mono);
    font-size: .6rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--ds-mine-edge);
    color: #fff;
    padding: .1rem .4rem;
    border-radius: 3px;
    vertical-align: middle;
}

.ds-admin-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
    padding: .55rem .75rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--ds-hair);
    border-radius: .5rem;
    margin: 1rem 0 .5rem;
}
.ds-admin-bar .ds-admin-label {
    font-family: var(--ds-mono);
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ds-muted);
    margin-right: .25rem;
}

/* ---------- Inbox (email client) ---------- */

.inbox {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 767px) {
    .inbox { grid-template-columns: 1fr; }
}

.inbox-list {
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--ds-hair);
    border-radius: .5rem;
}

.inbox-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ds-hair);
    padding: .6rem .75rem;
    cursor: pointer;
}
.inbox-item:last-child { border-bottom: 0; }
.inbox-item:hover { background: var(--bs-tertiary-bg, #f8f9fa); }
.inbox-item.active {
    background: var(--bs-tertiary-bg, #f8f9fa);
    box-shadow: inset 3px 0 0 var(--bs-primary, #6f42c1);
}

.inbox-item-row {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    align-items: baseline;
}
.inbox-from {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bs-body-color);
}
.inbox-date { font-size: .72rem; flex: none; }
.inbox-subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bs-body-color);
}
.inbox-preview {
    font-size: .8rem;
    color: var(--ds-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inbox-tag { margin-top: .35rem; }

/* Unread: heavier text plus a purple dot before the sender. */
.inbox-item--unread .inbox-from,
.inbox-item--unread .inbox-subject { font-weight: 600; }
.inbox-item--unread .inbox-from::before {
    content: "";
    display: inline-block;
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--bs-primary, #6f42c1);
    margin-right: .4rem;
    vertical-align: middle;
}

.inbox-empty { padding: 1.5rem .75rem; text-align: center; }

.inbox-reading {
    border: 1px solid var(--ds-hair);
    border-radius: .5rem;
    min-height: 14rem;
}
.inbox-detail { padding: 1rem 1.15rem; }
.inbox-placeholder { text-align: center; padding: 3.5rem 1rem; }
.inbox-body { white-space: normal; word-break: break-word; }

/* Filed-email rows on the day sheet open the message in a modal. */
.ds-email-row { border-bottom: 1px solid var(--ds-hair) !important; }
.ds-email-row:hover { background: var(--bs-tertiary-bg, #f8f9fa); }
.ds-email-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
