/* =====================================================
   WhatsApp Admin Panel — Design System
   ===================================================== */

:root {
    --wa-green:       #25D366;
    --wa-green-dark:  #128C7E;
    --wa-green-light: #dcf8c6;
    --sidebar-bg:     #0d1117;
    --sidebar-hover:  #1c2128;
    --sidebar-active: #1a3a2a;
    --sidebar-border: #21262d;
    --sidebar-text:   #8b949e;
    --sidebar-text-active: #fff;
    --main-bg:        #f0f2f5;
    --surface:        #ffffff;
    --border:         #e1e4e8;
    --text:           #1a1a2e;
    --text-secondary: #6e7681;
    --danger:         #d73a49;
    --warning:        #e36209;
    --info:           #0366d6;
    --success:        #28a745;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow:         0 2px 12px rgba(0,0,0,.08);
    --shadow-md:      0 4px 24px rgba(0,0,0,.12);
    --sidebar-w:      220px;
    --topbar-h:       64px;
    --transition:     .18s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--main-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* =====================================================
   LOGIN
   ===================================================== */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1117 0%, #1a3a2a 50%, #0d1117 100%);
    padding: 24px;
}

.login-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: #fff;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 32px;
}

/* =====================================================
   LOGIN — Form elements (injected by JS)
   ===================================================== */

#auth-content .form-label {
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    display: block;
    margin-bottom: 6px;
    color: var(--text);
}

#auth-content .form-control {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color var(--transition);
    width: 100%;
}

#auth-content .form-control:focus {
    outline: none;
    border-color: var(--wa-green);
    box-shadow: 0 0 0 3px rgba(37,211,102,.15);
}

#auth-content .input-group .form-control {
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

#auth-content .input-group .btn {
    border: 2px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--main-bg);
    color: var(--text-secondary);
    padding: 10px 14px;
}

#auth-content .btn-primary {
    background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    width: 100%;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
    margin-top: 8px;
}

#auth-content .btn-primary:hover { opacity: .9; transform: translateY(-1px); }

#auth-content .mb-3 { margin-bottom: 16px; text-align: left; }

.login-error {
    background: #fff0f0;
    border: 1px solid #ffc0c0;
    border-radius: var(--radius-sm);
    color: var(--danger);
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 12px;
    text-align: left;
}

/* =====================================================
   LAYOUT
   ===================================================== */

#admin-panel {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR
   ===================================================== */

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--wa-green);
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand i { font-size: 24px; }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border-radius: 0;
    margin: 2px 0;
}

.sidebar-link i { font-size: 18px; flex-shrink: 0; }

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--wa-green);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    color: var(--sidebar-text);
}

.session-info i { font-size: 22px; flex-shrink: 0; }

.session-name {
    font-weight: 600;
    font-size: 13px;
    color: #cdd9e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-time {
    font-size: 11px;
    color: var(--sidebar-text);
}

