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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f9fafb;
    --card: #ffffff;
    --muted: #f8f9fa;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --text: #1f2937;
    --text-muted: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.12);
}

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

body {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.035) 0%, transparent 46%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.035) 0%, transparent 48%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container,
.docs-shell {
    position: relative;
    z-index: 1;
    width: min(1400px, calc(100% - 80px));
    margin: 0 auto;
    padding: 56px 0;
}

.header,
.page-header,
.docs-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding: 24px 28px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.header > div,
.page-actions,
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.title,
h1 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.subtitle,
.user-info,
.page-description,
.docs-hero p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.card,
.panel,
.docs-card,
.stat-card,
.token-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.card,
.panel,
.docs-card { padding: 28px; margin-bottom: 24px; }

.card:hover,
.docs-card:hover,
.token-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--muted); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-small { min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.icon { font-size: 16px; line-height: 1; }

.tokens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.token-card { padding: 24px; position: relative; overflow: hidden; transition: all 0.2s ease; }
.token-card.disabled { opacity: 0.72; }
.token-card.expired::after { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--danger), #fb7185); }
.token-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.token-title { font-size: 15px; font-weight: 600; word-break: break-all; flex: 1; }
.token-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.token-info { display: flex; flex-direction: column; gap: 14px; }
.info-item { display: flex; align-items: center; gap: 12px; }
.info-label { min-width: 76px; color: var(--text-muted); font-size: 13px; font-weight: 500; }
.info-value { color: var(--text); font-size: 14px; font-weight: 500; flex: 1; }

.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge-success { background: rgba(16, 185, 129, 0.12); color: #047857; border-color: rgba(16, 185, 129, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border-color: rgba(239, 68, 68, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.2); }
.badge-info { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; border-color: rgba(59, 130, 246, 0.2); }

.table-wrapper { overflow-x: auto; margin: 24px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { background: var(--muted); padding: 15px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
td { padding: 15px 16px; border-top: 1px solid var(--border); vertical-align: top; color: var(--text); }
tr:hover { background: rgba(99, 102, 241, 0.04); }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
input, textarea, .input, select { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); }
input:focus, textarea:focus, .input:focus, select:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.14); }
textarea { min-height: 92px; resize: vertical; }
small { display: block; margin-top: 6px; color: var(--text-muted); line-height: 1.5; }
.form-actions, .actions { display: flex; gap: 12px; margin-top: 24px; }
.form-actions button, .actions button { flex: 1; }

.modal { display: none; position: fixed; inset: 0; padding: 24px; background: rgba(15, 23, 42, 0.35); backdrop-filter: blur(10px); z-index: 1000; overflow-y: auto; }
.modal.active { display: block; }
.modal-content { width: min(100%, 540px); margin: 8vh auto; padding: 28px; border-radius: 16px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.97); box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.3rem; }
.modal-close, .close { background: transparent; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--text-muted); }

