:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #d8dee8;
    --brand: #00bfff;
    --brand-dark: #00ace6;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 14px 24px;
}

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

.topbar nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.notifications {
    position: relative;
}

.notifications-trigger {
    align-items: center;
    background: #ffffff;
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    gap: 6px;
    min-height: 36px;
    padding: 6px;
    text-decoration: none;
}

.notifications-trigger:hover,
.notifications-trigger:focus {
    color: var(--brand);
    text-decoration: none;
}

.bell {
    display: block;
    height: 20px;
    width: 20px;
}

.badge {
    align-items: center;
    background: #b42318;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    min-width: 20px;
    padding: 2px 6px;
}

.notifications-menu {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    display: none;
    gap: 6px;
    min-width: 320px;
    padding: 10px;
    position: absolute;
    right: 0;
    z-index: 20;
}

.notifications:hover .notifications-menu,
.notifications:focus-within .notifications-menu {
    display: grid;
}

.notifications-menu-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.notifications-menu-head a {
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    padding: 0;
}

.notifications-clear-form {
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 8px;
}

.notifications-clear-form button {
    width: 100%;
}

.notifications-menu a {
    border-radius: 6px;
    color: var(--ink);
    display: grid;
    gap: 3px;
    padding: 8px;
}

.notifications-menu a:hover {
    background: #fff8e6;
    text-decoration: none;
}

.notifications-menu small,
.empty-note {
    color: var(--muted);
}


.notifications-page {
    display: grid;
    gap: 10px;
}

.notification-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    gap: 4px;
    padding: 12px;
}

.notification-row:hover {
    background: #fff8e6;
    text-decoration: none;
}

.notification-row small,
.notification-row span {
    color: var(--muted);
}

.notification-type {
    color: var(--brand) !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px 20px 56px;
}

h1,
h2 {
    margin: 0 0 12px;
}

.back-link {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 10px;
    text-decoration: none;
}

.back-link:hover {
    color: var(--brand);
    text-decoration: none;
}

.page-head {
    align-items: flex-end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.row-actions {
    align-items: center;
}

.panel,
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    margin-bottom: 22px;
    padding: 18px;
}

.narrow {
    margin-left: auto;
    margin-right: auto;
    max-width: 460px;
}

.cards {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
    color: var(--ink);
    display: grid;
    gap: 8px;
    padding: 18px;
}

.card:hover {
    border-color: var(--brand);
    text-decoration: none;
}

.muted {
    color: var(--muted);
}

