/* StepDesk colours follow the landing page and ict.gsu.edu.ph:
   blue #1337ac, link blue #025aa5, maroon #950004, soft blue #eef2fb, text #222. */

:root {
    --bs-body-font-family: 'Poppins', system-ui, sans-serif;
    --bs-body-color: #222222;
    --bs-body-color-rgb: 34, 34, 34;
    --bs-body-bg: #ffffff;
    --bs-primary: #1337ac;
    --bs-primary-rgb: 19, 55, 172;
    --bs-link-color: #025aa5;
    --bs-link-color-rgb: 2, 90, 165;
    --bs-link-hover-color: #1337ac;
    --bs-link-hover-color-rgb: 19, 55, 172;
    --bs-border-color: #dce3f4;
    --bs-light: #eef2fb;
    --bs-light-rgb: 238, 242, 251;
    --bs-secondary-color: #5a6070;
    --bs-secondary-bg: #eef2fb;
    --bs-tertiary-bg: #eef2fb;
    --bs-heading-color: #1337ac;
    --bs-focus-ring-color: rgba(19, 55, 172, 0.25);
}

.btn-primary {
    --bs-btn-bg: #1337ac;
    --bs-btn-border-color: #1337ac;
    --bs-btn-hover-bg: #10309b;
    --bs-btn-hover-border-color: #10309b;
    --bs-btn-active-bg: #0d2780;
    --bs-btn-active-border-color: #0d2780;
    --bs-btn-disabled-bg: #1337ac;
    --bs-btn-disabled-border-color: #1337ac;
    --bs-btn-focus-shadow-rgb: 19, 55, 172;
}

.btn-outline-primary,
.btn-outline-secondary {
    --bs-btn-color: #1337ac;
    --bs-btn-border-color: #c5d0ea;
    --bs-btn-hover-bg: #1337ac;
    --bs-btn-hover-border-color: #1337ac;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-bg: #10309b;
    --bs-btn-active-border-color: #10309b;
    --bs-btn-active-color: #ffffff;
    --bs-btn-focus-shadow-rgb: 19, 55, 172;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #1337ac;
    box-shadow: 0 0 0 0.25rem rgba(19, 55, 172, 0.25);
}

.form-check-input:checked {
    background-color: #1337ac;
    border-color: #1337ac;
}

.page-link {
    --bs-pagination-color: #1337ac;
    --bs-pagination-hover-color: #10309b;
    --bs-pagination-active-bg: #1337ac;
    --bs-pagination-active-border-color: #1337ac;
}

.table {
    --bs-table-striped-bg: #f6f8fd;
    --bs-table-hover-bg: #eef2fb;
}

.card {
    --bs-card-border-color: #dce3f4;
}

h1, h2, h3, h4, h5, h6 {
    color: #1337ac;
    font-weight: 600;
}

/* Native <dialog> modals (opened by app-shell.js), laid out with Bootstrap's modal-header/-body classes. */
.app-dialog {
    width: min(28rem, calc(100% - 2rem));
    padding: 0;
    border: 1px solid #dce3f4;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
}

.app-dialog::backdrop {
    background: rgba(7, 22, 74, 0.45);
}

/* ---- App shell: sidebar, top bar, content ---- */

.app-body {
    background: #f6f8fd;
}

.app-skip-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 1100;
    padding: 0.5rem 0.75rem;
    background: #1337ac;
    color: #fff;
    border-radius: 0.5rem;
    transform: translateY(-200%);
}

.app-skip-link:focus {
    transform: translateY(0);
    color: #fff;
}

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

.app-sidebar {
    position: sticky;
    top: 0;
    width: 248px;
    height: 100vh;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 1rem 0.75rem 1.5rem;
    background: #1337ac;
    color: #fff;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 1rem;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
}

.app-brand:hover {
    color: #fff;
}

.app-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
}

.app-nav-group + .app-nav-group {
    margin-top: 1rem;
}

