* {
    box-sizing: border-box;
}

:root {
    --bg: #f7f3ec;
    --bg-glow: radial-gradient(circle at top left, rgba(191, 148, 77, 0.18), transparent 34%), radial-gradient(circle at top right, rgba(36, 34, 32, 0.08), transparent 30%);
    --text: #231f1a;
    --accent: #b8893c;
    --accent-hover: #9f7530;
    --surface-soft: #eee6d8;
    --surface-hover: #e6dccb;
    --border: #d7c7ae;
    --secondary: #2b2622;
    --secondary-hover: #171412;
}

body {
    margin: 0;
    background: var(--bg);
    background-image: var(--bg-glow);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body.theme-dark {
    --bg: #11100f;
    --bg-glow: radial-gradient(circle at top left, rgba(191, 148, 77, 0.16), transparent 32%), radial-gradient(circle at top right, rgba(120, 113, 108, 0.08), transparent 30%);
    --text: #ece3d4;
    --accent: #d7ad63;
    --accent-hover: #bf944d;
    --surface-soft: #1d1a17;
    --surface-hover: #2a2520;
    --border: #463d34;
    --secondary: #f1e5cf;
    --secondary-hover: #e6d2a8;
    background: var(--bg);
    background-image: var(--bg-glow);
    color: #d1d5db;
}

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

.auth-topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
}

.layout {
    display: block;
    min-height: 100vh;
}

.sidebar {
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100vh;
    left: 0;
    position: fixed;
    top: 0;
    transition: width 180ms ease;
    overflow: hidden;
    width: 260px;
    z-index: 120;
}

.sidebar__head {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 18px;
}

.hamburger {
    background: var(--surface-soft);
    border: 0;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    height: 38px;
    width: 38px;
}

.sidebar__profile {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    padding: 18px;
}

.sidebar__profile img,
.sidebar__profile span,
.profile-preview img,
.profile-preview span {
    align-items: center;
    background: var(--accent);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    font-size: 18px;
    font-weight: 700;
    height: 48px;
    justify-content: center;
    object-fit: cover;
    width: 48px;
}

.sidebar__profile strong,
.sidebar__profile small {
    display: block;
}

.sidebar__profile small {
    color: #6b7280;
    font-size: 12px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__nav {
    align-content: start;
    display: grid;
    gap: 4px;
    grid-auto-rows: min-content;
    overflow-y: auto;
    padding: 10px 12px;
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
}

.sidebar__nav a,
.sidebar__footer a {
    align-items: center;
    border-radius: 6px;
    color: #374151;
    display: flex;
    font-size: 14px;
    gap: 10px;
    min-height: 38px;
    padding: 9px 12px;
    position: relative;
}

.sidebar__nav a:hover,
.sidebar__footer a:hover {
    background: #f3f4f6;
    color: #111827;
}

.sidebar__footer {
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: 6px;
    padding: 12px;
    flex: 0 0 auto;
}

.sidebar__footer .button {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    min-height: 38px;
    overflow: hidden;
    padding: 11px 12px;
    white-space: nowrap;
}

.sidebar-icon {
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 16px;
    justify-content: center;
    width: 18px;
}

.sidebar-link-icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 20px;
    font-size: 17px;
    justify-content: center;
    line-height: 1;
    width: 20px;
}

.sidebar-link-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-collapsed .sidebar {
    overflow: visible;
    width: 78px;
}

.sidebar-collapsed .app-shell {
    margin-left: 78px;
    width: min(1440px, calc(100% - 78px));
}

.sidebar-collapsed .app-shell__topbar {
    left: 78px;
}

