/* Django shell additions on top of theme.css (AdminLTE 4 + Bootstrap 5.3). */
.user-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--tm-primary); color: #fff; font-weight: 600; font-size: .7rem; }
.user-name { font-size: .8125rem; color: var(--tm-text); }
.user-role { font-size: .6875rem; }
.tm-dropdown { min-width: 240px; border-radius: var(--tm-radius-lg); box-shadow: var(--tm-shadow-lg); border-color: var(--tm-border); }
.app-sidebar .sidebar-brand .brand-link { display: flex; align-items: center; text-decoration: none; }
.app-sidebar .nav-link p { display: flex; align-items: center; gap: .5rem; width: 100%; }
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
[data-loading] .tm-table-scroll { opacity: .6; }
tr[data-href] { cursor: pointer; }
.tm-table tbody tr:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(var(--tm-primary-rgb), .55); }
.modal .is-invalid ~ .invalid-feedback, .modal .invalid-feedback.d-block { display: block; }
/* A form wrapping .modal-body + .modal-footer must keep the scrollable-body layout. */
.modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-content > form > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.toolbar .form-check { white-space: nowrap; }

[x-cloak] { display: none !important; }
.perm-option { cursor: pointer; }
.perm-option:has(input:checked) { border-color: var(--tm-primary) !important; background: var(--tm-primary-subtle); }

/* Active company selector (topbar) */
.company-switch { display: inline-flex; align-items: center; gap: .4rem; max-width: 240px; padding: .3rem .6rem; border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius); background: var(--tm-surface); color: var(--tm-text); font-size: .8125rem; font-weight: 600; }
.company-switch:disabled { opacity: 1; cursor: default; }
.company-switch--multi:hover { border-color: var(--tm-border-strong); }
.company-switch__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) { .company-switch { max-width: 120px; } }
.perm-section { border-top: 1px solid var(--tm-border); padding-top: .75rem; display: flex; flex-direction: column; gap: .75rem; }
.perm-section__title { font-size: .9375rem; font-weight: 600; margin: 0; }
.perm-row--denied td { background: var(--tm-danger-subtle); }
.licence-banner { display: flex; align-items: center; gap: .5rem; padding: .45rem 1rem; font-size: .8125rem; border-bottom: 1px solid var(--tm-border); }
.licence-banner--warning { background: var(--tm-warning-subtle); color: var(--tm-text); }
.licence-banner--danger { background: var(--tm-danger-subtle); color: var(--tm-text); }
/* Long identifiers (UUIDs, codes) must wrap on phones instead of widening the page. */
.dl-grid dd { min-width: 0; overflow-wrap: anywhere; }
.dl-grid dd code, .card-body code { overflow-wrap: anywhere; word-break: break-all; white-space: normal; }