.flash {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.flash.success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.flash.error {
    background: #fef3f2;
    border: 1px solid #fecdca;
}

form.stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

textarea {
    resize: vertical;
}

button,
.button {
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.button.secondary {
    background: #ffffff;
    color: var(--brand);
}

.button.secondary:hover {
    background: #eef7fa;
}

.button.danger,
button.danger {
    background: #b42318;
    border-color: #b42318;
    color: #ffffff;
}

.button.danger:hover,
button.danger:hover {
    background: #912018;
    border-color: #912018;
}

.link-button {
    background: none;
    border: 0;
    color: var(--brand);
    font-weight: 600;
    min-height: 0;
    padding: 0;
}

.link-button.danger {
    color: var(--danger);
}

.link-button:hover {
    background: none;
    text-decoration: underline;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: 2fr 1fr auto;
}

.filters,
.inline-form {
    align-items: end;
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.filters {
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto;
}

.inline-form {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

table {
    background: #ffffff;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

tbody {
    border: 1px solid var(--line);
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
}

th {
    background: #f0f3f7;
    color: #344054;
    font-size: 13px;
    text-transform: uppercase;
}

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

tr.issue-row {
    cursor: pointer;
}

tr.issue-row:hover,
tr.issue-row:focus {
    background: #f8fafc;
    outline: none;
}

tr.issue-row:focus {
    box-shadow: inset 0 0 0 2px var(--brand);
}


.priority-list-help {
    margin: 0 0 12px;
}

.priority-row {
    cursor: grab;
}

.priority-row:active {
    cursor: grabbing;
}

.priority-row.dragging {
    opacity: 0.55;
}

.priority-number {
    font-weight: 800;
}

.unread-row {
    background: #ffd;
    box-shadow: inset 0 0 0 9999px rgba(217, 119, 6, 0.08);
}

.unread-row td:first-child {
    border-left: 4px solid #d97706;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
}


.issue-summary-bar {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.feedback-toggle-switch {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 9px;
    margin-left: auto;
}

.feedback-toggle-label,
.feedback-switch {
    border: 0;
    font: inherit;
}

.feedback-toggle-label {
    background: transparent;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    min-height: 30px;
    padding: 5px 9px;
    transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
    align-items: center;

}

.feedback-toggle-label:hover {
    transform: translateY(-1px);
}

.feedback-toggle-label-client.active {
    background: color-mix(in srgb, var(--client-feedback-color) 32%, white);
    box-shadow: inset 0 0 0 1px var(--client-feedback-color);
    color: #1f2937;
}

.feedback-toggle-label-dev.active {
    background: color-mix(in srgb, var(--dev-feedback-color) 32%, white);
    box-shadow: inset 0 0 0 1px var(--dev-feedback-color);
    color: #1f2937;
}

.feedback-switch {
    background: transparent;
    cursor: pointer;
    min-height: auto;
    padding: 0;
}

.feedback-switch-track {
    background-color: var(--brand);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.18);
    display: block;
    height: 28px;
    padding: 3px;
    position: relative;
    transition: box-shadow 180ms ease, transform 180ms ease;
    width: 58px;
}

button.feedback-switch:hover {
    background: none;
}

button.feedback-toggle-label:hover {
    background: none;
}

.feedback-switch-thumb {
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.28);
    display: block;
    height: 20px;
    transform: translateX(0);
    transition: transform 240ms cubic-bezier(.2, .8, .2, 1), box-shadow 180ms ease;
    width: 20px;
}

.feedback-toggle-switch.is-dev .feedback-switch-thumb {
    transform: translateX(30px);
}

@media (max-width: 760px) {
    .issue-summary-bar {
        display: grid;
    }

    .feedback-toggle-switch {
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-left: 0;
    }
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.check-chip {
    display: inline-flex;
    font-weight: 500;
}

.check-chip input {
    margin-right: 6px;
    min-height: auto;
    width: auto;
}

.check-chip span,
.label {
    background: color-mix(in srgb, var(--chip-color) 14%, white);
    border: 1px solid var(--chip-color);
    border-radius: 999px;
    color: #1f2937;
    display: inline-flex;
    padding: 3px 9px;
    font-size: 13px;
}

.issue-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.issue-list-label {
    font-size: 12px;
    line-height: 1.2;
    padding: 2px 7px;
}

.pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 0px;
}


.status-pill {
    align-items: center;
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: 999px;
    color: #166534;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 9px;
    white-space: nowrap;
}

.status-closed {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #475569;
}

.issue-closed {
    opacity: 0.78;
}

.issue-closed strong {
    color: #64748b;
}

.closed-ticket-indicator {
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #94a3b8;
    border-radius: 999px;
    color: #475569;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    margin-left: 6px;
    padding: 2px 6px;
    vertical-align: middle;
}

.closed-ticket-indicator-title {
    font-size: 13px;
    padding: 4px 9px;
}

.meta {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0;
}

.meta div {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.meta dt {
    color: var(--muted);
    font-size: 13px;
}

.meta dd {
    margin: 2px 0 0;
}

.messages {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.message {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-left: 4px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
}

.message-admin {
    background: #f0fbff;
    border-left-color: var(--brand);
}

.message-client {
    background: #fffaf0;
    border-left-color: #f59e0b;
}

.message-head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.message-head span {
    color: var(--muted);
    font-size: 13px;
}

.message-icon-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.icon-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 16px;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    line-height: 1;
    min-height: 0;
    padding: 0;
    width: 30px;
}

.icon-button:hover {
    background: #ffffff;
    color: var(--brand);
}

.icon-button.danger:hover {
    background: #fef3f2;
    border-color: #fecdca;
    color: #912018;
}

.message-edit-form {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
}

.message-edit-form[hidden] {
    display: none;
}

.message-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.message-edit-actions button {
    min-height: 34px;
    padding: 6px 12px;
}

.attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.attachments a {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 9px;
}

.label-list {
    display: grid;
    gap: 10px;
}

.label-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px;
}

.pill.low {
    background: #eef4ff;
    color: #1849a9;
}

.pill.medium {
    background: #fef7c3;
    color: #854a0e;
}

.pill.high {
    background: #ffead5;
    color: #9c2a10;
}

.pill.critical {
    background: #fee4e2;
    color: #912018;
}

@media (max-width: 760px) {
    .topbar,
    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .grid.two,
    .grid.three,
    .filters {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}


.icon-button.admin-create-button {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 24px;
    height: 42px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 42px;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, 0.42);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 20px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 50;
}

.modal-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    max-width: 460px;
    padding: 22px;
    position: relative;
    width: min(100%, 460px);
}

.modal-card h2 {
    margin-top: 0;
}

.modal-close {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 26px;
    height: 34px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 14px;
    top: 12px;
    width: 34px;
}

.modal-close:hover {
    background: transparent;
    color: var(--brand);
}

.modal-form {
    display: grid;
    gap: 12px;
}


.meta-edit-dropdown {
    position: relative;
}
.meta-edit-dropdown summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}
.meta-edit-dropdown summary::-webkit-details-marker {
    display: none;
}
.meta-edit-dropdown summary::after {
    content: ' ▾';
    color: var(--muted);
    font-weight: 600;
}
.meta-edit-dropdown select {
    min-width: 200px;
}


.meta-check-list,
.assignee-check-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
}
.meta-check-list label,
.assignee-check-list label {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}
.field-group {
    display: grid;
    gap: 8px;
}
.field-label {
    color: var(--text);
    font-weight: 700;
}


.basic-dropdown {
    position: relative;
}
.basic-dropdown summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}
.basic-dropdown summary::-webkit-details-marker {
    display: none;
}
.basic-dropdown summary::after {
    color: var(--muted);
    content: ' ▾';
    font-weight: 600;
}
.basic-dropdown-menu {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    display: grid;
    gap: 2px;
    margin-top: 8px;
    max-height: 280px;
    min-width: 240px;
    overflow: auto;
    padding: 6px;
    position: absolute;
    z-index: 20;
}
.dropdown-option {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 8px;
    justify-content: flex-start;
    min-height: 34px;
    padding: 7px 9px;
    text-align: left;
    white-space: nowrap;
    width: 100%;
}
.dropdown-option:hover,
.dropdown-option:focus {
    background: #f8fafc;
    outline: none;
}
.dropdown-option.selected {
    font-weight: 700;
}
.dropdown-option-tick {
    color: var(--brand);
    display: inline-block;
    flex: 0 0 16px;
    text-align: center;
}


