html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
    --primary: #2c3e50;
    --accent: #1abc9c;
    --bg: #f8f9fa;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  background-color: var(--bg);
  font-family: 'Inter', sans-serif;
  color: #333;
}

body:has(.app-shell),
body:has(.public-shell) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

html:has(.public-shell) {
  overflow: hidden;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.ticket-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.ticket-id {
    color: #999;
    font-weight: 500;
}

.ticket-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.ticket-meta {
    font-size: 0.9rem;
    color: #666;
}

.filter-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: var(--card-shadow);
}

.badge-priority-low { background: #e0f2f1; color: #00897b; }
.badge-priority-medium { background: #fff3e0; color: #fb8c00; }
.badge-priority-high { background: #ffebee; color: #e53935; }

.status-dropdown {
    border: none;
    background: transparent;
    font-weight: 500;
    cursor: pointer;
}
#nprogress .bar { background: var(--accent) !important; height: 3px !important; }
#nprogress .peg { box-shadow: 0 0 10px var(--accent), 0 0 5px var(--accent) !important; }

#loader-wrapper {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(241, 245, 249, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1200;
    pointer-events: none;
}
#loader-wrapper.is-active { pointer-events: auto; }
.modal-backdrop { z-index: 1050 !important; }
.modal { z-index: 1055 !important; }
.modal.show { z-index: 1055 !important; pointer-events: none; }
.modal.show .modal-dialog { pointer-events: auto; }
.loader-container { text-align: center; }

.sla-info-trigger {
    line-height: 1;
    vertical-align: middle;
    text-decoration: none !important;
}
.sla-info-trigger .bi-info-circle {
    font-size: 0.95rem;
}
.popover .sla-info-popover-body ul,
.popover .sla-info-popover-body p {
    text-align: left;
}

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: all 0.2s ease;
}

.app-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    padding: 0.35rem 0.65rem 0.65rem;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-brand {
    display: block;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    border-radius: 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar-section-title {
    margin: 0.45rem 0.75rem 0.1rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    color: #343a40;
    text-decoration: none;
    border-radius: 0.5rem;
    padding: 0.38rem 0.65rem;
    font-weight: 500;
    line-height: 1.25;
}

.sidebar-link:hover {
    background: #eef2f7;
    color: var(--primary);
}

.sidebar-link.active {
    background: transparent;
    color: inherit;
    font-weight: 600;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    flex-shrink: 0;
    z-index: 1101;
    background: #ffffff;
}

.app-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg);
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 1.25rem;
    min-height: var(--app-header-height, 52px);
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.header-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
    max-width: 220px;
}

.header-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.header-user-link {
    color: #6c757d;
}

.header-user-link:hover {
    color: var(--accent);
}

