body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f3f6fb;
    color: #1f2937;
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

a {
    color: #1e4f8a;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 420px;
    margin: 80px auto;
    background: #ffffff;
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
    border: 1px solid #e5eaf2;
}

form {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: #102a43;
}

h2 {
    text-align: center;
    color: #102a43;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    box-sizing: border-box;
    font-size: 16px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button {
    width: auto;
    padding: 12px 14px;
    background: #1d4f91;
    border: none;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
    background: #163d71;
    transform: translateY(-1px);
}

button:disabled {
    background: #9aa8bc;
    cursor: not-allowed;
    transform: none;
}

.link {
    text-align: center;
    margin-top: 12px;
}

.container button {
    width: 100%;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #163a63 0%, #224d78 100%);
    color: #ffffff;
    padding: 28px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
}

.sidebar-header {
    display: block;
}

.sidebar-menu {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.sidebar-toggle {
    display: none;
}

.sidebar h2 {
    text-align: left;
    font-size: 22px;
    margin-bottom: 24px;
    padding: 0 10px;
    color: #ffffff;
}

.sidebar-brand {
    font-size: 18px;
    line-height: 1.35;
    word-break: break-word;
}

.sidebar a {
    display: block;
    color: #eaf2fb;
    padding: 12px 14px;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(3px);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
}

.sidebar .logout-link {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.10);
}

.main {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    min-width: 0;
    padding: 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.topbar {
    background: #ffffff;
    padding: 16px 20px;
    margin-bottom: 0;
    width: 100%;
    min-width: 0;
    border-radius: 18px;
    border: 1px solid #e5eaf2;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    font-weight: 600;
    color: #355070;
    box-sizing: border-box;
}

.page-shell,
.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex: 1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.dashboard-header {
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 20px;
    padding: 24px 26px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.dashboard-header p {
    margin: 0;
    color: #5b6b7f;
    font-size: 15px;
}

.page-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title-block p {
    margin: 0;
    color: #5b6b7f;
    font-size: 15px;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    max-width: 720px;
}

.search-form input {
    flex: 1;
    margin: 0;
}

.search-form button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 0;
    width: 100%;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 170px;
    min-width: 150px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 700;
    color: #4d5f73;
}

.filter-group input,
.filter-group select {
    margin: 0;
}

.filter-search {
    flex: 2 1 320px;
    min-width: 220px;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

.filter-primary-action {
    width: 100%;
}

.filter-primary-action button {
    width: 100%;
}

.filters-bar button,
.filters-bar .page-action {
    min-height: 44px;
    box-sizing: border-box;
}

.filter-secondary-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 6px;
    width: 100%;
}

.filter-secondary-actions .page-action {
    min-width: 170px;
}

.secondary-action {
    background: #e5ebf3;
    color: #355070;
    box-shadow: none;
}

.secondary-action:hover {
    background: #d7e0eb;
}

.add-staff-action {
    margin-left: 0;
    margin-top: 0;
}

.stats-grid,
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: stretch;
    width: 100%;
    grid-auto-rows: 1fr;
}

.stat-card,
.card {
    background: #ffffff;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid #e5eaf2;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    height: 100%;
    box-sizing: border-box;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card h3,
.card h3 {
    margin: 0 0 8px;
    font-size: 30px;
    color: #12355b;
}

.stat-card p,
.card p {
    margin: 0;
    color: #66778c;
    font-size: 14px;
}

.developer-card {
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.developer-card-inner {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 22px;
    align-items: start;
}

.developer-card-image img {
    width: 150px;
    max-width: 100%;
    border-radius: 16px;
    border: 1px solid #d8e1ec;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.profile-badge {
    display: inline-block;
    background: #163a63;
    color: #ffffff;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.developer-meta p {
    margin-bottom: 10px;
    color: #4f5f73;
    line-height: 1.6;
}

.developer-note {
    margin: 8px 0 0;
    color: #66778c;
    font-size: 14px;
}

.profile-panel {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: none;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
    margin: 0;
}

.profile-form hr {
    width: 100%;
    margin: 8px 0 2px;
    border: 0;
    border-top: 1px solid #d8e1ec;
}

.profile-form p {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.signature-preview {
    width: min(100%, 260px);
    max-height: 110px;
    object-fit: contain;
    padding: 10px;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: #ffffff;
}

.profile-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.profile-media-grid > div {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    background: #f8fbff;
}

.profile-media-grid img {
    width: 150px;
    height: 110px;
    object-fit: contain;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: #ffffff;
}

.profile-media-grid .table-muted {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.profile-field-label {
    margin-bottom: -8px;
    color: #344256;
    font-weight: 700;
}

.phone-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.phone-input-group span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #cfd8e3;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #eef4fb;
    color: #12355b;
    font-weight: 800;
}

.phone-input-group input {
    min-width: 0;
    border-radius: 0 10px 10px 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
}

.profile-summary-card {
    max-width: none;
}

.profile-summary-card p,
.profile-summary-card h3 {
    min-width: 0;
}

.profile-email {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.complaint-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.complaint-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.complaint-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.complaint-status-group {
    display: flex;
    align-items: center;
}

.status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.status-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 10px;
    background: #eef4fb;
    color: #1d4f91;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.status-tabs a:hover,
.status-tabs a.active {
    background: #1d4f91;
    color: #ffffff;
}

.complaint-card-snapshot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    padding: 12px 14px;
    background: #f8fbff;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
}

.complaint-card-snapshot p {
    margin: 0;
    color: #344256;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.complaint-details-toggle {
    border-top: 1px solid #e5eaf2;
    padding-top: 12px;
}

.complaint-details-toggle summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #e8f0ff;
    color: #1d4f91;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.complaint-details-toggle summary::-webkit-details-marker {
    display: none;
}

.summary-close-label {
    display: none;
}

.complaint-details-toggle[open] summary {
    margin-bottom: 16px;
    background: #1d4f91;
    color: #ffffff;
}

.complaint-details-toggle[open] .summary-open-label {
    display: none;
}

.complaint-details-toggle[open] .summary-close-label {
    display: inline;
}

.tracking-number {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    margin: 0 0 6px;
    border-radius: 999px;
    background: #eef4fb;
    color: #163a63;
    font-family: "Courier New", monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.tracking-number.compact {
    margin: 0;
    padding: 5px 8px;
    font-size: 12px;
}

.complaint-status-progress {
    background: #e8f0ff;
    color: #1d4f91;
}

.complaint-status-awaiting {
    background: #eef4ff;
    color: #244b8a;
}

.complaint-status-reopened {
    background: #fff0d8;
    color: #b45309;
}

.complaint-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    gap: 18px;
    align-items: start;
}

.complaint-detail-grid p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.complaint-action-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.complaint-action-links .page-action {
    width: 100%;
}

.complaint-action-links > * {
    min-width: 0;
}

.complaint-timeline {
    border-top: 1px solid #e5eaf2;
    padding-top: 18px;
}

.complaint-timeline h3 {
    margin-bottom: 14px;
    color: #12355b;
}

.timeline-item {
    position: relative;
    padding: 14px 16px 14px 20px;
    border-left: 4px solid #1d4f91;
    background: #f8fbff;
    border-radius: 12px;
    margin-bottom: 12px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.timeline-item-header span {
    color: #5b6b7f;
    font-size: 13px;
}

.timeline-item-meta {
    margin-bottom: 8px;
    color: #355070;
    font-size: 13px;
    font-weight: 600;
}

.timeline-item p {
    margin: 0;
    color: #4f5f73;
}

.timeline-proof-link {
    margin-top: 10px;
}

.timeline-proof-link a {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #e8f0ff;
    border-radius: 8px;
    text-decoration: none;
    color: #1d4f91;
    font-weight: 600;
}

.timeline-proof-link a:hover {
    background: #d9e6ff;
}

.timeline-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.proof-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(100%, 260px);
    padding: 8px 10px;
    background: #e8f0ff;
    border: 1px solid #d8e6ff;
    border-radius: 10px;
    color: #174784;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.proof-attachment:hover {
    background: #d9e6ff;
}

.proof-attachment img,
.proof-attachment video {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #c7d8f2;
    background: #ffffff;
}

.proof-attachment span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proof-attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #c7d8f2;
    color: #1d4f91;
    font-size: 11px;
    font-weight: 800;
}

.proof-viewer-page {
    min-height: 100vh;
    padding: 24px;
    background: #0f172a;
    color: #ffffff;
}

.proof-close-button {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #102a43;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.proof-viewer-shell,
.proof-message-card {
    width: min(100%, 1100px);
    margin: 0 auto;
}

.proof-viewer-header {
    padding: 8px 56px 18px 0;
}

.proof-viewer-header h1,
.proof-message-card h1 {
    margin: 0;
    color: #ffffff;
    font-size: 22px;
    text-align: left;
    overflow-wrap: anywhere;
}

.proof-message-card {
    padding-top: 20vh;
}

.proof-message-card p {
    color: #dbeafe;
    font-size: 16px;
    line-height: 1.6;
}

.proof-viewer-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
}

.proof-viewer-body img,
.proof-viewer-body video {
    max-width: 100%;
    max-height: calc(100vh - 130px);
    border-radius: 12px;
    background: #000000;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.proof-viewer-body iframe {
    width: 100%;
    height: calc(100vh - 130px);
    border: none;
    border-radius: 12px;
    background: #ffffff;
}

.complaint-update-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 12px 0 18px;
}

.complaint-confirmation-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.blotter-sign-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px;
    margin: 14px 0;
    border: 1px solid #d8e1ec;
    border-radius: 12px;
    background: #f8fbff;
    overflow: hidden;
}

