/* ==========================================================================
   Works Complaints — interface theme
   A modern layer on top of Bootstrap 5.3. Colours, spacing and radii are
   driven by the tokens below so every screen stays consistent.
   ========================================================================== */


:root {
    --ink-900: #0a1622;
    --ink-800: #12212f;
    --ink-700: #1d2f42;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --line: #e3e9f0;
    --line-soft: #eef2f7;
    --surface: #ffffff;
    --canvas: #f4f7f9;

    --brand-50: #effcf9;
    --brand-100: #d6f5ee;
    --brand-200: #abebe0;
    --brand-300: #71d9ca;
    --brand-400: #35bfae;
    --brand-500: #14a08f;
    --brand-600: #0f7f73;
    --brand-700: #0e655c;

    --accent: #f59e0b;
    --danger: #e11d48;
    --success: #0f9d63;
    --info: #2563eb;

    --radius-sm: 0.625rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.125rem;
    --radius-xl: 1.5rem;

    --shadow-xs: 0 1px 2px rgba(10, 22, 34, 0.06);
    --shadow-sm: 0 1px 2px rgba(10, 22, 34, 0.05), 0 5px 14px -8px rgba(10, 22, 34, 0.16);
    --shadow-md: 0 1px 3px rgba(10, 22, 34, 0.05), 0 16px 34px -22px rgba(10, 22, 34, 0.32);
    --shadow-lg: 0 28px 64px -34px rgba(10, 22, 34, 0.42);

    /* Bootstrap token overrides */
    --bs-body-font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: 0.95rem;
    --bs-body-line-height: 1.6;
    --bs-body-color: var(--slate-700);
    --bs-body-color-rgb: 51, 65, 85;
    --bs-body-bg: var(--canvas);
    --bs-body-bg-rgb: 244, 247, 249;
    --bs-emphasis-color: var(--ink-900);
    --bs-heading-color: var(--ink-900);
    --bs-secondary-color: var(--slate-500);
    --bs-tertiary-bg: #f1f5f9;
    --bs-border-color: var(--line);
    --bs-border-color-translucent: rgba(10, 22, 34, 0.08);
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 15, 127, 115;
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 15, 127, 115;
    --bs-link-hover-color: var(--brand-700);
    --bs-link-hover-color-rgb: 14, 101, 92;
    --bs-light: #f7fafb;
    --bs-light-rgb: 247, 250, 251;
    --bs-dark: var(--ink-900);
    --bs-dark-rgb: 10, 22, 34;
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-sm: 0.5rem;
    --bs-border-radius-lg: var(--radius-md);
    --bs-border-radius-xl: var(--radius-lg);
    --bs-focus-ring-color: rgba(15, 127, 115, 0.25);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
    height: -webkit-fill-available;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background-color: var(--canvas);
    background-image:
        radial-gradient(1100px 520px at 12% -10%, rgba(53, 191, 174, 0.13), transparent 62%),
        radial-gradient(900px 480px at 92% 0%, rgba(37, 99, 235, 0.08), transparent 60%);
    background-repeat: no-repeat;
    color: var(--slate-700);
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: var(--ink-900);
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.25;
}

h1,
.h1 {
    font-size: clamp(1.75rem, 3.2vw, 2.35rem);
}

h2,
.h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
}

.display-1,
.display-2,
.display-3,
.display-4,
.display-5 {
    color: var(--ink-900);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.display-4 {
    font-size: clamp(1.9rem, 4vw, 2.7rem);
}

hr {
    border-color: var(--line);
    opacity: 1;
}

a {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

::selection {
    background: var(--brand-200);
    color: var(--ink-900);
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 2000;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--ink-900);
    color: #fff;
    font-weight: 600;
    transition: top 0.18s ease;
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.app-main {
    display: flex;
    flex-direction: column;
    min-height: 60vh;
    padding: clamp(1.25rem, 3vw, 2.5rem) clamp(0.85rem, 2.5vw, 2rem) clamp(2rem, 4vw, 3.25rem);
}

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

.page-head__title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
}

.page-head__meta {
    margin: 0.35rem 0 0;
    color: var(--slate-500);
    font-size: 0.9rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-600);
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.app-header__inner {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 2rem);
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0.7rem clamp(0.85rem, 2.5vw, 2rem);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
    color: var(--ink-900);
    text-decoration: none;
}

.app-brand:hover {
    color: var(--ink-900);
}

