@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
	--ink: #182536;
	--muted: #718096;
	--paper: #f5f8fc;
	--line: #e3eaf2;
	--blue: #1769e0;
	--blue-dark: #104ca8;
	--navy: #142235;
	--amber: #f2b84b;
}

* { box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; color: var(--ink); }
h1, h2, h3, h4, h5, .brand-name { font-family: 'Space Grotesk', sans-serif; }
.dashboard-content { min-height: calc(100vh - 76px); }
.dashboard-header { background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); box-shadow: 0 5px 20px rgba(33,56,83,.05); position: relative; z-index: 10; }
.dashboard-header-inner { align-items: center; display: flex; justify-content: space-between; min-height: 76px; }
.dashboard-brand { align-items: center; color: var(--navy); display: flex; font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; font-weight: 700; gap: .65rem; text-decoration: none; }
.dashboard-brand-mark { align-items: center; background: var(--navy); border-radius: 10px; color: var(--amber); display: inline-flex; height: 34px; justify-content: center; width: 34px; }
.dashboard-nav { align-items: center; display: flex; flex-wrap: wrap; gap: .2rem; }
.dashboard-nav-link { border-radius: 8px; color: var(--muted); font-size: .82rem; font-weight: 600; padding: .55rem .65rem; text-decoration: none; transition: background .2s, color .2s; }
.dashboard-nav-link:hover { background: #edf4ff; color: var(--blue); }
.dashboard-nav-link i { margin-right: .35rem; }
.dashboard-nav-logout { color: #b04b4b; }
.dashboard-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; padding: 1.2rem 0; }
.bg-dark-hover:hover { background-color: rgba(255,255,255,0.1) !important; }
.cursor-pointer { cursor: pointer; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.cursor-pointer:hover { transform: translateY(-3px); border-color: #9bbff5; box-shadow: 0 10px 25px rgba(23,105,224,.12) !important; }
.app-shell { background: var(--paper); background-image: radial-gradient(#dbe7f4 1px, transparent 1px); background-size: 24px 24px; }
.sidebar { background: var(--navy) !important; width: 300px !important; flex: 0 0 300px; box-shadow: 12px 0 35px rgba(15,31,52,.08); }
.sidebar .brand-name { letter-spacing: -.02em; }
.sidebar .brand-icon { color: var(--amber); }
.sidebar .btn-outline-light { border-color: rgba(255,255,255,.2); color: #f4f8ff; background: rgba(255,255,255,.05); }
.sidebar .btn-outline-light:hover { background: var(--blue); border-color: var(--blue); }
.history-list a { color: #c3d0df !important; transition: background .2s, color .2s, transform .2s; }
.history-list a:hover, .history-list a.bg-primary { color: #fff !important; background: rgba(23,105,224,.9) !important; transform: translateX(3px); }
.chat-main { background: var(--paper) !important; }
#chat-container { background: linear-gradient(135deg, rgba(245,248,252,.92), rgba(232,241,252,.72)); }
.chat-message > div { border: 1px solid rgba(214,225,238,.8); }
.chat-message .bg-primary { background: var(--blue) !important; border-color: var(--blue); }
.chat-message .bg-white { box-shadow: 0 8px 26px rgba(37,61,91,.07) !important; }
.welcome-title { letter-spacing: -.04em; }
.welcome-subtitle { color: var(--muted); }
.composer { background: rgba(255,255,255,.9) !important; backdrop-filter: blur(12px); }
.mobile-toolbar { display: none; }
.menu-toggle { color: var(--ink); border: 1px solid var(--line); background: #fff; width: 40px; height: 40px; border-radius: 10px; }
.sidebar-overlay { display: none; }
#message-input { resize: none; border-radius: 18px; padding: 12px 50px 12px 16px; max-height: 200px; border-color: #d5e0ed; }
#message-input:focus, .form-control:focus { border-color: #7aaaf0; box-shadow: 0 0 0 .2rem rgba(23,105,224,.13); }
.send-button { background: var(--blue); border: 0; }
.send-button:hover { background: var(--blue-dark); }
.settings-page, .login-page { min-height: 100vh; background: var(--paper); background-image: radial-gradient(#dbe7f4 1px, transparent 1px); background-size: 24px 24px; }
.settings-card, .login-card { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 55px rgba(33,56,83,.1) !important; }
.settings-card h5 { letter-spacing: -.02em; }
.login-card { overflow: hidden; }
.login-accent { height: 7px; background: linear-gradient(90deg, var(--blue), var(--amber)); }
.login-logo { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 15px; color: #fff; background: var(--navy); box-shadow: 0 8px 20px rgba(20,34,53,.2); }
.login-card .form-control { padding: 12px 14px; border-color: #d5e0ed; border-radius: 10px; }
.login-card .btn-primary { background: var(--blue); border: 0; border-radius: 10px; padding: 12px; font-weight: 600; }
.api-page { max-width: 1080px; }
.api-page h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.04em; }
.eyebrow { color: var(--blue); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.api-count, .status-pill { border-radius: 999px; font-size: .75rem; font-weight: 700; padding: .4rem .7rem; white-space: nowrap; }
.api-count { background: #eaf2ff; color: var(--blue); }
.api-row { transition: transform .2s, box-shadow .2s; }
.api-row:hover { transform: translateY(-2px); box-shadow: 0 15px 35px rgba(33,56,83,.12) !important; }
.api-disabled { opacity: .65; }
.priority-badge { color: var(--muted); font-family: 'Space Grotesk', sans-serif; font-weight: 700; min-width: 28px; }
.api-icon { align-items: center; background: #fff3d8; border-radius: 11px; color: #bb7c09; display: flex; height: 38px; justify-content: center; width: 38px; }
.status-pill i { font-size: .45rem; margin-right: .35rem; vertical-align: middle; }
.status-on { background: #e7f8ef; color: #16834a; }
.status-off { background: #edf0f4; color: #718096; }
.api-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: .76rem; gap: 1rem; }
.empty-api { border: 1px dashed #cbd8e8; border-radius: 16px; color: var(--muted); }
.min-w-0 { min-width: 0; }
.api-secret { display: grid; gap: .45rem; }
.api-secret code { background: #102033; border-radius: 8px; color: #d7ecff; display: block; overflow-wrap: anywhere; padding: .8rem; }
.api-stat { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.scope-check { align-items: center; background: #f6f9fd; border: 1px solid var(--line); border-radius: 10px; display: flex; gap: .6rem; padding: .55rem .75rem; width: 100%; }
.scope-check input { accent-color: var(--blue); }
.scope-check span { display: grid; font-size: .85rem; }
.scope-check small { color: var(--muted); }
.code-block { background: #102033; border-radius: 10px; color: #d7ecff; font-size: .85rem; overflow-x: auto; padding: 1rem; white-space: pre-wrap; }
.dot { animation: blink 1.4s infinite both; font-size: 24px; line-height: 10px; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0% { opacity: .2; } 20% { opacity: 1; } 100% { opacity: .2; } }
.markdown-content pre { background: #0d1117; padding: 15px; border-radius: 8px; overflow-x: auto; position: relative; }
.markdown-content p:last-child { margin-bottom: 0; }
@media (max-width: 768px) {
	.dashboard-header-inner { align-items: flex-start; flex-direction: column; gap: .65rem; padding-bottom: .8rem; padding-top: .8rem; }
	.dashboard-nav { gap: .1rem; width: 100%; }
	.dashboard-nav-link { font-size: .76rem; padding: .45rem .5rem; }
	.dashboard-nav-link i { margin-right: .2rem; }
	.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1002; height: 100%; transform: translateX(-100%); transition: transform .25s ease; }
	.sidebar.is-open { transform: translateX(0); }
	.sidebar-overlay { position: fixed; inset: 0; z-index: 1001; background: rgba(12,25,42,.45); backdrop-filter: blur(2px); }
	.sidebar-overlay.is-visible { display: block; }
	.mobile-toolbar { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
	.mobile-toolbar .brand-name { font-size: 1rem; }
	.chat-main { min-width: 0; }
	#chat-container { padding: 1rem !important; }
	.chat-message > div { max-width: 92% !important; }
	.welcome-title { font-size: 1.65rem; }
	.welcome-subtitle { padding: 0 18px; }
	.welcome-title + .welcome-subtitle + .d-flex { flex-wrap: wrap; justify-content: center; gap: 10px !important; }
	.welcome-title + .welcome-subtitle + .d-flex .card { padding: .75rem !important; }
	.composer { padding: .7rem !important; }
	#message-input { font-size: .95rem; }
}