.sidebar-collapsed .sidebar__head {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .brand,
.sidebar-collapsed .sidebar__profile div,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-link-label {
    display: none;
}

.sidebar-collapsed .sidebar__profile {
    justify-content: center;
    padding: 18px 0;
}

.sidebar-collapsed .sidebar__profile img,
.sidebar-collapsed .sidebar__profile span {
    height: 44px;
    width: 44px;
}

.sidebar-collapsed .sidebar__nav,
.sidebar-collapsed .sidebar__footer {
    padding: 10px 12px;
}

.sidebar-collapsed .sidebar__nav a,
.sidebar-collapsed .sidebar__footer a,
.sidebar-collapsed .sidebar__footer .button {
    align-items: center;
    font-size: 14px;
    justify-content: center;
    min-height: 38px;
    padding: 0;
    width: 54px;
}

.sidebar-collapsed .sidebar-link-icon {
    flex-basis: auto;
    font-size: 18px;
    width: auto;
}

.sidebar-collapsed .sidebar__nav a:hover::after,
.sidebar-collapsed .sidebar__footer a:hover::after,
.sidebar-collapsed .sidebar__footer .button:hover::after {
    background: #111827;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    color: #ffffff;
    content: attr(data-tooltip);
    font-size: 13px;
    font-weight: 700;
    left: 66px;
    line-height: 1;
    padding: 10px 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    z-index: 220;
}

.sidebar-collapsed .sidebar__nav a:hover::before,
.sidebar-collapsed .sidebar__footer a:hover::before,
.sidebar-collapsed .sidebar__footer .button:hover::before {
    border-bottom: 6px solid transparent;
    border-right: 6px solid #111827;
    border-top: 6px solid transparent;
    content: "";
    left: 60px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 221;
}

.sidebar-collapsed .sidebar__footer .button .sidebar-icon {
    margin: 0;
}

.brand {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

.nav {
    align-items: center;
    display: flex;
    gap: 18px;
}

.nav a {
    color: #374151;
    font-size: 14px;
}

.app-shell {
    flex: 1;
    margin: 0 0 0 260px;
    max-width: 1440px;
    padding: 84px 24px 32px;
    transition: margin-left 180ms ease;
    width: min(1440px, calc(100% - 260px));
}

.app-shell__topbar {
    align-items: center;
    background: rgba(247, 243, 236, .92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(215, 199, 174, .75);
    display: flex;
    justify-content: flex-end;
    left: 260px;
    margin: 0;
    min-height: 60px;
    padding: 0 24px;
    position: fixed;
    right: 0;
    top: 0;
    transition: left 180ms ease;
    z-index: 60;
}

.notification-link {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    position: relative;
    width: 42px;
}

.notification-link__badge {
    align-items: center;
    background: #d81265;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    min-height: 18px;
    min-width: 18px;
    padding: 0 5px;
    position: absolute;
    right: -7px;
    top: -7px;
}

.app-shell--auth {
    display: block;
    margin: 0 auto;
    padding: 32px 24px;
}

.panel,
.hero,
.stats article {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.theme-dark .sidebar,
.theme-dark .auth-topbar,
.theme-dark .panel,
.theme-dark .hero,
.theme-dark .stats article,
.theme-dark .modal__panel {
    background: #111827;
    border-color: #263244;
}

.theme-dark .brand,
.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark .stats span,
.theme-dark .detail-grid strong,
.theme-dark .sidebar__nav a:hover,
.theme-dark .sidebar__footer a:hover {
    color: #f9fafb;
}

.theme-dark .sidebar__nav a:hover,
.theme-dark .sidebar__footer a:hover,
.theme-dark .sidebar__footer .button:hover {
    background: var(--accent);
    color: #ffffff;
}

.theme-dark .sidebar__head,
.theme-dark .sidebar__profile,
.theme-dark .sidebar__footer,
.theme-dark .table th,
.theme-dark .table td {
    border-color: #263244;
}

.theme-dark .sidebar__nav a,
.theme-dark .sidebar__footer a,
.theme-dark .nav a,
.theme-dark .form label {
    color: #d1d5db;
}

.theme-dark .muted,
.theme-dark .sidebar__profile small {
    color: #9ca3af;
}

.theme-dark .form input,
.theme-dark .form textarea,
.theme-dark .form select,
.theme-dark textarea[readonly] {
    background: #0f172a;
    border-color: #374151;
    color: #f9fafb;
}

.theme-dark .button.button--ghost,
.theme-dark button.button.button--ghost,
.theme-dark .hamburger,
.theme-dark .notification-link,
.theme-dark .icon-button,
.theme-dark .detail-grid div {
    background: #1f2937;
    color: #f9fafb;
}

.theme-dark .app-shell__topbar {
    background: rgba(17, 24, 39, .92);
    border-color: #263244;
}

.theme-dark .button.button--ghost:hover,
.theme-dark .button.button--ghost:focus,
.theme-dark .button.button--ghost:active,
.theme-dark button.button.button--ghost:hover,
.theme-dark button.button.button--ghost:focus,
.theme-dark button.button.button--ghost:active {
    background: #314054;
    border-color: #374151;
    color: #f9fafb;
}

.panel {
    padding: 24px;
}

.tabs-nav {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    gap: 6px;
    margin: 0 0 18px;
    overflow-x: auto;
    padding: 8px;
}

.ticket-tabs-nav {
    position: sticky;
    top: 72px;
    z-index: 45;
}

.website-tabs-nav {
    position: sticky;
    top: 72px;
    z-index: 55;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.theme-dark .tabs-nav {
    background: #111827;
    border-color: #263244;
}

.tabs-nav__button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #4b5563;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 11px 14px;
    white-space: nowrap;
}

.tabs-nav__button:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.tabs-nav__button.is-active {
    background: var(--accent);
    color: #ffffff;
}

.theme-dark .tabs-nav__button {
    color: #d1d5db;
}

.theme-dark .tabs-nav__button:hover {
    background: #1f2937;
    color: #ffffff;
}

.theme-dark .tabs-nav__button.is-active {
    background: var(--accent);
    color: #ffffff;
}

.tab-panel[hidden] {
    display: none !important;
}

.panel--narrow {
    margin: 32px auto;
    max-width: 480px;
}

.hero {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 28px;
}

.dashboard-hero {
    align-items: center;
    background: #111827;
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 30px;
}

.dashboard-hero h1 {
    color: #ffffff;
    font-size: 34px;
    margin-bottom: 10px;
}

.dashboard-hero p {
    color: #d1d5db;
    margin: 0;
}

.dashboard-hero .eyebrow {
    color: #f9a8d4;
}

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

.dashboard-stats,
.dashboard-grid,
.email-hub-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid,
.email-hub-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stats article,
.dashboard-card,
.email-hub-card {
    padding: 22px;
}

.dashboard-stats article {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.theme-dark .dashboard-stats article {
    background: #111827;
    border-color: #263244;
}

.dashboard-stats strong,
.dashboard-card span,
.email-hub-card span {
    color: #111827;
    display: block;
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 8px;
}

.theme-dark .dashboard-stats strong,
.theme-dark .dashboard-card span,
.theme-dark .email-hub-card span {
    color: #f9fafb;
}

.dashboard-stats span {
    color: #6b7280;
    font-weight: 800;
}

.email-tabs-nav {
    margin-bottom: 20px;
}

.email-overview {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.email-overview__item {
    border-right: 1px solid #e5e7eb;
    padding-right: 18px;
}

.email-overview__item:last-child {
    border-right: 0;
    padding-right: 0;
}

.theme-dark .email-overview__item {
    border-color: #263244;
}

.email-overview__item strong {
    color: #111827;
    display: block;
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 6px;
}

.theme-dark .email-overview__item strong {
    color: #f9fafb;
}

.email-overview__item span {
    color: #111827;
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
}

.theme-dark .email-overview__item span {
    color: #f9fafb;
}

.email-overview__item p {
    color: #6b7280;
    margin: 0;
}

h1,
h2 {
    color: #111827;
    margin: 0 0 12px;
}

.eyebrow {
    color: #d81265;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.muted {
    color: #6b7280;
    line-height: 1.6;
}

.ai-recommendation {
    font-size: 13px;
    margin: -6px 0 10px;
}

.slug-link-preview {
    font-size: 13px;
    margin: -6px 0 8px;
}

.slug-link-preview a {
    color: #b8893c;
    text-decoration: none;
    word-break: break-all;
}

.slug-link-preview a:hover {
    text-decoration: underline;
}

.slug-validation {
    color: #dc2626;
    font-size: 13px;
    margin: -4px 0 8px;
}

.button,
button.button {
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    padding: 12px 18px;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover,
button.button:hover {
    background: var(--accent-hover);
}

.button--small {
    padding: 8px 12px;
}

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

.button--secondary:hover {
    background: var(--secondary-hover);
    color: #f8f4ee;
}

.button.button--ghost,
button.button.button--ghost {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text);
}

.button.button--ghost:hover,
.button.button--ghost:focus,
.button.button--ghost:active,
button.button.button--ghost:hover,
button.button.button--ghost:focus,
button.button.button--ghost:active {
    background: transparent;
    border-color: var(--border);
    color: #111827;
}

.button.button--outline,
button.button.button--outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.button.button--outline:hover,
button.button.button--outline:hover {
    background: var(--surface-soft);
    border-color: var(--accent);
    color: var(--text);
}

.theme-dark .button.button--outline,
.theme-dark button.button.button--outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.theme-dark .button.button--outline:hover,
.theme-dark button.button.button--outline:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--text);
}

body.theme-dark .button--secondary {
    color: #221b10;
}

body.theme-dark .button--secondary:hover {
    color: #221b10;
}

.button--danger {
    background: #dc2626;
    color: #ffffff;
}

.button--danger:hover {
    background: #b91c1c;
    color: #ffffff;
}

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

.form label {
    color: #374151;
    display: grid;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
}

.form input,
.form textarea,
.form select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    font: inherit;
    padding: 11px 12px;
    width: 100%;
}

.form-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.form-section h3 {
    color: #111827;
    font-size: 16px;
    margin: 0;
}

.theme-dark .form-section {
    border-color: #263244;
}

.theme-dark .form-section h3 {
    color: #f9fafb;
}

.toggle-field {
    align-items: center;
    display: flex !important;
    gap: 12px !important;
}

.toggle-field input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.toggle-switch {
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 48px;
    height: 26px;
    padding: 3px;
    transition: background 160ms ease;
    width: 48px;
}

.toggle-switch::before {
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
    content: "";
    height: 20px;
    transition: transform 160ms ease;
    width: 20px;
}

.toggle-field input:checked + .toggle-switch {
    background: #d81265;
}

.toggle-field input:checked + .toggle-switch::before {
    transform: translateX(22px);
}

.toggle-field input:focus + .toggle-switch {
    outline: 2px solid rgba(216, 18, 101, 0.28);
    outline-offset: 2px;
}

.stats {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 24px 0;
}

.stats article {
    padding: 22px;
}

.stats span {
    color: #111827;
    display: block;
    font-size: 32px;
    font-weight: 700;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.deployment-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deployment-grid .panel {
    margin: 0;
}

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

.deploy-actions form {
    margin: 0;
}

.pages-control-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 18px;
}

.main-page-form,
.page-search {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 154px;
    padding: 16px;
}

.main-page-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1fr) auto;
}

.main-page-form label,
.page-search label {
    color: #374151;
    display: grid;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
}

.main-page-form select,
.page-search input {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    color: #111827;
    font: inherit;
    min-height: 44px;
    padding: 11px 12px;
    width: 100%;
}

.main-page-form .muted {
    grid-column: 1 / -1;
    margin: 0;
}

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

.form-actions .button,
.form-actions button.button {
    min-height: 44px;
    padding: 10px 16px;
    white-space: nowrap;
}

.form--spaced {
    margin-top: 18px;
}

.global-code-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.ai-settings-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-settings-grid .form-actions {
    grid-column: 1 / -1;
}

.global-code-form,
.global-code-side-form {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
}

.global-code-form {
    gap: 12px;
}

.global-code-form > label {
    font-size: 16px;
    font-weight: 800;
    gap: 6px;
    line-height: 1.35;
}

.global-code-form textarea {
    line-height: 1.55;
    min-height: 180px;
    padding: 10px 12px;
    resize: vertical;
}

.global-code-form .form-actions,
.global-code-side-form .form-actions {
    align-items: center;
}

.global-code-form .form-actions .button,
.global-code-side-form .form-actions .button,
.global-code-form .form-actions button.button,
.global-code-side-form .form-actions button.button {
    flex: 0 0 auto;
}

.global-code-side-form {
    align-content: start;
}

.theme-dark .main-page-form,
.theme-dark .page-search,
.theme-dark .global-code-form,
.theme-dark .global-code-side-form {
    background: #0f172a;
    border-color: #263244;
}

.theme-dark .main-page-form label,
.theme-dark .page-search label {
    color: #d1d5db;
}

.theme-dark .main-page-form select,
.theme-dark .page-search input {
    background: #111827;
    border-color: #374151;
    color: #f9fafb;
}

.page-card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    display: grid;
    gap: 16px;
    padding: 18px;
}