.app-brand__mark {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    border: 1px solid var(--line-soft);
    background: #fff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.app-brand__mark img {
    width: 100%;
    height: 100%;
    padding: 0.28rem;
    object-fit: contain;
}

.app-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.app-brand__title {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.app-brand__sub {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--slate-400);
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-inline: auto;
}

.app-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    color: var(--slate-600);
    font-size: 0.885rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.app-nav__link:hover,
.app-nav__link:focus-visible {
    color: var(--brand-700);
    background: var(--brand-50);
}

.app-nav__link.is-active {
    color: var(--brand-700);
    background: var(--brand-100);
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    margin-left: auto;
}

.app-header__toggle {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fff;
    color: var(--ink-800);
}

.app-avatar {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-900);
    font-weight: 600;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-avatar:hover {
    border-color: var(--brand-300);
    box-shadow: var(--shadow-sm);
}

.app-avatar__initials {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.app-avatar__name {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.app-menu {
    --bs-dropdown-min-width: 15rem;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.app-menu__header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem 0.5rem;
}

.app-menu__name {
    font-weight: 700;
    color: var(--ink-900);
}

.app-menu__meta {
    overflow: hidden;
    font-size: 0.78rem;
    color: var(--slate-500);
    text-overflow: ellipsis;
}

.dropdown-item {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--slate-700);
    font-size: 0.885rem;
    font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--brand-50);
    color: var(--brand-700);
}

.dropdown-divider {
    border-color: var(--line-soft);
}

/* --------------------------------------------------------------------------
   Cards & surfaces
   -------------------------------------------------------------------------- */

.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius-lg);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.35rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card-title {
    letter-spacing: -0.02em;
}

.shadow {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-xs) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-md) !important;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.section-card {
    padding: clamp(1.1rem, 2.2vw, 1.75rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.section-card + .section-card {
    margin-top: 1.25rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem;
    color: var(--slate-500);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.section-title::before {
    content: "";
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: var(--brand-400);
}

.field-label {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--slate-400);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.field-value {
    display: block;
    color: var(--ink-900);
    font-weight: 600;
    word-break: break-word;
}

.rounded-4 {
    border-radius: var(--radius-lg) !important;
}

.rounded-5 {
    border-radius: var(--radius-xl) !important;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--radius-sm);
    --bs-btn-padding-y: 0.55rem;
    --bs-btn-padding-x: 1.05rem;
    --bs-btn-font-size: 0.9rem;
    --bs-btn-focus-box-shadow: 0 0 0 0.22rem rgba(15, 127, 115, 0.18);
    letter-spacing: -0.005em;
    transition: transform 0.16s ease, box-shadow 0.18s ease, background-color 0.18s ease,
        border-color 0.18s ease, color 0.18s ease;
}

.btn-lg {
    --bs-btn-font-size: 0.95rem;
    --bs-btn-padding-y: 0.7rem;
    --bs-btn-padding-x: 1.35rem;
    --bs-btn-border-radius: var(--radius-md);
}

.btn-sm {
    --bs-btn-font-size: 0.82rem;
    --bs-btn-padding-y: 0.4rem;
    --bs-btn-padding-x: 0.85rem;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    --bs-btn-bg: var(--brand-600);
    --bs-btn-border-color: var(--brand-600);
    --bs-btn-hover-bg: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand-400);
    --bs-btn-disabled-border-color: var(--brand-400);
    box-shadow: 0 8px 18px -12px rgba(15, 127, 115, 0.9);
}

.btn-dark {
    --bs-btn-bg: var(--ink-900);
    --bs-btn-border-color: var(--ink-900);
    --bs-btn-hover-bg: var(--ink-700);
    --bs-btn-hover-border-color: var(--ink-700);
    --bs-btn-active-bg: var(--ink-700);
    --bs-btn-active-border-color: var(--ink-700);
    --bs-btn-disabled-bg: var(--slate-500);
    --bs-btn-disabled-border-color: var(--slate-500);
}

.btn-outline-dark {
    --bs-btn-color: var(--ink-900);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--ink-900);
    --bs-btn-hover-border-color: var(--ink-900);
    --bs-btn-active-bg: var(--ink-900);
    --bs-btn-active-border-color: var(--ink-900);
    background: #fff;
}

.btn-warning {
    --bs-btn-bg: #fbbf24;
    --bs-btn-border-color: #fbbf24;
    --bs-btn-color: #422006;
    --bs-btn-hover-bg: #f59e0b;
    --bs-btn-hover-border-color: #f59e0b;
    --bs-btn-hover-color: #422006;
    --bs-btn-active-bg: #f59e0b;
    --bs-btn-active-border-color: #f59e0b;
    --bs-btn-active-color: #422006;
}