.blotter-sign-box strong {
    display: block;
    margin-bottom: 6px;
    color: #12355b;
}

.blotter-sign-box .page-action {
    width: 100%;
    margin-bottom: 10px;
}

.blotter-sign-box p {
    margin-bottom: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.45;
}

.blotter-sign-box .table-muted {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.blotter-sign-box input[type="file"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

.complaint-update-form select,
.complaint-update-form textarea,
.complaint-update-form button,
.complaint-confirmation-form input[type="file"],
.complaint-confirmation-form textarea,
.complaint-confirmation-form button {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.complaint-update-form input[type="file"] {
    width: 100%;
    min-width: 0;
}

.complaint-update-form .table-muted {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.blotter-modal {
    width: min(96vw, 980px);
    max-height: 90vh;
    padding: 0;
    border: 1px solid #d8e1ec;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.blotter-modal::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

.blotter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(90vh - 2px);
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-header-row,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header-row h2 {
    margin: 0;
    text-align: left;
    overflow-wrap: anywhere;
}

.modal-close-button {
    flex: 0 0 auto;
}

.blotter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
}

.blotter-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    color: #344256;
    font-weight: 700;
}

.blotter-form input,
.blotter-form select,
.blotter-form textarea {
    margin: 0;
    min-width: 0;
}

.blotter-form .phone-input-group {
    min-width: 0;
}

.blotter-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 8px 12px;
}

.blotter-checks label {
    flex-direction: row;
    align-items: center;
    font-weight: 600;
}

.blotter-checks input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.ticket-page {
    align-items: stretch;
}

.ticket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.ticket-sheet {
    width: min(100%, 900px);
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #d7e0eb;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
    color: #172033;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #163a63;
}

.ticket-header h2 {
    text-align: left;
    margin: 0 0 8px;
    font-size: 28px;
    color: #102a43;
}

.ticket-header p {
    margin: 0;
    color: #5b6b7f;
    line-height: 1.5;
}

.ticket-kicker {
    margin-bottom: 8px !important;
    font-size: 13px;
    color: #1d4f91 !important;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticket-number-box {
    flex: 0 0 250px;
    padding: 16px;
    background: #eef4fb;
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    text-align: center;
}

.ticket-number-box span,
.ticket-grid span,
.ticket-block span,
.ticket-signature-row span {
    display: block;
    color: #5b6b7f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ticket-number-box strong {
    display: block;
    margin-top: 8px;
    color: #102a43;
    font-family: "Courier New", monospace;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.ticket-section {
    padding: 20px 0;
    border-bottom: 1px solid #e5eaf2;
}

.ticket-section h3 {
    margin-bottom: 14px;
    color: #12355b;
}

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ticket-grid div,
.ticket-block {
    padding: 14px;
    background: #f8fbff;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
}

.ticket-grid strong,
.ticket-block strong {
    display: block;
    margin-top: 6px;
    color: #172033;
    overflow-wrap: anywhere;
}

.ticket-block {
    margin-bottom: 12px;
}

.ticket-block:last-child {
    margin-bottom: 0;
}

.ticket-block p {
    margin: 8px 0 0;
    line-height: 1.65;
    color: #344256;
}

.ticket-note {
    margin: 20px 0;
    padding: 14px 16px;
    background: #fff7db;
    border: 1px solid #f0d991;
    border-radius: 12px;
    color: #614700;
    line-height: 1.6;
}

.ticket-signature-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 34px;
}

.ticket-signature-row div {
    padding-top: 14px;
    border-top: 1px solid #172033;
}

.ticket-signature-row strong {
    display: block;
    margin-top: 6px;
    min-height: 20px;
}

.record-page {
    align-items: stretch;
}

.record-sheet {
    width: min(100%, 980px);
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #d7e0eb;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
    color: #172033;
}

.record-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #163a63;
}

.record-header h2 {
    text-align: left;
    margin: 0 0 8px;
    font-size: 28px;
    color: #102a43;
}

.record-header p {
    margin: 0;
    color: #5b6b7f;
    line-height: 1.5;
}

.record-section {
    padding: 18px 0;
    border-bottom: 1px solid #e5eaf2;
}

.record-section h3 {
    margin-bottom: 14px;
    color: #12355b;
}

.record-empty {
    margin: 0;
    color: #6b7280;
}

.record-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-timeline-item {
    padding: 14px 16px;
    border: 1px solid #e5eaf2;
    border-left: 4px solid #1d4f91;
    border-radius: 12px;
    background: #f8fbff;
}

.record-timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.record-timeline-head span {
    color: #5b6b7f;
    font-size: 13px;
}

.record-timeline-item p {
    margin: 0 0 8px;
    color: #344256;
    line-height: 1.55;
}

.record-timeline-item p:last-child {
    margin-bottom: 0;
}

.record-proof {
    font-weight: 700;
}

.record-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.record-proof a {
    display: inline-flex;
    padding: 7px 10px;
    background: #e8f0ff;
    border-radius: 8px;
    color: #1d4f91;
    text-decoration: none;
}

.reopen-reason-box {
    margin-top: 12px;
    padding: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 10px;
    color: #7c2d12;
}

.reopen-reason-box strong {
    display: block;
    margin-bottom: 6px;
}

.reopen-reason-box p {
    margin: 0 0 8px;
    line-height: 1.45;
}

.reopen-reason-box span {
    display: block;
    color: #9a3412;
    font-size: 12px;
    font-weight: 600;
}

.table-card {
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 18px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.pagination-summary {
    color: #4f5f73;
    font-size: 14px;
    font-weight: 600;
}

.pagination-size-form {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: none;
}

.pagination-size-form label {
    color: #4d5f73;
    font-size: 13px;
    font-weight: 700;
}

.pagination-size-form select {
    width: auto;
    min-width: 82px;
    margin: 0;
    padding: 9px 28px 9px 10px;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-links a,
.pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.pagination-links a {
    background: #eef4fb;
    color: #1d4f91;
}

.pagination-links a:hover {
    background: #dbe8f7;
}

.pagination-links a.disabled {
    pointer-events: none;
    color: #8b98aa;
    background: #f1f4f8;
}

.pagination-links span {
    color: #355070;
    background: #f8fbff;
}

.action-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    margin: 2px 6px 2px 0;
    background: #eef4fb;
    color: #1d4f91;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.action-links a.action-edit {
    background: #e8f0ff;
    color: #1d4f91;
}

.action-links a.action-delete,
.action-links a.action-reject {
    background: #fdecec;
    color: #991b1b;
}

.action-links a.action-approve {
    background: #e8f7ee;
    color: #166534;
}

.action-cell {
    min-width: 250px;
}

.action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.table-muted {
    color: #6b7280;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-approved {
    background: #e8f7ee;
    color: #15803d;
}

.status-pending {
    background: #fff7db;
    color: #b45309;
}

.status-rejected {
    background: #fdecec;
    color: #b91c1c;
}

.status-cancelled {
    background: #eef0f3;
    color: #4b5563;
}

.complaint-filter-bar {
    align-items: flex-end;
}

.complaint-filter-bar .filter-actions {
    display: flex;
    flex-direction: row;
    align-items: end;
    justify-content: flex-start;
    flex: 0 0 auto;
    gap: 12px;
    width: auto;
}

.complaint-filter-bar .filter-primary-action,
.complaint-filter-bar .filter-secondary-actions {
    width: auto;
}

.complaint-filter-bar .filter-primary-action button,
.complaint-filter-bar .filter-secondary-actions .page-action {
    width: auto;
    min-width: 150px;
    padding-left: 18px;
    padding-right: 18px;
}

.complaint-filter-bar .filter-secondary-actions {
    flex-direction: row;
    align-items: stretch;
    padding-top: 0;
}

.complaint-filter-bar .filter-secondary-actions .page-action {
    min-width: 0;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    border-left: 4px solid #d8e1ec;
}

.notification-card.unread {
    border-left-color: #1d4f91;
    background: #f8fbff;
}

.notification-card h2 {
    margin-bottom: 8px;
    text-align: left;
    font-size: 20px;
}

.notification-card p {
    margin-bottom: 8px;
    line-height: 1.55;
}

.notification-actions,
.inline-action-form {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: none;
}

.inline-action-form {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.inline-action-form button.action-reject {
    background: #fdecec;
    color: #991b1b;
}

.inline-action-form button.action-reject:hover {
    background: #fbd5d5;
}

.confirm-dialog {
    width: min(92vw, 420px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
}

.confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.44);
}

.confirm-dialog-card {
    padding: 22px;
    border: 1px solid #d8e1ec;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.confirm-dialog-card h2 {
    margin: 0 0 10px;
    text-align: left;
    font-size: 22px;
}

.confirm-dialog-card p {
    margin: 0;
    color: #4f5f73;
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.announcement-form textarea {
    min-height: 160px;
}

.action-links a:hover {
    background: #dbe8f7;
}

.action-links a.action-delete:hover,
.action-links a.action-reject:hover {
    background: #fbd5d5;
}

.action-links a.action-approve:hover {
    background: #d4f2df;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    min-width: 860px;
    table-layout: auto;
}

.main > table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    -webkit-overflow-scrolling: touch;
}

.responsive-table {
    min-width: 900px;
}

.staff-complaints-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
    background: transparent;
}

.staff-complaints-table tbody {
    display: grid;
    gap: 30px;
}

.staff-complaints-table tr:first-child {
    display: none;
}

.staff-complaints-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
    overflow: hidden;
    border: 1px solid #d8e1ec;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.staff-complaints-table th,
.admin-complaints-table th {
    white-space: nowrap;
}

.staff-complaints-table th:nth-child(1),
.staff-complaints-table td:nth-child(1) {
    width: auto;
}

.staff-complaints-table th:nth-child(2),
.staff-complaints-table td:nth-child(2) {
    width: auto;
}

.staff-complaints-table th:nth-child(3),
.staff-complaints-table td:nth-child(3) {
    width: auto;
}

.staff-complaints-table th:nth-child(4),
.staff-complaints-table td:nth-child(4) {
    width: auto;
}

.staff-complaints-table th:nth-child(5),
.staff-complaints-table td:nth-child(5) {
    width: auto;
}

.staff-complaints-table th:nth-child(6),
.staff-complaints-table td:nth-child(6) {
    width: auto;
}

.staff-complaints-table th:nth-child(7),
.staff-complaints-table td:nth-child(7) {
    width: auto;
}

.staff-complaints-table .page-action {
    margin-bottom: 8px;
}

.staff-complaints-table textarea {
    min-height: 88px;
}

.admin-complaints-table {
    min-width: 1400px;
    table-layout: fixed;
}

.admin-complaints-table th:nth-child(1),
.admin-complaints-table td:nth-child(1) {
    width: 180px;
}

.admin-complaints-table th:nth-child(2),
.admin-complaints-table td:nth-child(2) {
    width: 180px;
}

.admin-complaints-table th:nth-child(3),
.admin-complaints-table td:nth-child(3) {
    width: 190px;
}

.admin-complaints-table th:nth-child(4),
.admin-complaints-table td:nth-child(4) {
    width: 300px;
}

.admin-complaints-table th:nth-child(5),
.admin-complaints-table td:nth-child(5) {
    width: 190px;
}

.admin-complaints-table th:nth-child(6),
.admin-complaints-table td:nth-child(6) {
    width: 180px;
}

.admin-complaints-table th:nth-child(7),
.admin-complaints-table td:nth-child(7) {
    width: 280px;
}

.users-table th,
.users-table td {
    white-space: normal;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
    min-width: 190px;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
    min-width: 220px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3),
.users-table th:nth-child(4),
.users-table td:nth-child(4),
.users-table th:nth-child(5),
.users-table td:nth-child(5),
.users-table th:nth-child(6),
.users-table td:nth-child(6) {
    min-width: 120px;
}

.users-table th:nth-child(7),
.users-table td:nth-child(7) {
    min-width: 260px;
}

th {
    background: #163a63;
    color: #ffffff;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e8edf4;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: anywhere;
}

th {
    overflow-wrap: normal;
}

.staff-complaints-table th,
.staff-complaints-table td {
    padding: 10px;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.staff-complaints-table td {
    position: relative;
    display: block;
    border-right: 1px solid #d8e1ec;
    border-bottom: 1px solid #e8edf4;
}

.staff-complaints-table td:last-child {
    border-right: 0;
}

.staff-complaints-table td:nth-child(3n) {
    border-right: 0;
}

.staff-complaints-table td:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.staff-complaints-table .action-cell {
    grid-column: 1 / -1;
    padding-top: 16px;
    padding-bottom: 18px;
}

.admin-complaints-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.staff-complaints-table .action-cell > * + * {
    margin-top: 14px;
}

.staff-complaints-table td::before {
    display: block;
    margin-bottom: 10px;
    color: #163a63;
    content: attr(data-label);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.staff-complaints-table th {
    line-height: 1.25;
}

.staff-complaints-table .tracking-number.compact {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
    letter-spacing: 0;
}

.staff-complaints-table .status-badge,
.staff-complaints-table .table-muted {
    white-space: normal;
}

.staff-complaints-table .reopen-reason-box {
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.staff-complaints-table .reopen-reason-box strong {
    font-size: 13px;
}

@media screen and (max-width: 1500px) {
    .staff-complaints-table tr {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media screen and (max-width: 900px) {
    .admin-complaints-table {
        display: block;
        min-width: 0;
        width: 100%;
        background: transparent;
    }

    .admin-complaints-table tbody {
        display: grid;
        gap: 24px;
    }

    .admin-complaints-table tr:first-child {
        display: none;
    }

    .admin-complaints-table tr {
        display: grid;
        grid-template-columns: 1fr;
        overflow: hidden;
        border: 1px solid #d8e1ec;
        border-radius: 16px;
        background: #ffffff;
    }

    .admin-complaints-table td {
        display: block;
        width: auto !important;
        min-width: 0;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid #e8edf4;
    }

    .admin-complaints-table td:last-child {
        border-bottom: 0;
    }

    .admin-complaints-table td::before {
        display: block;
        margin-bottom: 8px;
        color: #163a63;
        content: attr(data-label);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .admin-complaints-table .action-links,
    .admin-complaints-table form,
    .admin-complaints-table select,
    .admin-complaints-table button,
    .admin-complaints-table .page-action {
        width: 100%;
    }

    .staff-complaints-table tr {
        grid-template-columns: 1fr;
        margin-bottom: 8px;
    }

    .staff-complaints-table td,
    .staff-complaints-table td:nth-child(3n),
    .staff-complaints-table td:nth-last-child(-n + 3) {
        border-right: 0;
        border-bottom: 1px solid #e8edf4;
        padding-top: 14px;
        padding-bottom: 16px;
    }

    .staff-complaints-table td:last-child {
        border-bottom: 0;
    }

    .staff-complaints-table .action-cell {
        grid-column: auto;
        padding-top: 18px;
        padding-bottom: 22px;
    }
}

.page-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #1d4f91;
    color: #ffffff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(29, 79, 145, 0.16);
}

.page-action:hover {
    background: #163d71;
}

.main > form:not(.filters-bar):not(.search-form),
.page-shell > form:not(.filters-bar):not(.search-form),
.dashboard-wrapper > form:not(.filters-bar):not(.search-form) {
    width: 100%;
    max-width: 720px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.site-footer {
    margin-top: auto;
    width: 100%;
    background: #d9d9d9;
    border: 1px solid #c8c8c8;
    border-radius: 18px;
    padding: 28px 30px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    color: #222222;
    font-size: 14px;
    box-sizing: border-box;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 28px;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

.footer-column {
    flex: 1 1 180px;
    min-width: 160px;
}

.footer-column h4 {
    margin: 0 0 14px;
    color: #111111;
    font-size: 16px;
}

.footer-column p {
    margin: 0 0 8px;
    color: #222222;
    line-height: 1.6;
}

.footer-column a {
    color: #222222;
    text-decoration: underline;
}

.footer-column a:hover {
    color: #111111;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media screen and (max-width: 900px) {
    body {
        overflow-x: hidden;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 50;
        width: 100%;
        height: auto;
        max-height: 45vh;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 14px;
        overflow-y: auto;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    }

    .sidebar h2 {
        flex: 1 0 100%;
        margin: 0 0 4px;
        padding: 0;
        font-size: 18px;
    }

    .sidebar a {
        flex: 0 1 auto;
        margin: 0;
        padding: 9px 11px;
        border-radius: 10px;
        font-size: 14px;
        white-space: nowrap;
    }

    .sidebar .logout-link {
        margin-top: 0;
        margin-left: auto;
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding: 18px;
        gap: 24px;
    }

    .page-shell,
    .dashboard-wrapper,
    .complaint-list {
        gap: 24px;
    }

    .topbar {
        padding: 14px 16px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search,
    .filter-group {
        flex-basis: calc(50% - 7px);
        min-width: 0;
    }

    .filter-actions {
        width: 100%;
        margin-left: 0;
    }

    .filter-secondary-actions {
        align-items: flex-start;
        gap: 14px;
    }

    .developer-card-inner {
        grid-template-columns: 1fr;
    }

    .developer-card-image {
        text-align: center;
    }

    .complaint-detail-grid {
        grid-template-columns: 1fr;
    }

    .complaint-card-snapshot {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        gap: 20px;
    }

    .footer-column {
        flex: 1 1 calc(50% - 14px);
        min-width: 220px;
    }

    .ticket-header {
        flex-direction: column;
    }

    .record-header {
        flex-direction: column;
    }

    .ticket-number-box {
        flex: 1 1 auto;
    }
}

@media screen and (max-width: 640px) {
    .sidebar {
        max-height: 52vh;
    }

    .sidebar a {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
        justify-content: center;
    }

    .sidebar .logout-link {
        margin-left: 0;
    }

    .page-header-row {
        align-items: stretch;
    }

    .page-header-row .page-action {
        width: 100%;
    }

    .filters-bar {
        padding: 16px;
    }

    .filter-search,
    .filter-group,
    .filter-actions {
        flex-basis: 100%;
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .complaint-filter-bar .filter-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .complaint-filter-bar .filter-primary-action,
    .complaint-filter-bar .filter-secondary-actions,
    .complaint-filter-bar .filter-primary-action button,
    .complaint-filter-bar .filter-secondary-actions .page-action {
        width: 100%;
    }

    .filter-secondary-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .status-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-secondary-actions .page-action {
        width: 100%;
    }

    .action-cell {
        min-width: 220px;
    }

    .footer-column {
        flex-basis: 100%;
        min-width: 0;
    }

    .complaint-card-header,
    .timeline-item-header,
    .notification-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-actions,
    .notification-actions .page-action,
    .inline-action-form,
    .inline-action-form button {
        width: 100%;
    }

    .tracking-number,
    .status-badge,
    .table-muted {
        white-space: normal;
    }

    .proof-attachment {
        width: 100%;
        max-width: 100%;
    }

    .proof-viewer-page {
        padding: 16px;
    }

    .proof-viewer-header {
        padding-right: 54px;
    }

    .page-action,
    button {
        width: 100%;
    }

    .complaint-details-toggle summary {
        width: 100%;
    }

    .pagination-bar {
        align-items: stretch;
    }

    .pagination-summary,
    .pagination-size-form,
    .pagination-links {
        width: 100%;
    }

    .pagination-size-form {
        justify-content: space-between;
    }

    .pagination-size-form select {
        flex: 0 0 110px;
    }

    .pagination-links {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ticket-actions {
        justify-content: stretch;
    }

    .ticket-grid,
    .ticket-signature-row {
        grid-template-columns: 1fr;
    }

    .blotter-modal {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .blotter-form {
        max-height: 100vh;
        padding: 16px;
    }

    .modal-header-row,
    .modal-actions {
        align-items: stretch;
    }

    .blotter-grid,
    .blotter-checks {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .container {
        width: auto;
        margin: 24px 12px;
        padding: 22px;
    }

    .main {
        padding: 14px;
        gap: 22px;
    }

    .sidebar-brand {
        font-size: 17px;
    }

    .sidebar {
        padding: 12px;
        gap: 7px;
    }

    .sidebar a {
        flex-basis: 100%;
        padding: 10px;
    }

    .dashboard-header,
    .developer-card,
    .stat-card,
    .card,
    .table-card,
    .site-footer,
    .topbar {
        padding: 20px;
        border-radius: 16px;
    }

    .page-shell,
    .dashboard-wrapper,
    .complaint-list {
        gap: 22px;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 22px;
    }

    .stats-grid,
    .cards,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .cards {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 680px;
    }

    .responsive-table {
        min-width: 720px;
    }

    .staff-complaints-table {
        min-width: 0;
    }

    .admin-complaints-table {
        min-width: 0;
    }

    .admin-complaints-table.responsive-table {
        min-width: 0;
    }

    .users-table {
        min-width: 960px;
    }

    .action-links a {
        width: 100%;
        margin-right: 0;
    }
}

@media screen and (max-width: 900px) {
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 50;
        width: 100%;
        height: auto;
        max-height: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 12px;
        overflow: visible;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
    }

    .sidebar h2,
    .sidebar-brand {
        flex: 1 1 auto;
        margin: 0;
        padding: 0;
        font-size: 15px;
        line-height: 1.3;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        width: auto;
        min-height: 40px;
        padding: 9px 12px;
        border: 1px solid rgba(255, 255, 255, 0.24);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        font-size: 14px;
        box-shadow: none;
    }

    .sidebar-toggle:hover {
        background: rgba(255, 255, 255, 0.18);
        transform: none;
    }

    .sidebar-menu {
        display: none;
        width: 100%;
        margin-top: 10px;
        max-height: calc(100vh - 112px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.is-open .sidebar-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .sidebar a,
    .sidebar-menu a {
        flex: initial;
        margin: 0;
        padding: 10px 11px;
        text-align: center;
        white-space: normal;
        transform: none;
    }

    .sidebar a:hover,
    .sidebar-menu a:hover {
        transform: none;
    }

    .sidebar .logout-link {
        margin: 0;
        grid-column: 1 / -1;
    }

    .main {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 14px;
    }

    .staff-complaints-table {
        min-width: 0;
    }
}

@media screen and (max-width: 480px) {
    .sidebar.is-open .sidebar-menu {
        grid-template-columns: 1fr;
    }

    .sidebar-toggle {
        padding: 8px 10px;
    }
}

@page {
    size: 8.5in 13in;
    margin: 0.35in;
}

@media print {
    body {
        background: #ffffff;
        color: #000000;
        overflow: visible;
    }

    .no-print,
    .sidebar,
    .topbar,
    .site-footer {
        display: none !important;
    }

    .main {
        width: 100%;
        margin: 0;
        padding: 0;
        display: block;
    }

    .page-shell,
    .ticket-page {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .ticket-sheet {
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        font-size: 8.6pt;
        line-height: 1.18;
    }

    .record-sheet {
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        font-size: 11pt;
    }

    .ticket-header,
    .record-header {
        break-inside: avoid;
    }

    .ticket-header {
        align-items: flex-start;
        display: flex !important;
        flex-direction: row !important;
        gap: 14px;
        padding-bottom: 8px;
        border-bottom-width: 1px;
    }

    .ticket-header > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    .ticket-header h2 {
        margin-bottom: 3px;
        font-size: 15pt;
        line-height: 1.15;
    }

    .ticket-header p {
        font-size: 8pt;
        line-height: 1.25;
    }

    .ticket-kicker {
        margin-bottom: 3px !important;
        font-size: 7.5pt;
    }

    .ticket-number-box {
        flex: none !important;
        width: 1.65in !important;
        max-width: 1.65in;
        height: auto !important;
        min-height: 0 !important;
        max-height: 0.42in;
        padding: 4px 6px;
        border-radius: 6px;
        overflow: hidden;
    }

    .ticket-number-box strong {
        margin-top: 2px;
        font-size: 7.8pt;
    }

    .ticket-section,
    .record-section,
    .record-timeline-item,
    .ticket-note,
    .ticket-signature-row {
        break-inside: avoid;
    }

    .ticket-section {
        padding: 6px 0;
    }

    .ticket-section h3 {
        margin-bottom: 4px;
        font-size: 10pt;
    }

    .ticket-grid {
        gap: 5px;
    }

    .ticket-grid div,
    .ticket-block {
        padding: 5px 7px;
        border-radius: 6px;
    }

    .ticket-grid span,
    .ticket-block span,
    .ticket-signature-row span,
    .ticket-number-box span {
        font-size: 7.5pt;
    }

    .ticket-block {
        margin-bottom: 5px;
    }

    .ticket-block p {
        margin-top: 3px;
        line-height: 1.25;
    }

    .ticket-note {
        margin: 7px 0 10px;
        padding: 6px 8px;
        border-radius: 6px;
        line-height: 1.25;
    }

    .ticket-signature-row {
        gap: 14px;
        margin-top: 10px;
    }

    .ticket-signature-row div {
        padding-top: 6px;
    }

    .ticket-signature-row strong {
        margin-top: 3px;
        min-height: 10px;
    }

    .ticket-grid div,
    .ticket-block,
    .record-timeline-item,
    .ticket-note {
        background: #ffffff;
    }
}