/* Dashboard shortcuts (user-chosen; the side menu always stays) */
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.shortcut { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; text-decoration: none; color: inherit; }
.shortcut:hover, .shortcut:focus-visible { border-color: var(--tm-primary, #1f4fa3); }
.shortcut > .bi { font-size: 1.15rem; color: var(--tm-primary, #1f4fa3); }
.shortcut__label { font-weight: 600; }
.shortcut__hint { font-size: .75rem; color: var(--tm-text-muted, #6b7280); }

/* Line capacity calendar (plan dialog). Status is shown by icon + text, colour only supports it. */
.cal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem; }
.cal__head, .cal__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal__head span { font-size: .7rem; text-align: center; color: var(--tm-text-muted, #6b7280); }
.cal__row { margin-top: 3px; }
.cal__day { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 3.6rem; padding: .2rem .3rem;
  border: 1px solid var(--tm-border, #d9dde3); border-radius: .35rem; background: var(--tm-surface, #fff); font-size: .7rem;
  text-align: left; line-height: 1.15; color: inherit; min-width: 0; overflow: hidden; }
.cal__day:hover:not(:disabled), .cal__day:focus-visible { outline: 2px solid var(--tm-primary, #1f4fa3); outline-offset: 0; }
.cal__num { font-weight: 600; font-size: .78rem; }
.cal__state { white-space: nowrap; }
.cal__new { font-weight: 600; color: var(--tm-primary, #1f4fa3); white-space: nowrap; }
.cal__tag { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.cal__day--free { background: #ecf8f0; }
.cal__day--partial { background: #fff6e0; }
.cal__day--full { background: #fde8e8; }
.cal__day--maintenance { background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 6px, #e2e6ea 6px, #e2e6ea 12px); }
.cal__day--closed { background: #f1f3f5; color: var(--tm-text-muted, #6b7280); }
.cal__day.is-selected { box-shadow: inset 0 0 0 2px var(--tm-primary, #1f4fa3); }
.cal__day.is-suggested { box-shadow: inset 0 0 0 2px #0f8a4b; }
.cal__day.is-over { border-color: #c0352b; }
.cal__day.is-over .cal__new { color: #c0352b; }
.cal__day.is-past { opacity: .45; }
.cal__legend { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: .4rem 0 0; }
[data-bs-theme=dark] .cal__day--free { background: #16321f; }
[data-bs-theme=dark] .cal__day--partial { background: #3a3014; }
[data-bs-theme=dark] .cal__day--full { background: #3d1d1d; }
[data-bs-theme=dark] .cal__day--closed, [data-bs-theme=dark] .cal__day--maintenance { background: #2a2e33; }

/* Support capture mode (static/js/support_capture.js) */
.tm-capture-mask [data-sensitive], .tm-capture-mask-commercial [data-sensitive-commercial] {
  color: transparent !important; background: #1d1f22 !important; text-shadow: none !important; border-radius: 3px; }
.tm-capture-mask [data-sensitive] *, .tm-capture-mask-commercial [data-sensitive-commercial] * { color: transparent !important; background: transparent !important; }
.tm-support-busy { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(15, 18, 22, .35); }
.tm-support-busy__box { background: #fff; color: #1b1f24; padding: .9rem 1.1rem; border-radius: .5rem; max-width: 420px; font-size: .9rem; }
.tm-support { position: fixed; inset: 0; z-index: 3000; background: #0f1216; display: flex; flex-direction: column; }
.tm-support__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .45rem .6rem; background: #1b1f24; color: #fff; }
.tm-support__bar .btn[aria-pressed="true"] { background: #e2211c; color: #fff; border-color: #e2211c; }
.tm-support__hint { color: #d9dde3; font-size: .8rem; padding: .25rem .7rem; background: #15191e; }
.tm-support__stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; }
.tm-support__canvas { display: block; flex: none; width: auto; height: auto; max-width: 100%; max-height: 100%; cursor: crosshair; }
.tm-support__compose { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .75rem; padding: .55rem .7rem; background: #1b1f24; color: #d9dde3; }
.tm-support__compose textarea { grid-column: 1; grid-row: 1; resize: vertical; min-height: 3.2rem; }
.tm-support__meta { grid-column: 2; display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; max-width: 22rem; }
.tm-support__more summary { cursor: pointer; }
.tm-support__more[open] { display: flex; flex-wrap: wrap; gap: .3rem; }
.tm-support__more[open] summary { width: 100%; }
.tm-support__more select { width: auto; }
.tm-support__send { grid-column: 1 / -1; display: flex; align-items: center; gap: .75rem; }
.tm-support__send [data-f=privacy] { flex: 1 1 auto; color: #aeb5bf; }
.tm-support__send [data-f=error]:empty { display: none; }
@media (max-width: 640px) { .tm-support__compose { grid-template-columns: 1fr; } .tm-support__compose textarea, .tm-support__meta { grid-column: 1; grid-row: auto; max-width: none; } }
.tm-support__text { position: fixed; width: 260px; z-index: 3002; }

/* Live order list (static/js/live_orders.js) */
.tm-live-strip { padding: .5rem .75rem; border: 1px solid var(--tm-border, #e5e7eb); border-radius: .5rem; background: var(--tm-surface, #fff); }
.tm-table tr.is-live-new { animation: tm-live-new 2.5s ease-out; }
.tm-table tr.is-live-updated { animation: tm-live-updated 2.5s ease-out; }
@keyframes tm-live-new { from { background: rgba(25, 135, 84, .18); } to { background: transparent; } }
@keyframes tm-live-updated { from { background: rgba(13, 110, 253, .14); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .tm-table tr.is-live-new, .tm-table tr.is-live-updated { animation: none; } }