.sidebar-toggle-btn {
    border-radius: 0.5rem;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1098;
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.app-main .container-fluid {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: 78px;
}

.app-shell.sidebar-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-link {
    font-size: 0;
}

.app-shell.sidebar-collapsed .sidebar-brand i,
.app-shell.sidebar-collapsed .sidebar-link i {
    font-size: 1.2rem;
    margin-right: 0 !important;
}

.app-shell.sidebar-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-section-title {
    display: none;
}

.app-footer {
    flex-shrink: 0;
    background: #ffffff;
    padding: 0.65rem 1.25rem;
    line-height: 1.3;
    z-index: 1101;
}

.public-shell {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.public-header {
    flex-shrink: 0;
    z-index: 100;
    background: #ffffff;
}

.public-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.public-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.public-shell-home,
.app-shell-home {
    height: 100dvh;
    max-height: 100dvh;
}

.public-shell-home .public-content,
.app-shell-home .app-content-home {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.public-shell-home .public-home-container,
.app-shell-home .app-home-container {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.public-shell-home .public-home-footer {
    flex-shrink: 0;
}

.public-shell:has(.auth-page) .public-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.public-shell:has(.auth-page) .public-content > .container {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    overflow: hidden;
}

.home-landing {
    width: 100%;
    margin: 0 auto;
}

.home-hero-card .card-body {
    padding: 2.5rem 2rem !important;
}

.home-hero-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.2;
}

.home-hero-lead {
    font-size: 1.05rem;
    max-width: 760px;
}

.home-feature-card .card-body {
    padding: 1.35rem 1.5rem !important;
    min-height: 120px;
}

.home-feature-card h5 {
    font-size: 1rem;
}

.home-feature-card p {
    font-size: 0.9rem;
    line-height: 1.45;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1100;
        border-right: 1px solid #e9ecef;
        border-bottom: none;
        box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.12);
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-header-inner {
        padding: 0 1rem;
    }

    .header-user-name {
        max-width: 120px;
    }

    .app-main .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ManageEngine-style ticket details workspace */
.app-content:has(.ticket-workspace) {
    overflow: hidden !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.app-content:has(.ticket-workspace) .container-fluid {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ticket-workspace {
    display: flex;
    flex: 1;
    min-height: 0;
    height: 100%;
    background: #fff;
    border-top: none;
}

.ticket-workspace .ticket-list-panel {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid #e3e6ea;
    display: flex;
    flex-direction: column;
    background: #f7f8fa;
}

.ticket-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e3e6ea;
    background: #fff;
}

.ticket-list-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ticket-list-item {
    display: block;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: background 0.15s;
}

.ticket-list-item:hover {
    background: #eef3fb;
    color: inherit;
}

.ticket-list-item.active {
    background: #fff;
    border-left: none;
    font-weight: 600;
}

.ticket-list-item-top {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.ticket-list-subject {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ticket-list-meta {
    display: flex;
    flex-direction: column;
    font-size: 0.72rem;
    color: #6c757d;
    gap: 0.1rem;
    padding-left: 1.1rem;
}

.ticket-main-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.ticket-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #e3e6ea;
    background: #f7f8fa;
}

.ticket-toolbar-left,
.ticket-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.ticket-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    flex-shrink: 0;
}

.ticket-title-bar {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e3e6ea;
}

.ticket-title-icon {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: #eef3fb;
    color: #2c6fbb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ticket-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: #2c3e50;
}

.ticket-title-meta {
    font-size: 0.78rem;
    color: #6c757d;
}

.ticket-tabs {
    padding: 0 0.75rem;
    border-bottom: 1px solid #e3e6ea;
    background: #fff;
    flex-shrink: 0;
}

.ticket-tabs .nav-link {
    font-size: 0.82rem;
    color: #495057;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.55rem 0.85rem;
}

.ticket-tabs .nav-link.active {
    color: #2c6fbb;
    border-bottom-color: #2c6fbb;
    background: transparent;
    font-weight: 600;
}

.ticket-main-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: #f4f5f7;
}

.ticket-main-scroll .tab-pane {
    min-height: 120px;
}

.ticket-main-scroll .tab-pane.active {
    display: block;
}

.sdp-section {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 4px;
    margin: 0.75rem;
    overflow: hidden;
}

.sdp-section-header {
    padding: 0.5rem 0.75rem;
    background: #f7f8fa;
    border-bottom: 1px solid #e3e6ea;
    font-size: 0.82rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
}

.sdp-section-body {
    padding: 0.75rem;
    font-size: 0.85rem;
}

.sdp-properties-grid .sdp-prop-row,
.sdp-section-body > .sdp-prop-row {
    display: flex;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid #f0f1f3;
    font-size: 0.8rem;
    align-items: center;
    gap: 0.5rem;
}

.sdp-properties-grid .props-field {
    max-width: 100%;
}

.properties-edit-form .sdp-prop-readonly .sdp-prop-value {
    color: #6c757d;
}

.sdp-prop-label {
    width: 42%;
    color: #6c757d;
    flex-shrink: 0;
}

.sdp-prop-label::after {
    content: ":";
    margin-left: 0.15rem;
    margin-right: 0.35rem;
}

.sdp-prop-value {
    flex: 1;
    color: #212529;
    font-weight: 500;
}

.ticket-summary-panel {
    width: 260px;
    flex-shrink: 0;
    border-left: 1px solid #e3e6ea;
    overflow-y: auto;
    background: #f7f8fa;
    padding: 0.75rem;
}

.summary-block {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 4px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.65rem;
    font-size: 0.8rem;
}

.summary-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f1f3;
}

.summary-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    gap: 0.5rem;
}

.ticket-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ticket-tags-add {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.ticket-tags-add .form-control {
    flex: 1;
    min-width: 0;
}

.ticket-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    padding: 0.15rem 0.35rem 0.15rem 0.5rem;
    font-size: 0.75rem;
    background: #eef2f7;
    border: 1px solid #d8dee6;
    border-radius: 3px;
    color: #333;
}

.ticket-tag-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-tag-remove {
    border: 0;
    background: transparent;
    color: #6c757d;
    line-height: 1;
    padding: 0 0.15rem;
    font-size: 1rem;
    cursor: pointer;
}

.ticket-tag-remove:hover {
    color: #dc3545;
}

.ticket-tag-add-btn {
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
}

.requester-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.requester-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2c6fbb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sdp-status-resolved { background: #5cb85c !important; border-color: #5cb85c !important; }
.sdp-status-open { background: #f0ad4e !important; border-color: #f0ad4e !important; }
.sdp-status-onhold { background: #5bc0de !important; border-color: #5bc0de !important; }
.sdp-status-default { background: #6c757d !important; border-color: #6c757d !important; }

.summary-status-dot.sdp-status-resolved { background: #5cb85c; }
.summary-status-dot.sdp-status-open { background: #f0ad4e; }
.summary-status-dot.sdp-status-onhold { background: #5bc0de; }
.summary-status-dot.sdp-status-default { background: #6c757d; }

.ticket-content-body img { max-width: 100%; height: auto; }
.ticket-content-body a { color: #2c6fbb; }

/* ManageEngine-style Description section */
.sdp-desc-section {
    margin-top: 0.75rem;
}

.sdp-desc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.85rem;
    background: #f7f8fa;
    border-bottom: 1px solid #e3e6ea;
    cursor: pointer;
    user-select: none;
}

.sdp-desc-header-left {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: #343a40;
}

.sdp-desc-chevron {
    font-size: 0.75rem;
    color: #6c757d;
}

.sdp-desc-header-actions .btn-link {
    font-size: 1rem;
    line-height: 1;
}

.sdp-desc-email-meta {
    padding: 0.65rem 1rem 0.25rem;
    font-size: 0.82rem;
    color: #495057;
    background: #fff;
}

.sdp-desc-readonly {
    background: #fafbfc;
    border-bottom: 1px solid #e3e6ea;
}

.sdp-desc-readonly-badge {
    padding: 0.4rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6c757d;
    background: #f0f2f5;
    border-bottom: 1px solid #e9ecef;
}

.sdp-desc-email-envelope {
    padding: 0.65rem 1rem 0.35rem;
    background: #fff;
    border-bottom: 1px solid #eef0f2;
}

.sdp-desc-envelope-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.2rem 0;
    font-size: 0.82rem;
    line-height: 1.45;
}

.sdp-desc-envelope-label {
    flex: 0 0 52px;
    color: #6c757d;
    font-weight: 500;
}

.sdp-desc-envelope-value {
    flex: 1;
    color: #212529;
    word-break: break-word;
}

.sdp-desc-body-label {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
    background: #fff;
    border-top: 1px solid #eef0f2;
}

.sdp-desc-body-readonly {
    background: #fff;
    border-top: 1px solid #eef0f2;
}

.sdp-desc-body-readonly.ticket-content-body p,
.sdp-desc-body-readonly.ticket-content-body div,
.sdp-desc-body-readonly.ticket-content-body li {
    margin: 0;
    padding: 0;
}

.sdp-desc-body-readonly.ticket-content-body p + p,
.sdp-desc-body-readonly.ticket-content-body div + div {
    margin-top: 0.35em;
}

.sdp-desc-attachments-readonly {
    background: #fff;
}

.sdp-desc-no-attachments {
    padding: 0.25rem 0 0.5rem;
}

.sdp-desc-compose-area {
    background: #fff;
    padding-bottom: 0.25rem;
}

.sdp-desc-compose-area .sdp-desc-upload,
.sdp-desc-compose-area .sdp-desc-action-bar {
    margin-left: 1rem;
    margin-right: 1rem;
}

.sdp-desc-attachment-size {
    font-size: 0.72rem;
    margin-left: 0.25rem;
}

.sdp-desc-meta-row {
    margin-bottom: 0.15rem;
}

.sdp-desc-meta-label {
    color: #6c757d;
    margin-right: 0.25rem;
}

.sdp-desc-body {
    padding: 0.75rem 1rem 1rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #212529;
    background: #fff;
    white-space: normal;
}

.sdp-desc-attachments {
    padding: 0 1rem 0.75rem;
    background: #fff;
}

.sdp-desc-attachments-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 0.35rem;
}

.sdp-desc-divider {
    margin: 0.35rem 0 0.65rem;
    border-color: #dee2e6;
    opacity: 1;
}

.sdp-desc-divider-dashed {
    border-top: 1px dashed #ced4da;
    background: transparent;
}

.sdp-desc-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sdp-desc-attachment-card {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    background: #f8f9fa;
    text-decoration: none;
    color: #495057;
    font-size: 0.8rem;
    max-width: 100%;
}

.sdp-desc-attachment-card:hover {
    background: #eef3fb;
    color: #2c6fbb;
    border-color: #c5d5ea;
}

.sdp-desc-attachment-icon {
    font-size: 1rem;
    color: #6c757d;
}

.sdp-desc-attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sdp-desc-upload {
    margin: 0 1rem 0.75rem;
    padding: 0.85rem 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: #6c757d;
    background: #fff;
    border: 1px dashed #ced4da;
    border-radius: 3px;
    transition: border-color 0.15s, background 0.15s;
}

.sdp-desc-upload.drag-over {
    border-color: #2c6fbb;
    background: #f0f6ff;
}

.sdp-desc-upload-icon {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    color: #adb5bd;
}

.sdp-desc-browse-link {
    color: #2c6fbb;
    text-decoration: none;
    font-weight: 500;
}

.sdp-desc-browse-link:hover {
    text-decoration: underline;
}

.sdp-desc-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.sdp-desc-file-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    background: #eef3fb;
    border: 1px solid #c5d5ea;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #495057;
}

.sdp-desc-action-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 0.85rem;
    background: #fff;
}

.sdp-desc-pill-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #ced4da;
    background: #f8f9fa;
    color: #495057;
}

.sdp-desc-pill-btn:hover {
    background: #eef2f7;
    border-color: #adb5bd;
    color: #343a40;
}

.conv-reply-actions .btn-link {
    font-size: 0.8125rem;
    white-space: nowrap;
}

.sdp-desc-composer {
    padding: 0.75rem 1rem 1rem;
    background: #f7f8fa;
    border-top: 1px solid #e3e6ea;
}

/* Ticket draft banner (ManageEngine-style) */
.ticket-draft-banner {
    border-bottom: 1px solid #e3e6ea;
    background: #fff;
}

.ticket-draft-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.85rem;
    background: #e8f4fc;
    border-bottom: 1px solid #d4e8f7;
    font-size: 0.8125rem;
}

.ticket-draft-bar-left,
.ticket-draft-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ticket-draft-bar .btn-link {
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    color: #2c6fbb;
}

.ticket-draft-bar .btn-link:hover {
    text-decoration: underline;
}

.ticket-draft-date {
    color: #6c757d;
    font-size: 0.8125rem;
}

.ticket-draft-sep {
    color: #adb5bd;
    margin: 0 0.15rem;
}

/* Send Notification modal (stack above standard modals) */
#sendNotificationModal.show {
    z-index: 1200 !important;
}
body.modal-open:has(#sendNotificationModal.show) .modal-backdrop {
    z-index: 1190 !important;
}

#sendNotificationModal .modal-content {
    max-height: min(90vh, 800px);
    display: flex;
    flex-direction: column;
}

#sendNotificationModal .send-notification-form {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
}

