/* ==========================================================================
   EhsanGPT - Premium Modern Dark AI Chat Interface
   ========================================================================== */

:root {
    --bg-main: #0a0e17;
    --bg-surface: #111827;
    --bg-surface-elevated: #1a2234;
    --bg-surface-hover: #222d44;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-focus: #10b981;

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-accent: #34d399;

    --primary-color: #10b981;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --primary-glow: rgba(16, 185, 129, 0.25);
    
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --sidebar-width: 280px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.35);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layout */
.app-layout {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.05) 0%, transparent 60%),
                radial-gradient(circle at 100% 100%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
                var(--bg-main);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
    z-index: 50;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}
.brand-name span {
    color: var(--primary-color);
}

.btn-new-chat {
    width: 100%;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}
.btn-new-chat:hover {
    background: var(--bg-surface-hover);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.sidebar-search {
    margin: 12px 16px 4px 16px;
    position: relative;
    display: flex;
    align-items: center;
}
.sidebar-search svg {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    pointer-events: none;
}
.sidebar-search input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 36px 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition-fast);
}
.sidebar-search input:focus {
    border-color: var(--primary-color);
}

.conversations-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 8px 8px 8px;
}

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    user-select: none;
}
.chat-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.chat-item.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary-color);
    font-weight: 600;
    border-right: 3px solid var(--primary-color);
}
.chat-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-left: 8px;
}
.chat-item-actions {
    display: none;
    align-items: center;
    gap: 4px;
}
.chat-item:hover .chat-item-actions {
    display: flex;
}
.chat-item-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}
.chat-item-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}
.chat-item-action-btn.delete:hover {
    color: var(--accent-rose);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}
.user-profile-card:hover {
    background: var(--bg-surface-hover);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    overflow: hidden;
    line-height: 1.3;
}
.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-top: 3px;
    font-weight: 600;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    z-index: 40;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Model Selector Button */
.model-selector-wrapper {
    position: relative;
}

.model-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.model-selector-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-elevated);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.model-provider-tag {
    display: none !important;
}

.model-name {
    font-weight: 600;
}

.model-cost-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.chevron-down {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}
.model-selector-btn.open .chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.model-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    z-index: 100;
    animation: fadeInSlide 0.2s ease;
}

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

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}
.text-btn:hover {
    text-decoration: underline;
}

.model-list-container {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}
.model-item:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color);
}
.model-item.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary-color);
}

.model-item-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}
.model-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}
.model-item-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-weight: 500;
}
.model-item-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.model-item-cost {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 8px;
}
.cost-tag {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.15);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

/* Credit Pill in Topbar */
.credit-pill-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    color: #fef3c7;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.credit-pill-btn:hover {
    border-color: var(--accent-amber);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
    transform: translateY(-1px);
}
.coin-sparkle {
    font-size: 1rem;
    animation: pulseGlow 2s infinite ease-in-out;
}
@keyframes pulseGlow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #f59e0b); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 6px #f59e0b); }
}
.credit-number {
    font-weight: 800;
    color: #fbbf24;
}
.plus-chip {
    font-size: 0.72rem;
    background: var(--accent-amber);
    color: #000;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.btn-outline-auth {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    padding: 6px 16px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-outline-auth:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(16, 185, 129, 0.08);
}

/* ==========================================================================
   Chat Container & Hero
   ========================================================================== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.welcome-hero {
    max-width: 820px;
    width: 100%;
    margin: auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 10px;
}

.hero-orb {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 0 35px var(--primary-glow);
    animation: floatOrb 3s ease-in-out infinite;
}
@keyframes floatOrb {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #9ca3af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
}
.highlight-text {
    color: var(--primary-color);
    font-weight: 700;
}

.model-info-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    font-size: 0.88rem;
    color: #a7f3d0;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 15px;
}

.suggestion-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    text-align: right;
    transition: all var(--transition-fast);
}
.suggestion-card:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.card-icon {
    font-size: 1.4rem;
}
.card-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.card-text strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}
.card-text span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Chat Messages List
   ========================================================================== */
.messages-list {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 20px;
}

.message-item {
    display: flex;
    gap: 14px;
    width: 100%;
    animation: fadeInMsg 0.25s ease-out;
}
@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.message-item.user .message-avatar {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    order: 2;
}
.message-item.assistant .message-avatar {
    background: var(--primary-gradient);
    color: #fff;
    order: 1;
}