.app-nav-label {
    padding: 0 0.75rem 0.25rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 200ms ease-out, color 200ms ease-out;
}

.app-nav-link i {
    font-size: 1.125rem;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-nav-link.is-active {
    background: #fff;
    color: #1337ac;
    font-weight: 500;
}

.app-nav-link:focus-visible,
.app-brand:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.5rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #dce3f4;
}

.app-menu-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #dce3f4;
    border-radius: 0.5rem;
    background: #fff;
    color: #1337ac;
    font-size: 1.25rem;
}

.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    font-size: 0.875rem;
    color: #5a6070;
}

.app-breadcrumb a {
    color: #222;
    font-weight: 500;
    text-decoration: none;
}

.app-user-menu {
    position: relative;
    margin-left: auto;
}

.app-user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #222;
    font-size: 0.875rem;
}

.app-user-button:hover,
.app-user-button[aria-expanded='true'] {
    background: #eef2fb;
}

.app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #1337ac;
    color: #fff;
    font-weight: 600;
}

.app-user-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 15rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #dce3f4;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(19, 55, 172, 0.12);
}

.app-user-panel-head {
    padding: 0.5rem 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #dce3f4;
}

.app-user-panel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #950004;
    font-size: 0.875rem;
    text-align: left;
}

.app-user-panel-item:hover {
    background: #eef2fb;
}

.app-content {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    padding: 1.5rem;
}

.app-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(7, 22, 74, 0.4);
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 250ms ease-out;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-menu-button {
        display: inline-flex;
    }

    .app-user-name {
        display: none;
    }

    .app-topbar {
        padding: 0.5rem 1rem;
    }

    .app-content {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .app-nav-link {
        transition: none;
    }
}

/* ---- Page parts: header, panels, stats, lists ---- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.page-header p {
    margin: 0.25rem 0 0;
    color: #5a6070;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Older pages that still use a bare heading get the same size. */
.app-content > div > h1.h3 {
    font-size: 1.5rem;
}

.panel {
    background: #fff;
    border: 1px solid #dce3f4;
    border-radius: 0.75rem;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #dce3f4;
}

.panel-head h2 {
    margin: 0;
    font-size: 1rem;
}

.panel-body {
    padding: 1rem;
}

.panel > .table-responsive > .table,
.panel > .table {
    margin-bottom: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dce3f4;
    border-radius: 0.75rem;
    color: #222;
    text-decoration: none;
    transition: border-color 200ms ease-out, transform 200ms ease-out;
}

a.stat-card:hover {
    border-color: #1337ac;
    color: #222;
    transform: translateY(-1px);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #5a6070;
    font-size: 0.875rem;
}

.stat-label i {
    color: #1337ac;
    font-size: 1.125rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-card.is-warning .stat-value {
    color: #950004;
}

.stat-card.is-warning .stat-label i {
    color: #950004;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.bar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bar-list li + li {
    margin-top: 0.75rem;
}

.bar-list-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.bar-track {
    height: 0.5rem;
    margin-top: 0.25rem;
    border-radius: 999px;
    background: #eef2fb;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #1337ac;
}

.checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.checklist li + li {
    border-top: 1px solid #eef2fb;
}

.checklist .ph-check-circle {
    color: #22973d;
    font-size: 1.25rem;
}

.checklist .ph-circle {
    color: #8fa3dc;
    font-size: 1.25rem;
}

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-list li {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.activity-list li + li {
    border-top: 1px solid #eef2fb;
}

.activity-list i {
    color: #1337ac;
    font-size: 1.125rem;
}

/* ---- List pages ---- */

/* Screen-reader-only labels are absolutely positioned. Without a positioned ancestor
   inside the scroll box they escape it and make the whole page scroll sideways on phones. */
.table-responsive {
    position: relative;
}

.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dce3f4;
}

.list-search {
    position: relative;
    flex: 1 1 16rem;
    max-width: 24rem;
}

.list-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #5a6070;
}