.theme-dark .page-card {
    background: #111827;
    border-color: #263244;
}

.page-card__head,
.page-card__badges,
.page-card__actions {
    align-items: flex-start;
    display: flex;
    gap: 10px;
}

.page-card__head {
    justify-content: space-between;
}

.page-card__head h3 {
    color: #111827;
    font-size: 18px;
    margin: 0 0 4px;
}

.theme-dark .page-card__head h3 {
    color: #f9fafb;
}

.page-card__head p {
    color: #64748b;
    margin: 0;
}

.page-card__badges,
.page-card__actions {
    flex-wrap: wrap;
}

.page-card__meta {
    color: #64748b;
    display: grid;
    font-size: 13px;
    gap: 6px;
}

.page-card__meta strong {
    color: #111827;
    overflow-wrap: anywhere;
}

.theme-dark .page-card__meta strong {
    color: #f9fafb;
}

.page-search-empty {
    margin-top: 18px;
}

.button.is-loading,
.button:disabled,
button.button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.button.is-loading::before {
    animation: spin 0.8s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: 14px;
    margin-right: 8px;
    vertical-align: -2px;
    width: 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ftp-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
}

.ftp-update-link {
    background: #fff7fb;
    border: 1px solid #f9a8d4;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    margin: 0 0 18px;
    padding: 16px;
}