.message-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-x: auto;
}
.message-item.user .message-body {
    align-items: flex-end;
    order: 1;
}
.message-item.assistant .message-body {
    align-items: flex-start;
    order: 2;
}

.message-bubble {
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    font-size: 0.96rem;
    line-height: 1.7;
    position: relative;
    max-width: 90%;
    word-break: break-word;
}

.message-item.user .message-bubble {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.message-item.assistant .message-bubble {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
    width: 100%;
}

.message-header-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.message-model-tag {
    font-weight: 700;
    color: var(--primary-color);
}
.message-cost-tag {
    font-size: 0.72rem;
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Thinking / Reasoning Accordion Block */
.thinking-block {
    margin-bottom: 12px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
}
.thinking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: #a5b4fc;
    transition: background var(--transition-fast);
}
.thinking-header:hover {
    background: rgba(99, 102, 241, 0.1);
}
.thinking-label {
    display: flex;
    align-items: center;
    gap: 6px;
}
.thinking-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #818cf8;
    animation: thinkingPulse 1.2s infinite ease-in-out;
}
@keyframes thinkingPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}
.thinking-content {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #cbd5e1;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    white-space: pre-wrap;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.2);
    font-style: italic;
}

/* Markdown Rendering inside message bubble */
.markdown-content p {
    margin-bottom: 12px;
}
.markdown-content p:last-child {
    margin-bottom: 0;
}
.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3, 
.markdown-content h4 {
    margin: 16px 0 8px 0;
    font-weight: 700;
    color: #fff;
}
.markdown-content ul, 
.markdown-content ol {
    margin: 8px 24px 12px 0;
}
.markdown-content li {
    margin-bottom: 4px;
}
.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
}
.markdown-content a:hover {
    text-decoration: underline;
}
.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.88rem;
}
.markdown-content th, 
.markdown-content td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: right;
}
.markdown-content th {
    background: var(--bg-surface-elevated);
}

/* Code Blocks */
.code-block-wrapper {
    margin: 12px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #1e1e2e;
    direction: ltr;
    text-align: left;
}
.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #181825;
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: #a6adc8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.copy-code-btn {
    background: transparent;
    border: none;
    color: #a6adc8;
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}
.copy-code-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.code-block-wrapper pre {
    margin: 0;
    padding: 14px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Message Actions Footer */
.message-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}
.msg-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition-fast);
}
.msg-action-btn:hover {
    color: var(--text-primary);
}

/* Typing Cursor Effect */
.typing-cursor {
    display: inline-block;
    width: 6px;
    height: 16px;
    background: var(--primary-color);
    margin-right: 3px;
    vertical-align: middle;
    animation: blinkCursor 0.8s infinite;
}
@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   Chat Input Area & File Attachments
   ========================================================================== */
.chat-input-area {
    padding: 12px 20px 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, transparent 0%, var(--bg-main) 30%);
    position: relative;
    z-index: 10;
}

.input-card-container {
    max-width: 860px;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    overflow: hidden;
}
.input-card-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Attachment Tray (Pending files preview before sending) */
.attachment-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px 6px 14px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    animation: slideDownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-8px); max-height: 0; }
    to { opacity: 1; transform: translateY(0); max-height: 200px; }
}

.pending-att-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 10px 6px 8px;
    font-size: 0.82rem;
    position: relative;
    max-width: 220px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.pending-att-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-hover);
}
.pending-att-card.uploading {
    opacity: 0.7;
    border-color: var(--accent-indigo);
}