.list-search input {
    padding-left: 2.25rem;
}

.list-toolbar .form-select {
    width: auto;
    min-width: 10rem;
}

.list-table {
    margin-bottom: 0;
}

.list-table thead th {
    background: #f6f8fd;
    color: #5a6070;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.list-table td {
    vertical-align: middle;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;
}

.sort-link:hover,
.sort-link.is-active {
    color: #1337ac;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    white-space: nowrap;
}

.row-actions .btn {
    --bs-btn-padding-y: 0.125rem;
    --bs-btn-padding-x: 0.5rem;
}

.list-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dce3f4;
    color: #5a6070;
    font-size: 0.875rem;
}

.list-footer .pagination {
    margin: 0;
}

.empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #5a6070;
}

.empty-state i {
    display: block;
    margin-bottom: 0.5rem;
    color: #8fa3dc;
    font-size: 2.5rem;
}

.empty-state h2 {
    margin-bottom: 0.25rem;
    color: #222;
    font-size: 1rem;
}

.empty-state p {
    margin-bottom: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-pill.is-on {
    background: #e3f4e8;
    color: #1b7a31;
}

.status-pill.is-off {
    background: #eef0f3;
    color: #5a6070;
}

.status-pill.is-warning {
    background: #fbe9e9;
    color: #950004;
}

.status-pill.is-info {
    background: #eef2fb;
    color: #1337ac;
}

[v-cloak] {
    display: none;
}

.entry-html img {
    max-width: 100%;
}

/* ---- Public pages: header, breadcrumb, footer ---- */

.public-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f6f8fd;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #dce3f4;
}

.public-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1337ac;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
}

.public-brand:hover {
    color: #10309b;
}

.public-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #1337ac;
    color: #ffffff;
}

.public-nav-links {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.public-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    color: #5a6070;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.public-nav-link:hover {
    color: #1337ac;
    background: #eef2fb;
}

.public-nav-link[aria-current='page'] {
    color: #1337ac;
    background: #eef2fb;
}

.public-nav-account {
    margin-left: auto;
}

.public-nav-account .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Narrow screens: brand and account on the first row, links scroll on the second. */
@media (max-width: 767.98px) {
    .public-nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .public-nav-account {
        order: 2;
    }
}

.public-main {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.public-breadcrumb .breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.public-breadcrumb a {
    text-decoration: none;
}

.public-hint {
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #eef2fb;
    font-size: 0.875rem;
}

.public-hint > i {
    color: #1337ac;
    font-size: 1.125rem;
    line-height: 1.25rem;
}

.public-footer {
    padding: 1.5rem 0;
    border-top: 1px solid #dce3f4;
    background: #ffffff;
    color: #5a6070;
    font-size: 0.875rem;
}

.public-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.public-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.public-footer-links a {
    color: #5a6070;
    text-decoration: none;
}

.public-footer-links a:hover {
    color: #1337ac;
}

/* ---- Public: ticket received ---- */

.received-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #e6f4ea;
    color: #1e7b3a;
    font-size: 1.75rem;
}

.received-number {
    display: inline-flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.75rem 1.5rem;
    border: 1px dashed #b9c7ea;
    border-radius: 0.5rem;
    background: #eef2fb;
}

.received-number-value {
    color: #1337ac;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.received-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.received-steps li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.received-steps li > i {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #eef2fb;
    color: #1337ac;
    font-size: 1.125rem;
}

/* ---- Open-a-ticket forms (public/open.njk, agent and client tickets/create.njk) ---- */

.form-page {
    max-width: 52rem;
}

.form-card {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .form-card {
        padding: 1.75rem;
    }
}

.form-required-note {
    margin-bottom: 1.25rem;
    color: #5a6070;
    font-size: 0.875rem;
}