.theme-dark .ftp-update-link {
    background: #1f1020;
    border-color: #7f1d4f;
}

.ftp-update-link h3 {
    color: #111827;
    font-size: 16px;
    margin: 0 0 4px;
}

.theme-dark .ftp-update-link h3 {
    color: #f9fafb;
}

.copy-field {
    align-items: stretch;
    display: flex;
    gap: 10px;
}

.copy-field input {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #111827;
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
}

.theme-dark .copy-field input {
    background: #0b1120;
    border-color: #263244;
    color: #f9fafb;
}

.ftp-update-link__meta {
    color: #4b5563;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 10px 18px;
}

.theme-dark .ftp-update-link__meta {
    color: #cbd5e1;
}

.ftp-help {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
}

.theme-dark .ftp-help {
    background: #0f172a;
    border-color: #263244;
}

.ftp-help h3 {
    color: #111827;
    font-size: 16px;
    margin: 0 0 14px;
}

.theme-dark .ftp-help h3 {
    color: #f9fafb;
}

.ftp-help dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.ftp-help dt {
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 4px;
}

.theme-dark .ftp-help dt {
    color: #f9fafb;
}

.ftp-help dd {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
}

.theme-dark .ftp-help dd {
    color: #cbd5e1;
}

.action-panel {
    color: inherit;
    display: block;
}

.website-card-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.website-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: 18px;
    padding: 20px;
}

.theme-dark .website-card {
    background: #111827;
    border-color: #263244;
}

.website-card__head,
.website-card__actions,
.website-card__status {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.website-card__head h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.website-card__meta {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.website-card__meta span,
.website-card__status label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.website-card__meta strong {
    color: #111827;
    display: block;
    font-size: 14px;
    margin-top: 4px;
    text-transform: none;
}

.theme-dark .website-card__meta strong {
    color: #f9fafb;
}

.website-card__status {
    align-items: end;
}

.website-card__status label {
    display: grid;
    flex: 1;
    gap: 8px;
}

.website-card__status select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    font: inherit;
    padding: 9px 10px;
    text-transform: none;
}

.theme-dark .website-card__status select {
    background: #0f172a;
    border-color: #374151;
    color: #f9fafb;
}

.website-card__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.table {
    border-collapse: collapse;
    width: 100%;
}

.table th,
.table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 10px;
    text-align: left;
    vertical-align: top;
}

.table th {
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
}

.alert {
    border-radius: 6px;
    margin: 0 0 16px;
    padding: 12px 14px;
}

.alert--section {
    margin: 12px 0 0;
}

.alert--success {
    background: #ecfdf5;
    color: #047857;
}

.alert--error {
    background: #fef2f2;
    color: #b91c1c;
}

.theme-dark .alert--success {
    background: #024023;
    color: #07d89c;
}

.theme-dark .alert--error {
    background: #450a00;
    color: #f19494;
}

.toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal {
    align-items: center;
    backdrop-filter: blur(6px);
    background: rgba(17, 24, 39, 0.48);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 1300;
}