.pending-att-thumb {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #000;
    flex-shrink: 0;
}
.pending-att-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}
.pending-att-icon.pdf { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.pending-att-icon.spreadsheet { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.pending-att-icon.docx { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.pending-att-icon.code { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.pending-att-icon.text { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.pending-att-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    flex: 1;
}
.pending-att-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.pending-att-size {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.pending-att-remove {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-right: -2px;
}
.pending-att-remove:hover {
    background: var(--accent-rose);
    color: #fff;
    transform: scale(1.1);
}

/* Input Box Wrapper */
.input-box-wrapper {
    display: flex;
    align-items: flex-end;
    padding: 10px 14px;
    gap: 10px;
    background: transparent;
}

.attach-btn, .attach-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.attach-btn:hover, .attach-action-btn:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 12px var(--primary-glow);
    transform: translateY(-1px) scale(1.05);
}
.attach-btn:active, .attach-action-btn:active {
    transform: scale(0.95);
}

/* Drag & Drop Over Active on user input box */
.input-box-wrapper.drag-over-active {
    border-color: var(--primary-color) !important;
    background: rgba(16, 185, 129, 0.12) !important;
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.45) !important;
    outline: 2px dashed var(--primary-color);
    outline-offset: -3px;
}
.input-box-wrapper.drag-over-active textarea {
    color: #34d399;
}
.input-box-wrapper.drag-over-active textarea::placeholder {
    color: #34d399;
    font-weight: 600;
}

.input-box-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 180px;
    min-height: 26px;
    padding: 4px 0;
}
.input-box-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.send-btn, .stop-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.send-btn {
    background: var(--primary-gradient);
    color: #fff;
}
.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px var(--primary-glow);
}
.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.stop-btn {
    background: var(--accent-rose);
    color: #fff;
}

.input-disclaimer {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   Message Attachments (Rendered in Chat Bubbles)
   ========================================================================== */
.message-attachments-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    width: 100%;
}

/* Image Grid in Chat */
.message-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.message-image-item {
    position: relative;
    max-width: 280px;
    max-height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.message-image-item:hover {
    transform: scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.message-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.message-image-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Files / Documents in Chat */
.message-files-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.message-file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}
.message-file-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}
.message-file-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}
.message-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.message-file-name {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
}
.message-file-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.message-file-download-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}
.message-file-card:hover .message-file-download-btn {
    background: var(--primary-color);
    color: #fff;
}

/* ==========================================================================
   Drag & Drop Overlay
   ========================================================================== */
.drag-drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 23, 0.88);
    backdrop-filter: blur(10px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: fadeIn 0.15s ease;
}
.drag-drop-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px;
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-lg);
    background: rgba(16, 185, 129, 0.06);
    max-width: 500px;
    text-align: center;
    box-shadow: 0 0 30px var(--primary-glow);
}
.drag-drop-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceSlow 1.5s infinite;
}
@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.drag-drop-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}
.drag-drop-modal p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Image Lightbox Modal
   ========================================================================== */
.lightbox-overlay {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 2000;
}
.lightbox-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 92vh;
    gap: 12px;
}
.lightbox-close-btn {
    position: absolute;
    top: -44px;
    left: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.lightbox-close-btn:hover {
    background: var(--accent-rose);
    transform: rotate(90deg);
}
.lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
}
.lightbox-filename {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 600;
    direction: ltr;
}
.lightbox-image-wrapper {
    overflow: auto;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
}
.lightbox-image-wrapper img {
    max-width: 88vw;
    max-height: 78vh;
    object-fit: contain;
    display: block;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    width: 100%;
    padding: 28px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: zoomModal 0.2s ease-out;
}
.modal-card.modal-large {
    max-width: 680px;
}
@keyframes zoomModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}
.modal-close-btn:hover {
    color: var(--text-primary);
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}
.auth-logo {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 12px;
}
.auth-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}
.auth-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
}
.auth-tab.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.bonus-badge {
    font-size: 0.68rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 6px;
    border-radius: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.form-group input, 
.form-group select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color var(--transition-fast);
}
.form-group input:focus, 
.form-group select:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-block {
    width: 100%;
}

.alert-box {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 14px;
}
.alert-error {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fca5a5;
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* SMS OTP Registration & Auth Elements */
.form-hint {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.otp-info-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 6px;
}
.otp-info-text b {
    color: var(--primary-color);
}
.otp-input {
    text-align: center;
    letter-spacing: 12px;
    font-size: 1.6rem !important;
    font-weight: 700;
    padding: 12px 16px !important;
    direction: ltr;
}
.otp-timer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 10px 0;
    font-size: 0.84rem;
}
.otp-timer {
    color: var(--text-secondary);
}
.otp-timer b {
    color: var(--primary-color);
}
.otp-timer.expired b {
    color: #f43f5e;
}
.link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.link-btn:hover {
    color: #818cf8;
}
.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    margin-top: 4px;
    transition: all var(--transition-fast);
}
.btn-secondary:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Success Card & Credentials Display */
.auth-success-card {
    text-align: center;
    padding: 10px 0 6px 0;
}
.success-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid #10b981;
    color: #10b981;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    font-weight: bold;
}
.auth-success-card h3 {
    color: #34d399;
    font-size: 1.15rem;
    margin-bottom: 8px;
}
.success-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}
.credentials-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
}
.cred-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
}
.cred-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.cred-value {
    color: #34d399;
    font-family: 'Fira Code', monospace;
    font-size: 1.05rem;
    user-select: all;
}

