/* ==========================================
   Global Stylesheet - Simple Header & Sidebar
   ========================================== */

:root {
    --header-height: 60px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
    --primary-color: #4099ff;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --border-color: #ddd;
    --header-bg: #ffffff;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --sidebar-hover: #34495e;
}

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

body {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 14px;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

/* ==========================================
   Header Styles
   ========================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-nav {
    display: flex;
    list-style: none;
    gap: 15px;
}

.header-nav a {
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 14px;
}

.header-nav a:hover {
    background-color: var(--bg-color);
}

/* ==========================================
   Sidebar Styles
   ========================================== */

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-collapsed-width);
    height: calc(100vh - var(--header-height));
    background-color: var(--header-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    padding: 20px 0;
    transition: width 0.3s ease;
}

.sidebar:hover {
    width: var(--sidebar-width);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: 5px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
    font-size: 14px;
}

.sidebar-menu-link span:not(.sidebar-menu-icon) {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover .sidebar-menu-link span:not(.sidebar-menu-icon) {
    opacity: 1;
}

.sidebar-menu-link:hover {
    background-color: var(--header-bg);
}

.sidebar-menu-link.active {
    background-color: var(--primary-color);
}

.sidebar-menu-icon {
    margin-right: 12px;
    font-size: 18px;
    min-width: 20px;
    display: inline-flex;
    justify-content: center;
}

.sidebar-section-title {
    padding: 20px 20px 10px;
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.sidebar:hover .sidebar-section-title {
    opacity: 1;
}

/* ==========================================
   Main Content Area
   ========================================== */

.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-collapsed-width);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header-left {
        gap: 10px;
    }

    .header-nav {
        display: none;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #3082dd;
}

/* ==========================================
   Scrollbar Styling (Optional)
   ========================================== */

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   Bootstrap-compatible Grid & Components
   ========================================== */

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

[class*="col-"] {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Card Component (already defined but adding card-header and card-body) */
.card-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-control, input[type="text"], input[type="email"], input[type="password"], textarea {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(64, 153, 255, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Table */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    vertical-align: top;
    border-top: 1px solid var(--border-color);
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
}

.table tbody + tbody {
    border-top: 2px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 12px 20px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.text-c-red {
    color: var(--danger, #FF5370);
}

.mb-2 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.w-25 { width: 25%; }
.w-100 { width: 100%; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-color);
}

.btn-icon:hover {
    background-color: var(--bg-color);
    border-radius: 4px;
}

/* Progress Bar */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    background-color: #e9ecef;
    border-radius: 4px;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    text-align: center;
    background-color: var(--primary-color);
    transition: width 0.6s ease;
}

.progress-bar-label {
    font-size: 12px;
}

/* Tabs */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.nav-item {
    margin-bottom: -1px;
}

.nav-link {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid transparent;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.nav-link:hover {
    border-color: var(--border-color) var(--border-color) transparent;
}

.nav-link.active {
    color: var(--primary-color);
    background-color: white;
    border-color: var(--border-color) var(--border-color) white;
}

.tab-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
}

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

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

/* ==========================================
   About Page — Developer Tool Style
   ========================================== */

.about-page {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    max-width: 100%;
}

.about-section {
    margin-bottom: 32px;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.about-prompt {
    color: #6c757d;
    font-weight: 600;
    font-size: 14px;
}

.about-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.about-version {
    font-size: 12px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: auto;
}

.about-body {
    padding-left: 16px;
}

.about-body p {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-color);
}

.about-body code {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 13px;
    background: #e9ecef;
    padding: 1px 6px;
    border-radius: 3px;
    color: #d63384;
}

.about-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.about-key {
    color: #d63384;
    font-weight: 600;
    min-width: 100px;
}

.about-sep {
    color: #6c757d;
}

.about-val {
    color: var(--text-color);
}

.about-meta {
    color: #6c757d;
    font-size: 12px;
}

.about-desc {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.7;
}

.about-metrics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.about-metric {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 13px;
}

.about-metric-key {
    color: #4099ff;
    font-weight: 600;
    min-width: 140px;
    font-size: 13px;
}

.about-metric-desc {
    color: #6c757d;
    font-size: 13px;
}

.about-versions .about-key {
    min-width: 100px;
}

.about-footer {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

.about-footer a {
    color: #6c757d;
    text-decoration: underline;
}

.about-footer a:hover {
    color: var(--text-color);
}

/* ==========================================
   Page Titles
   ========================================== */

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 16px;
    vertical-align: middle;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title-row .page-title {
    margin-bottom: 0;
}

/* ==========================================
   Dashboard List
   ========================================== */

.db-list {
    max-width: 100%;
}

.db-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 6px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
}

.db-item-left {
    flex: 1;
    min-width: 0;
}

.db-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.db-name {
    font-weight: 500;
    font-size: 14px;
}

.db-name a {
    color: var(--text-color);
    text-decoration: none;
}

.db-name a:hover {
    color: var(--primary-color);
}

.db-tokens {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    margin-left: 12px;
}

.db-key {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 11px;
    color: var(--primary-color);
    user-select: all;
    margin-top: 2px;
}

.db-key-label {
    color: var(--text-color);
}

.db-price {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 8px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-color);
    justify-items: center;
}

.db-price-min,
.db-price-max {
    font-weight: 500;
}

.db-price-model {
    font-size: 10px;
    color: #bbb;
    margin-left: 2px;
}

.db-price-sep {
    color: #999;
    margin: 0 4px;
}

.db-copy-icon {
    cursor: pointer;
    margin-left: 4px;
    color: var(--primary-color);
}

.db-user {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
}

.db-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.db-date {
    font-size: 11px;
    color: #999;
}

.db-del-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    margin-left: 12px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s;
}

.db-del-btn:hover {
    background: #fecaca;
    color: #dc2626;
}

.db-del-btn:active {
    background: #fca5a5;
    color: #b91c1c;
}

.db-del-btn:hover {
    color: #FF5370;
}

.db-empty {
    text-align: center;
    padding: 48px 0;
    color: #999;
}

.db-create-form {
    display: inline-block;
}

.db-create-input {
    padding: 10px 14px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 300px;
    box-sizing: border-box;
    display: block;
    margin-bottom: 8px;
}

.new-dash-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.new-dash-input {
    padding: 8px 14px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 200px;
}

/* ==========================================
   Dashboard Detail (Charts, Stats, Filters)
   ========================================== */

.filter-bar {
    margin-bottom: 24px;
}

.filter-columns {
    display: flex;
    gap: 24px;
}

.filter-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 4px;
    text-align: center;
}

