* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #0f1117; color: #e0e0e0; min-height: 100vh; }
a { color: #6c5ce7; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 20px; }
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-box { background: #1a1d2e; padding: 40px; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.login-box h1 { color: #6c5ce7; margin-bottom: 8px; font-size: 1.6em; }
.login-box h2 { color: #999; margin-bottom: 24px; font-weight: normal; font-size: 1em; }

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid #2a2d3e; margin-bottom: 24px; }
.navbar h1 { color: #6c5ce7; font-size: 1.3em; }
.nav-links { display: flex; gap: 12px; align-items: center; }
.nav-links a { padding: 8px 16px; border-radius: 6px; transition: background 0.2s; }
.nav-links a:hover, .nav-links a.active { background: #2a2d3e; text-decoration: none; }

h2 { margin-bottom: 16px; font-size: 1.4em; }
h3 { margin-bottom: 12px; font-size: 1.1em; }
.subtitle { color: #888; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: #aaa; font-size: 0.9em; }
.form-group input, input[type="text"], input[type="password"], select { width: 100%; padding: 12px; background: #0f1117; border: 1px solid #2a2d3e; border-radius: 8px; color: #e0e0e0; font-size: 1em; }
.form-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-inline select, .form-inline input[type="text"] { width: auto; }

.btn { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.9em; transition: background 0.2s; display: inline-block; text-align: center; background: #2a2d3e; color: #e0e0e0; }
.btn:hover { background: #3a3d4e; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 0.8em; }
.btn-primary { background: #6c5ce7; color: white; }
.btn-primary:hover { background: #5a4bd1; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-success { background: #0d3320; border: 1px solid #27ae60; color: #2ecc71; }
.alert-error { background: #3d0d0d; border: 1px solid #e74c3c; color: #e74c3c; }
.alert-warning { background: #3d2e0d; border: 1px solid #f39c12; color: #f1c40f; }
.alert-info { background: #0d1f3d; border: 1px solid #3498db; color: #3498db; }

.add-key-form { background: #1a1d2e; padding: 24px; border-radius: 12px; margin-bottom: 24px; border: 1px solid #2a2d3e; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar .btn.active { background: #6c5ce7; color: white; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: #1a1d2e; padding: 24px; border-radius: 12px; border: 1px solid #2a2d3e; text-align: center; }
.stat-card h3 { color: #6c5ce7; margin-bottom: 8px; }
.stat-number { font-size: 1.8em; font-weight: bold; color: #2ecc71; }
.stat-sub { color: #666; font-size: 0.85em; margin: 4px 0 12px; }
.stat-usage { color: #f1c40f; font-size: 0.85em; margin: 4px 0 12px; }
.stat-cooldown { color: #e74c3c; font-size: 0.85em; margin: 4px 0; }
.usage-bar { display: block; width: 100%; height: 6px; background: #0f1117; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.usage-fill { display: block; height: 100%; background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c); border-radius: 3px; transition: width 0.3s; }

.info-box { background: #1a1d2e; padding: 24px; border-radius: 12px; border: 1px solid #2a2d3e; margin-bottom: 24px; }
.info-box h3 { color: #6c5ce7; margin-bottom: 8px; }
.info-box code { background: #0f1117; padding: 4px 8px; border-radius: 4px; color: #2ecc71; }
.info-box p { margin-top: 8px; color: #888; }

.keys-table { width: 100%; border-collapse: collapse; background: #1a1d2e; border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.keys-table th, .keys-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #2a2d3e; }
.keys-table th { background: #252838; color: #aaa; font-size: 0.85em; text-transform: uppercase; }
.keys-table td code { background: #0f1117; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: #f1c40f; }
.keys-table .actions { white-space: nowrap; }
.keys-table .text-center { text-align: center; color: #666; }
.badge { padding: 4px 10px; border-radius: 12px; font-size: 0.75em; font-weight: bold; }
.badge-active { background: #0d3320; color: #2ecc71; }
.badge-inactive { background: #3d0d0d; color: #e74c3c; }

.provider-section { background: #1a1d2e; padding: 24px; border-radius: 12px; border: 1px solid #2a2d3e; margin-bottom: 20px; }
.provider-section h3 { color: #6c5ce7; border-bottom: 1px solid #2a2d3e; padding-bottom: 12px; margin-bottom: 16px; }
.model-info { margin-bottom: 12px; color: #aaa; font-size: 0.9em; }
.model-info code { color: #f1c40f; }

.models-form { margin-top: 12px; }
.models-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.selected-count { color: #2ecc71; font-weight: bold; margin-left: auto; }
.models-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #6c5ce7; }