:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --line: #e5e8ef;
    --text: #5c6574;
    --ink: #1d2430;
    --red: #ff4b55;
    --red-soft: #fff1f1;
    --green: #1b9a59;
    --green-soft: #e8f7ef;
    --blue: #3559ff;
    --blue-soft: #edf2ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.campaign-app { min-height: 100vh; display: flex; }
.campaign-sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 16px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-head, .sidebar-nav, .sidebar-logout, .sidebar-help { padding: 0 20px; }
.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.campaign-brand img { display: block; width: 112px; height: auto; }
.sidebar-close, .menu-toggle { border: 0; background: 0; cursor: pointer; }
.sidebar-close { display: none; color: #657085; font-size: 31px; line-height: 1; }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar-nav a, .sidebar-logout {
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #7b8595;
    font-size: 14px;
    font-weight: 600;
    padding: 0 14px;
}
.sidebar-nav a.active {
    color: var(--red);
    background: #fff1f1;
    box-shadow: inset 3px 0 0 var(--red);
}
.sidebar-nav a span, .sidebar-logout span { width: 18px; text-align: center; font-size: 17px; }
.sidebar-logout { margin-top: auto; color: #7b8595; }
.sidebar-help {
    margin: 8px 20px 0;
    padding: 18px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #fffafa 100%);
}
.sidebar-help span { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 800; }
.sidebar-help p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.55; }
.sidebar-help a { display: inline-block; margin-top: 16px; color: var(--red); font-size: 13px; font-weight: 800; }

.campaign-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.campaign-header {
    height: 76px;
    padding: 0 22px;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.menu-toggle { display: none; padding: 4px; }
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 4px 0;
    border-radius: 999px;
    background: var(--ink);
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.support-email, .wallet-chip, .user-chip {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}
.wallet-chip { background: #111; color: #fff; border-color: #111; }
.user-chip { padding-left: 8px; }
.avatar {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffdfe1;
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
}

.support-main {
    width: min(1180px, calc(100% - 56px));
    margin: 0 auto;
    padding: 32px 0 40px;
}
.support-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
    gap: 22px;
    align-items: end;
}
.section-tag {
    margin: 0 0 8px;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 10px;
    font-weight: 800;
}
.support-intro-copy h1, .support-contact-card h2, .support-form-head h2, .support-list-head h2 {
    margin: 0;
    letter-spacing: -.03em;
}
.support-intro-copy h1 { font-size: 42px; line-height: 1.03; }
.support-intro-copy p {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
}
.support-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.support-stats article, .support-contact-card, .support-form-card, .support-list-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 18px 40px rgba(27,31,41,.06);
}
.support-stats article {
    padding: 16px;
    min-height: 126px;
}
.support-stats span {
    display: block;
    color: #778094;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.support-stats strong {
    display: block;
    margin-top: 14px;
    font-size: 26px;
    line-height: 1;
}
.support-stats p {
    margin: 10px 0 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1.55;
}