.filter-bar .form-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 4px;
    display: block;
}

.filter-bar .form-control {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    background: #fff;
    width: 100%;
    transition: border-color 0.15s;
    color: var(--text-color);
}

.filter-bar .form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.label-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 34px;
    align-items: center;
}

.label-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    transition: all 0.12s;
}

.label-tag:hover {
    background: #e0e8f0;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.label-tag.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.label-tag.clear {
    background: transparent;
    border-color: transparent;
    color: #ccc;
    font-style: italic;
}

.filter-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.btn-icon-only {
    flex: 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
}

.btn-icon-only:hover {
    background: #3082dd;
}

.btn-icon-only.btn-csv {
    background: #2ed8b6;
}

.btn-icon-only.btn-csv:hover {
    background: #26bfa0;
}

.btn-danger {
    background: #FF5370;
    color: #fff;
}

.btn-danger:hover {
    background: #e04860;
    color: #fff;
}

.btn-icon-only.btn-danger {
    background: #FF5370;
}

.btn-icon-only.btn-danger:hover {
    background: #e04860;
}

.stat-cards {
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
    padding: 16px 8px;
}

.stat-value {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-top: 2px;
    display: block;
}

.stat-sub {
    font-size: 10px;
    color: #bbb;
    display: block;
}

.price-estimate {
    text-align: center;
}

.price-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.price-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.price-model {
    font-size: 10px;
    color: #bbb;
    margin-top: 2px;
}

.price-label {
    font-size: 9px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 2px;
}

.price-estimate .stat-value {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-color);
}

.price-link {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    text-decoration: none;
}

.price-link:hover {
    color: var(--primary-color);
}

.chart-card {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 20px;
    overflow: hidden;
}

.chart-title {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    padding: 14px 16px 0;
    margin: 0;
}

.chart-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-body {
    padding: 8px 12px 12px;
}

.api-keys {
    margin-bottom: 20px;
}

.api-key-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 12px;
}

