html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.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: 60px;
    padding-top: 72px;
}

/* Navigation improvements */
.site-navbar {
    z-index: 1030;
    width: 100%;
    max-width: 100vw;
    --site-nav-surface: #f8f9fa;
    --site-nav-panel-surface: #ffffff;
    --site-nav-border: #d8dee4;
    --site-nav-text: #314454;
    --site-nav-muted: #6c7883;
    --site-nav-primary: #0d6efd;
    --site-nav-primary-soft: #e7f1ff;
}

.site-navbar > .container-fluid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 60px;
    flex-wrap: nowrap;
    padding-right: clamp(0.75rem, 2vw, 1.5rem);
    padding-left: clamp(0.75rem, 2vw, 1.5rem);
}

.site-navbar .navbar-brand,
.site-navbar .nav-link {
    white-space: nowrap;
}

.site-navbar .navbar-brand {
    min-width: 0;
}

.site-navbar .navbar-toggler {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
}

.site-navbar-toggler-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.site-navbar .navbar-collapse {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.site-nav-panel {
    width: 100%;
    min-width: 0;
}

.site-nav-right {
    min-width: 0;
}

.site-nav-panel-header,
.site-nav-section-heading,
.site-nav-admin-compact,
.site-nav-compact-only {
    display: none;
}

.site-nav-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.site-nav-label {
    min-width: 0;
}

.site-nav-danger-link,
.site-nav-danger-link .site-nav-icon {
    color: #845b61 !important;
}

.site-nav-account-content {
    display: flex;
    align-items: center;
}

.site-account-nav {
    align-items: center;
}

.site-account-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
}

@media (min-width: 1600px) {
    .site-navbar .navbar-collapse,
    .site-nav-panel,
    .site-nav-section,
    .site-nav-right,
    .site-nav-primary-section .site-nav-grid,
    .site-nav-admin-desktop,
    .site-nav-account-content,
    .site-account-nav {
        display: flex !important;
        align-items: center;
    }

    .site-nav-panel {
        gap: 0.2rem;
    }

    .site-nav-right {
        flex: 0 0 auto;
        gap: 0.25rem;
        margin-left: auto;
    }

    .site-navbar .navbar-collapse {
        width: auto;
    }

    .site-nav-section {
        flex: 0 0 auto;
    }

    .site-nav-context-section {
        min-width: 0;
        margin-left: 0;
    }

    .site-nav-account-section {
        margin-left: 0.25rem;
    }

    .site-nav-primary-section .site-nav-grid,
    .site-nav-admin-desktop,
    .site-account-nav {
        flex-direction: row;
    }

    .site-navbar .site-nav-link,
    .site-account-nav .nav-link {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        min-height: 44px;
        padding: 0.45rem 0.55rem;
        color: var(--site-nav-text);
        border: 1px solid transparent;
        border-radius: 0.55rem;
    }

    .site-navbar .site-nav-link:hover,
    .site-navbar .site-nav-link:focus-visible,
    .site-account-nav .nav-link:hover,
    .site-account-nav .nav-link:focus-visible {
        color: #1f3546;
        background-color: #e8edf1;
        border-color: #c6d0d8;
    }

    .site-navbar .site-nav-link.active {
        color: #0a58ca;
        background-color: var(--site-nav-primary-soft);
        border-color: #b6d4fe;
    }

    .site-navbar .site-nav-link .site-nav-icon,
    .site-account-nav .site-nav-icon,
    .site-navbar #notificationDropdown .site-nav-icon {
        width: 1.9rem;
        height: 1.9rem;
        color: inherit;
        background-color: rgba(13, 110, 253, 0.08);
        border-radius: 0.5rem;
    }

    .site-navbar .site-nav-link.active .site-nav-icon {
        background-color: rgba(13, 110, 253, 0.14);
    }

    .site-account-nav .dropdown-menu,
    .site-nav-admin-desktop .dropdown-menu {
        position: absolute;
        margin-top: 0.45rem;
    }
}

