/* ============================================
   Ekwa Client Dashboard — Global Styles
   Brand: Ekwa Marketing
   Colors: Navy #1c305d, Blue #3b74bb, Cyan #49cde4, Yellow #fde78c
   Font: Montserrat
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6f9;
    color: #1a1a2e;
    font-size: 14px;
    line-height: 1.5;
}

a { color: #3b74bb; text-decoration: none; }
a:hover { color: #1c305d; }

/* === Header === */
.header {
    background: #ffffff;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 8px rgba(28, 48, 93, 0.12);
    border-bottom: 3px solid #1c305d;
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-logo img {
    height: 32px;
    width: auto;
}
.header-logo h1 {
    font-size: 16px;
    font-weight: 600;
    color: #1c305d;
    letter-spacing: -0.3px;
}
.header-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.header-logo-link:hover { opacity: 0.85; }
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #666;
}
.header-user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #5a6474;
}
.header-user svg {
    color: #8892a4;
    flex-shrink: 0;
}
.header-email {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.header-logout {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #8892a4;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.header-logout:hover {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

/* === Dev Badge === */
.dev-badge {
    display: inline-block;
    background: #fde78c;
    color: #1c305d;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Container === */
.container {
    max-width: 1140px;
    margin: 24px auto;
    padding: 0 20px;
}

/* === Cards === */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* === Filter Bar === */
.filters {
    background: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-row input[type="text"],
.filter-row input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f8f9fb;
    transition: all 0.2s;
}
.filter-row input[type="date"] {
    padding: 9px 12px;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #555;
    background: #f8f9fb;
}
.filter-row input:focus {
    outline: none;
    border-color: #3b74bb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 116, 187, 0.1);
}
.filter-dropdown {
    padding: 9px 12px;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #555;
    background: #f8f9fb;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s;
}
.filter-dropdown:focus {
    outline: none;
    border-color: #3b74bb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 116, 187, 0.1);
}
.filter-row label {
    font-size: 12px;
    color: #8892a4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* === Buttons === */
.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary {
    background: #3b74bb;
    color: #fff;
}
.btn-primary:hover {
    background: #1c305d;
}
.btn-clear {
    background: #f0f2f5;
    color: #666;
    border: 1px solid #dde2ea;
}
.btn-clear:hover {
    background: #e4e7ec;
}

/* === Tab Filters === */
.filter-labels {
    font-size: 11px;
    font-weight: 700;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.status-tabs, .category-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.status-tabs a, .category-tabs a {
    padding: 7px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: #5a6474;
    background: #e8ecf2;
    transition: all 0.2s;
}
.status-tabs a:hover, .category-tabs a:hover {
    background: #d4dae4;
    color: #1c305d;
}
.status-tabs a.active {
    background: #1c305d;
    color: #fff;
}
.category-tabs a {
    font-size: 12px;
    padding: 6px 14px;
}
.category-tabs a.active {
    background: #3b74bb;
    color: #fff;
}
.cat-count {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

/* === Stats === */
.stats {
    font-size: 13px;
    color: #8892a4;
    margin-bottom: 12px;
}

/* === Table === */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
th {
    background: #f8f9fb;
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #edf0f5;
}
td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f0f2f5;
    color: #2d3748;
}
tr { transition: background 0.15s; }
tr:hover td { background: #f8fafc; }
tr:last-child td { border-bottom: none; }

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f0f4fa; }

.ticket-link {
    color: #1c305d;
    text-decoration: none;
    font-weight: 600;
}
.ticket-link:hover { color: #3b74bb; }
.ticket-id {
    color: #a0aec0;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* === Badges === */
.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.status-open { background: #dbeafe; color: #1e40af; }
.status-closed { background: #f1f5f9; color: #64748b; }
.status-resolved { background: #dcfce7; color: #166534; }

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #edf2ff;
    color: #3b74bb;
}
/* Attachment indicator (ticket listing) — purely visual, never clickable */
.attach-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.attach-indicator.has {
    color: #2f9e51;
}
.attach-indicator.none {
    color: #c2c9d6;
}
.last-reply-cell {
    font-size: 13px;
    font-weight: 500;
    color: #1c305d;
    white-space: nowrap;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #dde2ea;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: #5a6474;
    transition: all 0.15s;
}
.pagination a:hover {
    background: #f0f2f5;
    border-color: #c4cad4;
}
.pagination .active {
    background: #1c305d;
    color: #fff;
    border-color: #1c305d;
}

/* === Empty State === */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
    font-size: 15px;
}

/* === Thread/Post Styles === */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    color: #3b74bb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    padding: 6px 12px;
    border-radius: 6px;
    margin-left: -12px;
}
.back-link:hover { color: #1c305d; background: #edf2ff; }

.thread-header {
    background: #fff;
    padding: 28px 30px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.06);
    margin-bottom: 20px;
}
.thread-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.thread-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1c305d;
    line-height: 1.35;
    flex: 1;
}
.thread-header-top .status-badge {
    flex-shrink: 0;
    margin-top: 4px;
}
.thread-meta {
    font-size: 13px;
    color: #8892a4;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f0f2f5;
}
.thread-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Posts */
.posts {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 0;
}
.post {
    background: #fff;
    padding: 24px 28px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.05);
    transition: box-shadow 0.2s;
}
.post:hover {
    box-shadow: 0 3px 12px rgba(28, 48, 93, 0.08);
}
.post.staff {
    border-left: 4px solid #3b74bb;
    background: #fafbff;
}
.post.client {
    border-left: 4px solid #49cde4;
}
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f2f5;
}
.post-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-staff {
    background: #edf2ff;
    color: #3b74bb;
}
.avatar-client {
    background: #ecfeff;
    color: #0891b2;
}
.avatar-thirdparty {
    background: #fef3c7;
    color: #92400e;
}
.sender {
    font-weight: 600;
    font-size: 14px;
    color: #1c305d;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sender-email {
    display: block;
    color: #a0aec0;
    font-size: 12px;
    font-weight: 400;
    margin-top: 1px;
}
.sender-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tag-staff {
    background: #eef2ff;
    color: #3b74bb;
}
.tag-client {
    background: #ecfeff;
    color: #0891b2;
}
.tag-thirdparty {
    background: #fef3c7;
    color: #92400e;
}
.post-date-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}
.post-date {
    font-size: 12px;
    color: #a0aec0;
    font-weight: 500;
    white-space: nowrap;
}
.post-date-rel {
    font-size: 11px;
    color: #c4cad4;
    margin-top: 2px;
}
.post-body {
    font-size: 14px;
    line-height: 1.75;
    color: #374151;
    overflow-wrap: break-word;
}
.post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.message-main p, .message-main div { margin-bottom: 10px; }
.message-main p:last-child, .message-main div:last-child { margin-bottom: 0; }

/* Quoted content */
.quoted-content {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.quoted-content summary {
    padding: 10px 16px;
    background: #f8f9fb;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    user-select: none;
    transition: background 0.15s;
}
.quoted-content summary:hover { background: #edf0f5; }
.quoted-body {
    padding: 16px;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.65;
    background: #fafbfc;
    border-top: 1px solid #e5e7eb;
    max-height: 400px;
    overflow-y: auto;
}

/* Attachments */
.attachments {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #edf0f5;
}
.attachments-label {
    font-size: 11px;
    font-weight: 700;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.attachment-form {
    display: inline-flex;
    margin: 0;
}
.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f0f4ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    text-decoration: none;
    color: #1c305d;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.15s;
}
.attachment-item:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 116, 187, 0.12);
}
.attachment-size {
    color: #a0aec0;
    font-size: 11px;
    font-weight: 400;
}

/* === Plain-text editor with basic formatting === */
.editor-wrap {
    border: 1px solid #dde2ea;
    border-radius: 10px;
    background: #f8f9fb;
    overflow: hidden;
    transition: all 0.2s;
}
.editor-wrap:focus-within {
    border-color: #3b74bb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 116, 187, 0.1);
}
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    background: none;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: all 0.12s;
    padding: 0;
}
.editor-btn svg {
    display: block;
    pointer-events: none;
    flex-shrink: 0;
}
.editor-btn:hover {
    background: #f0f4ff;
    border-color: #dbeafe;
}
.editor-color-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    color: #374151;
    transition: all 0.12s;
}
.editor-color-btn:hover {
    background: #f0f4ff;
    border-color: #dbeafe;
}
.editor-color-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.editor-content {
    min-height: 120px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #1c305d;
    outline: none;
}
.editor-content:empty::before {
    content: attr(data-placeholder);
    color: #a0aec0;
    pointer-events: none;
}

/* === File upload === */
.file-input {
    width: 100%;
    font-size: 13px;
    font-family: inherit;
    color: #374151;
    background: #f8f9fb;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    box-sizing: border-box;
}
.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #3b74bb;
    cursor: pointer;
}
/* Hide native file input when a styled "Attach files" label drives it (avoids a duplicate button) */
.file-input-hidden {
    display: none;
}
.file-selected-names {
    font-size: 12px;
    color: #374151;
    word-break: break-word;
}
.reply-attach-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.file-help-text {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

/* === Reply recipients === */
.reply-recipients-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}
.reply-to-label {
    font-weight: 600;
    color: #6b7280;
    min-width: 26px;
}
.reply-to-value {
    color: #1c305d;
    font-weight: 500;
}
.btn-add-recipients {
    background: none;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: #3b74bb;
    cursor: pointer;
    padding: 3px 10px;
    margin-left: auto;
    transition: all 0.12s;
}
.btn-add-recipients:hover {
    background: #f0f4ff;
    border-color: #93c5fd;
}
.reply-extra-row {
    margin-bottom: 10px;
}
.reply-extra-row input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #f8f9fb;
    box-sizing: border-box;
    transition: all 0.2s;
}
.reply-extra-row input:focus {
    outline: none;
    border-color: #3b74bb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 116, 187, 0.1);
}