/* Credits & Transactions Modal Elements */
.credits-header {
    text-align: center;
    margin-bottom: 24px;
}
.credits-header h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}
.credits-balance-display {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 240px;
}
.balance-title {
    font-size: 0.85rem;
    color: #fde68a;
}
.balance-digits {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fbbf24;
}
.balance-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #fef3c7;
}

.credit-notice-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.85));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.credit-notice-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    padding-top: 2px;
}

.credit-notice-body h4 {
    margin: 0 0 6px 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
}

.credit-notice-body p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.credit-notice-body strong {
    color: #fbbf24;
}

.admin-credit-shortcut {
    margin-top: 14px;
}

.btn-outline-admin {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-outline-admin:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: #fbbf24;
    transform: translateY(-1px);
}

.recharge-section, .transactions-section, .models-cost-table-section, .add-model-box {
    margin-top: 24px;
}
.recharge-section h4, .transactions-section h4, .models-cost-table-section h4, .add-model-box h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.recharge-section p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.recharge-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.btn-recharge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-recharge:hover {
    border-color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.1);
    transform: translateY(-2px);
}
.btn-recharge.featured {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.table-wrapper {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.transactions-table th {
    background: var(--bg-surface-elevated);
    padding: 10px 14px;
    text-align: right;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}
.transactions-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Management Modal Elements */
.provider-card-preview {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 18px;
}
.preview-badge {
    display: inline-block;
    font-size: 0.7rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 6px;
    font-weight: 700;
}
.preview-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.preview-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.models-manage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}
.manage-model-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    gap: 12px;
}
.manage-model-info {
    flex: 1;
}
.manage-model-title {
    font-weight: 600;
    font-size: 0.92rem;
}
.manage-model-id {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: monospace;
}
.manage-cost-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.manage-cost-controls input {
    width: 75px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: #fbbf24;
    font-weight: 700;
    text-align: center;
    font-family: inherit;
}
.save-cost-btn {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.inline-grid-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}
.full-width {
    grid-column: span 2;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.toast.success {
    border-color: rgba(16, 185, 129, 0.4);
    background: #064e3b;
}
.toast.error {
    border-color: rgba(244, 63, 94, 0.4);
    background: #4c0519;
}

/* Utility Helpers */
.hidden {
    display: none !important;
}
.text-center {
    text-align: center;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        transform: translateX(100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .suggestion-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 0 12px;
    }
    .inline-grid-form {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
    .model-dropdown-menu {
        width: 300px;
    }
    .admin-stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .admin-tabs {
        overflow-x: auto;
    }
}

/* ==========================================================================
   Admin Dashboard & Management Styles - Professional Upgrade
   ========================================================================== */
.btn-admin-panel {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(79, 70, 229, 0.4));
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #f3e8ff;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.2);
}
.btn-admin-panel:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.5), rgba(79, 70, 229, 0.65));
    border-color: #c084fc;
    color: #fff;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.45);
    transform: translateY(-1px);
}
.admin-icon {
    font-size: 1rem;
}

/* Modal Admin Container - Overriding modal-card constraint */
.modal-card.modal-admin {
    max-width: min(1200px, 95vw) !important;
    width: min(1200px, 95vw) !important;
    height: 90vh !important;
    max-height: 90vh !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #0b1120;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 50px rgba(99, 102, 241, 0.15);
}

.modal-header-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 26px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    flex-shrink: 0;
}
.admin-header-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
.admin-shield-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 16px rgba(124, 58, 237, 0.35);
}
.modal-header-admin h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
}
.modal-header-admin p {
    margin: 3px 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}
.admin-modal-close {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}
.admin-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: rotate(90deg);
}