.form-section {
    margin: 0;
    padding: 0;
    border: 0;
}

.form-section + .form-section {
    margin-top: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dce3f4;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    color: #1337ac;
    font-size: 1rem;
    font-weight: 600;
}

.form-section-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #eef2fb;
    color: #1337ac;
    font-size: 0.875rem;
}

.form-optional {
    margin-left: 0.25rem;
    color: #5a6070;
    font-size: 0.8125rem;
    font-weight: 400;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.form-actions .btn-primary {
    min-width: 9rem;
}

.open-aside {
    padding: 1.25rem;
    border: 1px solid #dce3f4;
    border-radius: 0.75rem;
    background: #ffffff;
}

@media (min-width: 992px) {
    .open-aside {
        position: sticky;
        top: 1.5rem;
    }
}

.open-steps {
    gap: 0.875rem;
    font-size: 0.875rem;
}

.open-steps li > i {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem 0.375rem 0.75rem;
    border: 1px solid #dce3f4;
    border-radius: 0.5rem;
    background: #f6f8fd;
    font-size: 0.875rem;
}

.attachment-item > i {
    color: #1337ac;
}

.attachment-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-detail {
    flex-shrink: 0;
    color: #5a6070;
}

.attachment-remove {
    flex-shrink: 0;
    padding: 0 0.25rem;
}

.attachment-item.has-problem {
    border-color: #f1c4c5;
    background: #fbe9e9;
}

.attachment-item.has-problem > i,
.attachment-item.has-problem .attachment-detail {
    color: #950004;
}

/* ---- Toasts (views/partials/toasts.njk + public/js/toasts.js) ---- */

.app-toast-stack {
    position: fixed;
    top: 4.25rem;
    right: 1.25rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(24rem, calc(100% - 2rem));
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.75rem 0.75rem 0.875rem;
    border: 1px solid #dce3f4;
    border-left-width: 4px;
    border-radius: 0.625rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(19, 55, 172, 0.16);
    font-size: 0.875rem;
    pointer-events: auto;
    animation: app-toast-in 200ms ease-out;
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity 200ms ease-in, transform 200ms ease-in;
}

.app-toast-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1.25rem;
}

.app-toast-text {
    flex: 1;
    min-width: 0;
    padding-top: 0.0625rem;
}

.app-toast-action {
    flex-shrink: 0;
    font-weight: 600;
    text-decoration: none;
}

.app-toast-close {
    flex-shrink: 0;
    display: inline-flex;
    padding: 0.125rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: #5a6070;
    font-size: 1rem;
}

.app-toast-close:hover {
    background: #eef2fb;
    color: #222;
}