/* === Inline field validation errors === */
.field-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: -2px;
    margin-bottom: 2px;
    display: none;
}
.field-optional {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
}

/* Reply form */
.reply-form {
    background: #fff;
    padding: 28px 30px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.06);
    margin-bottom: 20px;
}
.reply-form h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #1c305d;
}
.reply-form textarea {
    width: 100%;
    min-height: 130px;
    padding: 14px 16px;
    border: 1px solid #dde2ea;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #f8f9fb;
    transition: all 0.2s;
}
.reply-form textarea:focus {
    outline: none;
    border-color: #3b74bb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 116, 187, 0.1);
}
.reply-form .reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
}
.reply-char-count {
    font-size: 12px;
    color: #a0aec0;
    transition: color 0.2s;
}
.reply-form button {
    padding: 10px 28px;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* === Login Page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1c305d 0%, #3b74bb 100%);
}
.login-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
}
.login-card .logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-card .logo img {
    height: 40px;
}
.login-card h1 {
    font-size: 22px;
    color: #1c305d;
    text-align: center;
    margin-bottom: 6px;
}
.login-card .subtitle {
    color: #8892a4;
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
}
.login-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}
.login-card input[type="email"],
.login-card .login-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 18px;
    background: #f8f9fb;
    transition: all 0.2s;
    box-sizing: border-box;
}
.login-card input[type="email"]:focus,
.login-card .login-input:focus {
    outline: none;
    border-color: #3b74bb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 116, 187, 0.12);
}
.login-card button {
    width: 100%;
    padding: 12px;
    background: #1c305d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.login-card button:hover { background: #3b74bb; }
.login-card .error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.login-card .success {
    background: #dcfce7;
    color: #166534;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.dev-link {
    background: #fef9e7;
    border: 1px solid #fde78c;
    padding: 14px;
    border-radius: 8px;
    margin-top: 18px;
    font-size: 13px;
}
.dev-link strong { color: #92400e; }
.dev-link a {
    display: block;
    margin-top: 8px;
    word-break: break-all;
    color: #3b74bb;
    font-weight: 500;
}

/* Login — How It Works */

/* Login — Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #edf0f5;
    font-size: 12px;
    color: #8892a4;
}
.login-footer a {
    color: #3b74bb;
    font-weight: 500;
}

/* Legal Pages (Privacy Policy, Terms of Service) */
.legal-page {
    background: #f5f7fa;
    min-height: 100vh;
    padding: 40px 20px;
}
.legal-container {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(28, 48, 93, 0.08);
    padding: 40px 48px;
}
.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf0f5;
}
.legal-back {
    color: #3b74bb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.legal-back:hover {
    text-decoration: underline;
}
.legal-logo {
    height: 32px;
}
.legal-container h1 {
    font-size: 24px;
    color: #1c305d;
    margin: 0 0 4px 0;
}
.legal-updated {
    font-size: 13px;
    color: #8892a4;
    margin: 0 0 24px 0;
}
.legal-container h2 {
    font-size: 16px;
    color: #1c305d;
    margin: 28px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #edf0f5;
}
.legal-container h3 {
    font-size: 14px;
    color: #3b74bb;
    margin: 16px 0 8px 0;
}
.legal-container p,
.legal-container li {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.7;
}
.legal-container ul {
    padding-left: 20px;
    margin: 8px 0 16px 0;
}
.legal-container li {
    margin-bottom: 6px;
}
.legal-container a {
    color: #3b74bb;
}
.legal-container code {
    background: #f0f3f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.legal-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #edf0f5;
    font-size: 12px;
    color: #8892a4;
}
.legal-footer a {
    color: #3b74bb;
    text-decoration: none;
    font-weight: 500;
}
.legal-footer a:hover {
    text-decoration: underline;
}
@media (max-width: 600px) {
    .legal-container {
        padding: 24px 20px;
    }
}

/* Legal Modals (Login page) */
.legal-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(28, 48, 93, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.legal-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(28, 48, 93, 0.2);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #edf0f5;
}
.legal-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1c305d;
}
.legal-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8892a4;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.legal-modal-close:hover {
    color: #1c305d;
}
.legal-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}
.legal-modal-body h3 {
    font-size: 15px;
    color: #1c305d;
    margin: 24px 0 10px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #edf0f5;
}
.legal-modal-body h3:first-of-type {
    margin-top: 16px;
}
.legal-modal-body h4 {
    font-size: 13px;
    color: #3b74bb;
    margin: 14px 0 6px 0;
}
.legal-modal-body p,
.legal-modal-body li {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.7;
}
.legal-modal-body ul {
    padding-left: 20px;
    margin: 6px 0 14px 0;
}
.legal-modal-body li {
    margin-bottom: 4px;
}
.legal-modal-body a {
    color: #3b74bb;
}
.legal-modal-body code {
    background: #f0f3f7;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}
.legal-updated {
    font-size: 12px;
    color: #8892a4;
    margin: 0 0 16px 0;
}
@media (max-width: 600px) {
    .legal-modal {
        max-height: 90vh;
    }
    .legal-modal-header {
        padding: 16px 20px;
    }
    .legal-modal-body {
        padding: 16px 20px;
    }
}

/* Login — Loading Spinner */
.login-card .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.spinner {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Login — Success message styling */
.login-card .success {
    background: #dcfce7;
    color: #166534;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #bbf7d0;
    line-height: 1.5;
}

/* === Dashboard Layout (sidebar + main) === */
.dashboard-layout {
    display: flex;
    gap: 28px;
    max-width: 1800px;
    margin: 24px auto;
    padding: 0 20px;
    align-items: flex-start;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.06);
}

.sidebar-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1c305d;
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-date-range {
    font-size: 12px;
    color: #888;
    display: block;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-empty {
    font-size: 13px;
    color: #999;
    text-align: center;
    padding: 12px 0;
    margin: 0;
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-list li {
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list li a {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar-list li a:hover {
    background: #f8fafc;
    margin: 0 -18px;
    padding: 8px 18px;
}

.sidebar-subject {
    display: block;
    font-size: 13px;
    color: #1c305d;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.sidebar-date {
    font-size: 11px;
    color: #999;
}

.type-badge.small {
    font-size: 10px;
    padding: 1px 6px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* Two-column layout (advanced view): sidebar + full-width main content */
.dashboard-layout--two-col {
    display: flex;
    gap: 28px;
}
.dashboard-layout--two-col .main-content {
    flex: 1;
    min-width: 0;
}

/* === Right Panel: New Ticket === */
.right-panel {
    width: 300px;
    flex-shrink: 0;
    align-self: flex-start;
}

.new-ticket-card h3 {
    margin-bottom: 4px;
}

.new-ticket-subtitle {
    font-size: 12px;
    color: #888;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.new-ticket-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.new-ticket-form label {
    font-size: 12px;
    font-weight: 600;
    color: #1c305d;
    margin-bottom: -4px;
}

.new-ticket-form input[type="text"],
.new-ticket-form input[type="email"],
.new-ticket-form select,
.new-ticket-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    background: #f8f9fb;
    box-sizing: border-box;
    transition: all 0.2s;
}

.new-ticket-form input[type="text"]:focus,
.new-ticket-form input[type="email"]:focus,
.new-ticket-form select:focus,
.new-ticket-form textarea:focus {
    outline: none;
    border-color: #3b74bb;
    background: #fff;
}

.new-ticket-form textarea {
    min-height: 100px;
    resize: vertical;
}

.new-ticket-form .btn {
    margin-top: 4px;
    width: 100%;
    justify-content: center;
}

.new-ticket-form select {
    text-overflow: ellipsis;
}

/* === Pending Your Attention Card === */
.pending-attention-card {
    border-left: 3px solid #ef4444;
}

.pending-attention-card h3 {
    color: #ef4444;
}

.pending-attention-card .sidebar-date-range {
    color: #ef4444;
    font-weight: 600;
}

/* Rotate-to-landscape hint — hidden by default, shown only on small portrait screens */
.rotate-hint {
    display: none;
}
@media (max-width: 768px) and (orientation: portrait) {
    .rotate-hint {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        background: #fef9e7;
        border-bottom: 1px solid #f5e6a3;
        color: #7a6c2a;
        font-size: 12px;
        line-height: 1.4;
        flex-shrink: 0;
    }
    .rotate-hint svg {
        flex-shrink: 0;
        color: #b8a435;
    }
}

/* === Thread Container (narrower than dashboard) === */
.thread-container {
    max-width: 860px;
    margin: 24px auto;
    padding: 0 20px;
}

/* === Login Dev Badge (centered) === */
.login-dev-badge {
    text-align: center;
    margin-bottom: 16px;
}

/* === Dev Link in compact context (New Ticket card) === */
.dev-link--compact {
    margin-bottom: 14px;
    margin-top: 0;
}

/* === Responsive === */

/* Tablet landscape — sidebar narrower, layout adapts */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .right-panel {
        width: 240px;
    }
    .dashboard-layout {
        gap: 18px;
        padding: 0 16px;
    }
    .dashboard-layout--two-col {
        gap: 18px;
    }
    .stat-cards-grid {
        gap: 10px;
    }
}

/* Tablet portrait & phones */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        height: 54px;
    }
    .header-logo h1 { font-size: 14px; }
    .header-right { font-size: 12px; gap: 10px; }
    .container { padding: 0 12px; margin: 16px auto; }

    .dashboard-layout {
        flex-direction: column;
        gap: 16px;
        padding: 0 12px;
        margin: 16px auto;
    }
    .dashboard-layout--two-col {
        flex-direction: column;
    }
    .sidebar {
        width: 100% !important;
        flex-direction: column;
        overflow-x: visible;
        flex-shrink: 0;
    }
    .sidebar::after {
        display: none;
    }
    .sidebar-card {
        min-width: unset;
        width: 100%;
        flex-shrink: 1;
    }
    .main-content {
        width: 100%;
        flex: none;
        overflow-x: auto;
    }

    .right-panel {
        width: 100% !important;
        position: static;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .filter-row input[type="text"],
    .filter-row input[type="email"] {
        min-width: 100%;
    }
    .filter-row input[type="date"] {
        flex: 1;
        width: 100%;
    }
    .filter-dropdown {
        width: 100%;
    }
    .filter-row label {
        margin-top: 2px;
    }

    /* Wrap dates side by side */
    .filter-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .filter-row input[type="text"],
    .filter-row input[type="email"],
    .filter-row select,
    .filter-row .btn {
        grid-column: 1 / -1;
    }

    table { font-size: 13px; }
    th, td { padding: 10px 12px; }

    /* Hide less important columns on tablet: Ekwa Responses(7), Client Responses(8) */
    th:nth-child(7), td:nth-child(7),
    th:nth-child(8), td:nth-child(8) {
        display: none;
    }

    .post { padding: 16px; }
    .post-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .post-header-left { gap: 10px; }
    .post-avatar { width: 32px; height: 32px; font-size: 12px; }
    .post-date-group { align-items: flex-start; }
    .thread-header { padding: 16px; }
    .thread-header-top { flex-direction: column; gap: 8px; }
    .thread-meta { flex-direction: column; gap: 6px; }
    .header-email {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-logout span { display: none; }

    .login-card {
        margin: 16px;
        padding: 32px 24px;
        max-width: 100%;
    }
    .login-card h1 { font-size: 20px; }
    .login-card .subtitle { font-size: 13px; }
    .login-card form input[type="email"] { font-size: 16px; /* prevents iOS zoom on focus */ }
    .reply-form { padding: 16px; }
    .attachment-list { flex-direction: column; }
    .editor-toolbar { gap: 1px; padding: 4px 8px; }
    .editor-btn, .editor-color-btn { width: 26px; height: 26px; }
    .reply-recipients-row { font-size: 12px; }
    .btn-add-recipients { font-size: 11px; }

    /* Pagination */
    .pagination { flex-wrap: wrap; justify-content: center; }

    /* Admin header stacks on tablet */
    .header-actions {
        gap: 4px;
        flex-wrap: wrap;
    }
    .header-actions .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Stats display */
    .stats {
        font-size: 12px;
        padding: 0 4px;
    }
}

/* Intermediate breakpoint — small tablets / large phones */
@media (max-width: 600px) {
    .header-logo h1 { font-size: 12px; }
    .header-email { max-width: 90px; }

    .filter-row .filter-dropdown { font-size: 12px; }
    .filter-row input[type="date"] { font-size: 12px; }
    .filters { padding: 12px 14px; }

    table { font-size: 12px; }
    th, td { padding: 8px 10px; }

    /* Sidebar cards stack nicely */
    .sidebar-card { min-width: unset; }

    /* Thread view tighter */
    .post { padding: 14px; }
    .post-avatar { width: 28px; height: 28px; font-size: 11px; }

    /* Admin table tighter */
    .admin-table thead th { padding: 10px 12px; font-size: 10px; }
    .admin-table tbody td { padding: 8px 12px; font-size: 12px; }
    .admin-container { padding: 0 12px; }

    /* Authorized email form stacks fully */
    .authorized-email-form { flex-direction: column !important; }

    /* Last Reply column tighter */
    .last-reply-cell {
        white-space: normal;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header-logo img { height: 26px; }
    .header-logo h1 { display: none; }
    .header-email { display: none; }
    .header-user svg { display: none; }

    /* On very small screens, hide more columns: Category(4), Last Reply(6), Last Activity(9) */
    th:nth-child(4), td:nth-child(4),
    th:nth-child(6), td:nth-child(6),
    th:nth-child(9), td:nth-child(9) {
        display: none;
    }

    /* Show only Ticket, Subject, Status on smallest screens */
    table { font-size: 11px; }
    th, td { padding: 8px; }
    .ticket-id { font-size: 11px; }
    .ticket-link { font-size: 12px; }
    .status-badge { font-size: 10px; padding: 2px 8px; }
    .type-badge { font-size: 10px; padding: 2px 8px; }

    .pagination { flex-wrap: wrap; gap: 4px; }
    .pagination a, .pagination span {
        padding: 6px 10px;
        font-size: 12px;
    }

    .reply-form .reply-actions { flex-direction: column; gap: 8px; align-items: stretch; }

    /* Filter adjustments */
    .filter-row {
        grid-template-columns: 1fr;
    }
    .filters { padding: 10px 12px; }
    .btn { padding: 8px 16px; font-size: 13px; }

    /* View toggle */
    .view-toggle-bar { padding: 0 12px; }
    .btn-back-simple { padding: 8px 16px; font-size: 13px; }
    .reply-char-count { text-align: right; }

    /* Notification dropdown fits small screens */
    .notif-dropdown {
        width: calc(100vw - 24px);
        max-width: 340px;
        right: -8px;
    }

    /* New ticket form in sidebar */
    .new-ticket-form input,
    .new-ticket-form select,
    .new-ticket-form textarea {
        font-size: 16px; /* prevents iOS zoom */
    }
}

/* ============================================
   Marketing Stats — Card + Modal
   ============================================ */

/* Stats card in right panel */
.stats-card {
    margin-top: 16px;
}
.stats-card-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 14px 0;
    line-height: 1.5;
}
.stats-open-btn {
    width: 100%;
    justify-content: center;
}

/* Overlay */
.stats-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 48, 93, 0.4);
    z-index: 1000;
    transition: opacity 0.3s;
    opacity: 0;
}
.stats-overlay.active {
    display: block;
    opacity: 1;
}

/* Large centered modal */
.stats-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 900px;
    max-width: 92vw;
    height: 85vh;
    max-height: 85vh;
    background: #fff;
    z-index: 1001;
    display: none;
    flex-direction: column;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(28, 48, 93, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.stats-modal.active {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal header */
.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 3px solid #1c305d;
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}
.stats-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1c305d;
    margin: 0;
}
.stats-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #8892a4;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.stats-close-btn:hover {
    color: #1c305d;
}

/* Tabs */
.stats-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    border-bottom: 1px solid #edf0f5;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}
.stats-tab {
    padding: 7px 16px;
    border-radius: 20px;
    border: none;
    background: #e8ecf2;
    color: #5a6474;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.stats-tab:hover {
    background: #d4dae4;
    color: #1c305d;
}
.stats-tab.active {
    background: #1c305d;
    color: #fff;
}

/* Scrollable body */
.stats-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Footer */
.stats-modal-footer {
    padding: 14px 28px;
    border-top: 1px solid #edf0f5;
    border-radius: 0 0 14px 14px;
    flex-shrink: 0;
}
.stats-updated {
    font-size: 11px;
    color: #a0aec0;
}

/* Loading / Empty / Error states */
.stats-loading,
.stats-empty,
.stats-error {
    text-align: center;
    padding: 48px 20px;
    font-size: 14px;
    color: #8892a4;
}
.stats-error {
    color: #991b1b;
}

/* Section headings */
.stats-section {
    margin-bottom: 28px;
}
.stats-section:last-child {
    margin-bottom: 0;
}
.stats-section h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1c305d;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #edf0f5;
}
.stats-period {
    font-size: 12px;
    font-weight: 400;
    color: #8892a4;
    margin-left: 8px;
}
.stats-sub-heading {
    font-size: 12px;
    font-weight: 700;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 0;
}

