@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

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

:root {
    --blue: #1B43D4;
    --yellow: #FCAC17;
    --dark-blue: #091F3D;
    --black: #333333;
    --grey: #848B93;
    --light-grey: #E5EAF0;
    --white: #FFFFFF;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(9,31,61,0.06), 0 4px 12px rgba(9,31,61,0.04);
    --shadow-hover: 0 2px 8px rgba(9,31,61,0.1), 0 8px 24px rgba(9,31,61,0.06);
}

body {
    font-family: 'Poppins', -apple-system, sans-serif;
    font-weight: 400;
    background: #F6F8FB;
    color: var(--black);
    line-height: 1.6;
    font-size: 14px;
}

/* ── Nav ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 56px;
    background: var(--dark-blue);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-left .logo {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: -0.01em;
}
.nav-left .logo span { color: var(--yellow); }
.nav-right { display: flex; gap: 1.25rem; align-items: center; }
.nav-right a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.85rem; font-weight: 400; transition: color 0.15s; }
.nav-right a:hover { color: var(--white); }
.user-info {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    font-weight: 300;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255,255,255,0.12);
}

/* ── Layout ── */
main { max-width: 1160px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 500; color: var(--dark-blue); }
.page-header p { color: var(--grey); font-size: 0.85rem; font-weight: 300; margin-top: 0.25rem; }

/* ── Cards ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(229,234,240,0.6);
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.card-header h2 { font-size: 0.95rem; font-weight: 500; color: var(--dark-blue); }
.card-header .card-subtitle { font-size: 0.8rem; color: var(--grey); font-weight: 300; }

/* ── Grid ── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Stats ── */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(229,234,240,0.6);
}
.stat-card .stat-label { font-size: 0.75rem; color: var(--grey); font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 600; color: var(--dark-blue); margin-top: 0.25rem; }
.stat-card .stat-sub { font-size: 0.75rem; color: var(--grey); font-weight: 300; margin-top: 0.15rem; }
.stat-card.accent { border-left: 3px solid var(--blue); }
.stat-card.accent-yellow { border-left: 3px solid var(--yellow); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--light-grey);
    border-radius: 8px;
    background: var(--white);
    color: var(--black);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-primary:hover { background: #1535A8; }
.btn-yellow { background: var(--yellow); color: var(--dark-blue); border-color: var(--yellow); font-weight: 500; }
.btn-yellow:hover { background: #E89D0E; }
.btn-warn { border-color: var(--yellow); color: #92640A; }
.btn-warn:hover { background: #FFF8E7; }
.btn-danger { border-color: #EF4444; color: #DC2626; }
.btn-danger:hover { background: #FEF2F2; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.btn-lg { padding: 0.65rem 1.75rem; font-size: 0.95rem; }
.btn-ghost { border: none; background: none; color: var(--grey); }
.btn-ghost:hover { color: var(--blue); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.65rem 0.75rem; font-size: 0.7rem; font-weight: 500; color: var(--grey); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--light-grey); }
td { padding: 0.75rem; border-bottom: 1px solid rgba(229,234,240,0.5); font-size: 0.85rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.disabled-row { opacity: 0.45; }
.assign-row td { padding: 0.35rem 0.75rem; background: #FAFBFD; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(229,234,240,0.7);
    color: var(--grey);
}
.badge-active { background: #E8F5E9; color: #2E7D32; }
.badge-disabled { background: #FFEBEE; color: #C62828; }
.badge-model { background: rgba(27,67,212,0.08); color: var(--blue); }
.badge-project { background: rgba(252,172,23,0.12); color: #92640A; }

/* Creator brand badges */
.badge-creator-anthropic { background: rgba(204,108,29,0.12); color: #CC6C1D; }
.badge-creator-openai { background: rgba(0,0,0,0.08); color: #1A1A1A; }
.badge-creator-google { background: rgba(66,133,244,0.12); color: #2962FF; }
.badge-creator-meta { background: rgba(0,100,209,0.12); color: #0064D1; }
.badge-creator-deepseek { background: rgba(30,60,120,0.12); color: #1E3C78; }
.badge-creator-mistral { background: rgba(200,100,20,0.12); color: #C86414; }
.badge-creator-x-ai { background: rgba(0,0,0,0.08); color: #111; }
.badge-creator-nvidia { background: rgba(118,185,0,0.12); color: #76B900; }
.badge-creator-qwen { background: rgba(25,118,210,0.12); color: #1976D2; }
.badge-creator-inception { background: rgba(200,40,80,0.12); color: #C82850; }
.badge-creator-cohere { background: rgba(130,60,200,0.12); color: #823CC8; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; align-items: end; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.7rem; color: var(--grey); font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; }
input, select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--light-grey);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--black);
    background: var(--white);
    transition: border-color 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,67,212,0.08); }
input::placeholder { color: var(--grey); font-weight: 300; }
.inline-form { display: inline; }
.form-inline { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.form-inline input, .form-inline select { padding: 0.3rem 0.5rem; font-size: 0.8rem; }

/* ── Alerts ── */
.alert {
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; }
.alert-warn { background: #FFFBEB; border: 1px solid #FDE68A; }
.key-display {
    display: block;
    padding: 0.6rem 0.75rem;
    background: var(--dark-blue);
    color: #A5F3FC;
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    margin: 0.5rem 0;
    letter-spacing: 0.02em;
}
.alert-content { flex: 1; }
.alert-content strong { font-weight: 500; }

/* ── Key row ── */
.key-name { font-weight: 500; color: var(--dark-blue); }
.key-label { font-size: 0.75rem; color: var(--grey); font-weight: 300; font-family: 'SF Mono', monospace; }
.key-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.actions { display: flex; gap: 0.35rem; white-space: nowrap; }

/* ── Usage bar ── */
.usage-bar-container { width: 100%; background: var(--light-grey); border-radius: 999px; height: 6px; overflow: hidden; }
.usage-bar { height: 100%; border-radius: 999px; background: var(--blue); transition: width 0.3s; }
.usage-bar.warn { background: var(--yellow); }
.usage-bar.danger { background: #EF4444; }

/* ── Chart container ── */
.chart-container { position: relative; height: 260px; margin-top: 0.5rem; }

/* ── Misc ── */
.muted { color: var(--grey); font-size: 0.8rem; font-weight: 300; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }

/* ── Login ── */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--dark-blue);
    color: var(--white);
}
.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-card h1 { font-size: 1.4rem; font-weight: 500; color: var(--dark-blue); margin-bottom: 0.5rem; }
.login-card p { color: var(--grey); font-size: 0.85rem; font-weight: 300; margin-bottom: 2rem; }
.login-card .muted { margin-top: 1.5rem; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--light-grey); margin-bottom: 1.5rem; }
.tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--grey);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}
.tab:hover { color: var(--dark-blue); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 500; }

/* ── Empty state ── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--grey); }
.empty p { font-weight: 300; }

/* ── Expiry/dates ── */
.expires-soon { color: var(--yellow); font-weight: 500; }
.expired { color: #EF4444; font-weight: 500; }