/* Admin Quick Stats Bar */
.admin-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 14px 26px;
    background: rgba(15, 23, 42, 0.65);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    flex-shrink: 0;
}
.stat-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.stat-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.stat-card.stat-users .stat-icon-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.stat-card.stat-users:hover {
    border-color: #38bdf8;
}
.stat-card.stat-credits .stat-icon-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.stat-card.stat-credits:hover {
    border-color: #fbbf24;
}
.stat-card.stat-providers .stat-icon-badge {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.stat-card.stat-providers:hover {
    border-color: #a855f7;
}
.stat-card.stat-models .stat-icon-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.stat-card.stat-models:hover {
    border-color: #10b981;
}

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
}
.stat-lbl {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 3px;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 26px 0;
    background: #0b1120;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    flex-shrink: 0;
    overflow-x: auto;
}
.admin-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 12px 12px 0 0;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.admin-tab:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
}
.admin-tab.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.09);
    border-bottom: 2px solid #38bdf8;
}

/* Admin Content Area */
.admin-content-area {
    padding: 22px 26px 30px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.admin-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.pane-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.pane-toolbar .search-box {
    flex: 1;
    min-width: 240px;
}
.pane-toolbar .search-box input {
    width: 100%;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    color: #f8fafc;
    font-size: 0.88rem;
    font-family: inherit;
}
.pane-toolbar .search-box input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.pane-description-banner {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.pane-description-banner .banner-text-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pane-description-banner p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.6;
    color: #bae6fd;
}
.banner-hint-sub {
    font-size: 0.78rem;
    color: #7dd3fc;
    opacity: 0.9;
}
.banner-badge-icon {
    font-size: 1.3rem;
}

/* Models Toolbar & Provider Filter Strip */
.models-toolbar-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.provider-filter-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-strip-label {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 600;
    white-space: nowrap;
}
.provider-filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.prov-filter-chip {
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.prov-filter-chip:hover {
    border-color: #38bdf8;
    color: #fff;
    background: rgba(56, 189, 248, 0.1);
}
.prov-filter-chip.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.25));
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}
.prov-chip-count {
    background: rgba(255, 255, 255, 0.12);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
}
.prov-filter-chip.active .prov-chip-count {
    background: rgba(56, 189, 248, 0.3);
    color: #fff;
}

.models-search-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.search-models-box {
    position: relative;
    flex: 1;
    min-width: 260px;
    max-width: 460px;
}
.search-models-box svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.search-models-box input {
    width: 100%;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    padding: 8px 38px 8px 14px;
    color: #f8fafc;
    font-size: 0.86rem;
    font-family: inherit;
    transition: all 0.2s;
}
.search-models-box input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Collapsible Form Drawer */
.drawer-box {
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.25s ease;
}
.drawer-box h4 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: #f1f5f9;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #cbd5e1;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
    cursor: pointer;
}
.form-actions-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Admin Data Table */
.admin-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.45);
}
.admin-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: right;
}
.admin-table th {
    background: #1e293b;
    padding: 12px 16px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.82rem;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
    vertical-align: middle;
}
.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
}
.role-badge.admin {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}
.role-badge.user {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.credits-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.86rem;
    font-family: 'Inter', sans-serif;
}

/* Model Cell Details */
.model-cell-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.model-cell-name {
    font-weight: 700;
    color: #f8fafc;
    font-size: 0.92rem;
}
.model-cell-id {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    direction: ltr;
}
.model-cell-desc {
    font-size: 0.76rem;
    color: #64748b;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Provider Pill Badge in Table */
.provider-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.provider-pill-badge.prov-active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}
.provider-pill-badge.prov-inactive {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.prov-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
}
.provider-pill-badge.prov-inactive .prov-dot {
    background: #f87171;
}
.prov-off-warn {
    font-size: 0.72rem;
    color: #f87171;
}

/* Cost Editor Widget - The Core Interactive Tool */
.cost-editor-widget {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    padding: 3px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}
.cost-editor-widget:focus-within {
    border-color: #fbbf24;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}
.cost-step-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fbbf24;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    user-select: none;
}
.cost-step-btn:hover {
    background: rgba(245, 158, 11, 0.3);
    color: #fff;
    border-color: #fbbf24;
}
.cost-step-btn:active {
    transform: scale(0.9);
}
.cost-input-box {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 4px;
}
.cost-coin-icon {
    font-size: 0.9rem;
}
.cost-number-input {
    width: 58px;
    background: transparent;
    border: none;
    color: #fbbf24;
    font-family: 'Inter', monospace;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    padding: 3px 0;
}
.cost-number-input:focus {
    outline: none;
}
.cost-number-input::-webkit-outer-spin-button,
.cost-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cost-number-input[type=number] {
    -moz-appearance: textfield;
}