/* Stat card grid — competitor-style: 4 cols, left-aligned, clean borders */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    text-align: left;
}
.stat-card-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.stat-card-label .info-icon {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}
.stat-value-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
}
.stat-trend {
    font-size: 12px;
    margin-top: 6px;
}
.stat-secondary {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Trend badge — inline green/red pill */
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.trend-badge-up {
    background: #f0fdf4;
    color: #16a34a;
}
.trend-badge-down {
    background: #fef2f2;
    color: #dc2626;
}
.trend-badge-flat {
    background: #f8fafc;
    color: #94a3b8;
}
.trend-badge .trend-arrow {
    font-size: 10px;
}

/* Legacy color variants (kept for backward compat) */
.stat-green { border-left: 3px solid #22c55e; }
.stat-blue { border-left: 3px solid #3b74bb; }
.stat-cyan { border-left: 3px solid #49cde4; }
.stat-navy { border-left: 3px solid #1c305d; }
.stat-red { border-left: 3px solid #ef4444; }
.stat-gray { border-left: 3px solid #94a3b8; }

.stat-green .stat-value { color: #166534; }
.stat-red .stat-value { color: #991b1b; }

/* Trend arrows (legacy) */
.trend-up { color: #16a34a; font-weight: 600; }
.trend-down { color: #dc2626; font-weight: 600; }
.trend-flat { color: #8892a4; }

/* Bar chart */
.stats-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bar-label {
    width: 36px;
    font-size: 12px;
    font-weight: 600;
    color: #5a6474;
    text-align: right;
    flex-shrink: 0;
}
.bar-track {
    flex: 1;
    height: 22px;
    background: #edf0f5;
    border-radius: 6px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b74bb, #49cde4);
    border-radius: 6px;
    transition: width 0.5s ease;
    min-width: 2px;
}
.bar-value {
    width: 52px;
    font-size: 13px;
    font-weight: 600;
    color: #1c305d;
    flex-shrink: 0;
}

/* Stats table */
.stats-table-wrap {
    overflow-x: auto;
    margin-top: 14px;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    box-shadow: none;
}
.stats-table th {
    background: #f8f9fb;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #8892a4;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 2px solid #edf0f5;
}
.stats-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f2f5;
    color: #2d3748;
}
.stats-table-total td {
    border-top: 2px solid #1c305d;
    background: #f8f9fb;
}

/* NAP score display */
.nap-score-display {
    text-align: center;
    padding: 20px 0;
}
.nap-score-big {
    font-size: 48px;
    font-weight: 700;
    color: #1c305d;
    line-height: 1;
}
.nap-pct {
    font-size: 20px;
    color: #8892a4;
}
.nap-change {
    font-size: 14px;
    font-weight: 500;
    margin-top: 6px;
}
.nap-note {
    margin-top: 14px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 13px;
    color: #166534;
}

/* Mobile adjustments for stats modal */
@media (max-width: 768px) {
    .stats-modal {
        width: 96vw;
        max-width: 96vw;
        height: 90vh;
        max-height: 90vh;
        border-radius: 12px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-modal-tabs {
        padding: 10px 16px;
    }
    .stats-modal-body {
        padding: 16px;
    }
    .stat-value {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Simple Dashboard View
   ============================================ */

.simple-view {
    min-height: calc(100vh - 60px);
    background: #f4f6f9;
}

/* Welcome Bar */
.welcome-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.06);
}

.welcome-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1c305d;
    margin: 0 0 2px 0;
    letter-spacing: -0.3px;
}

.welcome-text p {
    font-size: 13px;
    color: #8892a4;
    margin: 0;
}

.welcome-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Notification Bell Wrapper & Dropdown */
.notif-bell-wrapper {
    position: relative;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(28, 48, 93, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 5000;
    overflow: hidden;
    animation: notif-drop-in 0.2s ease;
}

.notif-dropdown.active {
    display: block;
}

@keyframes notif-drop-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eef1f6;
}

.notif-dropdown-title {
    font-size: 14px;
    font-weight: 700;
    color: #1c305d;
}

.notif-dropdown-count {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #ef4444;
    padding: 2px 8px;
    border-radius: 10px;
}

.notif-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: #999;
}

.notif-dropdown-empty svg {
    margin-bottom: 8px;
}

.notif-dropdown-empty p {
    font-size: 13px;
    color: #999;
}

.notif-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f6f8;
    transition: background 0.15s;
}

.notif-dropdown-item:hover {
    background: #f0f4ff;
}

.notif-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf2ff;
    border-radius: 8px;
    color: #3b74bb;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #3b74bb;
    margin-bottom: 2px;
}

.notif-item-subject {
    font-size: 13px;
    font-weight: 500;
    color: #1c305d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.notif-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #888;
}

.notif-item-type {
    background: #f0f4ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    color: #3b74bb;
}

.notif-item-time {
    color: #999;
}

.notif-dropdown-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid #eef1f6;
    background: #fafbfc;
}

.notif-dropdown-footer a {
    font-size: 13px;
    font-weight: 600;
    color: #3b74bb;
    text-decoration: none;
}

.notif-dropdown-footer a:hover {
    color: #1c305d;
    text-decoration: underline;
}

/* Notification Bell with Badge (Header) */
.header-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #1c305d;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    font-family: inherit;
}

.header-bell:hover {
    background: #edf2ff;
    color: #3b74bb;
}

.header-bell .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    line-height: 1;
    animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Notification Bell (Welcome Bar — legacy, kept for backward compat) */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #fff;
    border-radius: 50%;
    color: #1c305d;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.notification-bell:hover {
    background: #edf2ff;
    color: #3b74bb;
    box-shadow: 0 2px 8px rgba(28, 48, 93, 0.15);
}

.notification-bell > .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #f4f6f9;
    line-height: 1;
    animation: badge-pop 0.3s ease;
}

/* === Toast Notification System === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(28, 48, 93, 0.18);
    padding: 14px 40px 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid #3b74bb;
    animation: toast-slide-up 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
    pointer-events: auto;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    cursor: default;
}

.toast-success { border-left-color: #22c55e; }
.toast-error   { border-left-color: #ef4444; }
.toast-info    { border-left-color: #49cde4; }

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg { width: 20px; height: 20px; }

.toast-success .toast-icon { color: #22c55e; }
.toast-error .toast-icon   { color: #ef4444; }
.toast-info .toast-icon    { color: #49cde4; }
.toast .toast-icon         { color: #3b74bb; }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13px;
    font-weight: 600;
    color: #1c305d;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    font-family: inherit;
    transition: color 0.15s;
}

.toast-close:hover {
    color: #333;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 0;
    height: 3px;
    background: rgba(28, 48, 93, 0.08);
    border-radius: 0 0 10px 0;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    border-radius: 0 0 10px 0;
    animation: toast-timer 5s linear forwards;
}

.toast-success .toast-progress-bar { background: #22c55e; }
.toast-error .toast-progress-bar   { background: #ef4444; }
.toast-info .toast-progress-bar    { background: #49cde4; }
.toast .toast-progress-bar         { background: #3b74bb; }

@keyframes toast-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.toast-dismiss {
    animation: toast-fade-out 0.3s ease forwards;
}

@keyframes toast-fade-out {
    to { transform: translateX(120%); opacity: 0; }
}

@keyframes toast-timer {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Advanced View Button */
.btn-advanced {
    padding: 10px 22px;
    background: #fff;
    color: #3b74bb;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-advanced:hover {
    background: #3b74bb;
    color: #fff;
    border-color: #3b74bb;
}

/* Stat Cards Grid */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.dash-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

a.dash-stat-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.dash-stat-card:hover {
    box-shadow: 0 3px 12px rgba(28, 48, 93, 0.08);
    transform: translateY(-2px);
}

.dash-stat-card.card-highlight {
    border-color: #3b74bb;
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-total {
    background: #edf2ff;
    color: #3b74bb;
}

.icon-open {
    background: #fef3c7;
    color: #d97706;
}

.icon-closed {
    background: #dcfce7;
    color: #16a34a;
}

.icon-awaiting {
    background: #dbeafe;
    color: #1c305d;
}
.icon-calls {
    background: #dcfce7;
    color: #166534;
}
.icon-keywords {
    background: #fef3c7;
    color: #92400e;
}
.icon-gmb {
    background: #e0e7ff;
    color: #3730a3;
}
.icon-nap {
    background: #fce7f3;
    color: #9d174d;
}
.icon-webforms {
    background: #f0fdf4;
    color: #15803d;
}

/* Stat Cards Header (gear icon) */
.stat-cards-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}
.tile-settings-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s;
}
.tile-settings-btn:hover {
    background: #f1f5f9;
    color: #1c305d;
    border-color: #cbd5e1;
}

/* Tile Settings Panel */
.tile-settings-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.tile-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.tile-settings-header h4 {
    margin: 0;
    font-size: 15px;
    color: #1c305d;
}
.tile-settings-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}
.tile-settings-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 12px;
}
.tile-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.tile-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
}
.tile-option:hover {
    border-color: #3b74bb;
    background: #f8fafc;
}
.tile-option-selected {
    border-color: #3b74bb;
    background: #eff6ff;
}
.tile-option-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.tile-option input[type="checkbox"] {
    display: none;
}
.tile-option-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #64748b;
}
.tile-option-icon svg {
    width: 18px;
    height: 18px;
}
.tile-option-selected .tile-option-icon {
    color: #3b74bb;
}
.tile-option-label {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
}
.tile-settings-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tile-count-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.dash-stat-info {
    display: flex;
    flex-direction: column;
}