.btn-success {
    --bs-btn-bg: var(--success);
    --bs-btn-border-color: var(--success);
    --bs-btn-hover-bg: #0b8151;
    --bs-btn-hover-border-color: #0b8151;
    --bs-btn-active-bg: #0b8151;
    --bs-btn-active-border-color: #0b8151;
}

.btn-danger {
    --bs-btn-bg: var(--danger);
    --bs-btn-border-color: var(--danger);
    --bs-btn-hover-bg: #be123c;
    --bs-btn-hover-border-color: #be123c;
    --bs-btn-active-bg: #be123c;
    --bs-btn-active-border-color: #be123c;
}

.btn-outline-secondary {
    --bs-btn-color: var(--slate-600);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--slate-700);
    --bs-btn-hover-border-color: var(--slate-700);
    background: #fff;
}

.btn-info {
    --bs-btn-bg: var(--brand-50);
    --bs-btn-border-color: var(--brand-200);
    --bs-btn-color: var(--brand-700);
    --bs-btn-hover-bg: var(--brand-100);
    --bs-btn-hover-border-color: var(--brand-300);
    --bs-btn-hover-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-100);
    --bs-btn-active-border-color: var(--brand-300);
    --bs-btn-active-color: var(--brand-700);
}

.btn-outline-success {
    --bs-btn-color: var(--success);
    --bs-btn-border-color: #b7ebd2;
    --bs-btn-hover-bg: var(--success);
    --bs-btn-hover-border-color: var(--success);
    --bs-btn-active-bg: #0b8151;
    --bs-btn-active-border-color: #0b8151;
    background: #fff;
}

.btn svg {
    vertical-align: -0.15em;
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */

.modal-content {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.05rem 1.35rem;
    border-bottom: 1px solid var(--line-soft);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.35rem;
}

.modal-footer {
    gap: 0.5rem;
    padding: 0.9rem 1.35rem;
    border-top: 1px solid var(--line-soft);
}

.modal-backdrop.show {
    opacity: 0.45;
}

.modal .btn-close {
    opacity: 0.5;
}

.modal .btn-close:hover {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-control,
.form-select {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: var(--ink-900);
    font-size: 0.92rem;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-select {
    padding-right: 2.25rem;
}

.form-control::placeholder {
    color: var(--slate-400);
}

/* Neutralise legacy hard-coded border utility classes on fields */
.form-control.border-secondary,
.form-control.border-dark,
.form-select.border-secondary,
.form-select.border-dark {
    border-color: var(--line) !important;
}

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

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 0.22rem rgba(20, 160, 143, 0.16);
}

.form-control-lg {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.form-label,
.col-form-label {
    margin-bottom: 0.35rem;
    color: var(--slate-600);
    font-size: 0.8rem;
    font-weight: 600;
}

.form-text {
    color: var(--slate-400);
    font-size: 0.8rem;
}

.form-check-input {
    border-color: #cbd5e1;
}

.form-check-input:checked {
    border-color: var(--brand-600);
    background-color: var(--brand-600);
}

textarea.form-control {
    min-height: 7rem;
}

input[type="file"].form-control,
input[type="file"] {
    padding: 0.45rem 0.6rem;
    color: var(--slate-600);
    font-size: 0.85rem;
}

input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.4rem 0.85rem;
    border: 0;
    border-radius: 0.5rem;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.16s ease;
}

input[type="file"]::file-selector-button:hover {
    background: var(--brand-100);
}

.asteriskField {
    margin-left: 0.15rem;
    color: var(--brand-500);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

table {
    white-space: nowrap;
}

.table {
    --bs-table-border-color: var(--line-soft);
    --bs-table-hover-bg: var(--brand-50);
    margin-bottom: 0;
    color: var(--slate-700);
}

.table > :not(caption) > * > * {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.table > thead th {
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    color: var(--slate-500);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.table-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Badges, pills & status
   -------------------------------------------------------------------------- */

.badge {
    padding: 0.4em 0.7em;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pill::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.75;
}

.status-pill {
    background: #eef2f7;
    border-color: #e2e8f0;
    color: var(--slate-600);
}

.status-is_open {
    background: #fff7e6;
    border-color: #fde3ac;
    color: #a16207;
}

.status-in_progress {
    background: #eaf2ff;
    border-color: #c7ddff;
    color: #1d4ed8;
}

.status-programmed {
    background: #f0edff;
    border-color: #ddd6fe;
    color: #6d28d9;
}

.status-redirected,
.status-private_issue {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--slate-600);
}

.status-is_resolved {
    background: #e7f8f0;
    border-color: #b7ebd2;
    color: #0b8151;
}

.priority-pill {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--slate-600);
}

.priority-low {
    background: #eef2f7;
    border-color: #e2e8f0;
    color: var(--slate-600);
}

.priority-medium {
    background: #eff8ff;
    border-color: #c3e4ff;
    color: #0369a1;
}

.priority-high {
    background: #fff4e6;
    border-color: #fed7aa;
    color: #c2410c;
}

.priority-urgent {
    background: #ffe9ee;
    border-color: #fecdd3;
    color: #be123c;
}

.avatar-chip {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.45rem;
    border: 1px solid var(--brand-200);
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
}

.avatar-chip:hover {
    background: var(--brand-100);
    color: var(--brand-700);
}

/* Initial chips still using legacy pill/border utility classes */
.rounded-pill.border-dark {
    border-color: var(--brand-200) !important;
    background-color: var(--brand-50) !important;
    color: var(--brand-700);
}

.rounded-pill.border-dark a,
.rounded-pill.border-dark * {
    color: var(--brand-700) !important;
}

/* --------------------------------------------------------------------------
   Complaint listing
   -------------------------------------------------------------------------- */

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

.stat-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-xs);
    color: var(--slate-600);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-chip:hover {
    transform: translateY(-2px);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-sm);
    color: var(--brand-700);
}

.stat-chip__value {
    color: var(--ink-900);
    font-size: 1.15rem;
    font-weight: 800;
}

.stat-chip--accent {
    border-color: #fde3ac;
    background: linear-gradient(135deg, #fffaf1, #fff 65%);
}

.stat-chip--accent:hover {
    border-color: var(--accent);
}

.complaint-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.15rem 1.2rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.complaint-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
}

.complaint-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.complaint-card__ref {
    display: block;
    color: var(--ink-900);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.complaint-card__ref:hover {
    color: var(--brand-700);
}

.complaint-card__date {
    display: block;
    margin-top: 0.15rem;
    color: var(--slate-400);
    font-size: 0.78rem;
}

.complaint-card__body {
    display: grid;
    gap: 0.22rem;
    margin-bottom: 0.9rem;
    color: var(--slate-600);
    font-size: 0.86rem;
    line-height: 1.45;
}

.complaint-card__person {
    color: var(--ink-800);
    font-weight: 700;
}

.complaint-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line-soft);
}

