:root {
    --primary: #411e5a;
    --primary-light: #5a2d7a;
    --primary-dark: #2d1440;
    --secondary: #FB8C00;
    --secondary-light: #ffa030;
    --secondary-dark: #e07800;
    --bg: #f4f2f7;
    --surface: #ffffff;
    --text-muted: #7a6b8a;
    --border: #e4dded;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(65, 30, 90, 0.10);
    --shadow-lg: 0 8px 40px rgba(65, 30, 90, 0.18);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: #2d1440;
    margin: 0;
}

/* ───────────────────────── NAVBAR ───────────────────────── */
.sf-navbar {
    background: var(--primary);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(65, 30, 90, 0.25);
}

.sf-navbar .logo img {
    height: 32px;
}

.sf-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sf-navbar .user-name {
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
}

.sf-navbar .badge-agent {
    background: var(--secondary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sf-navbar .badge-manager {
    background: var(--secondary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ───────────────────────── BTN ───────────────────────── */
.btn-primary-sf {
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-primary-sf:hover {
    background: var(--secondary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(251,140,0,0.35);
    color: #fff;
}
.btn-primary-sf:active { transform: translateY(0); }

.btn-outline-sf {
    background: transparent;
    color: rgba(255,255,255,0.9);
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline-sf:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.7);
    color: #fff;
}

/* ───────────────────────── LOGIN ───────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    margin: 0;
    background: var(--bg);
}

.login-brand {
    flex: 1;
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(251,140,0,0.08);
    top: -100px;
    right: -100px;
}

.login-brand::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: -80px;
    left: -80px;
}

.login-brand img {
    height: 52px;
    position: relative;
    z-index: 1;
}

.login-brand .tagline {
    color: rgba(255,255,255,0.7);
    font-size: 1.05rem;
    text-align: center;
    max-width: 280px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.change-password-modal {
    max-width: 460px;
}

.change-password-text {
    background: #faf9fc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 1.15rem;
    padding: 0.85rem 1rem;
}

/* ───────────────────────── FORM ───────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2d1440;
    background: #faf9fc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65,30,90,0.1);
    background: #fff;
}

.form-control::placeholder { color: #bbb; }

/* ───────────────────────── TICKETS PAGE ───────────────────────── */
.page-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.page-header .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badge-role {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.badge-role.manager { background: rgba(251,140,0,0.15); color: var(--secondary-dark); }
.badge-role.user    { background: rgba(65,30,90,0.1);   color: var(--primary); }

/* ───────────────────────── TABLE ───────────────────────── */
.sf-table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sf-table thead tr {
    background: var(--primary);
    color: #fff;
}

.sf-table thead th {
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sf-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.sf-table tbody tr:last-child { border-bottom: none; }
.sf-table tbody tr:hover { background: #faf8fc; }

.sf-table tbody td {
    padding: 0.85rem 1rem;
    color: #3a2050;
    vertical-align: middle;
}

.sf-table .id-col { color: var(--text-muted); font-size: 0.8rem; }

/* ───────────────────────── STATUS BADGES ───────────────────────── */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

.status-open     { background: #e8f8ee; color: #1a7f4b; }
.status-closed   { background: #f0eef4; color: #7a6b8a; }
.status-pending  { background: #fff4e0; color: #c06600; }
.status-default  { background: #f0eef4; color: #5a4a6a; }

/* ───────────────────────── PRIORITY BADGES ───────────────────────── */
.priority-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.priority-low     { background: #eef4ff; color: #3b5bdb; }
.priority-normal  { background: #e8f4fd; color: #1971a8; }
.priority-high    { background: #fff4e0; color: #c06600; }
.priority-urgent  { background: #fdf0ef; color: #c0392b; }
.priority-default { background: #f0eef4; color: #7a6b8a; }

/* ───────────────────────── EMPTY STATE ───────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state svg { opacity: 0.3; margin-bottom: 1rem; }
.empty-state p { color: var(--text-muted); font-size: 1rem; }

/* ───────────────────────── TOASTS ───────────────────────── */
#sf-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 360px;
}

.sf-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    background: var(--surface);
    border-left: 4px solid;
    animation: toastIn 0.3s ease forwards;
    position: relative;
    min-width: 280px;
}

.sf-toast.toast-error   { border-color: #e53935; }
.sf-toast.toast-success { border-color: #43a047; }
.sf-toast.toast-info    { border-color: var(--primary); }
.sf-toast.toast-warning { border-color: var(--secondary); }

.sf-toast .toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.sf-toast.toast-error   .toast-icon { color: #e53935; }
.sf-toast.toast-success .toast-icon { color: #43a047; }
.sf-toast.toast-info    .toast-icon { color: var(--primary); }
.sf-toast.toast-warning .toast-icon { color: var(--secondary); }

.sf-toast .toast-body { flex: 1; }
.sf-toast .toast-title { font-weight: 700; font-size: 0.85rem; color: #2d1440; margin-bottom: 2px; }
.sf-toast .toast-msg   { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.sf-toast .toast-close {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.sf-toast .toast-close:hover { color: #555; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); max-height: 100px; }
    to   { opacity: 0; transform: translateX(30px); max-height: 0; padding: 0; margin: 0; }
}

.sf-toast.removing { animation: toastOut 0.3s ease forwards; }

/* ───────────────────────── DETAIL PAGE ───────────────────────── */
.detail-page { max-width: 860px; }

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.detail-header-left { display: flex; align-items: flex-start; gap: 1rem; }

.detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.detail-type {
    font-size: 0.78rem;
    background: rgba(65,30,90,0.08);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.detail-date, .detail-id {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.detail-section {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.detail-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* ───────────────────────── ATTACHMENTS ───────────────────────── */
.attachments-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
    max-width: 220px;
}
.attachment-chip:hover {
    background: rgba(65,30,90,0.06);
    border-color: var(--primary);
}
.attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.attachment-dl { color: var(--text-muted); font-size: 0.9rem; flex-shrink: 0; }

/* ───────────────────────── CHAT ───────────────────────── */
.chat-section { padding-bottom: 0; }

.chat-container {
    max-height: 480px;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.chat-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 2rem 0;
}

.chat-row {
    display: flex;
    max-width: 75%;
}

.chat-row-left  { align-self: flex-start; }
.chat-row-right { align-self: flex-end; flex-direction: row-reverse; }

.chat-bubble {
    border-radius: 14px;
    padding: 0.65rem 0.9rem;
    max-width: 100%;
    word-break: break-word;
    position: relative;
}

.bubble-mine {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble-theirs {
    background: #f0eef5;
    color: #2d1440;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.bubble-sender {
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.bubble-mine   .bubble-sender { color: rgba(255,255,255,0.75); }
.bubble-theirs .bubble-sender { color: var(--primary); }

.bubble-role {
    background: var(--secondary);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bubble-text { font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; }

.bubble-time {
    font-size: 0.68rem;
    margin-top: 0.35rem;
    text-align: right;
}
.bubble-mine   .bubble-time { color: rgba(255,255,255,0.55); }

.bubble-description {
    border: 1.5px solid rgba(255,255,255,0.2);
    background: var(--primary-light);
}
.bubble-theirs .bubble-time { color: var(--text-muted); }

/* ───────────────────────── CHAT INPUT ───────────────────────── */
.chat-input-form {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 1rem 0 0.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.chat-textarea {
    flex: 1;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
    resize: none;
    outline: none;
    color: #2d1440;
    background: #faf9fc;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-height: 140px;
    overflow-y: auto;
}
.chat-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65,30,90,0.1);
    background: #fff;
}

.chat-send-btn {
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}
.chat-send-btn:hover { background: var(--secondary-light); transform: scale(1.06); }
.chat-send-btn:active { transform: scale(0.97); }

/* ───────────────────────── TABS ───────────────────────── */
.tabs-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    line-height: 1.6;
}

.tab-count-open   { background: rgba(65,30,90,0.1);   color: var(--primary); }
.tab-count-closed { background: rgba(120,110,130,0.12); color: var(--text-muted); }

.tab-panel .sf-table .date-col { color: var(--text-muted); font-size: 0.82rem; white-space: nowrap; }

.tickets-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.tickets-dashboard .page-header {
    margin-bottom: 0;
}

.page-content.tickets-dashboard {
    max-width: none;
    width: 100%;
    padding: 1.5rem clamp(1rem, 2vw, 2rem) 2rem;
}

.page-kicker,
.modal-kicker {
    display: inline-block;
    color: var(--secondary-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.ticket-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.ticket-summary-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 80px;
    padding: 0.85rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
}

.ticket-summary-item strong {
    color: var(--primary);
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 800;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.summary-open  { border-left-color: #1a7f4b; }
.summary-open strong { color: #1a7f4b; }

.summary-closed { border-left-color: var(--text-muted); }
.summary-closed strong { color: var(--text-muted); }

.summary-total { border-left-color: var(--primary); }

.ticket-filters {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.ticket-search-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ticket-search-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticket-search-control {
    flex: 1;
    position: relative;
}

.ticket-search-icon {
    color: var(--text-muted);
    font-size: 1.15rem;
    left: 0.9rem;
    line-height: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.ticket-search-input {
    padding-left: 2.35rem;
    padding-right: 2.55rem;
}

.ticket-search-clear {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    font-size: 1.25rem;
    height: 30px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
}

.ticket-search-clear:hover {
    background: var(--bg);
    color: var(--primary);
}

.ticket-search-control.has-value .ticket-search-clear {
    display: inline-flex;
}

.segmented-filter {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: inline-flex;
    padding: 0.25rem;
}

.segmented-filter input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-filter label {
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
    margin: 0;
    min-width: 104px;
    padding: 0.55rem 0.85rem;
    text-align: center;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.segmented-filter input:checked + label {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(65, 30, 90, 0.22);
    color: #fff;
}

.tickets-empty {
    border: 1px solid var(--border);
}

.tickets-search-empty {
    padding: 2.5rem 2rem;
}

.empty-icon {
    align-items: center;
    background: rgba(65,30,90,0.07);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    font-size: 1.7rem;
    height: 54px;
    justify-content: center;
    margin-bottom: 0.8rem;
    width: 54px;
}

.ticket-title-cell {
    color: var(--primary-dark);
    display: inline-block;
    font-weight: 800;
    max-width: 360px;
}

.ticket-title-link {
    text-decoration: none;
}

.ticket-title-link:hover {
    color: var(--secondary-dark);
    text-decoration: underline;
}

.ticket-description-cell {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: 0.18rem;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tickets-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.tickets-table {
    min-width: 1100px;
    table-layout: fixed;
}

.tickets-table .tickets-col-code { width: 76px; }
.tickets-table .tickets-col-title { width: 32%; }
.tickets-table .tickets-col-type { width: 120px; }
.tickets-table .tickets-col-status { width: 104px; }
.tickets-table .tickets-col-priority { width: 100px; }
.tickets-table .tickets-col-requester { width: 160px; }
.tickets-table .tickets-col-owner { width: 160px; }
.tickets-table .tickets-col-date { width: 90px; }
.tickets-table .tickets-col-actions { width: 116px; }

.tickets-table .ticket-title-cell {
    display: block;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tickets-table .ticket-description-cell {
    max-width: none;
    width: 100%;
}

.tickets-table .date-col {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.tickets-table tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.actions-col {
    text-align: right;
    white-space: nowrap;
}

.table-action-btn {
    min-width: 92px;
    text-align: center;
}

.modal-ticket-title {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 800;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
}

.sf-modal-wide {
    max-width: 720px;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.modal-field-full {
    grid-column: 1 / -1;
}

.modal-textarea {
    min-height: 150px;
    resize: vertical;
}

.modal-textarea-small {
    min-height: 108px;
    resize: vertical;
}

.sf-modal-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.sf-modal-footer {
    background: #faf9fc;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.ticket-detail-page {
    padding: 1rem 1.5rem 2rem;
}

.ticket-detail-header {
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1.25rem 1.4rem;
}

.ticket-detail-back {
    color: var(--text-muted);
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    text-decoration: none;
}

.ticket-detail-back:hover {
    color: var(--primary);
}

.ticket-detail-title h1 {
    color: var(--primary-dark);
    font-size: 1.45rem;
    line-height: 1.3;
    margin: 0.65rem 0 0;
    max-width: 1040px;
}

.ticket-detail-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.ticket-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 1rem;
}

.ticket-history-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: calc(100vh - 185px);
    overflow: hidden;
}

.ticket-history-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    position: relative;
}

.ticket-history-item::before {
    background: #35a928;
    bottom: -18px;
    content: "";
    left: 36px;
    position: absolute;
    top: 58px;
    width: 3px;
    z-index: 0;
}

.ticket-history-item:last-child::before {
    display: none;
}

.ticket-history-item.support::before {
    background: #35a928;
}

.ticket-history-item.client::before,
.ticket-history-description::before {
    background: var(--secondary);
}

.history-avatar {
    align-items: center;
    background: var(--primary);
    border: 3px solid var(--surface);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(45, 20, 64, 0.14);
    color: #fff;
    display: flex;
    font-size: 0.85rem;
    font-weight: 800;
    height: 46px;
    justify-content: center;
    justify-self: center;
    margin-top: 1rem;
    position: relative;
    width: 46px;
    z-index: 1;
}

.ticket-history-item.client .history-avatar,
.ticket-history-description .history-avatar {
    background: var(--secondary);
}

.history-card {
    border-bottom: 1px solid var(--border);
    min-height: 112px;
    padding: 1rem 1rem 1.25rem 0.25rem;
}

.ticket-history-item.support .history-card {
    background: #f7fbff;
}

.ticket-history-description .history-card {
    background: #fffdf0;
}

.history-card header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.history-card header strong {
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.history-card header span {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-left: 0.35rem;
}

.history-card time {
    color: #a39aac;
    flex-shrink: 0;
    font-size: 0.86rem;
}

.history-message {
    color: #2f2438;
    font-size: 0.96rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.history-message p {
    margin: 0 0 0.75rem;
}

.history-message p:last-child {
    margin-bottom: 0;
}

.history-message ul,
.history-message ol {
    margin: 0.5rem 0 0.75rem 1.25rem;
    padding: 0;
}

.history-message li {
    margin: 0.25rem 0;
}

.history-message a {
    color: var(--primary);
    font-weight: 700;
}

.history-message blockquote {
    border-left: 3px solid var(--border);
    color: var(--text-muted);
    margin: 0.75rem 0;
    padding: 0.2rem 0 0.2rem 0.75rem;
}

.history-message table {
    border-collapse: collapse;
    display: block;
    margin: 0.75rem 0;
    max-width: 100%;
    overflow-x: auto;
    width: max-content;
}

.history-message th,
.history-message td {
    border: 1px solid var(--border);
    padding: 0.45rem 0.6rem;
    text-align: left;
}

.history-message img {
    border-radius: 8px;
    display: block;
    height: auto;
    margin: 0.75rem 0;
    max-width: 100%;
}

.history-empty {
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
}

.ticket-side-panel {
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.ticket-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ticket-info-card > header {
    background: #faf9fc;
    border-bottom: 1px solid var(--border);
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.85rem 1rem;
}

.ticket-info-card dl {
    margin: 0;
    padding: 1rem;
}

.ticket-info-card dl div {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 120px minmax(0, 1fr);
    padding: 0.7rem 0;
}

.ticket-info-card dl div:first-child {
    padding-top: 0;
}

.ticket-info-card dl div:last-child {
    padding-bottom: 0;
}

.ticket-info-card dt {
    color: var(--text-muted);
    font-weight: 600;
}

.ticket-info-card dd {
    color: var(--primary-dark);
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.attachment-card {
    align-items: center;
    background: #faf9fc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.attachment-card:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.attachment-file-icon {
    align-items: center;
    background: rgba(251, 140, 0, 0.12);
    border-radius: 8px;
    color: var(--secondary-dark);
    display: inline-flex;
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.attachment-card-body {
    min-width: 0;
}

.attachment-card-body strong {
    display: block;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-card-body small {
    color: var(--text-muted);
    display: block;
    font-size: 0.74rem;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-empty {
    background: #faf9fc;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    padding: 1rem;
    text-align: center;
}

button.attachment-card {
    cursor: pointer;
    font: inherit;
    text-align: left;
    width: 100%;
}

/* ─── Ticket info card header with action button ─── */
.ticket-info-card > header.has-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ticket-info-card-action {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    transition: background 0.15s, border-color 0.15s;
}
.ticket-info-card-action:hover {
    background: rgba(65, 30, 90, 0.06);
    border-color: var(--primary);
}

/* ─── Preview modal ─── */
.sf-modal-preview {
    max-width: min(96vw, 1280px);
    width: min(96vw, 1280px);
}
.attachment-preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}
.attachment-preview-content img {
    border-radius: 6px;
    max-height: calc(90vh - 130px);
    max-width: 100%;
    object-fit: contain;
}
.attachment-preview-content iframe {
    border: none;
    height: calc(90vh - 130px);
    width: 100%;
}

.ticket-rating-box {
    background: #faf9fc;
    border-radius: 8px;
    margin-top: 1rem;
    padding: 1rem;
}

.ticket-rating-box .rating-comment {
    border-left: 2px solid var(--border);
    margin: 1rem 0 0;
    min-width: 0;
}

.ticket-closing-comment {
    border-left: 3px solid var(--secondary);
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 1rem 1rem;
    padding-left: 0.75rem;
}

.ticket-reply-form {
    background: #faf9fc;
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem 1.35rem 72px;
}

.ticket-reply-editor {
    min-height: 140px;
    overflow-y: auto;
}

.new-ticket-editor {
    min-height: 170px;
}

.ticket-reply-editor:empty::before {
    color: #b8afc2;
    content: attr(data-placeholder);
    pointer-events: none;
}

.ticket-reply-editor img {
    border-radius: 8px;
    display: block;
    height: auto;
    margin: 0.75rem 0;
    max-width: 100%;
}

.ticket-reply-editor ul,
.ticket-reply-editor ol {
    margin: 0.5rem 0 0.5rem 1.25rem;
    padding: 0;
}

.rich-editor-toolbar {
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--border);
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    gap: 0.35rem;
    padding: 0.4rem;
}

.rich-editor-toolbar + .ticket-reply-editor {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.rich-editor-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 800;
    min-height: 30px;
    padding: 0.25rem 0.55rem;
}

.rich-editor-toolbar button:hover {
    background: var(--bg);
    border-color: var(--border);
}

.ticket-reply-textarea {
    min-height: 110px;
    resize: vertical;
}

.ticket-reply-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.ticket-closed-note {
    background: #faf9fc;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem 1.5rem;
    text-align: center;
}

/* ───────────────────────── CLOSE TICKET BUTTON ───────────────────────── */
.btn-close-ticket {
    background: transparent;
    color: #c0392b;
    border: 1.5px solid #e0b0ab;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-close-ticket:hover {
    background: #fdf0ef;
    border-color: #c0392b;
}

/* ───────────────────────── MODAL ───────────────────────── */
.sf-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(45, 20, 64, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.sf-modal-backdrop.open { display: flex; }

.sf-modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0;
}
.sf-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}
.sf-modal-x {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.sf-modal-x:hover { background: var(--bg); color: #2d1440; }

.sf-modal-body  { padding: 1.25rem 1.5rem; }
.sf-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.5rem 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

/* ───────────────────────── RESOLVED OPTIONS ───────────────────────── */
.resolved-options {
    display: flex;
    gap: 0.75rem;
}
.resolved-option input { display: none; }
.resolved-btn {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border-radius: 8px;
    border: 2px solid var(--border);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg);
    color: var(--text-muted);
}
.resolved-option input:checked + .resolved-yes-btn {
    background: #e8f8ee; color: #1a7f4b; border-color: #1a7f4b;
}
.resolved-option input:checked + .resolved-no-btn {
    background: #fdf0ef; color: #c0392b; border-color: #c0392b;
}
.resolved-btn:hover { border-color: var(--primary); }

/* ───────────────────────── NPS SELECTOR ───────────────────────── */
.nps-selector {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.nps-option input { display: none; }

.nps-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 2px solid var(--border);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg);
    color: var(--text-muted);
}
.nps-btn-detractor { border-color: #f4b8b2; color: #c0392b; }
.nps-btn-passive   { border-color: #fde8b0; color: #b07a00; }
.nps-btn-promoter  { border-color: #b5e5c8; color: #1a7f4b; }

.nps-option input:checked + .nps-btn-detractor { background: #fdf0ef; border-color: #c0392b; transform: scale(1.12); }
.nps-option input:checked + .nps-btn-passive   { background: #fffbec; border-color: #b07a00; transform: scale(1.12); }
.nps-option input:checked + .nps-btn-promoter  { background: #e8f8ee; border-color: #1a7f4b; transform: scale(1.12); }

.nps-hint {
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 0.5rem;
    padding: 1px 8px;
    border-radius: 20px;
}
.nps-hint.nps-promoter  { background: #e8f8ee; color: #1a7f4b; }
.nps-hint.nps-passive   { background: #fffbec; color: #b07a00; }
.nps-hint.nps-detractor { background: #fdf0ef; color: #c0392b; }

/* ───────────────────────── RATING DISPLAY (ticket fechado) ───────────────────────── */
.rating-section { border-left: 3px solid var(--secondary); }

.rating-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.rating-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.rating-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.rating-value { font-weight: 700; font-size: 1rem; }
.resolved-yes { color: #1a7f4b; }
.resolved-no  { color: #c0392b; }

.rating-score {
    font-size: 1.6rem;
    font-weight: 800;
}
.nps-promoter  { color: #1a7f4b; }
.nps-passive   { color: #b07a00; }
.nps-detractor { color: #c0392b; }

.rating-comment {
    flex: 1;
    min-width: 200px;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-left: 2px solid var(--border);
    padding-left: 0.75rem;
}

/* ───────────────────────── CARD ───────────────────────── */
.sf-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

/* ───────────────────────── EXTRA BUTTONS ───────────────────────── */
.btn-outline-dark-sf {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}
.btn-outline-dark-sf:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }

.btn-ghost-sf {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
    display: inline-block;
}
.btn-ghost-sf:hover { color: var(--primary); }

.required { color: var(--secondary); }

/* ───────────────────────── UPLOAD ───────────────────────── */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-muted);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(65, 30, 90, 0.03);
    color: var(--primary);
}

.upload-area.drag-over { background: rgba(65, 30, 90, 0.06); }

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.upload-placeholder p { margin: 0; font-size: 0.9rem; }
.upload-link { color: var(--primary); font-weight: 600; text-decoration: underline; }
.upload-hint { font-size: 0.78rem; color: var(--text-muted); }

.file-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.file-icon { flex-shrink: 0; }
.file-name { flex: 1; color: #3a2050; font-weight: 500; word-break: break-all; }
.file-size { color: var(--text-muted); white-space: nowrap; font-size: 0.78rem; }

.file-remove {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    transition: color 0.15s;
    flex-shrink: 0;
}
.file-remove:hover { color: #e53935; }

/* ───────────────────────── NAVBAR AVATAR ───────────────────────── */
.nav-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border-radius: 8px;
    padding: 3px 8px 3px 3px;
    transition: background 0.15s;
}

.nav-profile-btn:hover {
    background: rgba(255,255,255,0.1);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.25);
}

.nav-avatar {
    position: relative;
}

.nav-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ───────────────────────── PROFILE PAGE ───────────────────────── */
.profile-page {
    max-width: 1040px;
}

.profile-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 1.1rem;
    align-items: start;
}

.profile-photo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    position: sticky;
    top: 1rem;
}

.profile-avatar-wrap {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    display: block;
    overflow: hidden;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.profile-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar-initials {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.42);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    opacity: 0;
    transition: opacity 0.18s;
}

.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }

.profile-photo-input { display: none; }

.profile-save-photo-btn {
    width: 100%;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    padding: 0.5rem;
}

.profile-card-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0.15rem 0 0;
}

.profile-card-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-all;
    margin: 0;
}

.profile-forms {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.profile-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.profile-section-header {
    background: #faf9fc;
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1.25rem;
}

.profile-section-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-section-body {
    padding: 1.25rem;
}

.profile-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
}

.profile-fields-grid .form-group { margin-bottom: 1rem; }

.profile-field-full { grid-column: 1 / -1; }

.profile-form-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ───────────────────────── RESPONSIVE ───────────────────────── */
@media (max-width: 768px) {
    .login-brand { display: none; }

    .login-form-side { padding: 1.5rem 1rem; background: var(--primary); }
    .login-card { box-shadow: none; border-radius: var(--radius); }

    .page-content { padding: 1rem; }
    .ticket-summary-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .ticket-summary-item { min-height: 64px; padding: 0.65rem 0.75rem; }
    .ticket-summary-item strong { font-size: 1.4rem; }
    .ticket-search-panel { flex-direction: column; align-items: stretch; gap: 0.4rem; }
    .ticket-search-label { display: none; }
    .ticket-detail-page { padding: 0.75rem; }
    .ticket-detail-header { flex-direction: column; }
    .ticket-detail-layout { grid-template-columns: 1fr; }
    .ticket-side-panel { position: static; }
    .ticket-history-panel { min-height: auto; }
    .ticket-history-item { grid-template-columns: 58px minmax(0, 1fr); }
    .ticket-history-item::before { left: 29px; }
    .history-avatar { height: 40px; width: 40px; }
    .history-card header { flex-direction: column; gap: 0.3rem; }
    .ticket-reply-form { padding: 1rem; }
    .ticket-info-card dl div { grid-template-columns: 1fr; gap: 0.2rem; }
    .chat-row { max-width: 92%; }
    .ticket-filters { flex-direction: column; }
    .segmented-filter { width: 100%; overflow-x: auto; }
    .segmented-filter label { flex: 1; min-width: max-content; }
    .modal-grid { grid-template-columns: 1fr; }
    .sf-navbar { padding: 0 1rem; }
    .sf-navbar .user-info { gap: 0.5rem; }
    .sf-navbar .user-name { display: none; }
    .sf-table { font-size: 0.82rem; }
    .sf-table thead th, .sf-table tbody td { padding: 0.65rem 0.6rem; }

    .profile-layout { grid-template-columns: 1fr; }
    .profile-photo-card { position: static; }
    .profile-fields-grid { grid-template-columns: 1fr; }
    .profile-field-full { grid-column: 1; }
}