.dash-stat-number {
    font-size: 26px;
    font-weight: 700;
    color: #1c305d;
    line-height: 1.1;
}

.dash-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: #8892a4;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-stat-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    animation: badge-pop 0.3s ease;
}

/* Recent Tickets Section */
.recent-section {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.06);
    overflow: hidden;
    margin-bottom: 20px;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.recent-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1c305d;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view-all {
    background: none;
    border: none;
    color: #3b74bb;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.btn-view-all:hover {
    background: #edf2ff;
    color: #1c305d;
}

.recent-list {
    display: flex;
    flex-direction: column;
}

.recent-ticket {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.recent-ticket:last-child {
    border-bottom: none;
}

.recent-ticket:hover {
    background: #f8fafc;
}

.recent-ticket-main {
    flex: 1;
    min-width: 0;
}

.recent-ticket-subject {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1c305d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 1.35;
}

.recent-ticket-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-ticket-time {
    font-size: 12px;
    color: #a0aec0;
}

.recent-empty {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
    font-size: 14px;
}


/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.quick-action-btn {
    flex: 1;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 8px;
}

/* New Ticket Modal */
.ticket-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 48, 93, 0.4);
    z-index: 1000;
    transition: opacity 0.3s;
    opacity: 0;
}
.ticket-overlay.active {
    display: block;
    opacity: 1;
}

