@font-face {
    font-family: "Share Tech Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/share-tech-mono.ttf") format("truetype");
}

:root {
    --sidebar-width: 260px;
    --primary: #0020c2;
    --primary-dark: #001280;
    --accent: #ff0000;
    --accent-dark: #cc0000;
    --cyan: #00d2ff;
    --background: #f8fafc;
    --sidebar: #050b18;
    --sidebar-hover: #101d36;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--background);
    color: var(--text);
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-dark);
    --bs-btn-hover-border-color: var(--accent-dark);
    --bs-btn-active-bg: var(--accent-dark);
    --bs-btn-active-border-color: var(--accent-dark);
    border-radius: 4px;
    font-weight: 700;
}

.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    border-radius: 4px;
    font-weight: 600;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--sidebar);
    color: white;
    z-index: 1000;
    border-right: 1px solid rgba(0, 210, 255, 0.2);
    box-shadow: 10px 0 30px rgba(5, 11, 24, 0.16);
    transition: transform 0.25s ease;
}

.sidebar-brand {
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: #060c19;
    color: white;
    border-bottom: 1px solid rgba(0, 210, 255, 0.22);
    font-family: "Orbitron", sans-serif;
    font-size: 0.88rem;
    letter-spacing: 0.025em;
}

.sidebar-brand small {
    color: #94a3b8;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    margin-right: 12px;
    object-fit: contain;
    flex-shrink: 0;
    padding: 5px;
    border-radius: 6px;
    background: white;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.18);
}

.sidebar-navigation {
    padding: 18px 14px;
}

.sidebar-navigation a,
.sidebar-navigation .nav-disabled {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    padding: 12px 14px;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    transition: 0.2s;
}

.module-placeholder {
    max-width: 760px;
    padding: 48px;
    text-align: center;
}

.module-placeholder-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    border-radius: 20px;
    color: var(--primary);
    background: #eef2ff;
    font-size: 2rem;
}

.email-message {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: #f8fafc;
}

.email-message-outbound {
    border-left-color: #078760;
    background: #f2fbf7;
}

.email-message p:last-child {
    margin-bottom: 0;
}

.inbox-subject {
    max-width: 360px;
    vertical-align: middle;
}

.login-logo {
    display: block;
    width: 104px;
    height: 96px;
    margin-right: auto;
    margin-left: auto;
    object-fit: contain;
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--primary);
    background: #eef2ff;
    font-size: 1.35rem;
}

.human-verification {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.captcha-image {
    border: 1px solid #d8dee9;
    border-radius: 10px;
    object-fit: cover;
}

.human-verification-trap {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.sidebar-navigation i {
    width: 20px;
    font-size: 1.05rem;
    text-align: center;
}

.sidebar-navigation a:hover,
.sidebar-navigation a.active {
    color: white;
    background: var(--sidebar-hover);
}

.sidebar-navigation a.active {
    color: var(--cyan);
    box-shadow: inset 3px 0 var(--accent);
}

.sidebar-navigation .nav-disabled {
    color: #64748b;
    cursor: not-allowed;
}

.nav-disabled > span {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
}

.nav-disabled small {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.app-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.app-header {
    height: 72px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    background: #060c19;
    border-bottom: 1px solid rgba(0, 210, 255, 0.2);
    box-shadow: 0 2px 10px rgba(5, 11, 24, 0.18);
    position: sticky;
    top: 0;
    z-index: 900;
}

.app-header strong {
    color: white;
    font-family: "Orbitron", sans-serif;
    letter-spacing: 0.025em;
}

.app-header .text-secondary {
    color: #cbd5e1 !important;
}

.app-header .btn-outline-secondary {
    color: white;
    border-color: #64748b;
}

.app-header .btn-outline-secondary:hover {
    color: #050b18;
    background: var(--cyan);
    border-color: var(--cyan);
}

.app-main {
    padding: 30px;
}

.page-title-row h1,
.app-main > .row h1 {
    color: var(--primary);
    font-family: "Orbitron", sans-serif;
    font-weight: 800;
}

.stat-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    padding: 24px;
    border: 0;
    color: white;
    border-radius: 8px;
    background: #060c19;
    box-shadow: 0 8px 20px rgba(5, 11, 24, 0.12);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-top: 4px solid var(--primary);
}

.stat-label {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-value {
    margin-top: 8px;
    font-size: 2rem;
    line-height: 1;
    font-family: "Orbitron", sans-serif;
    font-weight: 800;
}

.technician-alert-count {
    animation: technician-alert-blink 1.2s steps(1, end) infinite;
}

@keyframes technician-alert-blink {
    0%,
    49% {
        color: #dc2626;
    }

    50%,
    100% {
        color: #111827;
    }
}

@media (prefers-reduced-motion: reduce) {
    .technician-alert-count {
        color: #dc2626;
        animation: none;
    }
}

.ticket-row-high > td,
.ticket-row-high > td a:not(.btn) {
    animation: ticket-high-blink 1.2s steps(1, end) infinite;
}

.ticket-row-critical {
    --bs-table-bg: #dc3545;
    --bs-table-hover-bg: #c92f3d;
    --bs-table-border-color: #b92d3a;
}

.ticket-row-critical > td,
.ticket-row-critical > td a:not(.btn) {
    animation: ticket-critical-blink 1.2s steps(1, end) infinite;
}

@keyframes ticket-high-blink {
    0%,
    49% {
        color: #dc2626;
    }

    50%,
    100% {
        color: #111827;
    }
}

@keyframes ticket-critical-blink {
    0%,
    49% {
        color: #fff;
    }

    50%,
    100% {
        color: #111827;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticket-row-high > td,
    .ticket-row-high > td a:not(.btn) {
        color: #dc2626;
        animation: none;
    }

    .ticket-row-critical > td,
    .ticket-row-critical > td a:not(.btn) {
        color: #fff;
        animation: none;
    }
}

.stat-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.15rem;
}

.stat-card-primary .stat-icon {
    color: var(--cyan);
    background: rgba(0, 210, 255, 0.12);
}

.stat-card-success .stat-icon {
    color: #078760;
    background: #e7f8f1;
}

.stat-card-success {
    border-top-color: #00d084;
}

.stat-card-danger .stat-icon {
    color: #dc3545;
    background: #fcebed;
}

.stat-card-danger {
    border-top-color: var(--accent);
}

.stat-card-warning .stat-icon {
    color: #b77900;
    background: #fff4d6;
}

.stat-card-warning {
    border-top-color: #f5a524;
}

.stat-card-technician .stat-icon {
    color: var(--cyan);
    background: rgba(0, 210, 255, 0.12);
}

.stat-card-technician {
    border-top-color: var(--cyan);
    color: #111827;
    background: white;
}

.stat-card-technician .stat-label {
    color: var(--muted);
}

.content-card {
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
}

.content-card.card-body {
    overflow: visible;
}

.table > :not(caption) > * > * {
    padding: 14px 16px;
}

.table thead th {
    color: var(--muted);
    color: #dbeafe;
    background: #060c19;
    border-bottom-color: var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-new {
    color: #3157d5;
    background: #eef2ff;
}

.status-in_progress {
    color: #086fa1;
    background: #e8f6fc;
}

.status-waiting {
    color: #986700;
    background: #fff3cd;
}

.status-waiting_technician {
    color: #6d28d9;
    background: #f1eafe;
}

.status-resolved {
    color: #087653;
    background: #ddf7ec;
}

.status-closed {
    color: #596273;
    background: #e9edf3;
}

.priority-badge {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
}

.priority-critical {
    color: #c92a3a;
}

.priority-none {
    color: #64748b;
}

.priority-high {
    color: #d16800;
}

.priority-normal {
    color: #3157d5;
}

.priority-low {
    color: #64748b;
}

.card-header {
    border-color: var(--border);
    color: var(--primary);
    font-weight: 650;
}

dl dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
}

dl dd {
    margin-bottom: 1rem;
}

.form-control,
.form-select {
    border-color: #d8dee9;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 32, 194, 0.14);
}

.app-public {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 32, 194, 0.28), transparent 32rem),
        radial-gradient(circle at 90% 90%, rgba(0, 210, 255, 0.12), transparent 28rem),
        #050b18;
}

.app-public main > .text-center h1 {
    color: white;
    font-family: "Orbitron", sans-serif;
    font-weight: 800;
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.app-public main > .text-center .text-secondary {
    color: #cbd5e1 !important;
}

.app-public .card {
    border-top: 4px solid var(--primary) !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24) !important;
}

.app-public .card h2,
.app-public .card h3 {
    color: var(--primary);
}

.app-public .login-logo {
    width: 126px;
    height: 108px;
    padding: 8px 14px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 0 18px rgba(0, 210, 255, 0.26);
}

.feature-icon {
    color: var(--primary);
    background: #e8edff;
    border-radius: 8px;
}

.mobile-menu-button {
    display: none;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 950;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.55);
}