.support-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}
.support-contact-card { padding: 24px; }
.support-contact-card-bottom { margin-top: 22px; }
.support-contact-card h2, .support-form-head h2 { font-size: 24px; line-height: 1.08; }
.support-copy {
    margin: 12px 0 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.65;
}
.support-contact-list {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}
.support-contact-list div {
    padding: 14px 16px;
    border: 1px solid #edf0f5;
    border-radius: 16px;
    background: #fbfcfe;
}
.support-contact-list span {
    display: block;
    color: #7a8394;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.support-contact-list a, .support-contact-list strong {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.support-form-card { padding: 24px; }
.support-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.safe-chip {
    padding: 7px 12px;
    border-radius: 999px;
    background: #ebf8f1;
    color: var(--green);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.support-form-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.support-span-2 { grid-column: 1 / -1; }
.support-form-grid label {
    display: block;
    margin-bottom: 8px;
    color: #222834;
    font-size: 12px;
    font-weight: 750;
}
.support-form-grid select,
.support-form-grid input,
.support-form-grid textarea {
    width: 100%;
    border: 1px solid #dde3ee;
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    outline: 0;
    transition: border-color .2s, box-shadow .2s;
}
.support-form-grid select,
.support-form-grid input {
    height: 50px;
    padding: 0 14px;
}
.support-form-grid textarea {
    min-height: 160px;
    padding: 14px;
    resize: vertical;
}
.support-form-grid select:focus,
.support-form-grid input:focus,
.support-form-grid textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(255,75,85,.1);
}
.support-field-error {
    min-height: 18px;
    margin-top: 6px;
    color: #de4b55;
    font-size: 12px;
}
.support-form-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.support-help {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1.55;
}
.support-form-actions button {
    height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: #ffd65b;
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(255,214,91,.28);
}
.support-form-actions button span { margin-left: 6px; font-size: 18px; }

.support-list-card {
    margin-top: 22px;
    padding: 24px 0 18px;
}
.support-list-head {
    padding: 0 24px 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}
.support-list-head h2 { font-size: 24px; line-height: 1.08; }
.support-search {
    width: min(320px, 100%);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.support-search span { color: #98a0ae; font-size: 18px; }
.support-search input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: 12px;
}
.support-table-wrap { padding: 18px 20px 8px; overflow-x: auto; }
.support-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}
.support-table thead th {
    padding: 8px 10px;
    color: #92959e;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 9px;
    white-space: nowrap;
}
.support-table tbody tr {
    background: #fafafa;
    transition: transform .2s, box-shadow .2s;
}
.support-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(27,29,36,.08);
}
.support-table tbody td {
    padding: 14px 10px;
    border-top: 1px solid #eceef1;
    border-bottom: 1px solid #eceef1;
    color: #424650;
    font-size: 11px;
    vertical-align: middle;
}
.support-table tbody td:first-child {
    border-left: 1px solid #eceef1;
    border-radius: 12px 0 0 12px;
    font-weight: 800;
}
.support-table tbody td:last-child {
    border-right: 1px solid #eceef1;
    border-radius: 0 12px 12px 0;
}
.status-pill,
.reply-link,
.reply-muted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}
.status-pill.open { color: #d08d14; background: #fff7df; }
.status-pill.pending { color: #3156d6; background: var(--blue-soft); }
.status-pill.resolved { color: var(--green); background: var(--green-soft); }
.reply-link {
    border: 0;
    background: #f1f4fb;
    color: #273351;
    cursor: pointer;
}
.reply-muted { color: #8d93a3; background: #f2f4f8; }
.empty-row td { padding: 0 !important; background: #fff !important; border: 0 !important; }
.empty-state { padding: 34px 20px; text-align: center; }
.empty-state strong { display: block; font-size: 15px; }
.empty-state p { margin: 8px 0 0; color: var(--text); font-size: 12px; }

.campaign-footer {
    margin-top: auto;
    padding: 20px 34px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    background: #fafbfc;
    color: #858993;
    font-size: 10px;
}
.campaign-footer p { margin: 0; }
.campaign-footer div { display: flex; gap: 22px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(20,20,22,.42);
}

.reply-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(16, 20, 28, .42);
    z-index: 35;
}
.reply-modal.show { display: flex; }
.reply-modal-panel {
    width: min(560px, 100%);
    padding: 20px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.2);
}
.reply-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.reply-modal-head h3 { margin: 0; font-size: 18px; }
.reply-modal-close {
    border: 0;
    background: 0;
    cursor: pointer;
    color: #708096;
    font-size: 30px;
    line-height: 1;
}
.reply-modal-panel p {
    margin: 14px 0 0;
    color: #4c5564;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

@media (max-width: 1080px) {
    .support-intro,
    .support-grid { grid-template-columns: 1fr; }
    .support-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .support-contact-card-bottom { margin-top: 18px; }
}

@media (max-width: 900px) {
    .campaign-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .campaign-sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .campaign-shell { width: 100%; margin-left: 0; }
    .campaign-header { justify-content: space-between; }
    .menu-toggle { display: block; }
    .sidebar-overlay.show { display: block; }
    .support-main { width: calc(100% - 36px); padding-top: 18px; }
    .support-email { display: none; }
    .campaign-footer { align-items: center; gap: 12px; flex-direction: column; }
    .campaign-footer div { gap: 14px; }
}

@media (max-width: 700px) {
    .campaign-header { height: 68px; padding: 0 15px; }
    .wallet-chip { padding: 0 13px; }
    .user-chip > span:last-child { display: none; }
    .support-main { width: calc(100% - 28px); padding: 14px 0 50px; }
    .support-intro-copy h1 { font-size: 30px; }
    .support-intro-copy p { font-size: 13px; }
    .support-stats { grid-template-columns: 1fr; }
    .support-stats article,
    .support-contact-card,
    .support-form-card,
    .support-list-card { border-radius: 16px; }
    .support-contact-card,
    .support-form-card { padding: 20px; }
    .support-contact-card h2,
    .support-form-head h2,
    .support-list-head h2 { font-size: 22px; }
    .support-form-grid { grid-template-columns: 1fr; }
    .support-form-actions { flex-direction: column; align-items: stretch; }
    .support-form-actions button { width: 100%; }
    .support-list-head,
    .support-table-wrap { padding-left: 16px; padding-right: 16px; }
    .support-search { width: 100%; }
    .support-table thead { display: none; }
    .support-table,
    .support-table tbody,
    .support-table tr,
    .support-table td { display: block; width: 100%; }
    .support-table tbody tr {
        margin-bottom: 15px;
        padding: 11px;
        border: 1px solid var(--line);
        border-radius: 13px;
    }
    .support-table tbody td {
        padding: 8px;
        border: 0 !important;
        border-radius: 0 !important;
    }
    .support-table tbody td:nth-child(2)::before { content: 'Support ID: '; color: #999; }
    .support-table tbody td:nth-child(3)::before { content: 'Campaign ID: '; color: #999; }
    .support-table tbody td:nth-child(4)::before { content: 'Subject: '; color: #999; }
    .support-table tbody td:nth-child(5)::before { content: 'Status: '; color: #999; }
    .support-table tbody td:nth-child(6)::before { content: 'Entry Date: '; color: #999; }
    .support-table tbody td:nth-child(7)::before { content: 'Reply: '; color: #999; }
    .campaign-footer { padding: 20px; gap: 13px; align-items: center; flex-direction: column; }
}
