:root {
    --bg-color: #f5f6f7;
    --card-bg: #ffffff;
    --border-color: #ebebeb;
    --text-primary: #1e1e23;
    --text-secondary: #7e7e87;
    --accent: #03c75a;
    --accent-glow: rgba(3, 199, 90, 0.1);
    --btn-primary-bg: #03c75a;
    --btn-primary-hover: #02b351;
    --success: #03c75a;
    --danger: #f85149;
    --font-sans: 'Inter', 'Noto Sans KR', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.full-height {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Landing View */
.hero-section {
    text-align: center;
    max-width: 600px;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h1 span {
    color: var(--accent);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.main-input {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.main-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.accent {
    color: var(--accent);
}

.token-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item.full-width {
    grid-column: 1 / -1;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent);
    user-select: all;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.stat-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.stat-item .label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.stat-item .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    word-break: break-all;
}

.status-active {
    color: var(--success) !important;
}

.status-inactive {
    color: var(--danger) !important;
}

/* Table Wrapper */
.table-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.badge-model {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
}

.tokens {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.status-check {
    color: var(--success);
}

/* Buttons */
.btn {
    cursor: pointer;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    color: white;
    padding: 0 1.5rem;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.btn-icon:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Footer / Pagination */
.dashboard-footer {
    padding: 2rem 0;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* States */
.empty-state {
    padding: 4rem;
    text-align: center;
    color: var(--text-secondary);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner-container {
    text-align: center;
    color: var(--accent);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(88, 166, 255, 0.1);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .search-box {
        flex-direction: column;
    }

    .btn-primary {
        height: 3rem;
    }
}

/* Usage Logs Section */
.usage-logs-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.total-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.badge-model {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: #f1f3f5;
    color: #495057;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.data-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.data-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

.data-value {
    color: var(--text-primary);
    font-size: 0.875rem;
    word-break: break-all;
}

.other-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.other-section h3 {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

#rawOther {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    overflow-x: auto;
}

.pagination-footer {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}