.modal.is-open {
    display: flex;
}

.modal__panel {
    background: #ffffff;
    border-radius: 8px;
    max-height: 92vh;
    max-width: 720px;
    overflow: auto;
    padding: 24px;
    width: 100%;
}

.modal__panel--wide {
    max-width: 980px;
}

.modal__panel--danger {
    border-top: 4px solid #dc2626;
}

.modal__header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.image-preview-modal__panel {
    align-items: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    display: flex;
    justify-content: center;
    max-width: 90vw;
    padding: 0;
    position: relative;
}

.image-preview-modal {
    z-index: 2000;
}

.image-preview-modal__panel img {
    display: block;
    height: auto;
    max-height: 85vh;
    max-width: 80vw;
    object-fit: contain;
    width: auto;
}

.image-preview-modal__close {
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .24);
    position: absolute;
    right: -14px;
    top: -14px;
    z-index: 2;
}

.text-link {
    background: transparent;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    display: inline;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-align: left;
}

.text-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.delete-warning {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    color: #991b1b;
    margin-bottom: 18px;
    padding: 16px;
}

.delete-warning p {
    margin: 10px 0 0;
}

.theme-dark .delete-warning {
    background: #22161a;
    border-color: #5b2430;
    color: #f3d6db;
}

.theme-dark .delete-warning .muted,
.theme-dark .delete-warning p {
    color: #c9b6bc;
}

.theme-dark .delete-warning strong {
    color: #fff1f2;
}

.button:disabled,
button.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.icon-button {
    background: #eef2f7;
    border: 0;
    border-radius: 6px;
    color: #111827;
    cursor: pointer;
    font-size: 20px;
    height: 36px;
    width: 36px;
}

.checkbox {
    align-items: center;
    display: flex !important;
    flex-direction: row;
    font-weight: 400 !important;
}

.checkbox input {
    width: auto;
}