.pwa-install-button {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1100;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-backdrop.is-visible {
        display: block;
    }

    .app-content {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
    }

    .app-main {
        padding: 20px;
    }
}

@media (max-width: 575px) {
    .pwa-install-button {
        right: 14px;
        bottom: 14px;
    }

    .app-header {
        height: 64px;
        padding: 0 16px;
    }

    .app-main {
        padding: 18px 14px;
    }

    .page-title-row {
        align-items: stretch !important;
        flex-direction: column;
        gap: 14px;
    }

    .page-title-row > .btn,
    .page-title-row > .d-flex {
        width: 100%;
    }

    .page-title-row > .d-flex .btn {
        flex: 1;
    }

    .user-name {
        display: none;
    }

    .logout-label {
        display: none;
    }

    .stat-card {
        padding: 20px;
    }
}

.language-switcher {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.7);
}

.language-switcher a {
    min-width: 28px;
    padding: 3px 6px;
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
}

.language-switcher a:hover,
.language-switcher a:focus-visible {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.language-switcher a.active {
    color: white;
    background: var(--primary);
}

.language-switcher-public {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 1050;
    box-shadow: 0 4px 14px rgba(5, 11, 24, 0.16);
}

.password-change-card input[type="password"] {
    display: block;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background: white;
}

.password-change-card input[type="password"]:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 32, 194, 0.15);
}

@media (max-width: 767px) {
    .password-change-label {
        display: none;
    }
}