.complaint-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.complaint-card__owner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--slate-400);
    font-size: 0.76rem;
}

.complaint-card__link {
    color: var(--brand-600);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.complaint-card__link:hover {
    color: var(--brand-700);
    text-decoration: underline;
}

.complaint-list:hover {
    background-color: var(--brand-50);
}

.empty-state {
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.65);
    color: var(--slate-500);
    text-align: center;
}

.empty-state__title {
    margin-bottom: 0.35rem;
    color: var(--ink-900);
    font-weight: 700;
}

.chart-holder {
    position: relative;
    height: 17rem;
}

/* --------------------------------------------------------------------------
   Users directory
   -------------------------------------------------------------------------- */

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.75rem;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-xs);
    color: var(--ink-900);
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.user-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-sm);
    color: var(--ink-900);
}

.user-card .avatar-chip {
    flex-shrink: 0;
}

.user-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.user-card__name {
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card__meta {
    overflow: hidden;
    color: var(--slate-400);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 1200px) {
    .chart-holder {
        height: 19rem;
    }
}

/* --------------------------------------------------------------------------
   Filter panel
   -------------------------------------------------------------------------- */

.filter-panel {
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.filter-panel__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.filter-panel__grid > * {
    flex: 1 1 9rem;
    min-width: 0;
}

.filter-panel__search {
    flex: 1 1 100%;
}

.filter-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line-soft);
}

.filter-panel__actions .btn {
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Detail view
   -------------------------------------------------------------------------- */

.detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.15rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line-soft);
}

.detail-header__ref {
    margin: 0;
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.detail-header__meta {
    color: var(--slate-400);
    font-size: 0.78rem;
}

.detail-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem 1.5rem;
}