#sendNotificationModal .modal-body {
    overflow: visible;
    flex: 0 1 auto;
    min-height: 0;
}

#sendNotificationModal .modal-footer.send-notification-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-top: 1px solid #dee2e6;
    background: #fff;
}

.send-notification-dialog {
    max-width: 760px;
}

.send-notification-header {
    padding: 0.45rem 0.75rem;
}

.send-notification-header .modal-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.send-notification-body {
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
}

.send-notify-section-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
}

.send-notify-label {
    font-size: 0.8125rem;
    color: #495057;
    min-width: 4.5rem;
    padding-top: 0.2rem;
    margin-bottom: 0;
}

#sendNotificationModal .col-form-label.send-notify-label {
    padding-top: 0.25rem;
    padding-bottom: 0;
}

.send-notify-tags {
    min-height: 28px;
    padding: 0.15rem 0.4rem;
    border: 1px solid #ced4da;
    border-radius: 3px;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    font-size: 0.8125rem;
}

.send-notify-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.35rem;
    background: #eef3fb;
    border: 1px solid #c5d5ea;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #495057;
}

#sendNotificationModal .form-control-sm,
#sendNotificationModal .form-select-sm {
    font-size: 0.8125rem;
    padding: 0.2rem 0.45rem;
    min-height: calc(1.4em + 0.4rem);
}