.formatted-message p,
.formatted-message ul,
.formatted-message ol,
.formatted-message blockquote {
    margin: 0 0 10px;
}
.formatted-message p:last-child,
.formatted-message ul:last-child,
.formatted-message ol:last-child,
.formatted-message blockquote:last-child {
    margin-bottom: 0;
}
.formatted-message ul,
.formatted-message ol {
    padding-left: 22px;
}
.formatted-message blockquote {
    border-left: 4px solid var(--line);
    color: var(--muted);
    padding: 6px 0 6px 12px;
}
.format-hint {
    color: var(--muted);
    font-size: 12px;
    margin: -6px 0 4px;
}


.quill-editor {
    background: #fff;
    border-radius: 0 0 8px 8px;
    min-height: 150px;
}
.ql-toolbar.ql-snow {
    background: #f8fafc;
    border-color: var(--line);
    border-radius: 8px 8px 0 0;
}
.ql-container.ql-snow {
    border-color: var(--line);
    border-radius: 0 0 8px 8px;
    font: inherit;
}
.ql-editor {
    min-height: 140px;
}
.message-edit-form .ql-editor {
    min-height: 110px;
}

/* Compact the limited Quill toolbar controls. */
.ql-toolbar.ql-snow {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
}
.ql-toolbar.ql-snow .ql-formats {
    display: inline-flex;
    gap: 4px;
    margin: 0;
}
.ql-toolbar.ql-snow button {
    align-items: center;
    border-radius: 5px;
    display: inline-flex;
    height: 26px;
    justify-content: center;
    padding: 4px;
    width: 26px;
}
.ql-toolbar.ql-snow button svg {
    height: 15px;
    width: 15px;
}
.ql-toolbar.ql-snow button.ql-blockquote svg,
.ql-toolbar.ql-snow button.ql-list svg {
    height: 16px;
    width: 16px;
}