.permission-group {
    border: 1px solid var(--line-soft, #e5e7eb);
    border-radius: 10px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.permission-group__header h3 {
    font-size: 16px;
    margin: 0;
}

.permission-group__items {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.permission-checkbox {
    align-items: flex-start;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    gap: 10px !important;
    padding: 12px;
}

.permission-checkbox span {
    display: grid;
    gap: 4px;
}

.permission-checkbox strong {
    color: #111827;
    font-size: 13px;
}

.permission-checkbox small {
    color: #6b7280;
    font-size: 12px;
}

.table-actions {
    white-space: nowrap;
}

.theme-dark .permission-group {
    border-color: #334155;
}

.theme-dark .permission-checkbox {
    border-color: #334155;
}

.theme-dark .permission-checkbox strong {
    color: #f8fafc;
}

.theme-dark .permission-checkbox small {
    color: #94a3b8;
}

.badge {
    background: #eef2f7;
    border-radius: 999px;
    color: #374151;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.badge--ok {
    background: #ecfdf5;
    color: #047857;
}

.badge--warn {
    background: #fff7ed;
    color: #c2410c;
}

.theme-dark .badge--ok {
    background: #111111;
    color: #dc9f35;
}

.theme-dark .badge--warn {
    background: #2d7803;
    color: #ffffff;
}

.badge--danger {
    background: #fef2f2;
    color: #b91c1c;
}

.detail-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid div {
    background: #f9fafb;
    border-radius: 6px;
    padding: 12px;
}

.profile-preview {
    align-items: center;
    display: flex;
    gap: 12px;
}

textarea[readonly] {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    font: inherit;
    margin-top: 12px;
    padding: 12px;
    width: 100%;
}

.detail-grid strong {
    color: #111827;
    display: block;
    margin-bottom: 6px;
}

.media-preview-block {
    display: grid;
    gap: 10px;
    margin: 4px 0 10px;
}

.media-preview-block__label {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.media-preview-link {
    align-items: center;
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: inline-flex;
    justify-content: center;
    min-height: 84px;
    padding: 12px;
    text-decoration: none;
    width: fit-content;
}

.media-preview-image {
    display: block;
    height: auto;
    max-width: 100%;
}

.media-preview-image--og {
    width: 280px;
    max-width: 280px;
}

.media-preview-image--favicon {
    max-height: 96px;
    max-width: 96px;
}

.row-click {
    cursor: pointer;
}

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

.section-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-head h2,
.section-head h3 {
    margin: 0 0 6px;
}

.filters {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 20px;
}

.filters--tickets {
    align-items: end;
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(150px, 1fr)) auto;
    padding: 14px;
}

.filters--tickets label {
    color: var(--text-muted);
    display: grid;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
    margin: 0;
    text-transform: uppercase;
}

.filters--tickets input,
.filters--tickets select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

.theme-dark .filters--tickets input,
.theme-dark .filters--tickets select {
    background: #0f172a;
    border-color: #374151;
    color: #f9fafb;
}

.filters__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.icon-button-field {
    align-items: center;
    display: inline-flex;
    font-size: 18px;
    height: 44px;
    justify-content: center;
    min-width: 44px;
    padding: 0;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.stack-list__item {
    align-items: center;
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 14px 16px;
}

.stack-list__item[hidden],
[data-activity-page-item][hidden] {
    display: none !important;
}

.stack-list__item.is-unread {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(184, 137, 60, 0.15);
}

.stack-list__item p,
.stack-list__item strong,
.stack-list__item small {
    margin: 0;
}

.ticket-layout {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
}

.ticket-thread,
.ticket-sidebar {
    display: grid;
    gap: 20px;
}

.ticket-summary-card {
    display: grid;
    gap: 10px;
    padding: 16px 20px;
}

.ticket-summary-card__meta,
.ticket-summary-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ticket-summary-card__main {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.ticket-summary-card__links {
    justify-content: flex-end;
}

.ticket-summary-details {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    margin-top: 10px;
}

.ticket-summary-details div {
    background: transparent;
    border: 0;
    border-left: 1px solid var(--border-color);
    border-radius: 0;
    display: grid;
    gap: 3px;
    padding: 0 10px;
}

.ticket-summary-details div:first-child {
    border-left: 0;
    padding-left: 0;
}

.ticket-summary-details span,
.ticket-portal-details span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ticket-summary-details strong,
.ticket-portal-details strong {
    color: var(--text-color);
    font-size: 14px;
}

.ticket-overview-panel {
    display: grid;
    gap: 16px;
    padding: 22px;
}

.ticket-overview-panel[hidden] {
    display: none !important;
}

.ticket-overview-head {
    align-items: flex-start;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ticket-overview-head h2 {
    font-size: 26px;
    margin-bottom: 0;
}

.ticket-overview-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.ticket-overview-grid {
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ticket-overview-grid > div {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.72));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    min-width: 0;
    padding: 14px;
}

.ticket-overview-grid strong {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.ticket-overview-grid span,
.ticket-overview-grid a {
    color: var(--text-color);
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.ticket-overview-grid a {
    color: var(--accent);
}

.ticket-overview-grid a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.theme-dark .ticket-overview-grid > div {
    background: #111827;
}

.ticket-update-head {
    align-items: flex-start;
    margin-bottom: 14px;
}

.ticket-update-head > div {
    width: 100%;
}

.ticket-update-head h2 {
    margin-bottom: 6px;
}

.ticket-update-form {
    display: grid;
    gap: 18px;
}

.ticket-update-form label {
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.ticket-update-form label select {
    margin-top: 0;
}

.ticket-update-form small {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.ticket-locked-context {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ticket-locked-context div {
    background: linear-gradient(135deg, rgba(184, 137, 60, 0.10), rgba(255, 255, 255, 0.68));
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    display: grid;
    gap: 5px;
    padding: 14px;
}

.ticket-locked-context span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ticket-locked-context strong {
    color: var(--text-color);
    font-size: 15px;
}

.ticket-locked-context small {
    color: var(--text-muted);
    font-size: 12px;
}

.theme-dark .ticket-update-form label,
.theme-dark .ticket-locked-context div {
    background: #111827;
}

.ticket-product-modal {
    display: grid;
    gap: 16px;
}

.ticket-product-modal__image {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: block;
    max-height: 260px;
    max-width: 100%;
    object-fit: contain;
}

.ticket-product-modal__details {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ticket-product-modal__details div,
.ticket-product-modal__section {
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
}

.ticket-product-modal__details span {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.ticket-product-modal__section {
    line-height: 1.55;
}

.ticket-detail-grid,
.input-copy-row {
    display: grid;
    gap: 14px;
}

.ticket-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 16px;
}

.ticket-detail-grid div {
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 5px;
    padding: 12px;
}

.ticket-detail-grid span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.input-copy-row {
    align-items: end;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 18px;
}

.clickable-row {
    cursor: pointer;
}

.grid-span-2 {
    grid-column: 1 / -1;
}

.product-thumb {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: block;
    height: 42px;
    object-fit: cover;
    width: 56px;
}

.product-image-detail {
    grid-row: span 2;
}

.product-image-detail img {
    border-radius: 8px;
    display: block;
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
}

.ticket-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 14px;
}

.ticket-pagination__button {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    min-width: 34px;
    padding: 7px 10px;
}

.ticket-pagination__button.is-active,
.ticket-pagination__button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.ticket-message-list {
    display: grid;
    gap: 14px;
}

.ticket-conversation-scroll {
    background: #f7f3ec;
    border: 1px solid #d7dee9;
    border-radius: 8px;
    max-height: 620px;
    overflow-y: auto;
    padding: 14px;
}

.ticket-message {
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.ticket-message--internal_note {
    border-left: 4px solid #b8893c;
}

.ticket-message--public {
    border-left: 4px solid #2f6fdd;
}

.ticket-message--customer {
    background: #ffffff;
    margin-right: clamp(0px, 8vw, 72px);
}

.ticket-message--agent {
    background: #f8fafc;
    margin-left: clamp(0px, 8vw, 72px);
}

.theme-dark .ticket-message--customer,
.theme-dark .ticket-message--agent,
.theme-dark .ticket-reply-composer,
.theme-dark .ticket-comment,
.theme-dark .ticket-message-modal-source,
.theme-dark .ticket-file-card {
    background: #0f172a;
    border-color: #374151;
    color: #f9fafb;
}

.theme-dark .ticket-conversation-scroll {
    background: #110f0f;
    border-color: #334155;
}

.theme-dark .ticket-comments-search input {
    background: #0f172a;
    border-color: #374151;
    color: #f9fafb;
}

.theme-dark .ticket-comment-row,
.theme-dark .mention-suggestions {
    background: #0f172a;
    border-color: #334155;
    color: #f9fafb;
}

.theme-dark .ticket-comment-row:hover {
    background: #111c31;
    border-color: #4b5f80;
}

.theme-dark .ticket-comment-row__avatar {
    background: #1e3a8a;
    color: #dbeafe;
}

.theme-dark .ticket-comment-row__message,
.theme-dark .ticket-comment-row__head small,
.theme-dark .mention-suggestions small {
    color: #a7b3c6;
}

.theme-dark .mention-suggestions button:hover,
.theme-dark .mention-suggestions button:focus {
    background: #1e293b;
}

.ticket-message__head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ticket-message__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.ticket-message__head strong,
.ticket-message__head small {
    display: block;
}

.ticket-message__body {
    color: var(--text-color);
    line-height: 1.65;
    white-space: normal;
}

.ticket-reply-composer {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 18px;
    padding: 16px;
}

.ticket-editor {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

.ticket-editor__toolbar {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 6px;
    padding: 8px;
}

.ticket-editor__toolbar button {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    min-width: 34px;
}

.ticket-editor__surface {
    background: #ffffff;
    color: #111827;
    line-height: 1.65;
    min-height: 180px;
    max-height: 350px;
    outline: 0;
    overflow-y: auto;
    padding: 12px;
    white-space: pre-wrap;
}

.theme-dark .ticket-editor {
    border-color: #374151;
}

.theme-dark .ticket-editor__toolbar {
    background: #111827;
    border-color: #374151;
}

.theme-dark .ticket-editor__toolbar button,
.theme-dark .ticket-editor__surface {
    background: #0f172a;
    border-color: #374151;
    color: #f9fafb;
}

.ticket-attachment-list {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.ticket-attachment-chip {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 10px;
    text-decoration: none;
}

.ticket-attachment-chip--download {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
}

.ticket-attachment-chip--download span {
    background: #ffffff;
    border-radius: 999px;
    color: #1e40af;
    font-size: 11px;
    padding: 3px 7px;
}

.ticket-attachment-image {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: block;
    overflow: hidden;
}

.ticket-attachment-image img {
    display: block;
    height: 86px;
    object-fit: cover;
    width: 116px;
}

.customer-thread-button {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
    padding-inline: 16px;
}

.customer-thread-button:hover {
    background: #374151;
    color: #ffffff;
}

.ticket-message-comments {
    border-top: 1px solid var(--border-color);
    margin-top: 14px;
    padding-top: 12px;
}

.ticket-message-comments summary {
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.ticket-comment,
.ticket-comment-form {
    margin-top: 12px;
}

.ticket-comment {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
}

.ticket-comment p {
    margin: 6px 0 0;
}

.ticket-comments-search {
    color: var(--text-muted);
    display: grid;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    margin-bottom: 16px;
}

.ticket-comments-search input {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
}

.ticket-comment-list {
    display: grid;
    gap: 12px;
}

.ticket-comment-row {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 14px;
    text-align: left;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
    width: 100%;
}

.ticket-comment-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.ticket-comment-row__avatar {
    align-items: center;
    background: #dbeafe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 14px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.ticket-comment-row__content {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.ticket-comment-row__head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.ticket-comment-row__head small,
.ticket-comment-row__message {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.ticket-comment-row__body {
    color: var(--text-color);
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-message-modal-source {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2f6fdd;
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 14px;
}

.ticket-message-modal-source__label {
    color: #1d4ed8;
    display: inline-block;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ticket-message-modal-source__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ticket-message-modal-source p,
.ticket-message-modal-source__body {
    line-height: 1.65;
    margin: 10px 0 0;
}

.theme-dark .ticket-message-modal-source {
    background: #0b1b33;
    border-color: #1d4ed8;
}

.ticket-reply-preview {
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    line-height: 1.65;
    max-height: 320px;
    overflow-y: auto;
    padding: 14px;
    white-space: normal;
}

.ticket-modal-comments {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    max-height: 280px;
    overflow-y: auto;
}

.mention-suggestions {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
    display: grid;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    z-index: 1200;
}

.mention-suggestions[hidden] {
    display: none;
}

.mention-suggestions button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 2px;
    padding: 9px 10px;
    text-align: left;
}

.mention-suggestions button:hover,
.mention-suggestions button:focus {
    background: #eff6ff;
    outline: none;
}

.mention-suggestions small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.ticket-note-form {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 22px;
    padding-bottom: 22px;
}

.ticket-note-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.ticket-notes-list {
    margin-top: 8px;
}

.ticket-image-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin-bottom: 20px;
}

.ticket-file-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 10px;
}

.ticket-file-check {
    align-items: center;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
}

.ticket-file-card img {
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
    width: 100%;
}

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

.notification-list__item {
    color: inherit;
    text-decoration: none;
}

.ticket-portal-body {
    background: #f4f7fb;
    color: #111827;
    margin: 0;
}

.ticket-portal-shell {
    display: grid;
    gap: 22px;
    margin: 0 auto;
    max-width: 920px;
    padding: clamp(18px, 4vw, 48px);
}

.ticket-portal-hero,
.ticket-portal-panel {
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
}

.ticket-portal-hero__head {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ticket-portal-status {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticket-portal-hero h1 {
    margin-bottom: 8px;
}

.ticket-portal-details {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.ticket-portal-details div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: 5px;
    padding: 12px;
}

.ticket-portal-conversation {
    background: #eef2f7;
    border: 1px solid #d8e0eb;
    border-radius: 10px;
    max-height: 560px;
    overflow-y: auto;
    padding: 14px;
}

.ticket-ai-suggestion,
.ticket-ai-summary {
    background: var(--panel-muted);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: grid;
    gap: 12px;
    padding: 16px;
}

.ticket-ai-suggestion h3 {
    margin: 0;
}

.ticket-ai-suggestion__body {
    color: var(--text-color);
    line-height: 1.65;
    white-space: pre-wrap;
}

.ticket-ai-summary--saved {
    background: #f8fafc;
    border-left: 3px solid var(--accent);
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.ticket-ai-summary--details {
    margin-top: 18px;
}

.ticket-ai-summary__head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.ticket-ai-summary__side {
    align-items: flex-end;
    display: grid;
    gap: 8px;
    justify-items: end;
}

.ticket-ai-summary__button {
    font-size: 12px;
    min-height: 30px;
    padding: 7px 10px;
}

.ticket-ai-action-help {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    display: grid;
    font-size: 12px;
    gap: 6px;
    line-height: 1.45;
    margin-top: 8px;
    padding: 10px 12px;
}

.ticket-ai-action-help p {
    margin: 0;
}

.ticket-ai-action-help ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.ticket-ai-action-help li {
    margin: 3px 0;
}

.ticket-ai-action-help strong {
    color: var(--text-color);
}

.ticket-ai-summary__head h3,
.ticket-ai-summary__meta {
    margin: 0;
}

.ticket-ai-summary__head h3 {
    font-size: 15px;
}

.ticket-ai-summary__head .muted {
    font-size: 12px;
    margin: 4px 0 0;
}

.ticket-ai-summary__meta {
    color: var(--text-muted);
    display: grid;
    font-size: 11px;
    gap: 6px;
    text-align: right;
}

.ticket-ai-summary__body {
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.55;
}

.theme-dark .ticket-ai-summary--saved {
    background: #0f172a;
    border-color: #334155;
    border-left-color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(215, 173, 99, 0.08);
}

.theme-dark .ticket-ai-summary__head h3,
.theme-dark .ticket-ai-summary__body {
    color: #f8fafc;
}

.theme-dark .ticket-ai-summary__head .muted,
.theme-dark .ticket-ai-summary__meta {
    color: #a7b3c6;
}

.theme-dark .ticket-ai-summary__meta strong {
    color: #f1e5cf;
}

.theme-dark .ticket-ai-action-help {
    background: #0f172a;
    border-color: #334155;
    color: #a7b3c6;
}

.theme-dark .ticket-ai-action-help strong {
    color: #f8fafc;
}

.detail-list {
    display: grid;
    gap: 14px;
}

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

.detail-list div {
    display: grid;
    gap: 4px;
}

.detail-list strong {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.ticket-portal-body {
    background: #f4f7fb;
    margin: 0;
    min-height: 100vh;
}

.ticket-portal {
    display: grid;
    gap: 22px;
    margin: 0 auto;
    max-width: 920px;
}

.dt-container {
    font-family: Arial, Helvetica, sans-serif;
}

@media (max-width: 820px) {
    .auth-topbar,
    .hero,
    .toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .layout {
        display: block;
    }

    .sidebar {
        height: auto;
        min-height: auto;
        position: static;
        width: 100%;
    }

    .sidebar__nav {
        max-height: 45vh;
    }

    .app-shell,
    .sidebar-collapsed .app-shell {
        margin-left: 0;
        padding-top: 84px;
        width: 100%;
    }

    .app-shell__topbar,
    .sidebar-collapsed .app-shell__topbar {
        left: 0;
        min-height: 56px;
    }

    .ticket-tabs-nav {
        top: 66px;
    }

    .sidebar-collapsed .sidebar {
        width: 100%;
    }

    .nav {
        flex-wrap: wrap;
    }

    .stats,
    .grid,
    .website-card-grid,
    .page-card-grid,
    .pages-control-grid,
    .global-code-grid,
    .ai-settings-grid,
    .deployment-grid,
    .ftp-layout,
    .main-page-form,
    .dashboard-stats,
    .dashboard-grid,
    .email-hub-grid,
    .email-overview,
    .detail-grid,
    .ticket-layout,
    .filters,
    .filters--tickets {
        grid-template-columns: 1fr;
    }

    .copy-field {
        flex-direction: column;
    }

    .filters__actions {
        justify-content: stretch;
    }

    .filters__actions .button {
        flex: 1;
    }

    .ticket-message--customer,
    .ticket-message--agent {
        margin-left: 0;
        margin-right: 0;
    }

    .detail-list--grid {
        grid-template-columns: 1fr;
    }

    .ticket-summary-card__main,
    .ticket-summary-details,
    .ticket-overview-grid,
    .ticket-locked-context,
    .ticket-product-modal__details {
        grid-template-columns: 1fr;
    }

    .ticket-summary-details div,
    .ticket-summary-details div:first-child {
        border-left: 0;
        border-top: 1px solid var(--border-color);
        padding: 8px 0 0;
    }

    .ticket-summary-card__links {
        justify-content: stretch;
    }

    .email-overview__item {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
        padding: 0 0 16px;
    }

    .email-overview__item:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }
}