#sendNotificationModal .notify-status-select {
    min-width: 12.5rem;
    width: auto;
}

#sendNotificationModal .btn-sm {
    font-size: 0.8125rem;
    padding: 0.2rem 0.55rem;
}

#sendNotificationModal .send-notify-upload {
    margin: 0;
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
    text-align: center;
}

#sendNotificationModal .send-notify-upload .sdp-desc-upload-icon {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

#sendNotificationModal .sdp-desc-browse-link {
    font-size: 0.75rem;
}

.send-notify-editor-wrap {
    border: 1px solid #ced4da;
    border-radius: 3px;
    overflow: hidden;
    background: #fff;
}

.send-notify-toolbar {
    padding: 0.2rem 0.4rem;
}

.send-notify-toolbar .btn {
    color: #495057;
    padding: 0.1rem 0.3rem;
    font-size: 0.8rem;
}

#sendNotificationModal .notify-font-select,
#sendNotificationModal .notify-size-select {
    width: auto;
    max-width: 5.5rem;
    font-size: 0.75rem;
    padding: 0.15rem 1.5rem 0.15rem 0.35rem;
    min-height: auto;
}

.send-notify-editor {
    min-height: 3.5rem;
    height: auto;
    max-height: 28vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.45rem 0.6rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    outline: none;
    resize: none;
    box-sizing: border-box;
}