.error, .error-message, .success { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.error, .error-message { border: 1px solid rgba(239, 68, 68, 0.18); background: rgba(239, 68, 68, 0.08); color: #b91c1c; }
.success { border: 1px solid rgba(16, 185, 129, 0.18); background: rgba(16, 185, 129, 0.08); color: #047857; }

.empty-state { text-align: center; padding: 72px 24px; border: 1px dashed var(--border); border-radius: 16px; background: var(--card); }
.empty-icon { font-size: 42px; margin-bottom: 12px; }

.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.login-box { width: 100%; max-width: 420px; padding: 36px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-lg); }
.login-title { margin-bottom: 8px; font-size: 28px; font-weight: 700; text-align: center; color: var(--text); }
.login-subtitle { margin-bottom: 28px; text-align: center; color: var(--text-muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-input { width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 15px; background: #fff; color: var(--text); }
.login-btn { width: 100%; padding: 13px 14px; border: 0; border-radius: 12px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }

.user-balance-card { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 24px; border-radius: 16px; margin-bottom: 24px; box-shadow: 0 14px 40px rgba(99, 102, 241, 0.22); }
.user-balance-card h2 { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.88); }
.balance-amount { font-size: 32px; font-weight: 700; line-height: 1.2; margin: 6px 0; }
.balance-info { color: rgba(255,255,255,0.85); font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-card h3 { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 700; }
.key-display { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; background: rgba(99,102,241,0.08); padding: 4px 8px; border-radius: 8px; font-size: 12px; word-break: break-all; }
.new-key-display { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.22); border-radius: 12px; padding: 14px; margin-top: 14px; }
.new-key-display strong { display: block; color: #047857; margin-bottom: 10px; }
.new-key-display code { display: block; padding: 10px; border-radius: 10px; background: #fff; color: var(--text); word-break: break-all; }
.copy-btn { margin-top: 10px; padding: 7px 12px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; cursor: pointer; }
.search-bar, .action-buttons, .pagination { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 220px; }
.pagination { justify-content: center; margin-top: 20px; }
.pagination button { padding: 8px 14px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { color: var(--text-muted); font-size: 14px; }

.docs-shell { max-width: 1180px; }
.docs-hero { display: block; text-align: center; padding: 42px 32px; }
.docs-hero h1 { font-size: 3rem; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.docs-card h2, .docs-card h3 { margin-bottom: 14px; }
.endpoint { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); margin: 16px 0; }
.method-badge { padding: 6px 12px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 700; }
.method-badge.get { background: #2563eb; }
.method-badge.post { background: #059669; }
.endpoint-url, code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
pre { overflow-x: auto; margin: 16px 0; padding: 18px; border-radius: 12px; background: #1e1e1e; color: #d4d4d4; }
:not(pre) > code { padding: 3px 7px; border-radius: 7px; background: rgba(99,102,241,0.08); color: var(--primary-dark); }
ul, ol { padding-left: 22px; }

@media (max-width: 768px) {
    .container, .docs-shell { width: min(100% - 24px, 1400px); padding: 20px 0; }
    .header, .page-header, .docs-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
    .docs-hero { text-align: left; }
    .docs-hero h1 { font-size: 2rem; }
    .title, h1 { font-size: 1.6rem; }
    .tokens-grid { grid-template-columns: 1fr; }
    .token-header { flex-direction: column; }
    .form-actions, .actions { flex-direction: column; }
    .modal { padding: 12px; }
    .modal-content { margin: 4vh auto; padding: 22px; }
    .login-box { padding: 28px 20px; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .search-bar input { min-width: 0; }
}

@media (max-width: 480px) {
    .container, .docs-shell { width: min(100% - 20px, 1400px); }
    .login-box { padding: 24px 16px; }
    .login-title { font-size: 24px; }
}


.toc {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.toc h3 { margin-bottom: 12px; }
.toc ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 18px; padding-left: 18px; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.model-card { padding: 18px; border: 1px solid rgba(99,102,241,0.18); border-radius: 12px; background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.05)); }
.model-card code { font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.model-card p { margin-top: 8px; color: var(--text-muted); font-size: 14px; }
.parameter-table { margin: 18px 0; }
.parameter-table table { min-width: 860px; }
.notice, .alert, .info-box, .warning-box, .tip-box {
    margin: 18px 0;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(99,102,241,0.18);
    background: rgba(99,102,241,0.06);
}
.warning-box { border-color: rgba(245,158,11,0.22); background: rgba(245,158,11,0.08); }
.error-box { border: 1px solid rgba(239,68,68,0.22); background: rgba(239,68,68,0.08); border-radius: 12px; padding: 16px 18px; margin: 18px 0; }
.response-example { margin-top: 18px; }
.docs-card p { margin: 10px 0; color: var(--text-muted); }
.docs-card h2 { font-size: 1.55rem; margin-bottom: 16px; }
.docs-card h3 { font-size: 1.15rem; margin: 24px 0 12px; }
.docs-card li { margin: 6px 0; }


/* Polished auth and docs surfaces */
.auth-page {
    background: #ffffff;
}

.auth-page::before {
    display: none;
}

.auth-brand {
    position: fixed;
    top: 28px;
    left: 32px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
}

.auth-logo {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 24px 32px;
    position: relative;
    z-index: 1;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-heading {
    margin-bottom: 28px;
    text-align: center;
}

.login-title {
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    color: #111827;
}

.login-subtitle {
    margin: 0;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-input {
    width: 100%;
    height: 42px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
}

.login-input:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.login-btn {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.login-btn:hover {
    background: #1f2937;
}

.docs-shell {
    width: min(1280px, calc(100% - 64px));
    max-width: none;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 40px 0 72px;
}

.docs-hero {
    grid-column: 1 / -1;
    display: block;
    margin-bottom: 0;
    padding: 8px 0 18px;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.docs-hero h1 {
    font-size: 32px;
    line-height: 1.2;
    color: #111827;
    background: none;
    -webkit-text-fill-color: currentColor;
}

.docs-hero p {
    max-width: 720px;
    margin-top: 8px;
    color: #6b7280;
    font-size: 15px;
}

.toc {
    grid-column: 1;
    position: sticky;
    top: 24px;
    align-self: start;
    margin: 0;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: none;
}

.toc h3 {
    margin-bottom: 12px;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.toc ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 0;
    list-style: none;
}

.toc a {
    display: block;
    padding: 7px 9px;
    border-radius: 7px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.4;
}

.toc a:hover {
    background: #f3f4f6;
    color: #111827;
}

.docs-card {
    grid-column: 2;
    margin-bottom: 18px;
    padding: 24px 28px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: none;
}

.docs-card:hover {
    border-color: #e5e7eb;
    box-shadow: none;
}

.docs-card h2 {
    margin-bottom: 12px;
    color: #111827;
    font-size: 22px;
    line-height: 1.3;
}

.docs-card h3 {
    margin: 24px 0 10px;
    color: #111827;
    font-size: 16px;
}

.docs-card p {
    margin: 8px 0 12px;
    color: #4b5563;
    font-size: 14px;
}

.model-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 16px 0 0;
}

.model-card {
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.model-card code {
    color: #111827;
    font-size: 12px;
    font-weight: 600;
}

.endpoint {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.method-badge {
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 11px;
}

pre {
    border-radius: 8px;
    background: #111827;
    font-size: 13px;
}

.docs-card .table-wrapper {
    border-radius: 8px;
}

@media (max-width: 900px) {
    .docs-shell {
        width: min(100% - 28px, 1280px);
        display: block;
        padding: 24px 0 48px;
    }

    .toc {
        position: static;
        margin: 18px 0;
    }

    .docs-card {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .auth-brand {
        position: static;
        padding: 18px 20px 0;
    }

    .login-container {
        min-height: calc(100vh - 58px);
        padding-top: 36px;
    }

    .login-title {
        font-size: 26px;
    }
}


/* Final auth/docs polish */
.auth-page {
    background: #f8fafc;
}

.auth-brand {
    top: 30px;
    left: 34px;
}

.login-container {
    min-height: 100vh;
    padding: 96px 24px 48px;
}

.login-box {
    max-width: 420px;
    padding: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.auth-heading {
    margin-bottom: 26px;
}

.login-title {
    font-size: 26px;
}

.login-form {
    gap: 16px;
}

.login-input,
.login-btn {
    height: 40px;
}

.docs-shell {
    width: min(1120px, calc(100% - 56px));
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    padding-top: 36px;
}

.docs-hero {
    padding-bottom: 20px;
}

.docs-hero h1 {
    font-size: 30px;
}

.docs-hero p {
    font-size: 14px;
}

.toc {
    padding: 16px;
    border-radius: 8px;
}

.toc a {
    padding: 6px 8px;
    font-size: 13px;
}

.docs-card {
    padding: 22px 24px;
    border-radius: 8px;
}

.docs-card h2 {
    font-size: 20px;
}

.model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-card {
    min-height: 44px;
    display: flex;
    align-items: center;
}

.endpoint {
    min-height: 44px;
}

pre {
    max-height: 420px;
    border: 1px solid #1f2937;
}

@media (max-width: 900px) {
    .docs-shell {
        width: min(100% - 28px, 1120px);
        display: block;
    }

    .model-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .auth-page {
        background: #ffffff;
    }

    .auth-brand {
        padding: 18px 20px 0;
    }

    .login-container {
        padding: 36px 20px 32px;
    }

    .login-box {
        padding: 0;
        border: 0;
        box-shadow: none;
    }
}


/* Dashboard and admin table polish */
body:not(.auth-page) {
    background: #f8fafc;
}

.container {
    width: min(1120px, calc(100% - 56px));
    padding: 40px 0 72px;
}

.header {
    min-height: 76px;
    margin-bottom: 22px;
    padding: 20px 24px;
    border-radius: 12px;
    border-color: #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.header > div:first-child {
    min-width: 0;
    align-items: baseline;
}

.title,
.header h1 {
    font-size: 26px;
    letter-spacing: -0.025em;
    color: #111827;
}

.subtitle,
.user-info {
    margin-top: 0;
    font-size: 13px;
    color: #6b7280;
}

.header-actions .btn,
.header > div:last-child .btn,
.header > div:last-child a.btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
}

.header-actions .btn-primary,
.header > div:last-child .btn-primary {
    background: #4f46e5;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.18);
}

.tokens-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
}

.token-card {
    padding: 20px;
    border-radius: 12px;
    border-color: #e5e7eb;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.token-card:hover {
    transform: translateY(-1px);
    border-color: #d1d5db;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.token-header {
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.token-title {
    max-width: 190px;
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
}

.token-actions {
    gap: 6px;
}

.token-actions .btn-small {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 8px;
    font-size: 12px;
}

.token-info {
    gap: 11px;
}

.info-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.info-label {
    min-width: 0;
    color: #6b7280;
    font-size: 12px;
}

.info-value {
    color: #111827;
    font-size: 13px;
    min-width: 0;
    word-break: break-word;
}

.badge {
    padding: 3px 8px;
    border-radius: 7px;
    font-size: 11px;
}

.table-wrapper {
    margin-top: 18px;
    border-radius: 12px;
    border-color: #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

table {
    min-width: 900px;
}

th {
    height: 44px;
    padding: 0 16px;
    background: #f8fafc;
    color: #374151;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
}

td {
    height: 48px;
    padding: 10px 16px;
    color: #111827;
    font-size: 13px;
}

td:last-child {
    white-space: nowrap;
}

td:last-child .btn,
td:last-child button {
    margin-right: 6px;
}

td .btn-small,
td .btn {
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 12px;
}

tr:hover {
    background: #f9fafb;
}

.empty-state {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

@media (max-width: 900px) {
    .container {
        width: min(100% - 28px, 1120px);
        padding: 24px 0 48px;
    }

    .header {
        align-items: flex-start;
    }

    .header > div:first-child {
        display: block;
    }

    .tokens-grid {
        grid-template-columns: 1fr;
    }
}


/* Sidebar admin layout */
.admin-page {
    min-height: 100vh;
    background: #f8fafc;
}

.admin-page::before {
    display: none;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    border-right: 1px solid #e5e7eb;
    background: #ffffff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 20px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.sidebar-logo {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 11px;
    border-radius: 8px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.sidebar-link.active {
    background: #eef2ff;
    color: #4338ca;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 10px 4px;
    border-top: 1px solid #f1f5f9;
    color: #9ca3af;
    font-size: 12px;
}

.admin-main {
    min-width: 0;
    padding: 28px 32px 64px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.admin-topbar h1 {
    color: #111827;
    font-size: 28px;
    letter-spacing: -0.025em;
}

.admin-topbar p {
    margin-top: 5px;
    color: #6b7280;
    font-size: 14px;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-content-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.section-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.section-toolbar h2 {
    color: #111827;
    font-size: 18px;
    line-height: 1.3;
}

.section-toolbar p {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.admin-page .tokens-grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.admin-page .token-card {
    padding: 18px;
    border-radius: 10px;
    box-shadow: none;
}

.admin-page .token-title {
    max-width: 210px;
}

.admin-page .table-wrapper {
    margin: 0;
    box-shadow: none;
}

.admin-page table {
    min-width: 880px;
}

.admin-page th {
    height: 42px;
    background: #f9fafb;
}

.admin-page td {
    height: 50px;
}

.admin-page .btn-primary {
    background: #4f46e5;
}

.admin-page .btn-primary:hover {
    background: #4338ca;
}

.admin-page .btn-secondary {
    background: #ffffff;
}

@media (max-width: 960px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-brand {
        padding-bottom: 12px;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .sidebar-link {
        flex: 0 0 auto;
    }

    .sidebar-footer {
        display: none;
    }

    .admin-main {
        padding: 22px 16px 48px;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-content-panel {
        padding: 16px;
    }

    .admin-page .tokens-grid {
        grid-template-columns: 1fr;
    }
}


/* Token panel density */
.admin-page .admin-content-panel:has(.tokens-grid) {
    max-width: 920px;
}

.admin-page .tokens-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 360px));
}

.admin-page .empty-state {
    max-width: 560px;
}

@supports not selector(:has(*)) {
    .admin-page .tokens-grid {
        max-width: 920px;
    }
}