.app-toast.is-ok { border-left-color: #1b7a31; }
.app-toast.is-ok .app-toast-icon { color: #1b7a31; }
.app-toast.is-info { border-left-color: #1337ac; }
.app-toast.is-info .app-toast-icon { color: #1337ac; }
.app-toast.is-warning { border-left-color: #b26a00; }
.app-toast.is-warning .app-toast-icon { color: #b26a00; }
.app-toast.is-error { border-left-color: #950004; }
.app-toast.is-error .app-toast-icon { color: #950004; }

@keyframes app-toast-in {
    from { opacity: 0; transform: translateY(-0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Agent ticket page ---- */

.ticket-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #dce3f4;
    border-radius: 0.75rem;
}

.ticket-header-main {
    flex: 1 1 24rem;
    min-width: 0;
}

.ticket-header-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.ticket-number {
    color: #5a6070;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.ticket-subject {
    margin: 0 0 0.375rem;
    font-size: 1.375rem;
    overflow-wrap: anywhere;
}

.ticket-header-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    color: #5a6070;
    font-size: 0.8125rem;
}

.ticket-header-facts i {
    color: #1337ac;
}

.ticket-header .page-actions .btn,
.ticket-action-bar .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Thread */

.thread-entry .card-header {
    background: #fff;
}

.thread-entry.is-response {
    border-left: 3px solid #1337ac;
}

.thread-entry.is-note {
    border-color: #f1d48a;
    border-left: 3px solid #d39e00;
    background: #fffaf0;
}

.thread-entry.is-note .card-header {
    background: #fff4d6;
}

.thread-entry-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #eef2fb;
    color: #1337ac;
    font-weight: 600;
}

.thread-entry.is-response .thread-entry-avatar {
    background: #1337ac;
    color: #fff;
}

.thread-entry.is-note .thread-entry-avatar {
    background: #d39e00;
    color: #fff;
}

.thread-entry-type {
    display: block;
    color: #5a6070;
    font-size: 0.75rem;
}

/* Thread as a chat (agent ticket page): the signed-in user's entries on the right,
   everyone else's on the left, client messages highlighted. */

.thread-row {
    display: flex;
}

.thread-row.is-mine {
    justify-content: flex-end;
}

.thread-row.is-theirs {
    justify-content: flex-start;
}

.thread-bubble {
    width: fit-content;
    min-width: min(18rem, 100%);
    max-width: 85%;
    border-radius: 1rem;
    border-top-left-radius: 0.25rem;
    overflow: hidden;
}

.thread-bubble .card-header {
    border-bottom: 0;
    padding-bottom: 0.25rem;
    background: transparent;
}

.thread-bubble .card-body {
    padding-top: 0.5rem;
}

/* Mine: right side, tail on the top right, header mirrored, primary tint. */
.thread-bubble.is-mine {
    border-top-left-radius: 1rem;
    border-top-right-radius: 0.25rem;
    border-left: 1px solid #c9d4f2;
    border-right: 3px solid #1337ac;
    background: #eef2fb;
}

.thread-bubble.is-mine .card-header {
    flex-direction: row-reverse;
}

.thread-bubble.is-mine .card-header > span:first-child {
    flex-direction: row-reverse;
    text-align: right;
}

/* My internal notes keep the note colours, on the right. */
.thread-bubble.is-mine.is-note {
    border-color: #f1d48a;
    border-right: 3px solid #d39e00;
    background: #fffaf0;
}

/* Client messages: green accent, tinted background, a soft glow so they stand out. */
.thread-bubble.is-client {
    border-color: #a9dcc0;
    border-left: 3px solid #198754;
    background: #effaf3;
    box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.12);
}

.thread-bubble.is-client .thread-entry-avatar {
    background: #198754;
    color: #fff;
}

.thread-bubble.is-client .thread-entry-type {
    color: #146c43;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .thread-bubble {
        max-width: 95%;
    }
}

.reply-card .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Sidebar facts */

.ticket-facts {
    display: grid;
    grid-template-columns: minmax(6.5rem, auto) 1fr;
    gap: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.ticket-facts dt {
    color: #5a6070;
    font-weight: 500;
}

.ticket-facts dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.panel-head h2 i {
    color: #1337ac;
}

/* History */

.ticket-timeline {
    list-style: none;
    margin: 0;
    padding: 0.5rem 1rem;
}

.ticket-timeline li {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

/* The line that joins the icons. */
.ticket-timeline li:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 0.9375rem;
    top: 2.5rem;
    bottom: -0.5rem;
    width: 2px;
    background: #eef2fb;
}

.ticket-timeline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #eef2fb;
    color: #1337ac;
    font-size: 1rem;
}

.ticket-timeline .is-status .ticket-timeline-icon { background: #e3f4e8; color: #1b7a31; }
.ticket-timeline .is-overdue .ticket-timeline-icon { background: #fbe9e9; color: #950004; }
.ticket-timeline .is-reopened .ticket-timeline-icon { background: #fdf1dc; color: #8a5300; }
.ticket-timeline .is-transferred .ticket-timeline-icon { background: #e0f2f4; color: #0f6e7a; }

/* Action bar and coloured action buttons */

.ticket-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 800;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dce3f4;
    border-radius: 0.75rem 0.75rem 0 0;
    box-shadow: 0 -6px 20px rgba(19, 55, 172, 0.08);
}

.ticket-action-bar-label {
    margin-right: auto;
    color: #5a6070;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Assign: StepDesk blue. Transfer: teal. Status: green (resolve/close) or amber (reopen).
   All keep at least 4.5:1 contrast with white text. */
.btn-action-assign {
    --bs-btn-color: #fff;
    --bs-btn-bg: #1337ac;
    --bs-btn-border-color: #1337ac;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #10309b;
    --bs-btn-hover-border-color: #10309b;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0d2780;
    --bs-btn-active-border-color: #0d2780;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #1337ac;
    --bs-btn-disabled-border-color: #1337ac;
    --bs-btn-focus-shadow-rgb: 19, 55, 172;
}

.btn-action-transfer {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0f6e7a;
    --bs-btn-border-color: #0f6e7a;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0c5c66;
    --bs-btn-hover-border-color: #0c5c66;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0a4c54;
    --bs-btn-active-border-color: #0a4c54;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0f6e7a;
    --bs-btn-disabled-border-color: #0f6e7a;
    --bs-btn-focus-shadow-rgb: 15, 110, 122;
}

.btn-action-status {
    --bs-btn-color: #fff;
    --bs-btn-bg: #1b7a31;
    --bs-btn-border-color: #1b7a31;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #166629;
    --bs-btn-hover-border-color: #166629;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #125421;
    --bs-btn-active-border-color: #125421;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #1b7a31;
    --bs-btn-disabled-border-color: #1b7a31;
    --bs-btn-focus-shadow-rgb: 27, 122, 49;
}

.btn-action-reopen {
    --bs-btn-color: #fff;
    --bs-btn-bg: #8a5300;
    --bs-btn-border-color: #8a5300;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #744600;
    --bs-btn-hover-border-color: #744600;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #5f3900;
    --bs-btn-active-border-color: #5f3900;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #8a5300;
    --bs-btn-disabled-border-color: #8a5300;
    --bs-btn-focus-shadow-rgb: 138, 83, 0;
}

/* Dialog parts */

.app-dialog-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #dce3f4;
}

.app-dialog-body {
    padding: 1rem;
}

.app-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dce3f4;
    background: #f6f8fd;
}

.app-dialog-foot .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.app-dialog-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    font-size: 1.25rem;
}

.app-dialog-icon.is-assign { background: #eef2fb; color: #1337ac; }
.app-dialog-icon.is-transfer { background: #e0f2f4; color: #0f6e7a; }
.app-dialog-icon.is-status { background: #e3f4e8; color: #1b7a31; }
.app-dialog-icon.is-reopen { background: #fdf1dc; color: #8a5300; }

/* CSM dialog: what each answer means */

.csm-hints {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.csm-hints dt {
    font-weight: 600;
}

.csm-hints dd {
    margin: 0;
    color: #5a6070;
}

/* Status choices: one card-like radio button per status */

.status-choices {
    display: grid;
    gap: 0.5rem;
}

.status-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #dce3f4;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: border-color 150ms ease-out, background-color 150ms ease-out;
}

.status-choice .form-check-input {
    flex-shrink: 0;
    margin: 0;
}

.status-choice-icon {
    color: #5a6070;
    font-size: 1.375rem;
}

.status-choice:hover {
    border-color: #8fa3dc;
}

.status-choice:has(input:checked) {
    border-color: #1337ac;
    background: #f6f8fd;
}

.status-choice:has(input:checked) .status-choice-icon {
    color: #1337ac;
}

@media (prefers-reduced-motion: reduce) {
    .app-toast,
    .app-toast.is-leaving,
    .status-choice {
        animation: none;
        transition: none;
    }
}