.ticket-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 560px;
    max-width: 92vw;
    max-height: 85vh;
    background: #fff;
    z-index: 1001;
    display: none;
    flex-direction: column;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(28, 48, 93, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.ticket-modal.active {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.ticket-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 3px solid #1c305d;
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}
.ticket-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1c305d;
    margin: 0;
}

.ticket-modal-body {
    padding: 24px 28px 28px;
    overflow-y: auto;
}

.modal-ticket-form label {
    font-size: 13px;
}

.modal-ticket-form textarea {
    min-height: 140px;
}

.modal-ticket-form .btn {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    padding: 12px;
}

/* View Toggle Bar (Advanced View) */
.view-toggle-bar {
    max-width: 1800px;
    margin: 16px auto 0;
    padding: 0 20px;
}

.btn-back-simple {
    padding: 10px 22px;
    background: #fff;
    color: #3b74bb;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-back-simple:hover {
    background: #3b74bb;
    color: #fff;
    border-color: #3b74bb;
}

/* Simple View — Mobile Responsive */
@media (max-width: 768px) {
    .welcome-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 18px;
    }

    .welcome-text h2 {
        font-size: 18px;
    }

    .welcome-text p {
        font-size: 12px;
    }

    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dash-stat-card {
        padding: 14px 12px;
        gap: 10px;
    }

    .dash-stat-icon {
        width: 38px;
        height: 38px;
    }

    .dash-stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .dash-stat-number {
        font-size: 20px;
    }

    .dash-stat-label {
        font-size: 10px;
        letter-spacing: 0.3px;
    }

    .quick-actions {
        flex-direction: row;
        gap: 10px;
    }

    .quick-action-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .recent-ticket {
        padding: 12px 14px;
    }

    .recent-ticket-subject {
        font-size: 12px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .recent-ticket-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .recent-header {
        padding: 14px 14px;
    }

    .recent-header h3 {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .welcome-bar {
        padding: 14px;
        gap: 10px;
    }

    .welcome-text h2 {
        font-size: 16px;
    }

    .stat-cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .dash-stat-card {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 12px 8px;
    }

    .dash-stat-icon {
        width: 36px;
        height: 36px;
    }

    .dash-stat-number {
        font-size: 18px;
    }

    .dash-stat-label {
        font-size: 9px;
    }

    .dash-stat-badge {
        top: 8px;
        right: 8px;
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .quick-actions {
        flex-direction: column;
        gap: 8px;
    }

    .quick-action-btn {
        padding: 12px;
        font-size: 13px;
    }

    .recent-ticket {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .recent-ticket-main {
        width: 100%;
    }

    .recent-ticket-subject {
        font-size: 12px;
    }

    .recent-ticket-time {
        font-size: 11px;
    }
}

/* ============================================
   Admin Panel
   ============================================ */

/* Admin Tab Navigation Bar */
.admin-tab-bar {
    display: flex;
    gap: 0;
    background: #f8f9fb;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    overflow-x: auto;
}
.admin-tab {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    transition: all 0.2s;
    white-space: nowrap;
    background: transparent;
}
.admin-tab:hover {
    color: #1c305d;
    background: #eef2f7;
}
.admin-tab-active {
    color: #fff;
    background: #1c305d;
    border-bottom-color: #3b74bb;
    border-radius: 6px 6px 0 0;
}
.admin-tab-active:hover {
    color: #fff;
    background: #1c305d;
}

.admin-container {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.admin-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1c305d;
    margin: 0;
}

.admin-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.08);
}

.admin-table thead th {
    background: #f8f9fb;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid #edf0f5;
}

.admin-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f8f9fb;
}