@media (max-width: 1599.98px) {
    body.site-navigation-open {
        overflow: hidden;
    }

    .site-navbar > .container-fluid {
        flex-wrap: nowrap;
    }

    .site-navbar .navbar-toggler {
        display: inline-flex;
        color: #4f5e69;
        background-color: #fff;
        border: 2px solid #6c757d;
        border-radius: 0.55rem;
    }

    .site-navbar .navbar-toggler:hover,
    .site-navbar .navbar-toggler:focus-visible,
    .site-navbar .navbar-toggler[aria-expanded="true"] {
        color: #0a58ca;
        background-color: var(--site-nav-primary-soft);
        border-color: #0d6efd;
    }

    .site-navbar .navbar-collapse {
        position: fixed;
        top: var(--site-navbar-height, 61px);
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: none;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        color: var(--site-nav-text);
        background-color: var(--site-nav-panel-surface);
        border-top: 1px solid var(--site-nav-border);
        box-shadow: 0 1rem 2rem rgba(31, 45, 61, 0.16);
    }

    .site-navbar .navbar-collapse.collapsing {
        height: calc(100dvh - var(--site-navbar-height, 61px)) !important;
        transition: none;
    }

    .site-navbar .navbar-collapse.show .site-nav-panel {
        animation: site-nav-panel-reveal 0.18s ease-out;
    }

    .site-nav-panel {
        width: min(100%, 1200px);
        min-height: 100%;
        margin: 0 auto;
        padding: 0 1rem 2rem;
    }

    .site-nav-right {
        display: contents;
    }

    .site-nav-panel-header {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 58px;
        margin: 0 -1rem 0.75rem;
        padding: 0.4rem 1rem;
        background-color: rgba(255, 255, 255, 0.97);
        border-bottom: 1px solid var(--site-nav-border);
    }

    .site-nav-panel-title {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 1rem;
        font-weight: 600;
        color: #34495a;
    }

    .site-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        color: #53636f;
        background-color: transparent;
        border: 1px solid transparent;
        border-radius: 0.55rem;
    }

    .site-nav-close:hover,
    .site-nav-close:focus-visible {
        color: #0a58ca;
        background-color: var(--site-nav-primary-soft);
        border-color: #b6d4fe;
    }

    .site-nav-section {
        margin-top: 1.25rem;
    }

    .site-nav-section-heading {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin: 0 0 0.65rem;
        color: var(--site-nav-muted);
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.4;
    }

    .site-nav-section-heading::after {
        height: 1px;
        flex: 1 1 auto;
        content: "";
        background-color: var(--site-nav-border);
    }

    .site-nav-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    .site-nav-admin-desktop {
        display: none;
    }

    .site-nav-admin-compact {
        display: grid;
    }

    .site-navbar .site-nav-grid .nav-item,
    .site-account-nav .nav-item {
        min-width: 0;
    }

    .site-navbar .site-nav-grid .site-nav-link,
    .site-account-nav .nav-link,
    .site-navbar #notificationDropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.55rem;
        width: 100%;
        min-width: 0;
        min-height: 102px;
        padding: 0.75rem 0.5rem;
        color: var(--site-nav-text) !important;
        text-align: center;
        background-color: transparent;
        border: 1px solid transparent;
        border-radius: 0.75rem;
    }

    .site-navbar .site-nav-grid .site-nav-link:hover,
    .site-navbar .site-nav-grid .site-nav-link:focus-visible,
    .site-account-nav .nav-link:hover,
    .site-account-nav .nav-link:focus-visible,
    .site-navbar #notificationDropdown:hover,
    .site-navbar #notificationDropdown:focus-visible {
        color: #0a58ca !important;
        background-color: #f1f6fc;
        border-color: #c8d9ee;
    }

    .site-navbar .site-nav-grid .site-nav-link.active {
        color: #0a58ca !important;
        background-color: var(--site-nav-primary-soft);
        border-color: #b6d4fe;
    }

    .site-navbar .site-nav-grid .site-nav-icon,
    .site-account-nav .site-nav-icon,
    .site-navbar #notificationDropdown .site-nav-icon {
        position: relative;
        width: 3.25rem;
        height: 3.25rem;
        color: #526879;
        background-color: #f0f3f6;
        border: 1px solid #e2e7eb;
        border-radius: 50%;
    }

    .site-navbar .site-nav-grid .site-nav-icon .bi,
    .site-account-nav .site-nav-icon .bi,
    .site-navbar #notificationDropdown .site-nav-icon .bi {
        font-size: 1.35rem;
    }

    .site-navbar .site-nav-grid .site-nav-link:hover .site-nav-icon,
    .site-navbar .site-nav-grid .site-nav-link:focus-visible .site-nav-icon,
    .site-navbar .site-nav-grid .site-nav-link.active .site-nav-icon,
    .site-account-nav .nav-link:hover .site-nav-icon,
    .site-account-nav .nav-link:focus-visible .site-nav-icon,
    .site-navbar #notificationDropdown:hover .site-nav-icon,
    .site-navbar #notificationDropdown:focus-visible .site-nav-icon {
        color: #0a58ca;
        background-color: #e0edff;
        border-color: #b6d4fe;
    }

    .site-navbar .site-nav-danger-link,
    .site-navbar .site-nav-danger-link .site-nav-icon {
        color: #845b61 !important;
    }

    .site-navbar .site-nav-danger-link:hover,
    .site-navbar .site-nav-danger-link:focus-visible {
        color: #71454c !important;
        background-color: #f8f1f2 !important;
        border-color: #dcc7ca !important;
    }

    .site-navbar .site-nav-danger-link:hover .site-nav-icon,
    .site-navbar .site-nav-danger-link:focus-visible .site-nav-icon {
        color: #71454c !important;
        background-color: #f2e5e7 !important;
        border-color: #dcc7ca !important;
    }

    .site-nav-label {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }

    .site-nav-compact-only {
        display: inline;
    }

    .site-nav-context-section .ticket-navbar-actions {
        width: 100%;
        padding: 0.75rem;
        align-items: center;
        justify-content: flex-start;
        background-color: #f8fafb;
        border: 1px solid var(--site-nav-border);
        border-radius: 0.75rem;
    }

    .site-nav-context-section .ticket-navbar-count {
        flex: 1 1 22rem;
        margin-right: 0.5rem;
        white-space: normal;
    }

    .site-nav-account-content {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
        align-items: stretch;
    }

    .site-account-nav {
        display: contents;
    }

    .site-account-nav .form-inline {
        height: 100%;
    }

    .site-account-nav .form-inline .nav-link {
        height: 100%;
    }

    .site-account-menu {
        position: relative;
    }

    .site-account-menu .dropdown-menu {
        position: absolute;
        top: auto;
        right: 0;
        bottom: calc(100% + 0.25rem);
        left: auto;
        width: max-content;
        min-width: 13rem;
        margin: 0;
    }

    .site-notification-nav-item {
        position: static;
        min-width: 0;
    }

    .site-navbar .notification-dropdown {
        position: fixed !important;
        top: calc(var(--site-navbar-height, 61px) + 0.75rem) !important;
        right: 0.75rem !important;
        left: auto !important;
        margin: 0 !important;
        transform: none !important;
    }

    .site-navbar #notificationDropdown {
        height: 100%;
        border-width: 1px;
    }

    .site-navbar #notificationDropdown.has-unread {
        color: #0a58ca !important;
        background-color: #f1f6fc;
        border-color: #c8d9ee;
        box-shadow: none;
    }

    @keyframes site-nav-panel-reveal {
        from {
            opacity: 0;
            transform: translateY(-0.4rem);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (min-width: 576px) and (max-width: 1599.98px) {
    .site-nav-grid,
    .site-nav-account-content {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) and (max-width: 1599.98px) {
    .site-nav-admin-compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-navbar .navbar-collapse.show .site-nav-panel {
        animation: none;
    }
}

.ticket-navbar-page-size {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.75rem;
}

.ticket-navbar-page-size .form-label {
    font-size: 0.85rem;
}

.ticket-navbar-page-size .form-select {
    width: auto;
    min-width: 72px;
}

.navbar-brand {
    font-size: 1.25rem;
}

.nav-link {
    transition: background-color 0.2s ease;
}

    .nav-link:hover {
        background-color: rgba(0, 0, 0, 0.05);
        border-radius: 0.25rem;
    }

/* Card header improvements */
.card-header h5 {
    margin-bottom: 0;
}

/* Responsive button groups */
.gap-2 {
    gap: 0.5rem !important;
}

/* Maximize content width */
.container-fluid {
    max-width: 100%;
}

/* Reduce card margins for better space utilization */
.card {
    margin-bottom: 1rem;
}

/* Improve table responsiveness */
.table-responsive {
    overflow-x: auto;
}

/* Custom badge styles - Low saturation colors */
.badge-custom {
    display: inline-block;
    padding: 0.45em 0.85em;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid rgba(31, 41, 55, 0.22);
    border-radius: 0.45rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.ticket-list-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6.5rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.95rem;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: middle;
}

.ticket-list-badge-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-requester-company,
.ticket-requester-user {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status badges */
.badge-status-new {
    background-color: #9ca3af;
    color: #1f2937;
}

.badge-status-accepted {
    background-color: #cbd5e1;
    color: #1e293b;
}

.badge-status-inprogress {
    background-color: #93c5fd;
    color: #1e3a8a;
}

.badge-status-waiting {
    background-color: #d1d5db;
    color: #374151;
}

.badge-status-done {
    background-color: #86efac;
    color: #14532d;
}

.badge-status-closed {
    background-color: #6b7280;
    color: #f9fafb;
}

.badge-status-default {
    background-color: #e5e7eb;
    color: #374151;
}

/* Priority badges */
.badge-priority-high {
    background-color: #fca5a5;
    color: #7f1d1d;
}

.badge-priority-medium {
    background-color: #fcd34d;
    color: #78350f;
}

.badge-priority-low {
    background-color: #d1d5db;
    color: #374151;
}

.badge-priority-default {
    background-color: #e5e7eb;
    color: #374151;
}

/* Category badges */
.badge-category {
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-category.ticket-list-badge {
    min-height: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    white-space: normal;
}

.badge-category .ticket-list-badge-text {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

/* Login page styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.login-card {
    max-width: 450px;
    width: 100%;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .login-header h1 {
        font-size: 1.75rem;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 0.5rem;
    }

    .login-header p {
        color: #6b7280;
        font-size: 0.95rem;
    }

.login-form .form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.login-form .form-control {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}

    .login-form .form-control:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.login-form .btn-primary {
    padding: 0.75rem;
    font-weight: 500;
    background-color: #3b82f6;
    border-color: #3b82f6;
}

    .login-form .btn-primary:hover {
        background-color: #2563eb;
        border-color: #2563eb;
    }

.login-links {
    margin-top: 1.5rem;
    text-align: center;
}

    .login-links a {
        color: #3b82f6;
        text-decoration: none;
        font-size: 0.9rem;
    }

        .login-links a:hover {
            text-decoration: underline;
        }

/* Ticket list improvements */
.ticket-row:hover {
    background-color: #f8f9fa;
}

.ticket-row {
    transition: background-color 0.2s ease;
}

/* Header filter styles */
.dropdown-menu {
    z-index: 1050;
}

.dropdown-toggle::after {
    font-size: 0.7rem;
}

/* Search form toggle styles */
.card-header .btn {
    font-size: 0.875rem;
}

/* Pagination improvements */
.pagination .page-link {
    color: #6c757d;
}

.pagination .page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* BI dashboard: semantic, low-saturation colors and responsive information grouping */
.bi-dashboard {
    --bi-surface: #ffffff;
    --bi-surface-subtle: #fafbfc;
    --bi-border: #e3e7ea;
    --bi-grid: rgba(100, 116, 139, 0.065);
    --bi-text: #33414d;
    --bi-text-muted: #687681;
    --bi-blue: #aebdc8;
    --bi-blue-border: #8399aa;
    --bi-blue-soft: rgba(174, 189, 200, 0.1);
    --bi-blue-bar-soft: #dce4e9;
    --bi-green: #b4c2b8;
    --bi-green-border: #8ea092;
    --bi-green-soft: #e0e7e2;
    --bi-green-soft-border: #c2cec5;
    --bi-neutral-bar-soft: #e5e9ec;
    --bi-neutral-bar-border: #c9d1d6;
    --bi-teal: #b2c1c0;
    --bi-teal-border: #899d9b;
    --bi-teal-soft: #dfe6e5;
    --bi-slate: #b4bdc4;
    --bi-slate-border: #929ea7;
    --bi-slate-soft: #e0e5e8;
    --bi-amber: #c8bdac;
    --bi-violet: #bbb7c2;
    --bi-red: #c9b5b7;
    --bi-status-new: #dce5eb;
    --bi-status-accepted: #cbd8e1;
    --bi-status-progress: #aebfcb;
    --bi-status-answered: #c5ccd9;
    --bi-status-reconfirm: #dce4e9;
    --bi-status-done: #c6d4c9;
    width: 100%;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 8px auto 0;
    padding-bottom: 20px;
    color: var(--bi-text);
}

body.bi-dashboard-page {
    font-family: "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

.bi-dashboard-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 650;
    line-height: 1.25;
}

.bi-dashboard .card {
    margin-bottom: 0;
    border-color: var(--bi-border);
    border-radius: 0.45rem;
    box-shadow: 0 0.1rem 0.35rem rgba(51, 65, 85, 0.04);
}

.bi-filter-card .card-body {
    padding: 10px 12px;
}

.bi-filter-card .form-label {
    margin-bottom: 3px;
    color: var(--bi-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.bi-filter-card .form-control,
.bi-filter-card .form-select,
.bi-filter-card .btn {
    min-height: 38px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.85rem;
}

.bi-kpi-panel {
    min-width: 0;
    height: 100%;
}

.bi-kpi-grid {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bi-kpi-grid .card {
    grid-column: span 2;
    min-width: 0;
    min-height: 0;
    border-left-width: 3px;
}

.bi-kpi-grid .card:nth-child(n + 4) {
    grid-column: span 3;
}

.bi-kpi-grid .card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
}

.bi-kpi-grid .card-title {
    margin: 0;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
}

.bi-kpi-value {
    flex: 0 0 auto;
    font-size: clamp(1.35rem, 1.8vw, 1.8rem);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
}

.bi-card-primary {
    background-color: #fafbfc !important;
    border-left-color: var(--bi-blue) !important;
    color: var(--bi-text) !important;
}

.bi-card-warning {
    background-color: #fbfbfa !important;
    border-left-color: var(--bi-amber) !important;
    color: var(--bi-text) !important;
}

.bi-card-success {
    background-color: #fafbfa !important;
    border-left-color: var(--bi-green) !important;
    color: var(--bi-text) !important;
}

.bi-card-danger {
    background-color: #fbfafa !important;
    border-left-color: var(--bi-red) !important;
    color: var(--bi-text) !important;
}

.bi-card-secondary {
    background-color: #fafafa !important;
    border-left-color: var(--bi-violet) !important;
    color: var(--bi-text) !important;
}

.bi-overview-grid,
.bi-detail-grid {
    display: grid;
    gap: 20px;
}

.bi-overview-grid {
    height: 190px;
    grid-template-columns: minmax(480px, 0.9fr) minmax(560px, 1.15fr);
}

.bi-detail-grid {
    height: 300px;
    grid-template-columns: minmax(320px, 0.62fr) minmax(620px, 1.55fr);
}

.bi-chart-card {
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.bi-chart-card-trend {
    min-height: 0;
}

.bi-chart-card .card-header {
    flex: 0 0 auto;
    padding: 8px 10px;
    background: var(--bi-surface-subtle);
    border-color: var(--bi-border);
}

.bi-chart-card .card-header h2 {
    margin: 0;
    overflow: hidden;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bi-chart-card .card-body {
    position: relative;
    min-height: 0;
    padding: 10px 12px 12px;
}

.bi-chart-card canvas {
    width: 100% !important;
    height: 100% !important;
}

.bi-empty-state {
    display: flex;
    height: 100%;
    min-height: 80px;
    margin: 0;
    align-items: center;
    justify-content: center;
    color: var(--bi-text-muted);
    font-size: 0.82rem;
    text-align: center;
}

.bi-breakdown-card .card-header {
    display: flex;
    min-height: 52px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.bi-breakdown-card .card-body {
    padding: 8px 12px 10px;
}

.bi-breakdown-tabs {
    display: flex;
    width: auto;
    margin-left: auto;
    gap: 4px;
}

.bi-breakdown-tabs .nav-item {
    flex: 0 0 auto;
}

.bi-breakdown-tabs .nav-link {
    width: auto;
    min-width: 88px;
    min-height: 36px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    color: var(--bi-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.bi-breakdown-tabs .nav-link:hover,
.bi-breakdown-tabs .nav-link:focus-visible {
    border-color: var(--bi-border);
    background-color: var(--bi-surface);
    color: var(--bi-text);
}

.bi-breakdown-tabs .nav-link.active {
    border-color: var(--bi-blue);
    background-color: var(--bi-blue-soft);
    color: var(--bi-text);
}

.bi-breakdown-card .tab-content,
.bi-breakdown-card .tab-pane {
    height: 100%;
}

@media (max-width: 1199.98px) {
    .bi-overview-grid,
    .bi-detail-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .bi-kpi-panel {
        height: 190px;
    }

    .bi-chart-card-trend {
        height: 240px;
    }

    .bi-status-count-card {
        height: 270px;
    }

    .bi-breakdown-card {
        height: 300px;
    }
}

@media (max-width: 767.98px) {
    .bi-dashboard {
        gap: 10px;
        margin-top: 8px;
    }

    .bi-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
        height: auto;
    }

    .bi-kpi-panel {
        height: auto;
    }

    .bi-kpi-grid .card,
    .bi-kpi-grid .card:nth-child(n + 4) {
        min-height: 68px;
        grid-column: auto;
    }

    .bi-kpi-grid .card:last-child {
        grid-column: 1 / -1;
    }

    .bi-filter-card .form-control,
    .bi-filter-card .form-select {
        font-size: 16px;
    }

    .bi-chart-card-trend {
        height: 230px;
    }

    .bi-status-count-card {
        height: 280px;
    }

    .bi-breakdown-card {
        height: 330px;
    }

    .bi-breakdown-card .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .bi-breakdown-tabs {
        display: grid;
        width: 100%;
        margin-left: 0;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .bi-breakdown-tabs .nav-link {
        width: 100%;
        min-width: 0;
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .bi-dashboard {
        gap: 8px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .bi-dashboard-title {
        font-size: 1.3rem;
    }

    .bi-filter-card .card-body {
        padding: 10px;
    }

    .bi-kpi-grid {
        gap: 6px;
    }

    .bi-kpi-grid .card {
        min-height: 64px;
    }

    .bi-kpi-grid .card-body {
        gap: 6px;
        padding: 8px 10px;
    }

    .bi-chart-card-trend {
        height: 220px;
    }

    .bi-status-count-card {
        height: 280px;
    }

    .bi-breakdown-card {
        height: 340px;
    }

    .bi-breakdown-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Dashboard card improvements - Low saturation colors */
.dashboard-card-unassigned {
    background-color: #e0e7ff;
    border-left: 4px solid #818cf8;
}

    .dashboard-card-unassigned .card-title {
        color: #4338ca;
        font-size: 1rem;
        font-weight: 600;
    }

    .dashboard-card-unassigned h2 {
        color: #3730a3;
        font-size: 2.5rem;
        font-weight: 700;
        margin: 0;
    }

.dashboard-card-delayed {
    background-color: #fee2e2;
    border-left: 4px solid #f87171;
}

    .dashboard-card-delayed .card-title {
        color: #991b1b;
        font-size: 1rem;
        font-weight: 600;
    }

    .dashboard-card-delayed h2 {
        color: #7f1d1d;
        font-size: 2.5rem;
        font-weight: 700;
        margin: 0;
    }

.dashboard-card-status,
.dashboard-card-assignee {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

    .dashboard-card-status .card-title,
    .dashboard-card-assignee .card-title {
        color: #374151;
        font-size: 1rem;
        font-weight: 600;
    }

.status-count-item,
.assignee-count-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e5e7eb;
}

    .status-count-item:last-child,
    .assignee-count-item:last-child {
        border-bottom: none;
    }

.status-label,
.assignee-label {
    font-size: 1rem;
    color: #4b5563;
    font-weight: 500;
}

.status-value,
.assignee-value {
    font-size: 1.25rem;
    color: #1f2937;
    font-weight: 700;
}

/* Table header sortable */
th[onclick] {
    user-select: none;
}

    th[onclick]:hover {
        background-color: #f3f4f6;
    }

/* Admin master color picker */
.admin-color-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-color-picker.form-control-color {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0.12rem;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.admin-color-field-sm .admin-color-picker.form-control-color {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
}

.admin-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.admin-color-picker::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}

.admin-color-picker::-moz-color-swatch {
    border: 0;
    border-radius: 50%;
}

/* 共通操作結果 Toast */
.app-toast-container {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 1080;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.65rem;
    width: min(420px, calc(100vw - 3rem));
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 0.9rem;
    border: 1px solid #d1d5db;
    border-left-width: 0.35rem;
    border-radius: 0.65rem;
    background-color: #ffffff;
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.16);
    color: #1f2937;
    pointer-events: auto;
    animation: app-toast-in 0.24s ease-out both;
}

.app-toast.is-closing { animation: app-toast-out 0.25s ease-in forwards; }
.app-toast-success { border-left-color: #198754; }
.app-toast-error { border-left-color: #dc3545; }
.app-toast-warning { border-left-color: #ffc107; }
.app-toast-info { border-left-color: #0d6efd; }

.app-toast-icon {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    font-size: 1.1rem;
}

.app-toast-success .app-toast-icon { color: #198754; }
.app-toast-success .app-toast-icon::before { content: "\\f26a"; }
.app-toast-error .app-toast-icon { color: #dc3545; }
.app-toast-error .app-toast-icon::before { content: "\\f623"; }
.app-toast-warning .app-toast-icon { color: #997404; }
.app-toast-warning .app-toast-icon::before { content: "\\f33a"; }
.app-toast-info .app-toast-icon { color: #0d6efd; }
.app-toast-info .app-toast-icon::before { content: "\\f431"; }

.app-toast-content { flex: 1 1 auto; min-width: 0; }
.app-toast-title { margin-bottom: 0.15rem; font-weight: 700; line-height: 1.25; }
.app-toast-message { line-height: 1.4; overflow-wrap: anywhere; }
.app-toast-close { flex: 0 0 auto; padding: 0.15rem; border: 0; background: transparent; color: #6c757d; line-height: 1; }
.app-toast-close:hover, .app-toast-close:focus-visible { color: #212529; }

@keyframes app-toast-in {
    from { opacity: 0; transform: translateY(0.65rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes app-toast-out {
    to { opacity: 0; transform: translateY(-0.35rem); }
}

@media (max-width: 575.98px) {
    .app-toast-container { left: 0.75rem; bottom: 0.75rem; width: calc(100vw - 1.5rem); }
}
/* Admin role management */
.admin-role-card .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.1;
}

.admin-role-card .badge .bi {
    font-size: 1.25rem;
    line-height: 1;
}

.admin-checkbox-list {
    display: grid;
    gap: 0.45rem;
    max-height: 12rem;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #ffffff;
}

.admin-check-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    margin: 0;
    padding: 0.45rem 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: #f9fafb;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.admin-check-option:hover {
    border-color: #93c5fd;
    background-color: #eff6ff;
}

.admin-check-option.is-selected,
.admin-check-option:has(.form-check-input:checked) {
    border-color: #3b82f6;
    background-color: #dbeafe;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.admin-check-option .form-check-input {
    margin: 0;
}

/* Ticket index top panel: dashboard + search collapse/fixed behavior */
.ticket-top-panels {
    margin-bottom: 0.75rem;
    isolation: isolate;
}

.ticket-sticky-stack {
    position: fixed;
    top: var(--ticket-sticky-top, 64px);
    left: var(--ticket-sticky-left, 1.5rem);
    width: var(--ticket-sticky-width, calc(100% - 3rem));
    z-index: 1010;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-sizing: border-box;
}

.ticket-sticky-stack::before {
    content: "";
    position: absolute;
    inset: -0.75rem -0.75rem -0.75rem -0.75rem;
    z-index: -1;
    pointer-events: none;
    background: rgba(248, 250, 252, 0.9);
    border-bottom: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 0 0.55rem 1.1rem rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

.ticket-sticky-spacer {
    height: 0;
}

.ticket-top-panels-spacer {
    height: 0;
}

.ticket-panels-fixed {
    position: fixed;
    top: var(--ticket-panels-top, 0);
    left: var(--ticket-panels-left, 1.5rem);
    width: var(--ticket-panels-width, calc(100% - 3rem));
    max-height: calc(100vh - var(--ticket-panels-top, 0));
    box-sizing: border-box;
    overflow: visible;
    z-index: 1020;
    transform: translateZ(0);
    isolation: isolate;
}

.ticket-panels-fixed::before {
    content: "";
    position: absolute;
    top: calc(-1 * var(--ticket-panels-top, 0px));
    right: -1.5rem;
    bottom: -0.7rem;
    left: -1.5rem;
    z-index: -1;
    pointer-events: none;
    background: rgba(248, 250, 252, 0.82);
    border-bottom: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 0 0.55rem 1.1rem rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

.ticket-control-panel {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.55rem;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0.5rem 1.4rem rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    margin-bottom: 0 !important;
    overflow: hidden;
}

.ticket-control-panel .card-header {
    background: rgba(255, 255, 255, 0.32);
    border-bottom: 1px solid rgba(217, 226, 236, 0.6);
    border-radius: 0.55rem 0.55rem 0 0;
}

.ticket-control-panel .card-body {
    padding: 0.6rem 0.75rem;
}

.ticket-search-panel-body {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.ticket-search-form {
    flex: 1 1 auto;
    min-width: 0;
}

.ticket-navbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem;
}

.ticket-navbar-count {
    margin-right: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.ticket-search-side-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-left: auto;
}

.ticket-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    color: #5f6b76;
    background: transparent;
    border-color: transparent;
}

.ticket-search-toggle:hover,
.ticket-search-toggle:focus-visible {
    color: #212529;
    background-color: rgba(0, 0, 0, 0.05);
}

.ticket-search-fixed {
    margin-bottom: 0 !important;
}

.ticket-search-compact .form-label {
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
    line-height: 1.1;
}

.ticket-search-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
    gap: 0.65rem;
    margin: 0;
}

.ticket-search-compact > div {
    width: 100%;
    max-width: none;
    padding-right: 0;
    padding-left: 0;
}

.ticket-search-keyword {
    grid-column: span 2;
}

.ticket-search-sort {
    grid-column: span 2;
}

.ticket-search-range {
    grid-column: span 2;
}

.ticket-search-range > .form-label {
    display: block;
}

.ticket-search-range-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
}

.ticket-search-range-separator {
    color: #6c757d;
}

.ticket-search-sort-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(80px, 0.8fr);
    gap: 0.5rem;
}

.ticket-search-compact .form-control-sm,
.ticket-search-compact .form-select-sm {
    min-height: 30px;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    border-color: #cfd6df;
    background-color: #ffffff;
    font-size: 0.875rem;
    border-radius: 0.35rem;
}

.ticket-search-compact .form-control-sm:focus,
.ticket-search-compact .form-select-sm:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.12rem rgba(13, 110, 253, 0.16);
}

.ticket-search-compact .form-control-sm,
.ticket-search-compact .form-select-sm {
    width: 100%;
    min-width: 0;
}

@media (min-width: 1800px) {
    .ticket-search-compact {
        grid-template-columns:
            100px
            minmax(200px, 1.8fr)
            repeat(6, minmax(90px, 1fr))
            minmax(100px, 1fr)
            minmax(220px, 2fr)
            180px
            180px;
        gap: 0.5rem;
    }

    .ticket-search-keyword,
    .ticket-search-range,
    .ticket-search-sort {
        grid-column: auto;
    }

    .ticket-search-priority {
        max-width: 110px;
    }
}

.ticket-list-card {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #d9e2ec;
    border-radius: 0.5rem;
    box-shadow: 0 0.3rem 1rem rgba(15, 23, 42, 0.06);
}

.ticket-header-panel {
    overflow: hidden;
    border: 1px solid #d9e2ec;
    border-radius: 0.55rem;
    background-color: #eef4fb;
    box-shadow: 0 0.35rem 1.2rem rgba(15, 23, 42, 0.08);
}

.ticket-header-scroll {
    overflow: hidden;
    background-color: #eef4fb;
}

.ticket-header-scroll {
    overflow: hidden;
}

.ticket-header-table {
    table-layout: fixed;
    min-width: 1460px;
    transform-origin: left top;
}

.ticket-list-toolbar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #d9e2ec;
    border-radius: 0.5rem 0.5rem 0 0;
}

.ticket-list-toolbar-fixed {
    position: fixed;
    top: var(--ticket-list-toolbar-top, 0);
    left: var(--ticket-list-toolbar-left, 1.5rem);
    width: var(--ticket-list-toolbar-width, calc(100% - 3rem));
    box-sizing: border-box;
    z-index: 1015;
    background-color: #f8f9fa;
    border: 1px solid #e5e7eb;
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.08);
}

.ticket-list-toolbar-spacer {
    height: 0;
}

.ticket-list-body {
    max-width: 100%;
    min-width: 0;
    padding: 0;
    position: relative;
}

.ticket-table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 1rem;
    background-color: #ffffff;
}

.ticket-table-scroll .table {
    margin-bottom: 0;
    vertical-align: middle;
    table-layout: fixed;
    min-width: 1460px;
}

.ticket-request-date,
.ticket-updated-date {
    display: block;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ticket-request-date {
    margin-bottom: 0.25rem;
}

.ticket-status-badges {
    margin-bottom: 0.15rem;
}

.ticket-table-scroll tbody tr {
    border-bottom-color: #e5e7eb;
}

.ticket-table-scroll tbody tr:hover,
.ticket-table-scroll tbody tr:focus-within {
    background-color: #f5f8fc;
}

.ticket-header-panel,
.ticket-header-scroll,
.ticket-header-table,
.ticket-header-table thead,
.ticket-header-table thead tr,
.ticket-header-table thead th {
    background-color: #eef4fb;
}

    .ticket-header-panel thead th {
        color: #243447;
        font-weight: 600;
        box-shadow: inset 0 1px 0 #d6e0ea, inset 0 -1px 0 #c8d4e0;
        user-select: none;
    }

.ticket-header-panel .table > :not(caption) > * > * {
    border-bottom-width: 0;
}

.ticket-sort-button,
.ticket-column-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 0.25rem;
}

.ticket-sort-button:hover {
    color: #3c596f;
}

.ticket-sort-button:focus-visible,
.ticket-number-link:focus-visible {
    outline: 2px solid #526a7a;
    outline-offset: 2px;
}

.ticket-number-link {
    color: #0b5ed7;
    font-weight: 600;
    text-underline-offset: 0.15em;
}

.ticket-delay-label {
    margin-top: 0.2rem;
    color: #842029;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ticket-table-original-head-hidden th {
    visibility: hidden;
}

.ticket-table-fixed-header {
    position: fixed;
    z-index: 1019;
    overflow: hidden;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    pointer-events: auto;
    border-bottom: 1px solid #c8d4e0;
    box-shadow: 0 0.35rem 0.8rem rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ticket-table-fixed-header .table {
    table-layout: fixed;
    margin-bottom: 0;
}

.ticket-table-fixed-header th {
    white-space: nowrap;
}

.ticket-list-pagination {
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
}

/*
 * 中間幅では9項目の横方向の読み順を維持し、
 * セル内の余白と固定幅要素を縮めて一行に収める。
 * 長い文字列は各セル内だけで折り返す。
 */
@media (max-width: 1499.98px) {
    .ticket-header-panel {
        display: none;
    }

    .ticket-table-scroll {
        overflow-x: hidden;
        padding: 0.5rem;
    }

    .ticket-table-scroll .table,
    .ticket-table-scroll tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .ticket-table-scroll colgroup {
        display: none;
    }

    .ticket-table-scroll tbody .ticket-row {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr)
            minmax(0, 1.35fr)
            minmax(0, 1fr)
            minmax(0, 1.1fr)
            minmax(0, 0.95fr)
            minmax(0, 0.95fr)
            minmax(0, 0.95fr)
            minmax(0, 1.1fr);
        align-items: start;
        width: 100%;
        margin-bottom: 0.5rem;
        overflow: visible;
        background-color: #ffffff;
        border: 1px solid #d9e2ec;
        border-radius: 0.45rem;
        box-shadow: 0 0.15rem 0.45rem rgba(15, 23, 42, 0.05);
    }

    .ticket-table-scroll tbody .ticket-row:last-child {
        margin-bottom: 0;
    }

    .ticket-table-scroll .table > tbody > .ticket-row > td {
        display: block;
        min-width: 0;
        padding: 0.45rem 0.35rem;
        font-size: 0.8125rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
        background-color: transparent;
        border-bottom: 0;
    }

    .ticket-table-scroll .ticket-row > td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.15rem;
        color: #536273;
        font-size: 0.6875rem;
        font-weight: 600;
        line-height: 1.2;
    }

    .ticket-table-scroll .ticket-list-badge {
        width: 100%;
        max-width: 6.5rem;
        min-width: 0;
        padding-right: 0.25rem;
        padding-left: 0.25rem;
        font-size: 0.8125rem;
    }

    .ticket-table-scroll .badge-category .ticket-list-badge-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ticket-table-scroll .ticket-requester-company,
    .ticket-table-scroll .ticket-requester-user {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .ticket-table-scroll .ticket-row:hover,
    .ticket-table-scroll .ticket-row:focus-within {
        background-color: #f5f8fc;
    }

    .ticket-table-scroll .ticket-row.table-danger {
        background-color: #f8d7da;
    }

    .ticket-table-scroll .ticket-assignee-name {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .ticket-table-scroll .ticket-assignee-button {
        gap: 0.2rem;
        padding: 0.35rem 0.3rem;
        font-size: 0.75rem;
    }

    .ticket-table-scroll .ticket-number-link {
        font-size: 0.75rem;
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .ticket-table-scroll tbody .ticket-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ticket-table-scroll .table > tbody > .ticket-row > td {
        padding: 0.55rem 0.6rem;
        font-size: 0.875rem;
    }

    .ticket-table-scroll .ticket-row > td::before {
        font-size: 0.75rem;
    }

    .ticket-table-scroll .ticket-assignee-name {
        white-space: normal;
    }
}

@media (max-width: 575.98px) {
    .ticket-table-scroll {
        padding: 0.5rem;
    }

    .ticket-table-scroll tbody .ticket-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 0.5rem;
    }

    .ticket-table-scroll .ticket-row > td:nth-child(3),
    .ticket-table-scroll .ticket-row > td:nth-child(5) {
        grid-column: 1 / -1;
    }
}

.dashboard-summary-grid .card {
    margin-bottom: 0;
}

.dashboard-summary-grid .card-body {
    min-height: 78px;
    padding: 0.5rem 0.7rem;
}

.dashboard-summary-grid .card-title {
    margin-bottom: 0.25rem !important;
    font-size: 0.85rem !important;
    line-height: 1.2;
}

.dashboard-summary-grid .dashboard-card-unassigned h2,
.dashboard-summary-grid .dashboard-card-delayed h2 {
    font-size: 1.65rem;
    line-height: 1.1;
}

.dashboard-count-list {
    max-height: 58px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.dashboard-summary-grid .status-count-item,
.dashboard-summary-grid .assignee-count-item {
    padding: 0.12rem 0;
    line-height: 1.2;
}

.dashboard-summary-grid .status-label,
.dashboard-summary-grid .assignee-label {
    font-size: 0.82rem;
}

.dashboard-summary-grid .status-value,
.dashboard-summary-grid .assignee-value {
    font-size: 0.95rem;
}

@media (max-width: 767.98px) {
    body {
        padding-top: 88px;
    }

    .ticket-panels-fixed {
        left: 0.75rem;
        width: calc(100% - 1.5rem);
    }

    .ticket-list-toolbar-fixed {
        left: 0.75rem;
        width: calc(100% - 1.5rem);
    }

    .ticket-control-panel .card-header > .d-flex:first-child {
        width: 100%;
    }

    .ticket-create-button {
        width: 100%;
        justify-content: center;
    }

    .ticket-navbar-page-size {
        margin: 0.5rem 0;
    }

    .ticket-navbar-actions {
        width: 100%;
    }

    .ticket-search-panel-body {
        display: block;
    }

    .ticket-search-side-actions {
        width: 100%;
        margin-top: 0.65rem;
    }

    .ticket-search-side-actions .ticket-create-button {
        width: auto;
    }

    .ticket-list-pagination > .d-flex {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticket-row,
    .ticket-sort-button {
        transition: none;
    }
}
.ticket-assignee-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    min-height: 44px;
    padding: 0.45rem 0.6rem;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
    background: transparent;
    border: 1px solid #d2dbe3;
    border-radius: 0.35rem;
}

.ticket-assignee-button:hover,
.ticket-assignee-button[aria-expanded="true"] {
    background-color: #f7f9fc;
    border-color: #cfd8e3;
}

.ticket-assignee-button:focus-visible {
    outline: 2px solid rgba(70, 95, 115, 0.42);
    outline-offset: 1px;
}

.ticket-assignee-button:disabled {
    opacity: 0.7;
}

.ticket-assignee-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-assignee-caret {
    flex: 0 0 auto;
    color: #6c757d;
    font-size: 0.6rem;
}

.ticket-assignee-menu {
    position: fixed;
    z-index: 1085;
    width: 240px;
    max-height: min(360px, calc(100vh - 16px));
    overflow-y: auto;
    padding: 0.35rem;
    background-color: #ffffff;
    border: 1px solid #cfd8e3;
    border-radius: 0.45rem;
    box-shadow: 0 0.6rem 1.4rem rgba(15, 23, 42, 0.18);
}

.ticket-assignee-menu-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 32px;
    padding: 0.25rem 0.4rem 0.4rem;
    color: #495057;
    font-size: 0.82rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

.ticket-assignee-back {
    padding: 0;
    color: #0d6efd;
    font: inherit;
    background: transparent;
    border: 0;
}

.ticket-assignee-menu-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.55rem;
    color: #212529;
    font: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 0.3rem;
}

.ticket-assignee-menu-item:hover,
.ticket-assignee-menu-item:focus,
.ticket-assignee-menu-item.is-active {
    background-color: #eef4fb;
}
.ticket-assignee-menu-empty {
    padding: 0.65rem 0.55rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* 管理画面の検索・新規作成用コンパクト操作帯 */
.admin-sticky-tools {
    position: sticky;
    top: 64px;
    z-index: 1010;
}

.admin-command-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #d7e0eb;
    border-radius: 0.65rem;
    box-shadow: 0 0.5rem 1.2rem rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.admin-command-form {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-command-bar .form-label {
    margin-bottom: 0.3rem;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.admin-command-bar .form-control,
.admin-command-bar .form-select {
    min-height: 40px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    line-height: 1.5;
}

.admin-command-bar .user-search-grid {
    grid-template-columns: minmax(260px, 1.4fr) minmax(170px, 0.8fr) minmax(170px, 0.8fr);
    gap: 0.75rem;
}

.admin-primary-action,
.ticket-create-button {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    box-shadow: 0 0.35rem 0.8rem rgba(13, 110, 253, 0.24);
}

.admin-command-bar .admin-create-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    width: 100%;
    overflow: visible;
    border: 0;
    box-shadow: none;
}

.admin-command-bar .admin-create-panel .master-panel-header,
.admin-command-bar .admin-create-panel .role-panel-header {
    align-self: stretch;
    padding: 0 1rem 0 0;
    background: transparent;
    border: 0;
}

.admin-command-bar .admin-create-panel .master-panel-body,
.admin-command-bar .admin-create-panel .role-panel-body {
    padding: 0;
}

.admin-command-bar .master-create-grid,
.admin-command-bar .role-create-grid {
    gap: 0.75rem;
}

.ticket-create-button {
    flex: 0 0 auto;
}
.ticket-assignee-menu {
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    scrollbar-color: #7b8794 #eef2f6;
    scrollbar-width: auto;
}

.ticket-assignee-menu::-webkit-scrollbar {
    width: 12px;
}

.ticket-assignee-menu::-webkit-scrollbar-track {
    background: #eef2f6;
    border-radius: 999px;
}

.ticket-assignee-menu::-webkit-scrollbar-thumb {
    background: #7b8794;
    border: 3px solid #eef2f6;
    border-radius: 999px;
}

@media (max-width: 767.98px) {
    .admin-sticky-tools {
        top: 88px;
    }
}
/* 固定検索帯の文字切れを防ぐ */
.ticket-control-panel .card-header {
    min-height: 50px;
    padding: 0.6rem 0.85rem !important;
}

.ticket-control-panel .card-body {
    padding: 0.6rem 0.75rem;
}

.ticket-search-compact {
    gap: 0.5rem;
}

.ticket-search-compact .form-control-sm,
.ticket-search-compact .form-select-sm {
    min-height: 36px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .admin-sticky-tools {
        position: static;
    }

    .admin-command-bar,
    .admin-command-bar .admin-create-panel {
        display: block;
    }

    .admin-command-bar .admin-primary-action {
        width: 100%;
        margin-top: 0.75rem;
    }

    .admin-command-bar .admin-create-panel .master-panel-header,
    .admin-command-bar .admin-create-panel .role-panel-header {
        padding: 0 0 0.75rem;
    }
}
.notification-dropdown { width: min(400px, calc(100vw - 1.5rem)); max-height: 440px; overflow-y: auto; }
.notification-dropdown-item + .notification-dropdown-item { border-top: 1px solid #e5e7eb; }
.notification-dropdown-item { overflow-wrap: anywhere; }

.attachment-upload-control,
.attachment-upload-action {
    min-height: 44px;
}
.attachment-upload-preview {
    display: grid;
    gap: .75rem;
    margin-top: .75rem;
}

.attachment-upload-preview-item {
    border: 1px solid #d7dee7;
    border-radius: .5rem;
    padding: .75rem;
    background: #fff;
}

.attachment-upload-preview-meta {
    display: flex;
    flex-direction: column;
    margin-bottom: .5rem;
    overflow-wrap: anywhere;
}

.attachment-upload-preview-image {
    display: block;
    max-width: 100%;
    max-height: 18rem;
    object-fit: contain;
}

.attachment-upload-preview-pdf {
    width: 100%;
    height: 20rem;
    border: 1px solid #d7dee7;
}

.attachment-existing-preview {
    border: 0;
    padding: 0;
    background: transparent;
    color: #0d6efd;
    text-decoration: underline;
    text-align: left;
}

.attachment-existing-preview-panel {
    position: fixed;
    z-index: 1080;
    width: min(26rem, calc(100vw - 1.5rem));
    height: min(21rem, calc(100vh - 1.5rem));
    padding: .5rem;
    border: 1px solid #b8c2cf;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .22);
}

.attachment-existing-preview-panel.attachment-existing-preview-panel-wide {
    width: min(60rem, calc(100vw - 1.5rem));
    height: min(34rem, calc(100vh - 1.5rem));
}

.attachment-existing-preview-media {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

/* 全体の操作要素を低彩度の配色で見やすくする */
:root {
    --app-action-primary: #465f73;
    --app-action-primary-hover: #374d5f;
    --app-action-secondary: #69747e;
    --app-action-success: #557064;
    --app-action-danger: #845b61;
    --app-action-warning: #7a6a49;
    --app-action-info: #536b76;
    --app-action-border: #34495a;
    --app-action-ring: rgba(70, 95, 115, 0.28);
}

.badge {
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(31, 41, 55, 0.22);
    border-radius: 0.45rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.badge.bg-primary {
    color: #fff !important;
    background-color: #526a7a !important;
    border-color: #425866;
}

.badge.bg-secondary {
    color: #fff !important;
    background-color: #66717a !important;
    border-color: #535e67;
}

.badge.bg-success {
    color: #fff !important;
    background-color: #557064 !important;
    border-color: #40594f;
}

.badge.bg-danger {
    color: #fff !important;
    background-color: #7b555c !important;
    border-color: #68464c;
}

.badge.bg-warning {
    color: #fff !important;
    background-color: #786a4d !important;
    border-color: #62563f;
}

.badge.bg-info {
    color: #22323a !important;
    background-color: #9aabb2 !important;
    border-color: #7d9099;
}

.ticket-list-badge[class*="badge-status-"] {
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.15);
}

.btn {
    min-height: 46px;
    padding: 0.62rem 1.05rem;
    border-width: 1.5px;
    border-radius: 0.45rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    touch-action: manipulation;
}

.btn:hover {
    box-shadow: 0 3px 7px rgba(15, 23, 42, 0.18);
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.22rem var(--app-action-ring);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
    box-shadow: 0 0 0 0.22rem var(--app-action-ring);
}

.btn:disabled,
.btn.disabled {
    box-shadow: none;
    opacity: 0.55;
}

.btn-sm {
    min-height: 44px;
    padding: 0.5rem 0.82rem;
    font-size: 0.925rem;
}

.btn-lg {
    min-height: 50px;
    padding: 0.76rem 1.2rem;
    font-size: 1.075rem;
}

.btn-primary {
    background-color: var(--app-action-primary);
    border-color: var(--app-action-border);
}

.login-form .btn-primary {
    background-color: var(--app-action-primary);
    border-color: var(--app-action-border);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle,
.login-form .btn-primary:hover {
    background-color: var(--app-action-primary-hover);
    border-color: #2d4050;
}

.btn-secondary {
    background-color: var(--app-action-secondary);
    border-color: #56616b;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: #59646e;
    border-color: #4d5861;
}

.btn-success {
    background-color: var(--app-action-success);
    border-color: #40594f;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: #455e54;
    border-color: #394f46;
}

.btn-danger {
    background-color: var(--app-action-danger);
    border-color: #704a50;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background-color: #724c52;
    border-color: #623f45;
}

.btn-warning {
    color: #fff;
    background-color: var(--app-action-warning);
    border-color: #65583e;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    color: #fff;
    background-color: #695b40;
    border-color: #594d36;
}

.btn-info {
    color: #fff;
    background-color: var(--app-action-info);
    border-color: #435963;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    color: #fff;
    background-color: #455b65;
    border-color: #394d56;
}

.btn-dark {
    background-color: #37434f;
    border-color: #29343e;
}

.btn-light {
    color: #263746;
    background-color: #eef1f4;
    border-color: #aeb8c2;
}

.btn-light:hover,
.btn-light:focus,
.btn-light:active {
    color: #1f2e3a;
    background-color: #e1e6ea;
    border-color: #8f9ca8;
}

.btn-link {
    color: #3f5f78;
    box-shadow: none;
}

.btn-link:hover,
.btn-link:focus {
    color: #2d475c;
    box-shadow: none;
}

.btn-outline-primary {
    color: #3c596f;
    border-color: #587083;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    color: #fff;
    background-color: var(--app-action-primary);
    border-color: var(--app-action-border);
}

.btn-outline-secondary {
    color: #56616b;
    border-color: #7d8790;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    color: #fff;
    background-color: var(--app-action-secondary);
    border-color: #56616b;
}

.btn-outline-success {
    color: #456055;
    border-color: #638074;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
    color: #fff;
    background-color: var(--app-action-success);
    border-color: #40594f;
}

.btn-outline-danger {
    color: #754c52;
    border-color: #91666c;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
    color: #fff;
    background-color: var(--app-action-danger);
    border-color: #704a50;
}

.btn-outline-warning {
    color: #66583e;
    border-color: #8a7954;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    color: #fff;
    background-color: var(--app-action-warning);
    border-color: #65583e;
}

.btn-outline-info {
    color: #455d68;
    border-color: #657c86;
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
    color: #fff;
    background-color: var(--app-action-info);
    border-color: #435963;
}

.card-header .btn {
    font-size: 1rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--app-action-primary);
    border-color: var(--app-action-border);
}

.bi {
    font-size: 1.12em;
    line-height: 1;
    vertical-align: -0.08em;
}

.btn .bi,
.nav-link .bi,
.dropdown-item .bi {
    flex: 0 0 auto;
    font-size: 1.25em;
}

#notificationDropdown {
    width: 46px;
    height: 46px;
    min-width: 46px;
    padding: 0;
    color: #314454 !important;
    border: 1.5px solid transparent;
    border-radius: 0.55rem;
}

#notificationDropdown:hover,
#notificationDropdown:focus-visible,
#notificationDropdown.has-unread {
    color: #243746 !important;
    background-color: #e8edf1;
    border-color: #8293a1;
}

#notificationDropdown.has-unread {
    box-shadow: 0 2px 7px rgba(36, 55, 70, 0.2);
}

#notificationDropdown .bi {
    font-size: 1.45rem;
}

#notificationBadge {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0.18rem 0.3rem;
    font-size: 0.68rem;
    line-height: 0.85rem;
    background-color: #7b5158 !important;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
}

.notification-dropdown {
    width: min(420px, calc(100vw - 1.5rem));
    max-height: 480px;
    padding: 0.4rem 0;
    overflow-y: auto;
    color: #263746;
    background-color: #fcfdfd;
    border: 2px solid #687d8e;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2.25rem rgba(15, 23, 42, 0.24), 0 0.2rem 0.6rem rgba(15, 23, 42, 0.16), inset 0 1px 0 #fff;
}

.notification-dropdown.show {
    animation: notification-menu-reveal 0.2s ease-out;
}

.notification-dropdown-item {
    padding: 0.75rem 1rem !important;
    color: #304353;
    border-left: 3px solid transparent;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.notification-dropdown-item + .notification-dropdown-item {
    border-top-color: #cbd3da;
}

.notification-dropdown-item:hover,
.notification-dropdown-item:focus {
    color: #1f303e;
    background-color: #e4eaee;
}

.notification-dropdown-item.is-unread {
    color: #1f3342;
    background-color: #edf1f4;
    border-left-color: #5f7587;
}

.notification-dropdown-item.is-unread:hover,
.notification-dropdown-item.is-unread:focus {
    background-color: #dfe6eb;
}

.notification-dropdown .dropdown-divider {
    border-top-color: #9eabb6;
    opacity: 1;
}

.notification-dropdown > .d-flex {
    align-items: center;
    min-height: 44px;
}

@keyframes notification-menu-reveal {
    from {
        opacity: 0.35;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .notification-dropdown-item {
        transition: none;
    }

    .notification-dropdown.show {
        animation: none;
    }
}