.api-key-label {
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.api-key-value {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 12px;
    color: var(--primary-color);
    user-select: all;
}

.api-key-url {
    color: #999;
    font-size: 11px;
}

.api-key-url strong {
    color: var(--primary-color);
}

.dash-separator {
    margin: 24px 0;
    border: none;
    border-top: 1px solid #eee;
}

.dash-rename-btn {
    cursor: pointer;
    margin-left: 0;
    font-size: 14px;
    color: #999;
    vertical-align: middle;
}
}

.dash-rename-btn:hover {
    color: var(--primary-color);
}

.rename-form {
    display: none;
    margin-bottom: 16px;
}

.rename-input {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    width: 300px;
}

/* ==========================================
   Pricing Pages
   ========================================== */

.pricing-page,
.pricing-detail-page,
.pricing-container {
    max-width: 900px;
}

.pricing-container h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.pricing-container p {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.pricing-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.pricing-subtitle {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.pricing-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    padding: 8px 12px;
    border-bottom: 2px solid #eee;
}

.pricing-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.pricing-table tr:last-child td {
    border-bottom: none;
}

.model-name {
    font-weight: 500;
    color: var(--text-color);
}

.model-provider {
    color: #999;
    font-size: 12px;
}

.price-cell {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    color: var(--primary-color);
    font-weight: 500;
}

.total-cell {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    color: #2ed8b6;
    font-weight: 600;
    font-size: 16px;
}

.model-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.model-badge.best {
    background: #e0f0ff;
    color: var(--primary-color);
}

.model-badge.popular {
    background: #fff0e0;
    color: #ffb64d;
}

.model-badge.premium {
    background: #e0ffe0;
    color: #2ed8b6;
}

.model-badge.deprecated {
    background: #f0f0f0;
    color: #999;
}

.price-updated {
    font-size: 11px;
    color: #bbb;
    margin-bottom: 16px;
}

.fallback-note {
    font-size: 11px;
    color: #bbb;
    margin-top: -8px;
    margin-bottom: 20px;
}

.pricing-model-explanation {
    max-width: 900px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

#price-range-sep {
    color: #999;
    margin: 0 4px;
}

#price-link:hover {
    text-decoration: underline;
    cursor: pointer;
}

.pricing-model-explanation h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
}

.pricing-model-explanation h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 24px;
    margin-bottom: 8px;
}