.btn-save-cost {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 6px;
    color: #0b1120;
    font-weight: 700;
    font-size: 0.76rem;
    padding: 5px 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}
.btn-save-cost:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}
.btn-save-cost.saved-success {
    background: #10b981 !important;
    color: #fff !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
}

.model-tag-pill {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.78rem;
    color: #e2e8f0;
}

.table-action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-action-pill {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-action-pill.credit {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.btn-action-pill.credit:hover {
    background: rgba(16, 185, 129, 0.35);
    color: #fff;
}
.btn-action-pill.edit {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}
.btn-action-pill.edit:hover {
    background: rgba(56, 189, 248, 0.35);
    color: #fff;
}
.btn-action-pill.password {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}
.btn-action-pill.password:hover {
    background: rgba(59, 130, 246, 0.35);
    color: #fff;
}
.btn-action-pill.delete {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-action-pill.delete:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
}

/* Providers Grid in Tab 2 */
.admin-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.provider-admin-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}
.provider-admin-card.active-provider {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}
.provider-admin-card.inactive-provider {
    border-color: rgba(239, 68, 68, 0.25);
    opacity: 0.8;
}
.provider-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.provider-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}
.provider-card-url {
    font-size: 0.78rem;
    color: #94a3b8;
    font-family: monospace;
    direction: ltr;
    text-align: right;
    word-break: break-all;
}

/* Models quick summary inside provider card */
.provider-models-quick-summary {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.prov-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
}
.btn-link-filter {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
    font-family: inherit;
}
.btn-link-filter:hover {
    color: #7dd3fc;
    text-decoration: underline;
}
.provider-models-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.prov-model-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    color: #e2e8f0;
}
.prov-model-chip .cost-tag {
    color: #fbbf24;
    font-weight: 700;
}

/* Modern Toggle Switch */
.switch-control-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin-top: 4px;
}
.switch-label-text {
    font-size: 0.82rem;
    font-weight: 600;
}
.switch-label-text.active {
    color: #34d399;
}
.switch-label-text.inactive {
    color: #f87171;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    direction: ltr;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #10b981;
}
input:checked + .slider:before {
    transform: translateX(20px);
}

/* Credit Adjust Modal Styling */
.modal-sm {
    width: min(460px, 92vw);
}
.modal-md {
    max-width: min(560px, 94vw);
    width: 100%;
}
.action-toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}
.action-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.5);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.2s;
    color: #94a3b8;
}
.action-radio input {
    display: none;
}
.action-radio.add-active:has(input:checked) {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
}
.action-radio.deduct-active:has(input:checked) {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}

.preset-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.chip-btn {
    flex: 1;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    padding: 6px 0;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.chip-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #fff;
}

/* Edit Model Form Controls */
.input-credit-wrapper {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-md);
    padding: 0 12px;
    gap: 8px;
}
.input-credit-wrapper:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
.credit-input-symbol {
    font-size: 1.1rem;
}
.input-credit-wrapper input {
    border: none !important;
    background: transparent !important;
    padding: 10px 0 !important;
    box-shadow: none !important;
    color: #fbbf24 !important;
    font-weight: 700;
    font-size: 1rem;
    flex: 1;
}
.credit-input-unit {
    color: #94a3b8;
    font-size: 0.82rem;
}

/* Modal Responsive Media Queries */
@media (max-width: 900px) {
    .admin-stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        padding: 12px 16px;
    }
    .modal-card.modal-admin {
        height: 94vh !important;
        max-height: 94vh !important;
        width: 98vw !important;
    }
}
@media (max-width: 600px) {
    .admin-stats-bar {
        grid-template-columns: 1fr 1fr !important;
        padding: 10px 12px;
    }
    .modal-header-admin {
        padding: 14px 16px;
    }
    .admin-tabs {
        padding: 8px 12px 0;
    }
    .admin-content-area {
        padding: 16px 12px;
    }
    .models-search-actions-row {
        flex-direction: column;
        align-items: stretch;
    }
    .search-models-box {
        max-width: 100%;
    }
}