.admin-table tbody tr.row-hidden {
    opacity: 0.45;
}

.admin-type-id {
    display: inline-block;
    background: #edf0f5;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.admin-kayako-title {
    color: #94a3b8;
    font-size: 12px;
}

.admin-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dde2ea;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #1a1a2e;
    transition: border-color 0.15s;
}

.admin-input:focus {
    outline: none;
    border-color: #3b74bb;
    box-shadow: 0 0 0 2px rgba(59, 116, 187, 0.15);
}

.admin-input-narrow {
    width: 70px;
    text-align: center;
}

/* Toggle switch */
.admin-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.admin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: 0.2s;
}

.admin-toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.admin-toggle input:checked + .admin-toggle-slider {
    background: #22c55e;
}

.admin-toggle input:checked + .admin-toggle-slider::before {
    transform: translateX(18px);
}

.admin-toggle-cell {
    text-align: center;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 0;
}

.admin-count {
    font-size: 13px;
    color: #64748b;
}

/* Alert messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* Maintenance Mode Section */
.maintenance-section {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 4px rgba(28, 48, 93, 0.08);
}

.maintenance-section .admin-header {
    margin-bottom: 16px;
}

.maintenance-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.maintenance-status.status-on {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.maintenance-status.status-off {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.maintenance-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.maintenance-toggle,
.devmode-toggle {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: auto !important;
    height: auto !important;
    cursor: pointer;
}

.maintenance-toggle .admin-toggle-slider,
.devmode-toggle .admin-toggle-slider {
    position: relative;
    width: 40px;
    min-width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.maintenance-toggle-label,
.devmode-toggle-label {
    font-size: 13px;
    color: #475569;
}

.maintenance-message-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.maintenance-message-field label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.maintenance-message-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1a1a2e;
    resize: vertical;
    transition: border-color 0.15s;
}

.maintenance-message-field textarea:focus {
    outline: none;
    border-color: #3b74bb;
    box-shadow: 0 0 0 2px rgba(59, 116, 187, 0.15);
}

/* ============================================
   Admin Management — Users, Roles, History
   ============================================ */

/* Form grid (2-col layout for add admin / change password) */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.admin-form-field select.admin-input {
    height: 38px;
    cursor: pointer;
}

/* "You" badge next to current admin's name */
.admin-you-badge {
    display: inline-block;
    background: #edf2ff;
    color: #3b74bb;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.role-super_admin {
    background: #fef3c7;
    color: #92400e;
}

.role-admin {
    background: #edf2ff;
    color: #3b74bb;
}

/* Login status badges */
.login-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.login-success {
    background: #dcfce7;
    color: #166534;
}

.login-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Date cells in admin tables */
.admin-date-cell {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

/* Action buttons in admin tables */
.admin-actions-cell {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-action {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-action-reset {
    background: #edf2ff;
    color: #3b74bb;
    border-color: #c7d2fe;
}

.btn-action-reset:hover {
    background: #3b74bb;
    color: #fff;
}

.btn-action-role {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.btn-action-role:hover {
    background: #eab308;
    color: #fff;
}

.btn-action-remove {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.btn-action-remove:hover {
    background: #dc2626;
    color: #fff;
}

/* Account info grid */
.account-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.account-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-info-label {
    font-size: 11px;
    font-weight: 700;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-info-value {
    font-size: 14px;
    font-weight: 500;
    color: #1c305d;
}

/* Reset Password Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 48, 93, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(28, 48, 93, 0.25);
}

.modal-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1c305d;
    margin: 0 0 8px 0;
}

.modal-box p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px 0;
}

/* Password form */
.password-form {
    max-width: 600px;
}

/* Mobile responsive for admin management */
@media (max-width: 768px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .account-info-grid {
        grid-template-columns: 1fr;
    }

    .admin-actions-cell {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        display: none;
    }

    /* Admin header stacks vertically */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Maintenance section tighter padding */
    .maintenance-section {
        padding: 16px;
    }

    /* Admin table scrolls horizontally if needed */
    .admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Modal box full width on mobile */
    .modal-box {
        width: calc(100vw - 32px);
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    /* Admin page header buttons stack */
    .header-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    .header-actions .btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .admin-header h2 { font-size: 18px; }
    .admin-subtitle { font-size: 12px; }

    /* Tab bar responsive */
    .admin-tab-bar {
        padding: 0 12px;
    }
    .admin-tab {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* ============================================================
   Feedback Widget
   ============================================================ */

.feedback-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #3b74bb;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(28, 48, 93, 0.3);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.feedback-fab:hover {
    background: #1c305d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(28, 48, 93, 0.4);
}

.feedback-fab.active {
    background: #6b7280;
    transform: scale(0.95);
}

.feedback-fab svg {
    flex-shrink: 0;
}

.feedback-popup {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: 9999;
    width: 380px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(28, 48, 93, 0.2), 0 0 0 1px rgba(28, 48, 93, 0.08);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.feedback-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.feedback-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1c305d;
    color: #fff;
}

.feedback-popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.feedback-popup-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.feedback-popup-close:hover {
    color: #fff;
}

.feedback-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.feedback-required {
    color: #ef4444;
}

.feedback-stars {
    display: flex;
    gap: 4px;
}

.feedback-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: transform 0.15s;
}

.feedback-star:hover {
    transform: scale(1.2);
}

.feedback-star svg {
    width: 28px;
    height: 28px;
    fill: #e5e7eb;
    stroke: #d1d5db;
    stroke-width: 1;
    transition: fill 0.15s, stroke 0.15s;
}

.feedback-star.active svg {
    fill: #fbbf24;
    stroke: #f59e0b;
}

.feedback-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: #1f2937;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: #3b74bb;
    box-shadow: 0 0 0 3px rgba(59, 116, 187, 0.12);
}

.feedback-form textarea::placeholder {
    color: #9ca3af;
}

.feedback-char-count {
    text-align: right;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.feedback-submit {
    width: 100%;
    padding: 11px 16px;
    background: #3b74bb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.feedback-submit:hover {
    background: #1c305d;
}

.feedback-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.feedback-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.feedback-success p {
    margin: 16px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .feedback-fab span {
        display: none;
    }
    .feedback-fab {
        padding: 14px;
        border-radius: 50%;
    }
    .feedback-popup {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 76px;
    }
}

/* ============================================================
   Admin Feedback Table
   ============================================================ */

.feedback-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.feedback-table th {
    background: #f3f4f6;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.feedback-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
    vertical-align: top;
}

.feedback-table tr:hover td {
    background: #f9fafb;
}

.feedback-table .feedback-msg-cell {
    max-width: 400px;
    white-space: pre-wrap;
    word-break: break-word;
}

.feedback-stars-display {
    color: #fbbf24;
    font-size: 15px;
    letter-spacing: 1px;
}

.feedback-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.feedback-status-new {
    background: #dbeafe;
    color: #1d4ed8;
}

.feedback-status-reviewed {
    background: #d1fae5;
    color: #065f46;
}

.feedback-status-archived {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============================================================
   Take a Tour — Spotlight Walkthrough
   ============================================================ */

.tour-trigger-btn {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: 9997;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    background: #1c305d;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(28, 48, 93, 0.25);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tour-trigger-btn:hover {
    background: #3b74bb;
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(59, 116, 187, 0.35);
}

.tour-trigger-btn svg {
    flex-shrink: 0;
}

/* Overlay with spotlight cutout */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    --spotlight-top: 0px;
    --spotlight-left: 0px;
    --spotlight-width: 0px;
    --spotlight-height: 0px;
    background: rgba(0, 0, 0, 0);
}

.tour-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.55);
    /* Spotlight cutout using box-shadow on a pseudo element */
}

/* Highlighted element punches through the overlay */
.tour-highlighted {
    position: relative;
    z-index: 10001 !important;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(73, 205, 228, 0.5), 0 0 0 9999px rgba(0, 0, 0, 0.55);
    transition: box-shadow 0.3s;
}

/* Tooltip */
.tour-tooltip {
    position: fixed;
    z-index: 10002;
    width: 340px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(28, 48, 93, 0.25), 0 0 0 1px rgba(28, 48, 93, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s, top 0.3s ease, left 0.3s ease;
}

.tour-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tour-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 0;
}

.tour-step-counter {
    font-size: 12px;
    font-weight: 600;
    color: #3b74bb;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 10px;
}

.tour-tooltip-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.tour-tooltip-close:hover {
    color: #374151;
}

.tour-tooltip-title {
    margin: 10px 18px 6px;
    font-size: 16px;
    font-weight: 700;
    color: #1c305d;
}

.tour-tooltip-desc {
    margin: 0 18px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

.tour-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 16px;
    gap: 10px;
}

.tour-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tour-btn-primary {
    background: #3b74bb;
    color: #fff;
    flex: 1;
}

.tour-btn-primary:hover {
    background: #1c305d;
}

.tour-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.tour-btn-secondary:hover {
    background: #e5e7eb;
}

/* Prevent body scroll during tour */
body.tour-active {
    overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .tour-trigger-btn span {
        display: none;
    }
    .tour-trigger-btn {
        padding: 12px;
        border-radius: 50%;
        bottom: 80px;
    }
    .tour-tooltip {
        width: calc(100vw - 32px);
        left: 16px !important;
    }
}

/* ============================================
   Demo Account Styles
   ============================================ */

/* Demo banner — fixed top bar */
.demo-banner {
    background: #3b74bb;
    color: #ffffff;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.demo-banner svg {
    flex-shrink: 0;
}

/* Demo badge in header (like dev badge but blue) */
.demo-badge {
    display: inline-block;
    background: #49cde4;
    color: #1c305d;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Login page — demo section */

/* Thread — demo disabled reply form */
.demo-disabled-form .demo-action-blocked {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
}
.demo-disabled-form .demo-action-blocked svg {
    flex-shrink: 0;
    color: #94a3b8;
}
.demo-disabled-form .demo-action-blocked p {
    margin: 0;
    line-height: 1.5;
}

/* ============================================================
   User Config (Ryan A4) — listing, controls, popups
   ============================================================ */
.uc-search-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.uc-search-grid label { display:block; font-size:12px; font-weight:600; color:#334155; margin-bottom:4px; }
.uc-search-actions { display:flex; align-items:center; gap:10px; margin-top:14px; flex-wrap:wrap; }
.uc-count { font-size:13px; color:#64748b; margin-left:auto; }
.uc-table th { white-space:nowrap; }
.uc-table .uc-sort { color:#1c305d; text-decoration:none; }
.uc-table .uc-sort:hover { text-decoration:underline; }
.uc-table td { vertical-align:top; font-size:13px; }
.uc-org-default { display:block; font-weight:700; color:#0f172a; }
.uc-org-extra { display:block; color:#991b1b; font-size:12px; }
.uc-web { display:block; color:#64748b; font-size:12px; }
.uc-noorg { color:#475569; font-size:12px; font-style:italic; }
.uc-uid { display:block; color:#94a3b8; font-size:11px; margin-top:4px; }
.uc-activity { white-space:nowrap; color:#475569; }
.uc-lastlogin { white-space:nowrap; }
.uc-online { color:#16a34a; font-size:14px; margin-left:4px; }
.uc-muted { color:#94a3b8; }
.uc-unavail { color:#dc2626; font-size:12px; }
.uc-toggle, .uc-method { border:1px solid #cbd5e1; background:#fff; border-radius:6px; padding:4px 10px; font-size:12px; font-weight:600; cursor:pointer; }
.uc-toggle.on { background:#fee2e2; border-color:#fca5a5; color:#b91c1c; }
.uc-toggle.off { background:#f1f5f9; color:#334155; }
.uc-method { background:#eef2ff; border-color:#c7d2fe; color:#3730a3; }
.uc-modal-overlay { display:none; position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:1000; align-items:center; justify-content:center; }
.uc-modal { background:#fff; border-radius:12px; padding:22px; width:min(92vw,440px); max-height:88vh; overflow:auto; box-shadow:0 10px 40px rgba(0,0,0,.2); }
.uc-modal h3 { margin:0 0 6px; color:#1c305d; }
.uc-modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.uc-pw-row { display:flex; gap:8px; }
.uc-pw-row .admin-input { flex:1; }
.uc-org-list { max-height:300px; overflow:auto; border:1px solid #e2e8f0; border-radius:8px; padding:6px; }
.uc-org-opt { display:flex; align-items:center; gap:8px; padding:6px; border-radius:6px; cursor:pointer; }
.uc-org-opt:hover { background:#f8fafc; }
@media (max-width:768px){ .uc-search-grid { grid-template-columns:1fr; } }

/* ============================================================
   Dedicated Stats Page (Ryan C8)
   ============================================================ */
.stats-page { max-width:1100px; margin:0 auto; padding:24px 20px 80px; }
.stats-page-header { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:8px; }
.stats-page-title h1 { margin:6px 0 0; color:#1c305d; font-size:24px; }
.stats-back { color:#3b74bb; text-decoration:none; font-size:13px; font-weight:600; }
.stats-back:hover { text-decoration:underline; }
.stats-page-tabs { display:flex; gap:8px; flex-wrap:wrap; margin:18px 0 8px; border-bottom:1px solid #e2e8f0; }
.practice-tab { border:none; background:none; padding:10px 16px; font-size:14px; font-weight:600; color:#64748b; cursor:pointer; border-bottom:3px solid transparent; }
.practice-tab.active { color:#1c305d; border-bottom-color:#3b74bb; }
.stats-page-body { margin-top:16px; min-height:120px; }
.stats-grid-groups { display:flex; flex-direction:column; gap:20px; }
.stats-page .stats-updated { margin-top:18px; color:#94a3b8; font-size:12px; }
.stats-page-note { color:#64748b; margin-top:16px; }

/* Config-driven stats (Ryan A7 generic renderer) */
.stats-unavailable { color:#dc2626; font-size:13px; background:#fef2f2; border:1px solid #fecaca; border-radius:8px; padding:10px 12px; }
.cfg-chart { width:100%; overflow-x:auto; margin-top:6px; }
.cfg-svg { width:100%; max-width:620px; height:auto; }
.cfg-chart-pie { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.cfg-svg-pie { width:180px; height:180px; flex:0 0 auto; }
.cfg-legend { display:flex; flex-wrap:wrap; gap:10px 16px; margin:6px 0 4px; }
.cfg-legend-item { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#475569; }
.cfg-swatch { width:11px; height:11px; border-radius:2px; display:inline-block; }
