/* Admin Panel Specific Styles */

.admin-body {
    background: #080a10;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.admin-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.admin-sidebar {
    width: 270px;
    background: #0d111b;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    flex-shrink: 0;
}

.admin-brand {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-tab.active {
    background: rgba(246, 130, 31, 0.12);
    color: var(--cf-orange);
    font-weight: 600;
    border: 1px solid rgba(246, 130, 31, 0.25);
}

.admin-sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.d1-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--neon-green);
    background: rgba(0, 245, 155, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 245, 155, 0.25);
    width: 100%;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
}

/* Content Area */
.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0d14;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 17, 27, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.tab-pane {
    display: none;
    padding: 2rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.tab-pane.active {
    display: block;
}

.tab-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Provider Admin List */
.provider-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.provider-row {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s;
}

.provider-row:hover {
    border-color: var(--border-bright);
}

.provider-row-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

/* Code Sessions Layout */
.sessions-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 140px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sessions-sidebar {
    background: #0e121e;
    border-right: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-item {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s;
}

.session-item:hover {
    background: var(--bg-card-hover);
}

.session-item.active {
    border-color: var(--cf-orange);
    background: rgba(246, 130, 31, 0.08);
}

.session-chat-pane {
    display: flex;
    flex-direction: column;
    background: #080a10;
}

.session-header-bar {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d111b;
}

.session-messages-box {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-bubble.user {
    align-self: flex-end;
    background: #1e293b;
    color: #fff;
    border-bottom-right-radius: 2px;
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: #111726;
    border: 1px solid var(--border);
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.session-input-bar {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    background: #0d111b;
}

.session-input-bar textarea {
    min-height: 50px;
    height: 50px;
}

/* Telemetry Table */
.telemetry-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.telemetry-table th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
}

.telemetry-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.test-result-box {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}
