/* ============================================
   Madarik Admin Panel Styles
   ============================================ */

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --secondary: #5f6368;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --dark: #202124;
    --light: #f8f9fa;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--dark);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-header {
    background: var(--dark);
    color: var(--white);
    padding: 30px;
    text-align: center;
}

.login-header h1 { font-size: 28px; margin-bottom: 5px; }
.login-header p { opacity: 0.8; font-size: 14px; }
.login-form { padding: 30px; }
.login-footer { padding: 20px; text-align: center; background: var(--light); font-size: 12px; color: var(--secondary); }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--dark); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 15px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.error-message { background: #fce8e6; color: var(--danger); padding: 12px 15px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--light); color: var(--dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c5221f; }
.btn-success { background: var(--success); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--dark); }
.btn-outline { background: transparent; border: 1px solid currentColor; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width); background: var(--dark); color: var(--white);
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
}
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.sidebar-header h2 { font-size: 20px; }
.badge { background: var(--primary); color: var(--white); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 20px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: all 0.2s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.nav-item.active { background: var(--primary); color: var(--white); }
.nav-icon { font-size: 18px; }
.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.admin-info { margin-bottom: 10px; font-size: 13px; opacity: 0.8; word-break: break-all; }

.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.content-header { background: var(--white); padding: 20px 30px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.content-header h1 { font-size: 24px; font-weight: 600; }
.header-actions { display: flex; gap: 10px; }
.content-body { padding: 30px; flex: 1; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 15px; }
.stat-icon { font-size: 32px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--light); }
.stat-info h3 { font-size: 28px; font-weight: 700; margin-bottom: 5px; }
.stat-info p { color: var(--secondary); font-size: 13px; }
.stat-details { margin-left: auto; text-align: right; }
.stat-detail { font-size: 12px; color: var(--secondary); }
.stat-detail.success { color: var(--success); }
.stat-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.stat-link:hover { text-decoration: underline; }

/* Sections */
.section { background: var(--white); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.action-card { display: flex; align-items: center; gap: 12px; padding: 15px; background: var(--light); border-radius: var(--radius); text-decoration: none; color: var(--dark); transition: all 0.2s; }
.action-card:hover { background: var(--primary); color: var(--white); }
.action-icon { font-size: 24px; }
.action-text { font-weight: 500; }

/* Status List */
.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--light); border-radius: var(--radius); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--secondary); }
.status-item.success .status-dot { background: var(--success); }
.status-item.warning .status-dot { background: var(--warning); }
.status-item.danger .status-dot { background: var(--danger); }
.status-label { margin-left: auto; font-size: 12px; color: var(--secondary); }

/* Filters Bar */
.filters-bar { display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 13px; color: var(--secondary); }
.filter-group select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.search-box { flex: 1; min-width: 200px; }
.search-box input { width: 100%; padding: 8px 15px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }

/* Data Tables */
.table-container { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--light); font-weight: 600; font-size: 13px; color: var(--secondary); text-transform: uppercase; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table tbody tr:last-child td { border-bottom: none; }
.loading-cell { text-align: center; padding: 40px !important; color: var(--secondary); }
.user-cell { display: flex; flex-direction: column; }
.user-email { font-weight: 500; }
.user-name { font-size: 12px; color: var(--secondary); }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.status-active { background: #e6f4ea; color: var(--success); }
.status-inactive { background: #f1f3f4; color: var(--secondary); }
.status-suspended { background: #fef7e0; color: #b06000; }
.status-banned { background: #fce8e6; color: var(--danger); }
.status-deleted { background: #f1f3f4; color: var(--secondary); }
.status-orphaned { background: #fef7e0; color: #b06000; }
.verified-badge { color: var(--success); }
.unverified-badge { color: var(--secondary); }

/* FAL verification status badges */
.badge-status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-status-pending { background: #f1f3f4; color: var(--secondary); }
.badge-status-approved { background: #e6f4ea; color: var(--success); }
.badge-status-rejected { background: #fce8e6; color: var(--danger); }

/* Alert boxes */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; }
.alert-danger { background: #fce8e6; border: 1px solid #f5c6cb; color: #721c24; }
.alert-success { background: #e6f4ea; border: 1px solid #c3e6cb; color: #155724; }

/* Outline secondary button variant (used in FAL badge row) */
.btn-outline-secondary { background: transparent; border: 1px solid var(--border); color: var(--secondary); }
.btn-outline-secondary:hover { background: #f1f3f4; }

/* Role badges */
.role-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.role-individual { background: #e8f0fe; color: #1a73e8; }
.role-individual-lister { background: #fef7e0; color: #b8860b; border: 1.5px solid #daa520; }
.role-user { background: #e8f0fe; color: #1a73e8; }
.role-agent { background: #e6f4ea; color: var(--success); }
.role-broker { background: #f3e8ff; color: #7c3aed; }
.role-company { background: #e0f2f1; color: #00695c; }
.role-company-admin { background: #e0f2f1; color: #00695c; }
.role-admin { background: #fef7e0; color: #b06000; }
.role-super-admin { background: #fce8e6; color: var(--danger); }

.action-buttons { display: flex; gap: 5px; flex-wrap: wrap; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 20px; padding: 20px; }
#pageInfo { color: var(--secondary); font-size: 14px; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); }
.modal-content { position: relative; background: var(--white); border-radius: var(--radius); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); margin: 20px; }
.modal-lg { max-width: 800px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--secondary); padding: 0; line-height: 1; }
.modal-close:hover { color: var(--dark); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 20px; border-top: 1px solid var(--border); background: var(--light); }

/* Detail View */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.detail-item { padding: 10px; background: var(--light); border-radius: var(--radius); }
.detail-label { font-size: 11px; color: var(--secondary); text-transform: uppercase; margin-bottom: 5px; }
.detail-value { font-weight: 500; }
.detail-full { grid-column: 1 / -1; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 15px 20px; border-radius: var(--radius); color: var(--white); font-size: 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); animation: slideIn 0.3s ease; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--dark); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================
   TOTP / 2FA UI additions
   ============================================ */

/* Large, centered, letter-spaced TOTP code input (login + setup pages) */
.totp-code-input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 24px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.4em;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.totp-code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}
/* Smaller variant used inside the reauth modal */
.totp-code-input-sm {
    font-size: 18px;
    letter-spacing: 0.3em;
}

/* Description text shown above the TOTP input on the login page */
.totp-description {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 20px;
    text-align: center;
}

/* Link-style actions below the TOTP form (toggle backup code / Back) */
.totp-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}
.totp-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}
.totp-link:hover { text-decoration: underline; }

/* ---- setup-2fa.html ---- */
.setup-2fa-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}
.setup-2fa-subtitle {
    font-size: 13px;
    color: var(--secondary);
    margin-bottom: 24px;
}
.setup-stage-instructions {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 20px;
}
.setup-stage-loading-text {
    text-align: center;
    color: var(--secondary);
    padding: 20px 0;
}

/* QR code image */
.qr-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
.qr-image {
    width: 200px;
    height: 200px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    background: var(--white);
}

/* Manual-entry base32 secret */
.setup-manual-entry-label {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 6px;
    text-align: center;
}
.setup-base32-secret {
    display: block;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    word-break: break-all;
    user-select: all;
}

/* Backup codes grid */
.backup-code-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px 0;
}
.backup-code-item {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 600;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    text-align: center;
    letter-spacing: 0.1em;
    user-select: all;
}

/* Amber warning banner above backup codes */
.backup-codes-warning {
    background: #fef7e0;
    border: 1px solid #f9a825;
    border-radius: var(--radius);
    color: #b06000;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    margin-bottom: 12px;
}

/* "I've saved these codes" checkbox label */
.backup-saved-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}
.backup-saved-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ---- Reauth modal overlay ---- */
.reauth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}
.reauth-modal-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    overflow: hidden;
}
.reauth-modal-header {
    background: var(--dark);
    color: var(--white);
    padding: 20px 24px;
}
.reauth-modal-header h2 {
    font-size: 18px;
    margin-bottom: 4px;
}
.reauth-modal-header p {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
}
.reauth-modal-body {
    padding: 24px;
}
.reauth-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: var(--light);
    border-top: 1px solid var(--border);
}

/* ============================================
   AUDIT LOG — Plan 2 additions
   ============================================ */

/* Stats row */
.audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.audit-stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: box-shadow 0.2s, transform 0.1s;
    user-select: none;
}
.audit-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); transform: translateY(-1px); }
.audit-stat-card.audit-stat-info  { border-left-color: var(--primary); }
.audit-stat-card.audit-stat-warn  { border-left-color: var(--warning); }
.audit-stat-card.audit-stat-danger { border-left-color: var(--danger); }
.audit-stat-card.audit-stat-error { border-left-color: #d93025; }
.audit-stat-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--dark);
}
.audit-stat-label {
    font-size: 12px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.audit-stat-info  .audit-stat-number { color: var(--primary); }
.audit-stat-warn  .audit-stat-number { color: #b06000; }
.audit-stat-danger .audit-stat-number { color: var(--danger); }
.audit-stat-error .audit-stat-number { color: #d93025; }

/* Filters bar extension for audit page */
.audit-filters-bar .filter-group input[type="text"],
.audit-filters-bar .filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    min-width: 120px;
}

/* Severity badges */
.sev-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sev-badge-none     { background: #f1f3f4; color: var(--secondary); }
.sev-badge-info     { background: #e8f0fe; color: var(--primary); }
.sev-badge-warn     { background: #fef7e0; color: #b06000; }
.sev-badge-error    { background: #fce8e6; color: var(--danger); }
.sev-badge-critical { background: var(--danger); color: var(--white); }

/* Detail drawer */
.audit-detail-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.audit-detail-drawer.open { right: 0; }

.audit-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--dark);
    color: var(--white);
    flex-shrink: 0;
}
.audit-drawer-header h3 { font-size: 16px; margin: 0; }
.audit-drawer-header .modal-close { color: rgba(255,255,255,0.7); }
.audit-drawer-header .modal-close:hover { color: var(--white); }

.audit-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.audit-drawer-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--light);
    flex-shrink: 0;
}

.audit-changes-pre {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
    overflow: auto;
    max-height: 300px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Drawer backdrop */
.audit-drawer-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1050;
}
.audit-drawer-backdrop.open { display: block; }

/* Responsive */
@media (max-width: 768px) {
    .audit-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .audit-detail-drawer { width: 100%; right: -100%; }
}

/* =========================================================================
   Ticket detail drawer — reuses audit drawer base, ticket-specific overrides
   ========================================================================= */
.ticket-drawer {
    position: fixed;
    top: 0;
    right: -520px;
    width: 520px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.ticket-drawer.open { right: 0; }

.ticket-drawer-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1050;
}
.ticket-drawer-backdrop.open { display: block; }

.ticket-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--dark);
    color: var(--white);
    flex-shrink: 0;
    gap: 12px;
}
.ticket-drawer-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.ticket-drawer-header h3 { font-size: 15px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-drawer-header .modal-close { color: rgba(255,255,255,0.7); flex-shrink: 0; }
.ticket-drawer-header .modal-close:hover { color: var(--white); }

.ticket-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.ticket-drawer-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--light);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Unread dot in table rows */
.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e74c3c;
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Bulk action toolbar */
.bulk-toolbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #2c3e50;
    color: #fff;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    flex-wrap: wrap;
}
.bulk-toolbar.visible { display: flex; }
.bulk-toolbar .bulk-label { font-weight: 600; margin-right: 4px; }

/* Ticket drawer sender block */
.ticket-sender-block {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.ticket-sender-block h4 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.05em;
}
.ticket-sender-row {
    display: flex;
    gap: 6px;
    align-items: baseline;
    font-size: 14px;
    margin-bottom: 4px;
}
.ticket-sender-row .label { color: #666; min-width: 56px; font-size: 12px; }

/* Message body section */
.ticket-message-block {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.ticket-message-block h4 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
}
.ticket-message-body {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

@media (max-width: 768px) {
    .ticket-drawer { width: 100%; right: -100%; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { width: 100%; }
    .filter-group select { flex: 1; }
    .detail-grid { grid-template-columns: 1fr; }
}