.send-notify-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

#sendNotificationModal .sdp-desc-file-chip {
    font-size: 0.72rem;
    padding: 0.1rem 0.35rem;
}

/* SLA Policy / User modals (matches Send Notification layout) */
.sla-policy-modal.show {
    z-index: 1200 !important;
}
body.modal-open:has(.sla-policy-modal.show) .modal-backdrop {
    z-index: 1190 !important;
}

.sla-policy-modal .modal-content {
    max-height: min(90vh, 800px);
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.sla-policy-modal .sla-policy-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sla-policy-modal .sla-policy-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
}

.sla-policy-modal .sla-policy-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-top: 1px solid #dee2e6;
    background: #fff;
}

.sla-policy-dialog {
    max-width: 920px;
}

.sla-policy-modal .sla-policy-header {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.sla-policy-modal .sla-policy-header .modal-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.sla-policy-modal .send-notify-label {
    font-size: 0.8125rem;
    color: #495057;
    min-width: 5.5rem;
    padding-top: 0.2rem;
    margin-bottom: 0;
}

.sla-policy-modal .col-form-label.send-notify-label {
    padding-top: 0.25rem;
    padding-bottom: 0;
}

.sla-policy-modal .send-notify-section-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
}

.sla-policy-modal .form-control-sm,
.sla-policy-modal .form-select-sm {
    font-size: 0.8125rem;
    padding: 0.2rem 0.45rem;
    min-height: calc(1.4em + 0.4rem);
}

.sla-policy-modal .btn-sm {
    font-size: 0.8125rem;
    padding: 0.2rem 0.55rem;
}

#policyModal .sla-escalation-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.65rem;
}

#policyModal .sla-escalation-block {
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.65rem;
    background: #fff;
}

#policyModal .sla-escalation-block:last-child {
    margin-bottom: 0;
}

#policyModal .sla-level-fields.sla-level-disabled {
    opacity: 0.55;
    pointer-events: none;
}

#policyModal .sla-timing-row .sla-timing-sep {
    font-size: 0.75rem;
    padding: 0 0.15rem;
}

#policyModal .sla-actions-toggle {
    font-size: 0.8125rem;
    text-decoration: none;
}

#policyModal .input-group-sm .input-group-text {
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
}

.sla-policy-modal .modal-content input,
.sla-policy-modal .modal-content select,
.sla-policy-modal .modal-content button {
    pointer-events: auto;
}

@media (max-width: 1199.98px) {
    .ticket-summary-panel { width: 220px; }
    .ticket-workspace .ticket-list-panel { width: 240px; }
}

@media (max-width: 991.98px) {
    .ticket-workspace {
        flex-direction: column;
        overflow-y: auto;
    }

    .app-content:has(.ticket-workspace) {
        overflow-y: auto !important;
    }

    .ticket-workspace .ticket-list-panel,
    .ticket-workspace .ticket-summary-panel {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid #e3e6ea;
    }

    .ticket-main-panel {
        min-height: 400px;
    }
}

@media print {
    .app-content:has(.ticket-workspace),
    .app-content:has(.ticket-workspace) .container-fluid,
    .ticket-workspace,
    .ticket-main-panel,
    .ticket-main-scroll,
    .ticket-summary-panel {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        flex: none !important;
    }

    .ticket-workspace .ticket-list-panel,
    .ticket-toolbar,
    .sdp-desc-reply-actions,
    .sdp-desc-upload,
    .ticket-tabs {
        display: none !important;
    }

    .ticket-summary-panel {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid #dee2e6;
        margin-top: 1rem;
    }

    .ticket-main-scroll .tab-pane {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
    }

    .sdp-section {
        overflow: visible !important;
        page-break-inside: avoid;
    }

    .ticket-list-subject {
        overflow: visible !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
    }
}