.detail-facts > div {
    min-width: 0;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.detail-actions .btn {
    flex: 1 1 10rem;
}

.narrative {
    padding: 1rem 1.15rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: var(--ink-800);
    line-height: 1.65;
    word-break: break-word;
}

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

.assignee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.85rem;
}

.assignee {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: #fbfdfe;
}

.assignee__role {
    display: block;
    color: var(--slate-400);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.assignee__name {
    color: var(--ink-900);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Auth screens
   -------------------------------------------------------------------------- */

.auth-shell {
    display: grid;
    place-items: center;
    padding-block: clamp(1rem, 4vw, 2.5rem);
}

.auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 62rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

@media (min-width: 992px) {
    .auth-card {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    }
}

.auth-card__form {
    padding: clamp(1.6rem, 4vw, 2.75rem);
}

.auth-card__aside {
    position: relative;
    display: none;
    min-height: 24rem;
    padding: 2rem;
    background-color: var(--ink-900);
    color: #fff;
    isolation: isolate;
}

@media (min-width: 992px) {
    .auth-card__aside {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
}

.auth-card__aside::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: url("../img/dipt.jpg");
    background-position: center;
    background-size: cover;
}

.auth-card__aside::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(160deg, rgba(10, 22, 34, 0.35) 0%, rgba(10, 22, 34, 0.86) 78%);
}

.auth-card__aside-title {
    margin-bottom: 0.4rem;
    color: #fff;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-card__aside-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.auth-card__aside-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.15rem;
    padding: 0;
    list-style: none;
}

.auth-card__aside-list li {
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

.auth-head {
    margin-bottom: 1.5rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    color: var(--ink-900);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.auth-brand__mark {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--line-soft);
    border-radius: 0.7rem;
    background: #fff;
    box-shadow: var(--shadow-xs);
}

.auth-brand__mark img {
    width: 100%;
    height: 100%;
    padding: 0.2rem;
    object-fit: contain;
}

.auth-head h1 {
    margin-bottom: 0.35rem;
    font-size: 1.65rem;
    font-weight: 800;
}

.auth-head p {
    margin: 0;
    color: var(--slate-500);
    font-size: 0.9rem;
}

.auth-links {
    display: flex;
    justify-content: flex-end;
    margin: 0.25rem 0 1.1rem;
}

.auth-links a {
    color: var(--slate-500);
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--brand-600);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Messages / toasts
   -------------------------------------------------------------------------- */

#message-alert {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 1080;
    display: grid;
    gap: 0.6rem;
    width: min(22rem, calc(100vw - 2rem));
    animation: toast-in 0.28s ease-out both, toast-out 0.4s ease-in 7.6s forwards;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand-500);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-md);
    color: var(--slate-700);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.45;
}

.app-toast__body {
    flex: 1;
    min-width: 0;
}

.app-toast__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-600);
}

.app-toast__close {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--slate-400);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.app-toast__close:hover {
    background: var(--line-soft);
    color: var(--ink-900);
}

.app-toast--success {
    border-left-color: var(--success);
}

.app-toast--success .app-toast__icon {
    background: #e7f8f0;
    color: var(--success);
}

.app-toast--warning {
    border-left-color: var(--accent);
}

.app-toast--warning .app-toast__icon {
    background: #fff7e6;
    color: #b45309;
}

.app-toast--error {
    border-left-color: var(--danger);
}

.app-toast--error .app-toast__icon {
    background: #ffe9ee;
    color: var(--danger);
}

.app-toast--info,
.app-toast--debug {
    border-left-color: var(--info);
}

.app-toast--info .app-toast__icon,
.app-toast--debug .app-toast__icon {
    background: #eaf2ff;
    color: var(--info);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        visibility: hidden;
        transform: translateY(0.5rem);
    }
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.pagination .step-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-xs);
}

.pagination .step-links a,
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border: 0;
    border-radius: 999px;
    color: var(--slate-600);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.pagination .step-links a:hover,
.pagination .page-link:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

.pagination .current {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: var(--ink-900);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.app-footer {
    margin-top: auto;
    background: var(--ink-900);
    color: rgba(255, 255, 255, 0.72);
}

.app-footer__inner {
    max-width: 1560px;
    margin: 0 auto;
    padding: clamp(2rem, 4vw, 3rem) clamp(0.85rem, 2.5vw, 2rem) 1.25rem;
}

.app-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
    color: #fff;
    text-decoration: none;
}

.app-footer__brand img {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.25rem;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
}