.work-log-entry { padding: 1rem 0; border-bottom: 1px solid #e5e7eb; }
.work-log-entry:last-child { border-bottom: 0; }
.work-log-form .btn-check-group { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.work-log-form .btn-check-group li { margin: 0; }
.work-log-form .btn-check-group label { display: inline-block; padding: .45rem .75rem; border: 1px solid #cbd5e1; border-radius: .5rem; cursor: pointer; background: #fff; }
.work-log-form .btn-check-group input { margin-right: .35rem; }
.work-log-form .btn-check-group label:has(input:checked) { color: #fff; border-color: var(--primary); background: var(--primary); }

.ticket-info-sticky {
    position: sticky;
    top: 80px;
    z-index: 850;
    margin-bottom: 1rem;
}
.ticket-info-card {
    box-shadow: 0 8px 24px rgba(5, 11, 24, 0.14);
}
.ticket-info-card .card-header {
    padding: .55rem 1rem !important;
    font-size: .85rem;
}
.ticket-info-card .card-body {
    padding: .65rem 1rem;
}
.ticket-info-card dl {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: .15rem 1rem;
    align-items: start;
}
.ticket-info-card dt {
    font-size: .7rem;
    color: #64748b;
    line-height: 1.15;
}
.ticket-info-card dd {
    min-width: 0;
    margin-bottom: .35rem;
    overflow-wrap: anywhere;
    font-size: .86rem;
    line-height: 1.25;
}
@media (max-width: 1199px) {
    .ticket-info-card dl { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .ticket-info-sticky { position: static; }
    .ticket-info-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.work-log-note-column textarea {
    width: 100%;
    min-height: 132px;
    height: 100%;
    resize: vertical;
}
.work-log-meta-column {
    display: grid;
    grid-template-rows: auto auto;
    gap: .75rem;
    align-content: start;
}
.work-log-compact-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: end;
}
.work-log-compact-controls > div:not(.work-log-notify) {
    flex: 0 1 190px;
}
.work-log-compact-controls .form-label {
    margin-bottom: .2rem;
    font-size: .75rem;
    color: #64748b;
}
.work-log-notify {
    display: flex;
    flex: 1 1 230px;
    align-items: center;
    min-height: 31px;
    gap: .4rem;
    margin-bottom: 0;
}
.work-log-history { min-height: 0; }
@media (max-width: 991px) {
    .work-log-note-column textarea { height: auto; min-height: 115px; }
    .work-log-meta-column { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
}
@media (max-width: 575px) {
    .work-log-meta-column { grid-template-columns: 1fr; }
    .work-log-compact-controls > div:not(.work-log-notify) { flex: 1 1 100%; }
    .work-log-compact-controls .btn { width: 100%; }
}

.work-log-attachments {
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: .45rem .65rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #f8fafc;
}
.work-log-attachment-list {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    max-height: 58px;
    overflow-y: auto;
}
.attachment-chip {
    display: inline-block;
    max-width: 210px;
    padding: .18rem .45rem;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #334155;
    background: #fff;
    font-size: .72rem;
    line-height: 1.25;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-chip:hover { border-color: var(--primary); color: var(--primary); }
.work-log-attachment-upload { display: flex; flex: 0 0 auto; gap: .4rem; }
.work-log-more .hide-label { display: none; }
.work-log-more[aria-expanded="true"] .show-label { display: none; }
.work-log-more[aria-expanded="true"] .hide-label { display: inline; }
.work-log-more i { display: inline-block; transition: transform .2s ease; }
.work-log-more[aria-expanded="true"] i { transform: rotate(180deg); }
@media (max-width: 767px) {
    .work-log-attachments { align-items: stretch; flex-direction: column; }
    .work-log-attachment-upload { justify-content: flex-end; }
}

.ticket-description-compact {
    grid-column: 1 / -1;
    margin-top: .15rem;
    padding-top: .35rem;
    border-top: 1px solid #e2e8f0;
}
.ticket-description-button {
    display: inline-flex;
    gap: .3rem;
    align-items: center;
    padding: .12rem .35rem;
    border: 0;
    border-radius: .3rem;
    color: #475569;
    background: transparent;
    font-size: .66rem;
    font-weight: 600;
    line-height: 1.2;
}
.ticket-description-button:hover { color: var(--primary); background: #f1f5f9; }
.ticket-description-button .hide-label { display: none; }
.ticket-description-button[aria-expanded="true"] .show-label { display: none; }
.ticket-description-button[aria-expanded="true"] .hide-label { display: inline; }
.ticket-description-chevron { transition: transform .2s ease; }
.ticket-description-button[aria-expanded="true"] .ticket-description-chevron { transform: rotate(180deg); }
.ticket-description-text {
    max-height: 34vh;
    margin-top: .35rem;
    padding: .45rem .55rem;
    overflow-y: auto;
    border-radius: .35rem;
    color: #334155;
    background: #f8fafc;
    font-size: .72rem;
    line-height: 1.35;
}
.ticket-description-text p:last-child { margin-bottom: 0; }

.timeline-email {
    margin-top: .25rem;
    padding: .65rem .75rem;
    border-left: 3px solid #3b82f6;
    border-radius: .35rem;
    background: #f8fafc;
}
.timeline-email-outbound { border-left-color: #22c55e; }
.timeline-email-body {
    max-height: 150px;
    overflow-y: auto;
    color: #334155;
    font-size: .8rem;
    line-height: 1.35;
}
.customer-message-compact textarea { min-height: 90px; }

/* Professional light ServiceDesk theme */
:root {
    --sidebar-width: 248px;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --cyan: #60a5fa;
    --background: #f4f6f9;
    --sidebar: #10243e;
    --sidebar-hover: #1b3554;
    --text: #1e293b;
    --muted: #64748b;
    --border: #dfe5ec;
}
body { background: var(--background); color: #1f2937; font-size: .925rem; }
a { text-underline-offset: 2px; }
.app-sidebar {
    background: #10243e;
    border-right: 1px solid #203a59;
    box-shadow: 5px 0 20px rgba(15, 35, 58, .08);
}
.sidebar-brand {
    height: 68px;
    padding: 0 20px;
    background: #0d1f36;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: .82rem;
}
.sidebar-logo { width: 40px; height: 40px; border-radius: 8px; box-shadow: none; }
.sidebar-navigation { padding: 16px 12px; }
.sidebar-navigation a,
.sidebar-navigation .nav-disabled {
    gap: 11px;
    margin-bottom: 3px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: .875rem;
}
.sidebar-navigation a { color: #cbd5e1; }
.sidebar-navigation a:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-navigation a.active {
    color: #fff;
    background: #1d4f7a;
    box-shadow: inset 3px 0 #60a5fa;
}
.app-header {
    height: 68px;
    padding: 0 26px;
    background: #10243e;
    border-bottom: 1px solid #203a59;
    box-shadow: 0 2px 8px rgba(15,35,58,.1);
}
.app-header strong { font-size: .86rem; font-weight: 600; letter-spacing: .02em; }
.app-header .btn-outline-secondary { color: #e2e8f0; border-color: #526982; }
.app-header .btn-outline-secondary:hover { color: #10243e; background: #fff; border-color: #fff; }
.app-main { padding: 26px 28px 36px; }
.page-title-row { margin-bottom: 1.15rem !important; }
.page-title-row h1,
.app-main > .row h1 {
    color: #17324f;
    font-size: 1.42rem;
    font-weight: 700;
    letter-spacing: .015em;
}
.page-title-row .text-secondary { font-size: .8rem; }
.content-card {
    border: 1px solid #dfe5ec;
    border-top: 1px solid #dfe5ec;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(30,41,59,.045);
}
.content-card:hover { box-shadow: 0 3px 11px rgba(30,41,59,.065); }
.card-header {
    min-height: 43px;
    color: #243b53;
    background: #fbfcfd !important;
    border-bottom: 1px solid #e7ebf0;
    font-size: .87rem;
    font-weight: 650;
}
.card-body { color: #334155; }
.btn {
    border-radius: 7px;
    font-size: .85rem;
    font-weight: 600;
    box-shadow: none !important;
}
.btn-primary {
    --bs-btn-bg: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    border-radius: 7px;
    font-weight: 600;
}
.btn-outline-primary {
    --bs-btn-color: #2563eb;
    --bs-btn-border-color: #93b4ef;
    --bs-btn-hover-bg: #eff6ff;
    --bs-btn-hover-color: #1d4ed8;
    --bs-btn-hover-border-color: #2563eb;
    border-radius: 7px;
}
.btn-success { --bs-btn-bg: #16835f; --bs-btn-border-color: #16835f; }
.form-control,
.form-select {
    min-height: 38px;
    border-color: #cfd8e3;
    border-radius: 7px;
    color: #243b53;
    background-color: #fff;
    font-size: .875rem;
}
.form-control:hover,
.form-select:hover { border-color: #aab8c8; }
.form-control:focus,
.form-select:focus { border-color: #4f83df; box-shadow: 0 0 0 .18rem rgba(37,99,235,.12); }
.form-label { color: #40556d; font-size: .8rem; font-weight: 600; }
.form-text { color: #7b8a9a; font-size: .72rem; }
.table { --bs-table-color: #334155; --bs-table-hover-bg: #f7f9fc; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 11px 14px; border-bottom-color: #e9edf2; vertical-align: middle; }
.table thead th {
    color: #526579;
    background: #f1f4f7;
    border-top: 1px solid #dfe5ec;
    border-bottom: 1px solid #d5dde6;
    font-size: .69rem;
    letter-spacing: .045em;
}
.table tbody { background: #fff; }
.ticket-row-high > td,
.ticket-row-high > td a:not(.btn),
.ticket-row-critical > td,
.ticket-row-critical > td a:not(.btn) { animation: none !important; }
.ticket-row-high { box-shadow: inset 3px 0 #f59e0b; }
.ticket-row-critical { --bs-table-bg: #fff5f5; --bs-table-hover-bg: #ffeded; --bs-table-border-color: #f2d4d4; box-shadow: inset 3px 0 #dc2626; }
.ticket-row-critical > td,
.ticket-row-critical > td a:not(.btn) { color: #7f1d1d; }
.stat-card,
.stat-card-technician {
    min-height: 116px;
    padding: 20px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #dfe5ec;
    border-top: 1px solid #dfe5ec;
    border-left: 3px solid #2563eb;
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(30,41,59,.045);
}
.stat-card-success { border-left-color: #16835f; }
.stat-card-danger { border-left-color: #dc2626; }
.stat-card-warning { border-left-color: #d97706; }
.stat-card-technician { border-left-color: #64748b; }
.stat-label,
.stat-card-technician .stat-label { color: #64748b; font-size: .76rem; font-weight: 600; }
.stat-value { margin-top: 10px; color: #17324f; font-size: 1.65rem; font-weight: 700; }
.stat-icon { top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 8px; }
.stat-card-primary .stat-icon,
.stat-card-technician .stat-icon { color: #2563eb; background: #eff6ff; }
.status-badge { padding: 4px 8px; border: 1px solid transparent; font-size: .72rem; font-weight: 650; }
.status-new { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.status-in_progress { color: #075985; background: #ecfeff; border-color: #bae6fd; }
.status-waiting { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.status-waiting_technician { color: #6b21a8; background: #faf5ff; border-color: #e9d5ff; }
.status-waiting_external { color: #9a3412; background: #fff7ed; border-color: #fed7aa; }
.status-waiting_scheduled { color: #3730a3; background: #eef2ff; border-color: #c7d2fe; }
.status-resolved { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.status-closed { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }
.priority-badge { font-size: .76rem; font-weight: 650; }
.ticket-info-card { box-shadow: 0 3px 10px rgba(30,41,59,.07); }
.ticket-info-card .card-header { background: #f8fafc !important; }
.work-log-card .card-body { background: #fff; }
.work-log-entry { border-bottom-color: #e9edf2; }
.work-log-attachments { border-color: #dfe5ec; background: #f8fafc; }
.attachment-chip { border-color: #d5dde6; color: #40556d; }
.timeline-email { border-left-color: #4f83df; background: #f7faff; }
.timeline-email-outbound { border-left-color: #16835f; background: #f5fbf8; }
.alert { border-radius: 8px; font-size: .875rem; }
.pagination .page-link { color: #2563eb; border-color: #dfe5ec; }
.language-switcher { border-color: #526982; background: rgba(0,0,0,.12); }
.language-switcher a.active { background: #2563eb; }
@media (max-width: 991px) { .app-main { padding: 20px; } }
@media (max-width: 575px) {
    .app-header { height: 64px; }
    .app-main { padding: 16px 12px 26px; }
    .page-title-row h1, .app-main > .row h1 { font-size: 1.18rem; }
}

/* Clear label/value hierarchy in the compact ticket information panel */
.ticket-info-card dt {
    align-self: center;
    color: #8492a3;
    font-size: .62rem;
    font-weight: 650;
    letter-spacing: .055em;
    line-height: 1.2;
    text-transform: uppercase;
}
.ticket-info-card dd {
    align-self: center;
    min-height: 24px;
    padding: .25rem .4rem .25rem .55rem;
    border-left: 2px solid #bfdbfe;
    border-radius: 0 4px 4px 0;
    color: #172b3f;
    background: #f8fbff;
    font-size: .84rem;
    font-weight: 650;
}
.ticket-info-card dd a {
    color: #1d4f91;
    font-weight: 700;
    text-decoration: none;
}
.ticket-info-card dd a:hover { color: #1d4ed8; text-decoration: underline; }

/* Structured ticket event timeline */
.work-log-history { display: grid; gap: .65rem; }
.timeline-entry {
    position: relative;
    padding: .75rem .85rem;
    border: 1px solid #e1e7ee;
    border-left: 3px solid #94a3b8;
    border-radius: 7px;
    background: #fff;
}
.timeline-entry-work { border-left-color: #64748b; }
.timeline-email-inbound { border-left-color: #3b82f6; background: #f8fbff; }
.timeline-email-outbound { border-left-color: #16835f; background: #f7fcf9; }
.timeline-entry-latest {
    border-color: #b9d1f5;
    border-left-color: #2563eb;
    box-shadow: 0 2px 7px rgba(37,99,235,.08);
}
.timeline-entry-latest::after {
    content: "";
    position: absolute;
    top: 9px;
    right: -1px;
    width: 3px;
    height: 22px;
    border-radius: 3px 0 0 3px;
    background: #2563eb;
}
.timeline-entry-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .45rem;
}
.timeline-type {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    color: #243b53;
    font-size: .8rem;
    font-weight: 700;
}
.timeline-type i {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 6px;
    color: #475569;
    background: #eef2f6;
}
.timeline-email-inbound .timeline-type i { color: #1d4ed8; background: #dbeafe; }
.timeline-email-outbound .timeline-type i { color: #087653; background: #dcfce7; }
.timeline-time { color: #7b8a9a; font-size: .7rem; white-space: nowrap; }
.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .5rem;
    align-items: center;
    margin-bottom: .5rem;
}
.timeline-meta > span:not(.status-badge):not(.priority-badge) {
    display: inline-flex;
    gap: .25rem;
    align-items: center;
    max-width: 100%;
    padding: .2rem .42rem;
    border-radius: 5px;
    color: #5d6d7e;
    background: #f1f4f7;
    font-size: .69rem;
    overflow-wrap: anywhere;
}
.timeline-meta .status-badge { padding: .2rem .45rem; font-size: .68rem; }
.timeline-meta .priority-badge { padding: .2rem .42rem; border-radius: 5px; background: #f1f4f7; font-size: .68rem; }
.work-log-note-column textarea,
.customer-event-form textarea,
.timeline-entry-body {
    font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: .01em;
}
.ticket-info-card dd {
    font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: .01em;
}
.ticket-info-card dd,
.ticket-info-card dd strong,
.ticket-info-card .ticket-type-badge,
.ticket-info-card .status-badge,
.ticket-info-card .priority-badge {
    font-weight: 400;
}



.timeline-entry-body {
    padding-top: .45rem;
    border-top: 1px solid #edf0f4;
    color: #334155;
    font-size: .8rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
}
.timeline-entry-body p:last-child { margin-bottom: 0; }
#moreWorkLogs { display: grid; gap: .65rem; }
#moreWorkLogs:not(.show) { display: none; }
.work-log-more { justify-self: start; font-size: .75rem; text-decoration: none; }
@media (max-width: 575px) {
    .timeline-entry { padding: .65rem; }
    .timeline-entry-header { align-items: flex-start; flex-direction: column; gap: .35rem; }
    .timeline-time { padding-left: 29px; }
}

/* Professional status markers: compact label with a semantic dot */
.status-badge {
    --status-color: #64748b;
    display: inline-flex;
    gap: .42rem;
    align-items: center;
    padding: .28rem .48rem;
    border: 1px solid #dbe2ea;
    border-radius: 5px;
    color: #34465a;
    background: #f8fafc;
    font-size: .7rem;
    font-weight: 650;
    line-height: 1.15;
    white-space: nowrap;
}
.status-badge::before {
    content: "";
    width: 13px;
    height: 6px;
    flex: 0 0 13px;
    border-radius: 1px;
    background: var(--status-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--status-color) 14%, transparent);
}
.status-new { --status-color: #2563eb; }
.status-in_progress { --status-color: #0891b2; }
.status-waiting { --status-color: #d97706; }
.status-waiting_technician { --status-color: #7c3aed; }
.status-waiting_external { --status-color: #ea580c; }
.status-waiting_scheduled { --status-color: #4f46e5; }
.status-resolved { --status-color: #16835f; }
.status-closed { --status-color: #64748b; }
.table .status-badge { min-width: 0; justify-content: flex-start; }

/* Ticket type markers */
.ticket-type-badge {
    --ticket-type-color: #64748b;
    display: inline-flex;
    align-items: center;
    padding: .25rem .5rem;
    border: 1px solid color-mix(in srgb, var(--ticket-type-color) 24%, transparent);
    border-radius: 999px;
    color: var(--ticket-type-color);
    background: color-mix(in srgb, var(--ticket-type-color) 9%, white);
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}
.ticket-type-badge .bi {
    margin-right: .34rem;
    font-size: .76rem;
    line-height: 1;
}
.ticket-type-sales { --ticket-type-color: #2563eb; }
.ticket-type-service { --ticket-type-color: #0f766e; }
.ticket-type-internal { --ticket-type-color: #7c3aed; }
.ticket-type-complaint { --ticket-type-color: #dc2626; }
.ticket-type-row-sales { --ticket-row-type-color: #2563eb; }
.ticket-type-row-service { --ticket-row-type-color: #0f766e; }
.ticket-type-row-internal { --ticket-row-type-color: #7c3aed; }
.ticket-type-row-complaint { --ticket-row-type-color: #dc2626; }
.ticket-type-row > td:first-child {
    border-left: 3px solid var(--ticket-row-type-color, transparent);
}

/* Two-step ticket creation */
.ticket-wizard-progress {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    counter-reset: ticket-step;
}
.ticket-wizard-progress li {
    counter-increment: ticket-step;
    padding: .65rem .8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: #f8fafc;
    font-size: .78rem;
    font-weight: 700;
}
.ticket-wizard-progress li::before {
    content: counter(ticket-step);
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    margin-right: .5rem;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: #94a3b8;
}
.ticket-wizard-progress li.is-active {
    border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
    color: var(--primary-dark);
    background: color-mix(in srgb, var(--primary) 6%, white);
}
.ticket-wizard-progress li.is-active::before { background: var(--primary); }

/* Compact ticket-type breakdown inside dashboard statistic cards. */
.stat-type-counts {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .8rem;
    padding-top: .65rem;
    border-top: 1px solid #e7ebf0;
}
.stat-type-count {
    --ticket-type-color: #64748b;
    display: inline-flex;
    gap: .28rem;
    align-items: center;
    min-width: 2.35rem;
    padding: .2rem .36rem;
    border: 1px solid color-mix(in srgb, var(--ticket-type-color) 20%, transparent);
    border-radius: 5px;
    color: var(--ticket-type-color);
    background: color-mix(in srgb, var(--ticket-type-color) 7%, white);
    font-size: .66rem;
    line-height: 1;
}
.stat-type-count .bi { font-size: .68rem; }
.stat-type-count strong { font-size: .7rem; font-variant-numeric: tabular-nums; }

/* Billable versus internal work time. */
.work-time-billable { color: #087653; }
.work-time-internal { color: #6d28d9; }
.work-time-badge {
    display: inline-flex;
    gap: .28rem;
    align-items: center;
    padding: .2rem .42rem;
    border-radius: 5px;
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
}
.work-time-billable.work-time-badge { color: #087653; background: #e8f7f0; }
.work-time-internal.work-time-badge { color: #6d28d9; background: #f1eafe; }

/* Clickable ticket table rows */
.ticket-list-row { cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease; }
.ticket-list-row:hover { background: #f3f7fc; box-shadow: inset 3px 0 #93b4ef; }
.ticket-list-row:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; background: #eff6ff; }
.ticket-number-link { color: #1d4f91; font-weight: 700; text-decoration: none; }
.ticket-number-link:hover, .ticket-number-link:focus { color: #1d4ed8; text-decoration: none; }

/* Ticket filter actions */
.ticket-filter-actions .btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
@media (min-width: 768px) and (max-width: 1199px) { .filter-reset-label { display: none; } }

/* RGEIST corporate background and color alignment */
:root {
    --primary: #1769ff;
    --primary-dark: #0d4fc4;
    --accent: #1769ff;
    --accent-dark: #0d4fc4;
    --cyan: #37b9ff;
    --background: #f4f7fb;
    --sidebar: #0a1728;
    --sidebar-hover: #142b47;
    --text: #07111f;
    --muted: #657287;
    --border: #dce3ec;
}
.app-authenticated { background: #f4f7fb; }
.app-authenticated .app-content {
    background:
        radial-gradient(circle at 92% 2%, rgba(23,105,255,.065), transparent 28rem),
        linear-gradient(180deg, #f7f9fc 0, #f4f7fb 320px);
}
.app-sidebar {
    background: linear-gradient(180deg, #07111f 0, #0a1728 62%, #0d223b 100%);
    border-right-color: #1d334e;
}
.sidebar-brand,
.app-header {
    background: linear-gradient(100deg, #07111f, #0b1c34 72%, #0d2748);
    border-color: rgba(55,185,255,.13);
}
.app-header { box-shadow: 0 2px 10px rgba(7,17,31,.13); }
.content-card { border-color: #dce3ec; }
.card-header { border-bottom-color: #e4e9f0; }
.btn-primary {
    --bs-btn-bg: #1769ff;
    --bs-btn-border-color: #1769ff;
    --bs-btn-hover-bg: #0d56db;
    --bs-btn-hover-border-color: #0d56db;
}
.app-public {
    background:
        radial-gradient(circle at 82% 25%, rgba(23,105,255,.22), transparent 25%),
        linear-gradient(145deg, #07111f, #0b1c34 72%, #0d2748);
}

/* Subtle helpdesk request-flow animation on the application header */
.app-header::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            transparent 0%,
            rgba(55,185,255,.22) 18%,
            #37b9ff 29%,
            #ffffff 31%,
            #1769ff 34%,
            rgba(23,105,255,.22) 48%,
            transparent 64%);
    background-size: 220% 100%;
    filter: drop-shadow(0 0 4px rgba(55,185,255,.55));
    opacity: .82;
    animation: helpdesk-request-flow 7s linear infinite;
}
.app-header::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    background: #dff7ff;
    box-shadow: 0 0 0 3px rgba(55,185,255,.13), 0 0 10px #37b9ff;
    opacity: 0;
    animation: helpdesk-request-pulse 7s ease-in-out infinite;
}
@keyframes helpdesk-request-flow {
    from { background-position: 110% 0; }
    to { background-position: -110% 0; }
}
@keyframes helpdesk-request-pulse {
    0%, 8% { left: 8%; opacity: 0; transform: scale(.7); }
    14% { opacity: .9; }
    48% { opacity: .7; transform: scale(1); }
    86% { left: calc(100% - 8px); opacity: .9; transform: scale(.8); }
    94%, 100% { left: calc(100% - 8px); opacity: 0; transform: scale(.55); }
}
@media (prefers-reduced-motion: reduce) {
    .app-header::before, .app-header::after { animation: none; }
    .app-header::before { background: linear-gradient(90deg, transparent, rgba(55,185,255,.75), transparent); opacity: .55; }
    .app-header::after { display: none; }
}

/* More visible central helpdesk data bus */
@media (min-width: 992px) {
    .app-header::before {
        top: calc(50% - 3px);
        right: 34%;
        left: 28%;
        width: auto;
        height: 1px;
        background: repeating-linear-gradient(90deg,
            rgba(55,185,255,.12) 0 5px,
            rgba(55,185,255,.8) 5px 18px,
            transparent 18px 27px);
        background-size: 54px 100%;
        box-shadow: 0 6px 0 rgba(55,185,255,.28);
        filter: drop-shadow(0 0 4px rgba(55,185,255,.42));
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
        mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
        opacity: .82;
        animation: helpdesk-data-bus 3.8s linear infinite;
    }
    .app-header::after {
        top: calc(50% - 6px);
        left: 30%;
        width: 12px;
        height: 7px;
        border: 1px solid rgba(255,255,255,.85);
        border-radius: 2px;
        background: #37b9ff;
        box-shadow: 0 0 0 3px rgba(55,185,255,.12), 0 0 13px rgba(55,185,255,.95);
        animation: helpdesk-data-packet 5.4s ease-in-out infinite;
    }
}
@keyframes helpdesk-data-bus {
    from { background-position: 0 0; }
    to { background-position: 54px 0; }
}
@keyframes helpdesk-data-packet {
    0%, 7% { left: 30%; opacity: 0; transform: scaleX(.65); }
    13% { opacity: .95; }
    50% { opacity: .85; transform: scaleX(1); }
    88% { left: calc(66% - 12px); opacity: .95; transform: scaleX(.8); }
    94%, 100% { left: calc(66% - 12px); opacity: 0; transform: scaleX(.55); }
}
@media (max-width: 991px) {
    .app-header::before { top: 0; right: 0; left: 0; height: 2px; }
    .app-header::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .app-header::before { animation: none !important; }
    .app-header::after { display: none !important; }
}

/* Professional ServiceDesk sidebar status */
.app-sidebar { display: flex; flex-direction: column; }
.sidebar-navigation { flex: 1 1 auto; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #29445f transparent; }
.sidebar-service-status {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    gap: .7rem;
    align-items: center;
    margin: 10px 12px 14px;
    padding: .75rem;
    overflow: hidden;
    border: 1px solid rgba(96,165,250,.2);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(23,105,255,.12), rgba(55,185,255,.035));
}
.sidebar-service-status::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -43px;
    width: 95px;
    height: 95px;
    border: 1px solid rgba(55,185,255,.1);
    border-radius: 50%;
    box-shadow: 0 0 0 15px rgba(55,185,255,.025);
}
.sidebar-support-icon {
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid rgba(96,165,250,.28);
    border-radius: 9px;
    color: #70c9ff;
    background: rgba(7,17,31,.42);
    font-size: 1rem;
}
.sidebar-support-icon::before {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1px solid transparent;
    border-top-color: rgba(55,185,255,.6);
    border-right-color: rgba(23,105,255,.25);
    border-radius: 12px;
    animation: sidebar-support-scan 8s linear infinite;
}
.sidebar-support-icon span {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 8px;
    height: 8px;
    border: 2px solid #0a1728;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74,222,128,.75);
}
.sidebar-status-copy { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; }
.sidebar-status-copy strong { color: #f8fafc; font-size: .72rem; font-weight: 700; letter-spacing: .025em; }
.sidebar-status-copy small { display: flex; gap: .35rem; align-items: center; margin-top: .13rem; color: #a7f3d0; font-size: .64rem; }
.sidebar-status-copy small i { width: 5px; height: 5px; border-radius: 50%; background: #4ade80; }
.sidebar-status-copy > span { display: flex; gap: .3rem; align-items: center; margin-top: .2rem; color: #7f91a7; font-size: .58rem; }
.sidebar-status-copy > span i { color: #60a5fa; }
@keyframes sidebar-support-scan { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sidebar-support-icon::before { animation: none; } }

/* Subtle animated binary-code texture across the full sidebar. */
.app-sidebar {
    overflow: hidden;
    isolation: isolate;
}
.app-sidebar::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: -96px 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='248' height='192' viewBox='0 0 248 192'%3E%3Cg fill='%2360a5fa' fill-opacity='.15' font-family='monospace' font-size='11' letter-spacing='4'%3E%3Ctext x='9' y='18'%3E01001101 10110100%3C/text%3E%3Ctext x='34' y='42'%3E10100110 01011001%3C/text%3E%3Ctext x='2' y='66'%3E11010010 00101101%3C/text%3E%3Ctext x='48' y='90'%3E00110101 11001010%3C/text%3E%3Ctext x='17' y='114'%3E10011001 01100110%3C/text%3E%3Ctext x='58' y='138'%3E01101011 10010100%3C/text%3E%3Ctext x='5' y='162'%3E10110001 01001110%3C/text%3E%3Ctext x='39' y='186'%3E01010110 10101001%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-position: center 0;
    animation: sidebar-binary-drift 32s linear infinite;
}
.app-sidebar > * {
    position: relative;
    z-index: 1;
}
@keyframes sidebar-binary-drift {
    to { background-position: center 192px; }
}
@media (prefers-reduced-motion: reduce) {
    .app-sidebar::before { animation: none; }
}

/* Customer portal events */
.customer-event-card { max-width: 100%; }
.customer-event-form textarea { min-height: 105px; resize: vertical; }
.timeline-entry-email:has(.bi-person-plus) { border-left-color: #7c3aed; background: #faf8ff; }
.timeline-entry-email:has(.bi-person-plus) .timeline-type i { color: #6d28d9; background: #ede9fe; }
#moreCustomerEvents { display: grid; gap: .65rem; }
#moreCustomerEvents:not(.show) { display: none; }

/* Floating AI assistant on staff ticket detail */
.ticket-ai { position: fixed; z-index: 1060; right: 22px; bottom: 22px; font-family: Roboto, system-ui, sans-serif; }
.ticket-ai-launcher { display: flex; gap: .55rem; align-items: center; padding: .72rem 1rem; border: 1px solid rgba(96,165,250,.55); border-radius: 999px; color: #fff; background: linear-gradient(135deg, #1769ff, #5746d9); box-shadow: 0 14px 34px rgba(23,57,112,.3); font-weight: 600; }
.ticket-ai-launcher:hover { transform: translateY(-1px); box-shadow: 0 16px 38px rgba(23,57,112,.38); }
.ticket-ai-panel { width: min(390px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 44px)); overflow: hidden; border: 1px solid rgba(98,123,158,.35); border-radius: 16px; color: #172033; background: #f8fafc; box-shadow: 0 22px 60px rgba(15,35,70,.34); }
.ticket-ai-panel[hidden] { display: none; }
.ticket-ai-header { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1rem; color: #fff; background: linear-gradient(135deg, #112b55, #1769ff); }
.ticket-ai-header div { display: flex; min-width: 0; flex-direction: column; }
.ticket-ai-header strong { display: flex; gap: .45rem; align-items: center; }
.ticket-ai-header small { margin-top: .12rem; color: #cfe2ff; font: 400 .72rem/1.2 "Share Tech Mono", monospace; }
.ticket-ai-header button { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #fff; background: rgba(255,255,255,.12); }
.ticket-ai-notice { padding: .48rem .85rem; border-bottom: 1px solid #dce4ef; color: #496079; background: #eef5ff; font-size: .74rem; }
.ticket-ai-messages { display: flex; min-height: 180px; max-height: 310px; flex-direction: column; gap: .65rem; padding: .85rem; overflow-y: auto; }
.ticket-ai-message { max-width: 88%; padding: .65rem .75rem; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; line-height: 1.45; }
.ticket-ai-message.assistant { align-self: flex-start; border: 1px solid #dbe4ef; background: #fff; }
.ticket-ai-message.user { align-self: flex-end; color: #fff; background: #1769ff; }
.ticket-ai-message.error { align-self: flex-start; border: 1px solid #fecaca; color: #991b1b; background: #fff1f2; }
.ticket-ai-proposal { margin: 0 .85rem .75rem; padding: .75rem; border: 1px solid #b8d3ff; border-radius: 11px; background: #eef5ff; }
.ticket-ai-proposal[hidden] { display: none; }
.ticket-ai-change-list { display: grid; gap: .48rem; margin: .55rem 0 .7rem; }
.ticket-ai-change-list > div { display: grid; gap: .1rem; padding-bottom: .4rem; border-bottom: 1px solid rgba(98,123,158,.18); }
.ticket-ai-change-list b { font-size: .75rem; }
.ticket-ai-change-list span { overflow-wrap: anywhere; font-size: .8rem; }
.ticket-ai-proposal-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.ticket-ai-form { display: grid; grid-template-columns: 1fr 42px; gap: .5rem; padding: .75rem .85rem .45rem; border-top: 1px solid #dce4ef; background: #fff; }
.ticket-ai-form textarea { min-height: 46px; max-height: 130px; resize: vertical; padding: .6rem .7rem; border: 1px solid #cbd5e1; border-radius: 10px; font-size: .86rem; }
.ticket-ai-form button { border: 0; border-radius: 10px; color: #fff; background: #1769ff; }
.ticket-ai-form button:disabled { opacity: .55; }
.ticket-ai-status { min-height: 26px; padding: .15rem .9rem .55rem; color: #66778d; background: #fff; font-size: .72rem; }
.ticket-ai.is-busy .ticket-ai-header i { animation: ticket-ai-pulse 1s ease-in-out infinite alternate; }
@keyframes ticket-ai-pulse { to { opacity: .4; transform: scale(.88); } }
@media (max-width: 560px) {
    .ticket-ai { right: 10px; bottom: 10px; left: 10px; }
    .ticket-ai-launcher { margin-left: auto; }
    .ticket-ai-panel { width: 100%; max-height: calc(100dvh - 20px); border-radius: 14px; }
    .ticket-ai-messages { max-height: 38dvh; }
}
@media print { .ticket-ai { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ticket-ai-launcher, .ticket-ai.is-busy .ticket-ai-header i { animation: none; transition: none; } }
.ticket-ai-form-actions { display: flex; flex-direction: column; gap: .3rem; }
.ticket-ai-form-actions button { width: 42px; min-height: 34px; flex: 1; }
.ticket-ai-microphone { color: #1769ff !important; background: #e8f1ff !important; }
.ticket-ai-microphone.is-listening { color: #fff !important; background: #dc3545 !important; box-shadow: 0 0 0 4px rgba(220,53,69,.14); }
.ticket-ai-voice-preview { padding: .1rem .9rem .45rem; color: #345a87; background: #fff; font-size: .72rem; }
.ticket-ai-voice-preview[hidden] { display: none; }

.ticket-dictation-card { padding: 1rem 1.15rem; border: 1px solid #bfd4f4; border-radius: 14px; background: linear-gradient(135deg, rgba(232,241,255,.9), rgba(255,255,255,.96)); box-shadow: 0 8px 24px rgba(31,78,135,.08); }
.ticket-dictation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ticket-dictation-heading p { color: #5f7085; font-size: .9rem; }
.ticket-dictation-heading .bi { color: #1769ff; }
.ticket-dictation-timer { flex: 0 0 auto; min-width: 3.8rem; padding: .3rem .55rem; border-radius: 8px; color: #264b78; background: rgba(255,255,255,.8); text-align: center; font: 400 .9rem "Share Tech Mono", monospace; }
.ticket-dictation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1rem; }
.ticket-dictation-status { color: #52677f; font-size: .86rem; }
.ticket-dictation-card.is-recording { border-color: #dc3545; }
.ticket-dictation-card.is-recording .ticket-dictation-timer { color: #fff; background: #dc3545; animation: ticket-dictation-pulse 1s ease-in-out infinite alternate; }
.ticket-dictation-card textarea { resize: vertical; min-height: 7.5rem; }
@keyframes ticket-dictation-pulse { to { opacity: .72; } }
@media (max-width: 560px) { .ticket-dictation-heading { display: block; } .ticket-dictation-timer { display: inline-block; margin-top: .7rem; } .ticket-dictation-actions .btn { width: 100%; } }
@media print { .ticket-dictation-card { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ticket-dictation-card.is-recording .ticket-dictation-timer { animation: none; } }

.ticket-country-flag { display: inline-block; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 1.35rem; line-height: 1; vertical-align: -.12em; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .16)); }


/* Mobile workspace: touch-friendly navigation, forms and ticket cards. */
@media (max-width: 767px) {
 html,body{overflow-x:hidden} body{min-width:0}
 .app-header{position:sticky;z-index:900;top:0;gap:.55rem;height:58px;padding:0 max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left))}
 .app-header>.d-flex{min-width:0;gap:.45rem!important}.app-header>.d-flex:first-child strong{max-width:34vw;overflow:hidden;font-size:.83rem;text-overflow:ellipsis;white-space:nowrap}
 .mobile-menu-button,.app-header .btn-sm{display:inline-flex;width:40px;min-width:40px;height:40px;padding:0;align-items:center;justify-content:center}
 .language-switcher{flex:0 0 auto}.password-change-label,.logout-label,.user-name{display:none}
 .app-main{width:100%;padding:14px max(10px,env(safe-area-inset-right)) calc(78px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
 .content-card{border-radius:10px}.content-card>.card-body,.content-card>.card-header,.work-log-card .card-body{padding:1rem!important}
 .page-title-row{margin-bottom:1rem!important;gap:.75rem}.page-title-row h1{margin-bottom:.15rem;font-size:1.18rem}.page-title-row p{font-size:.82rem}
 .page-title-row>.d-flex{display:grid!important;grid-template-columns:1fr 1fr}.page-title-row>.d-flex>*,.page-title-row>.d-flex form,.page-title-row>.d-flex .btn{width:100%;min-width:0}
 .page-title-row>.d-flex form.d-flex{grid-column:1/-1;display:grid!important;grid-template-columns:1fr auto}
 .btn,.form-control,.form-select,.input-group-text{min-height:44px}textarea.form-control{min-height:112px}.form-label{margin-bottom:.3rem}.row.g-3{--bs-gutter-y:.75rem}.alert{padding-right:2.8rem;overflow-wrap:anywhere}
 .input-group{align-items:stretch;flex-direction:column}.input-group>.form-control,.input-group>.form-select,.input-group>.btn{width:100%;margin-left:0!important;border-radius:.375rem!important}.input-group>.btn{margin-top:.5rem}
 .ticket-mobile-table.table-responsive{overflow:visible}.ticket-mobile-table table,.ticket-mobile-table tbody{display:block}.ticket-mobile-table thead{display:none}
 .ticket-mobile-table .ticket-list-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.55rem .8rem;margin:0 0 .75rem;padding:.85rem;border:1px solid #dce3ec;border-left:4px solid var(--ticket-row-type-color,#94a3b8);border-radius:10px;background:#fff;box-shadow:0 3px 12px rgba(15,35,70,.06)}
 .ticket-mobile-table .ticket-list-row>td{display:block;min-width:0;padding:0;border:0;overflow-wrap:anywhere;font-size:.82rem}
 .ticket-mobile-table .ticket-list-row>td::before{content:attr(data-label);display:block;margin-bottom:.12rem;color:#7b8999;font-size:.62rem;font-weight:700;letter-spacing:.045em;text-transform:uppercase}
 .ticket-mobile-table .ticket-list-row>td:nth-child(1){grid-column:1;grid-row:1}.ticket-mobile-table .ticket-list-row>td:nth-child(1)::before,.ticket-mobile-table .ticket-list-row>td:nth-child(2)::before{display:none}
 .ticket-mobile-table .ticket-list-row>td:nth-child(2){grid-column:1/-1;grid-row:1;padding-left:2.1rem;align-self:center}
 .ticket-mobile-table .ticket-list-row>td:nth-child(3),.ticket-mobile-table .ticket-list-row>td:last-child{grid-column:1/-1}.ticket-mobile-table .ticket-list-row>td:nth-child(3){font-size:.96rem;font-weight:600}
 .ticket-mobile-table .ticket-list-row>td:last-child{margin-top:.15rem}.ticket-mobile-table .ticket-list-row>td:last-child form,.ticket-mobile-table .ticket-list-row>td:last-child .btn,.ticket-mobile-table .ticket-list-row>td:last-child .badge{width:100%}.ticket-mobile-table .ticket-list-row>td:last-child .badge{padding:.65rem}
 .ticket-mobile-table tbody>tr:not(.ticket-list-row){display:block}
 .ticket-info-card dl{gap:.45rem .7rem}.ticket-info-card dt{font-size:.58rem}.ticket-info-card dd{min-height:36px;margin:0;padding:.42rem .5rem}
 .work-log-notify{min-height:44px;padding:.45rem .2rem}.work-log-notify .form-check-input{width:1.25rem;height:1.25rem}.work-log-attachments,.work-log-attachment-upload{width:100%}.attachment-chip{max-width:100%}
 .timeline-time{padding-left:0}.timeline-entry-body{font-size:.84rem;line-height:1.55}.pagination{flex-wrap:wrap;gap:.25rem}.pagination .page-link{min-width:42px;min-height:42px;display:grid;place-items:center}
 .ticket-ai{bottom:calc(10px + env(safe-area-inset-bottom))}.ticket-ai-launcher{min-height:48px}.ticket-ai-panel{max-height:calc(100dvh - 20px - env(safe-area-inset-bottom))}.ticket-ai-form textarea{font-size:16px}
}
@media(max-width:380px){.app-header>.d-flex:first-child strong{display:none}.ticket-mobile-table .ticket-list-row{grid-template-columns:1fr}.ticket-mobile-table .ticket-list-row>td{grid-column:1/-1!important}.ticket-mobile-table .ticket-list-row>td:nth-child(1),.ticket-mobile-table .ticket-list-row>td:nth-child(2){grid-row:1}.ticket-info-card dl{grid-template-columns:1fr}}


/* Compact, action-first dashboard on phones. */
.dashboard-mobile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}
.dashboard-mobile-grid .stat-card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
.dashboard-mobile-grid .stat-card:hover,
.dashboard-mobile-grid .stat-card:focus-visible {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(5,11,24,.17);
}
.dashboard-new-ticket { display: none !important; border-top-color: #1769ff; background: linear-gradient(135deg,#1769ff,#0d4fc4); }
.dashboard-new-ticket .stat-label,
.dashboard-new-ticket .dashboard-tile-action,
.dashboard-new-ticket .stat-icon { color: #fff; }
.dashboard-new-ticket .stat-icon { background: rgba(255,255,255,.16); }
.dashboard-tile-action { margin-top: .45rem; font-size: .75rem; opacity: .82; }

@media (max-width: 767px) {
    .dashboard-page-title { display: none !important; }
    .dashboard-mobile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin-bottom: 0 !important; }
    .dashboard-mobile-grid .stat-card { min-height: 112px; padding: .8rem; border-top-width: 3px; border-radius: 9px; }
    .dashboard-mobile-grid .stat-icon { top: .65rem; right: .65rem; width: 32px; height: 32px; border-radius: 8px; font-size: .9rem; }
    .dashboard-mobile-grid .stat-label { max-width: calc(100% - 34px); font-size: .72rem; line-height: 1.2; }
    .dashboard-mobile-grid .stat-value { margin-top: .45rem; font-size: 1.45rem; }
    .dashboard-mobile-grid .stat-type-counts { gap: .2rem; margin-top: .45rem; padding-top: .4rem; }
    .dashboard-mobile-grid .stat-type-count { min-width: 1.75rem; padding: .16rem .25rem; }
    .dashboard-mobile-grid .stat-type-count .bi { display: none; }
    .dashboard-new-ticket { display: block !important; grid-column: 1/-1; min-height: 86px !important; }
    .dashboard-new-ticket .stat-label { font-size: .9rem; }
    .dashboard-secondary { display: none !important; }
}


/* Collapsible ticket filters on phones. */
.ticket-filter-toggle { display: none; }
@media (min-width: 768px) {
    .ticket-filter-panel.collapse { display: block !important; }
}
@media (max-width: 767px) {
    .ticket-filter-toggle {
        display: inline-flex;
        width: auto;
        min-height: 38px;
        gap: .45rem;
        align-items: center;
        padding: .4rem .7rem;
        font-size: .78rem;
    }
    .ticket-filter-toggle .badge { font-size: .6rem; font-weight: 600; }
    .ticket-filter-chevron { margin-left: .1rem; transition: transform .2s ease; }
    .ticket-filter-toggle[aria-expanded="true"] .ticket-filter-chevron { transform: rotate(180deg); }
    .ticket-filter-panel { margin-bottom: .75rem !important; }
    .ticket-filter-panel.collapsing { transition-duration: .2s; }
    .ticket-filter-panel .ticket-filter-actions { display: grid !important; grid-template-columns: 1fr auto; }
    .ticket-filter-panel .ticket-filter-actions .btn { min-height: 42px; }
}


/* Visually de-emphasize completed and waiting ticket rows. */
.ticket-row-muted > td {
    color: #8a96a6 !important;
}
.ticket-row-muted > td a:not(.ticket-number-link):not(.btn),
.ticket-row-muted .priority-badge,
.ticket-row-muted .ticket-type-badge {
    color: #8a96a6 !important;
    animation: none !important;
}
.ticket-row-muted > td,
.ticket-row-muted > td a:not(.btn) {
    animation: none !important;
}
.ticket-row-muted .ticket-number-link {
    color: #1d4f91 !important;
}
.ticket-row-muted .ticket-number-link:hover,
.ticket-row-muted .ticket-number-link:focus {
    color: #1d4ed8 !important;
}
.sidebar-module-title { margin-bottom: 2px !important; }
.sidebar-subnavigation { margin: 0 0 10px 20px; padding-left: 12px; border-left: 1px solid rgba(148,163,184,.35); }
.sidebar-subnavigation a { padding: 8px 10px; margin-bottom: 2px; font-size: .9rem; gap: 8px; }
.sidebar-subnavigation a i { width: 16px; font-size: .9rem; }


.sidebar-module-header { position: relative; }
.sidebar-navigation .sidebar-module-toggle { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 2px; padding: 12px 14px; border: 0; border-radius: 9px; color: #cbd5e1; background: transparent; text-align: left; transition: background .2s, color .2s; }
.sidebar-navigation .sidebar-module-toggle:hover, .sidebar-navigation .sidebar-module-toggle:focus-visible { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-navigation .sidebar-module-toggle .sidebar-toggle-chevron { width: auto; margin-left: auto; transition: transform .2s; }
.sidebar-subnavigation { display: none; }
.sidebar-module.expanded .sidebar-subnavigation { display: block; }
.sidebar-module.expanded .sidebar-toggle-chevron { transform: rotate(180deg); }