.btn-logout {
    background: none;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    color: var(--sidebar-text);
    padding: 7px 9px;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.btn-logout:hover { background: #d73a49; color: #fff; border-color: #d73a49; }

/* =====================================================
   MAIN CONTENT
   ===================================================== */

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.topbar-left h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.server-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--main-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.btn-primary-action {
    background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity var(--transition), transform var(--transition);
}

.btn-primary-action:hover { opacity: .9; transform: translateY(-1px); }

/* =====================================================
   PAGE SECTIONS
   ===================================================== */

.page-section {
    padding: 28px;
    display: none;
}

.page-section.active { display: block; }

/* =====================================================
   INSTANCES GRID
   ===================================================== */

.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.instance-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.instance-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.instance-card-header {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.instance-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.instance-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

.badge-connected    { background: #d4edda; color: #155724; }
.badge-connecting   { background: #fff3cd; color: #856404; }
.badge-disconnected { background: #f8d7da; color: #721c24; }
.badge-failed       { background: #f8d7da; color: #721c24; }
.badge-disabled     { background: #e2e3e5; color: #383d41; }
.badge-expiry-ok    { background: #d4edda; color: #155724; }
.badge-expiry-warn  { background: #fff3cd; color: #856404; }
.badge-expiry-err   { background: #f8d7da; color: #721c24; }
.badge-expiry-none  { background: #e2e3e5; color: #383d41; }

.instance-card-body {
    padding: 14px 20px;
}

.instance-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.instance-detail i { font-size: 13px; }

.instance-card-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Card action buttons */
.card-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity var(--transition);
}

.card-btn:hover { opacity: .82; }
.card-btn:disabled { opacity: .38; cursor: not-allowed; pointer-events: auto; }
.card-btn-toggle-on  { background: #fff3cd; color: #856404; border-color: #ffc107; }
.card-btn-toggle-off { background: #d4edda; color: #155724; border-color: #28a745; }
.card-btn-qr         { background: #cce5ff; color: #004085; border-color: #b8daff; }
.card-btn-reconnect  { background: #fff3e0; color: #bf360c; border-color: #ffcc80; }
.card-btn-media      { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.card-btn-notify     { background: #e3f2fd; color: #0d47a1; border-color: #90caf9; }
.card-btn-msg        { background: #e2e3f5; color: #383d9f; border-color: #c5c5ef; }
.card-btn-contacts   { background: #e2e3f5; color: #383d9f; border-color: #c5c5ef; }
.card-btn-received   { background: #e2e3f5; color: #383d9f; border-color: #c5c5ef; }
.card-btn-token      { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.card-btn-sub        { background: #fff; color: var(--text-secondary); border-color: var(--border); }
.card-btn-delete     { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
    color: var(--text-secondary);
}

.empty-state i { font-size: 56px; opacity: .25; display: block; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p  { font-size: 14px; margin-bottom: 24px; }

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */

#toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1c2128;
    color: #cdd9e5;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    pointer-events: all;
    animation: toast-in .25s ease;
    border-left: 4px solid var(--wa-green);
    font-size: 13px;
}

.toast-item.toast-success { border-color: var(--success); }
.toast-item.toast-error   { border-color: var(--danger); }
.toast-item.toast-warning { border-color: var(--warning); }
.toast-item.toast-info    { border-color: var(--info); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-item.toast-success .toast-icon { color: var(--success); }
.toast-item.toast-error   .toast-icon { color: var(--danger); }
.toast-item.toast-warning .toast-icon { color: var(--warning); }
.toast-item.toast-info    .toast-icon { color: var(--info); }

.toast-text { flex: 1; }
.toast-close {
    background: none;
    border: none;
    color: #6e7681;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(24px); }
}

/* =====================================================
   SESSION WARNING OVERLAY
   ===================================================== */

.session-warning-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.session-warning-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.warning-icon {
    font-size: 48px;
    color: var(--warning);
    display: block;
    margin-bottom: 16px;
}

.session-warning-box h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.session-warning-box p  { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
#warning-countdown       { font-weight: 700; color: var(--danger); }

.warning-actions { display: flex; gap: 12px; justify-content: center; }

.btn-extend {
    background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    padding: 10px 22px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout-now {
    background: var(--main-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 22px;
    cursor: pointer;
    font-size: 14px;
}

/* =====================================================
   BOOTSTRAP MODAL OVERRIDES
   ===================================================== */

.modal-content   { border-radius: var(--radius); border: none; box-shadow: var(--shadow-md); }
.modal-header    { border-bottom: 1px solid var(--border); padding: 16px 20px; }
.modal-title     { font-weight: 700; font-size: 16px; }
.modal-body      { padding: 20px; }
.modal-footer    { border-top: 1px solid var(--border); padding: 12px 20px; }

.modal .form-control,
.modal .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition);
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--wa-green);
    box-shadow: 0 0 0 3px rgba(37,211,102,.15);
}

.modal .btn-primary   { background: var(--wa-green); border-color: var(--wa-green-dark); }
.modal .btn-primary:hover { background: var(--wa-green-dark); }

/* =====================================================
   APP PANEL — sostituisce il Bootstrap Modal
   Si apre dalla destra, copre solo main-content,
   lasciando la sidebar accessibile e usabile.
   ===================================================== */

.app-panel {
    position: fixed;
    left: var(--sidebar-w);
    right: 0;
    top: 0;
    bottom: 0;
    background: var(--surface);
    z-index: 150;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -6px 0 32px rgba(0,0,0,0.18);
}

.app-panel.open {
    transform: translateX(0);
}

.app-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.app-panel-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 17px;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.app-panel-close:hover {
    background: #f8d7da;
    color: var(--danger);
}

.app-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

/* Riadatta gli stili Bootstrap che erano nel modal al panel */
.app-panel-body .form-control,
.app-panel-body .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition);
}

.app-panel-body .form-control:focus,
.app-panel-body .form-select:focus {
    border-color: var(--wa-green);
    box-shadow: 0 0 0 3px rgba(37,211,102,.15);
}

.app-panel-body .btn-primary   { background: var(--wa-green); border-color: var(--wa-green-dark); }
.app-panel-body .btn-primary:hover { background: var(--wa-green-dark); }

/* =====================================================
   SEZIONE API — Documentazione & Tester
   ===================================================== */

.api-section {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 48px;
}

.api-info-box {
    background: var(--sidebar-bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px 32px;
}

.api-info-item { display: flex; flex-direction: column; gap: 5px; }

.api-info-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-text);
}

.api-info-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--wa-green);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.api-copy-btn {
    background: none;
    border: 1px solid var(--sidebar-border);
    border-radius: 4px;
    color: var(--sidebar-text);
    padding: 2px 9px;
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    font-weight: 600;
}

.api-copy-btn:hover { background: var(--wa-green); border-color: var(--wa-green); color: #fff; }

.api-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.api-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-tab-btn:hover { color: var(--text); background: var(--main-bg); }
.api-tab-btn.active { color: var(--wa-green); border-bottom-color: var(--wa-green); }

.api-tab-content { display: none; }
.api-tab-content.active { display: block; }

.api-group { margin-bottom: 36px; }

.api-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-group-title i { font-size: 15px; }

.endpoint-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.endpoint-card:hover { border-color: #b0c8b0; box-shadow: 0 1px 6px rgba(37,211,102,.08); }

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    cursor: pointer;
    user-select: none;
    flex-wrap: wrap;
}

.ep-method {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 4px;
    font-family: monospace;
    flex-shrink: 0;
}

.ep-get    { background: #d4edda; color: #155724; }
.ep-post   { background: #d1ecf1; color: #0c5460; }
.ep-put    { background: #fff3cd; color: #856404; }
.ep-delete { background: #f8d7da; color: #721c24; }

.ep-path {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--text);
    flex: 1;
    min-width: 120px;
}

.ep-path span { color: var(--wa-green-dark); }

.ep-desc {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 2;
    min-width: 160px;
}

.ep-auth-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.auth-admin  { background: #d4edda; color: #155724; }
.auth-token  { background: #fff3cd; color: #856404; }
.auth-none   { background: #e2e3e5; color: #383d41; }

.ep-try-btn {
    background: var(--wa-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
    margin-left: auto;
}

.ep-try-btn:hover { background: var(--wa-green-dark); }

/* API Tester nel pannello */
.tester-url-bar {
    background: var(--sidebar-bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: monospace;
    font-size: 13px;
    color: var(--wa-green);
    word-break: break-all;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tester-method-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: monospace;
    flex-shrink: 0;
}

.tester-response {
    background: #0d1117;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #e6edf3;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 16px;
}

.tester-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.status-2xx { background: #d4edda; color: #155724; }
.status-4xx { background: #fff3cd; color: #856404; }
.status-5xx { background: #f8d7da; color: #721c24; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-brand span,
    .sidebar-link span,
    .session-info div { display: none; }
    .sidebar-brand { justify-content: center; padding: 16px; }
    .sidebar-link  { justify-content: center; padding: 12px; }
    .main-content  { margin-left: 60px; }
    .instances-grid { grid-template-columns: 1fr; }
    .app-panel { left: 60px; }
    .ep-desc { display: none; }
}