.app-footer__brand span {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.app-footer__about {
    max-width: 22rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.84rem;
    line-height: 1.6;
}

.app-footer__title {
    margin-bottom: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.app-footer__link {
    display: inline-block;
    padding: 0.22rem 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.87rem;
    text-decoration: none;
    transition: color 0.16s ease, transform 0.16s ease;
}

.app-footer__link:hover {
    color: #fff;
    transform: translateX(2px);
}

.app-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.15rem;
    padding-right: 3.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
}

.app-footer__bottom a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.app-footer__bottom a:hover {
    color: #fff;
}

.app-fab {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 1040;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-md);
    color: var(--ink-900);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.app-fab:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--brand-700);
}

/* --------------------------------------------------------------------------
   Legacy sidebar helpers (kept for compatibility)
   -------------------------------------------------------------------------- */

.dropdown-toggle {
    outline: 0;
}

.btn-toggle {
    padding: 0.25rem 0.5rem;
    background-color: transparent;
    color: var(--bs-emphasis-color);
    font-weight: 600;
}

.btn-toggle:hover,
.btn-toggle:focus {
    background-color: var(--bs-tertiary-bg);
    color: rgba(var(--bs-emphasis-color-rgb), 0.85);
}

.btn-toggle::before {
    width: 1.25em;
    line-height: 0;
    content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%2810,22,34,.45%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
    transition: transform 0.35s ease;
    transform-origin: 0.5em 50%;
}

.btn-toggle[aria-expanded="true"] {
    color: rgba(var(--bs-emphasis-color-rgb), 0.85);
}

.btn-toggle[aria-expanded="true"]::before {
    transform: rotate(90deg);
}

.btn-toggle-nav a {
    padding: 0.1875rem 0.5rem;
    margin-top: 0.125rem;
    margin-left: 1.25rem;
}

.btn-toggle-nav a:hover,
.btn-toggle-nav a:focus {
    background-color: var(--bs-tertiary-bg);
}

.scrollarea {
    overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 600px) {
    .v-banner {
        visibility: visible;
    }

    .h-col {
        display: none;
    }
}

@media only screen and (min-width: 992px) {
    .v-banner {
        visibility: hidden;
    }

    .app-main {
        padding-top: 2.25rem;
    }
}

@media (max-width: 991.98px) {
    .app-header__inner {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .app-brand {
        order: 0;
    }

    .app-header__toggle {
        order: 1;
    }

    .app-header__actions {
        order: 2;
        margin-left: 0;
    }

    .app-nav {
        order: 3;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        width: 100%;
        margin: 0;
        padding: 0.5rem 0 0.75rem;
        border-top: 1px solid var(--line-soft);
    }

    .app-nav__link {
        padding: 0.6rem 0.75rem;
        border-radius: var(--radius-sm);
    }

    .app-avatar__name {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Responsive sidebar navigation */
.app-mobile-bar {
    display: flex;
    align-items: center;
    padding: .8rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line-soft);
}
.app-header.offcanvas-lg {
    --bs-offcanvas-width: 260px;
    width: 260px;
    background: rgba(255,255,255,.96);
    border-right: 1px solid var(--line);
    border-bottom: 0;
}
.app-header .app-header__inner {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 1.75rem;
    height: 100%;
    min-height: 0;
    padding: 1.5rem 1.1rem;
    overflow-y: auto;
}
.app-header .app-brand { padding: 0 .25rem; }
.app-sidebar__close { position: absolute; right: .65rem; top: .65rem; }
.app-header .app-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    order: initial;
    width: 100%;
    gap: .35rem;
    margin: 0;
    padding: 1.25rem 0;
    border-top: 1px solid var(--line-soft);
}
.app-header .app-nav__link { padding: .7rem .9rem; border-radius: var(--radius-sm); }
.app-header .app-header__actions {
    flex-direction: column;
    align-items: stretch;
    order: initial;
    gap: 1rem;
    margin: auto 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line-soft);
}
.app-header .app-cta { justify-content: center; }
.app-header .app-avatar { width: 100%; }
.app-header .app-avatar__name { display: inline; min-width: 0; }
.app-header .app-avatar__initials { flex-shrink: 0; }
.app-header .app-menu { --bs-dropdown-min-width: 13.5rem; }
@media (min-width: 992px) {
    .app-header.offcanvas-lg {
        position: fixed;
        inset: 0 auto 0 0;
        height: 100dvh;
        background: rgba(255,255,255,.88) !important;
    }
    .app-body--sidebar > .app-main,
    .app-body--sidebar > .app-footer { margin-left: 260px; }
}