.pricing-model-explanation p {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.pricing-model-explanation ul.pricing-notes,
.pricing-model-explanation p.pricing-notes {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
    padding-left: 20px;
}

.pricing-model-explanation ul.pricing-notes li {
    margin-bottom: 4px;
}

.formula {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 12px;
    color: #666;
    background: #f8f8f8;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    white-space: pre;
    overflow-x: auto;
}

.fallback-star {
    color: #ff6b6b;
}

.pricing-detail-input {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.pricing-detail-input span {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    color: var(--primary-color);
    font-weight: 500;
}

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

.plan-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.plan-header {
    margin-bottom: 16px;
}

.plan-header h2 {
    font-size: 16px;
    color: var(--primary-color);
    margin: 0 0 4px 0;
}

.plan-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.plan-pricing {
    margin-bottom: 12px;
}

.plan-monthly {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

.plan-annual {
    font-size: 14px;
    color: #999;
    margin-left: 8px;
}

.plan-features {
    margin-bottom: 12px;
}

.feature-item {
    font-size: 13px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.plan-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

.plan-link:hover {
    text-decoration: underline;
}

.no-data {
    color: #999;
    font-size: 14px;
}

.fetch-bar {
    margin-bottom: 20px;
}

.fetch-msg {
    font-size: 13px;
    color: #2ed8b6;
    margin-bottom: 16px;
    display: none;
}

/* ==========================================
   Notebook Page
   ========================================== */

.note-main {
    max-width: 100%;
}

.note-sidebar {
    max-width: 100%;
}

/* ==========================================
   Empty / Error State Pages
   ========================================== */

.state-page {
    max-width: 480px;
    margin: 80px auto;
    text-align: center;
}

.state-code {
    font-size: 48px;
    font-weight: 700;
    color: #dce1e8;
    margin-bottom: 8px;
}

.state-message {
    font-size: 15px;
    color: #999;
    margin-bottom: 24px;
}

.state-back {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
}

.state-back:hover {
    text-decoration: underline;
}

.state-form {
    margin-top: 0;
}

.state-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.state-btn {
    padding: 10px 32px;
    font-size: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.state-btn:hover {
    background: #3082dd;
}

/* ==========================================
   Button Variations
   ========================================== */

.btn-green {
    background: #2ed8b6;
    text-align: center;
    display: inline-block;
}

.btn-green:hover {
    background: #26bfa0;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 12px;
    font-size: 11px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-danger {
    background: #FF5370;
    color: #fff;
}

/* ==========================================
   Token Records Page — Admin
   ========================================== */

.tokens-page {
    max-width: 100%;
}

.tokens-filter-bar {
    margin-bottom: 16px;
}

.tokens-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.tokens-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tokens-filter-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.tokens-filter-select {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    min-width: 200px;
    color: var(--text-color);
}

.tokens-filter-select-sm {
    min-width: 80px;
}

.tokens-count {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.tokens-table-wrap {
    overflow-x: auto;
}

.tokens-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.tokens-table th {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 2px solid #eee;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    white-space: nowrap;
}

.tokens-table td {
    padding: 6px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tokens-table tbody tr:hover {
    background: #f8f9fa;
}

.tokens-cell-id {
    color: #999;
    font-size: 10px;
}

.tokens-cell-session {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 10px;
    color: #666;
    max-width: 120px;
}

.tokens-cell-api {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 10px;
    color: var(--primary-color);
    max-width: 120px;
}

.tokens-cell-model {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 10px;
}

.tokens-cell-num {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    font-size: 11px;
    text-align: right;
    font-weight: 500;
}

.tokens-cell-labels {
    font-size: 10px;
    color: #666;
    max-width: 100px;
}

.tokens-cell-time {
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

.tokens-empty {
    text-align: center;
    padding: 32px 0 !important;
    color: #999;
    font-size: 13px;
}

/* ==========================================
   Splash Page — Developer Tool Style
   ========================================== */

.splash-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 0;
}

.splash-hero {
    text-align: center;
    padding: 40px 0 24px;
}

.splash-hero-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.splash-hero-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px;
}

.splash-hero-sub {
    font-size: 14px;
    color: #999;
    margin: 0;
}

.splash-section {
    margin-bottom: 32px;
}

.splash-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.splash-prompt {
    color: #6c757d;
    font-weight: 600;
    font-size: 14px;
}

.splash-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.splash-body {
    padding-left: 16px;
}

.splash-body p {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-color);
}

.splash-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.splash-key {
    color: #d63384;
    font-weight: 600;
    min-width: 100px;
}

.splash-sep {
    color: #6c757d;
}

.splash-val {
    color: var(--text-color);
}

.splash-val-ok {
    color: #2ed8b6;
}

.splash-metrics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.splash-metric {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 13px;
}

.splash-metric-key {
    color: #4099ff;
    font-weight: 600;
    min-width: 140px;
    font-size: 13px;
}

.splash-metric-desc {
    color: #6c757d;
    font-size: 13px;
}

.splash-desc {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.7;
}

.splash-ctas {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.splash-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.splash-btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.splash-btn-primary:hover {
    background: #3082dd;
}

.splash-btn-secondary {
    background: #e9ecef;
    color: var(--text-color);
}

.splash-btn-secondary:hover {
    background: #dde1e5;
}

/* ==========================================
   Delete Dashboard Confirmation Page
   ========================================== */

.delete-confirm-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    padding: 40px 20px;
}

.delete-confirm-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.delete-confirm-card h2 {
    margin: 0 0 20px;
    font-size: 20px;
    color: var(--text-color);
}

.delete-confirm-text {
    color: #555;
    margin-bottom: 16px;
    line-height: 1.6;
}

.delete-confirm-key-hint {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.delete-confirm-api-key {
    margin: 12px 0 20px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 13px;
}

.delete-confirm-api-key code {
    font-family: 'Space Grotesk', 'Roboto Mono', monospace;
    color: var(--text-color);
    font-weight: 600;
}

.delete-confirm-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.delete-confirm-input {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 2px;
    text-align: center;
}

.delete-confirm-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(64, 153, 255, 0.1);
}

.delete-confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background: #c82333;
}

.alert-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.db-del-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #999;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.db-del-link:hover {
    color: #dc3545;
    background: #fff5f5;
}

/* ==========================================
   Modal Styles
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--text-color);
}

.modal-box p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.modal-box .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 8px;
}

.modal-box .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(64, 153, 255, 0.1);
}

.modal-box .form-error {
    margin: 4px 0;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-end;
}
