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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
}

h2 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #aaa;
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #16213e;
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    background: #0f3460;
    color: #fff;
}

.tab-content {
    display: none;
}

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

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.controls label {
    color: #aaa;
}

.controls select,
.controls input {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #16213e;
    color: #fff;
    font-size: 14px;
}

.controls input[type="number"] {
    width: 80px;
}

.controls button,
button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #0f3460;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.controls button:hover,
button:hover {
    background: #1a4a7a;
}

/* Usage Section */
.usage-section {
    background: #16213e;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

#usageText {
    font-size: 1.2rem;
    font-weight: bold;
}

#remainingText {
    color: #aaa;
}

.progress-bar {
    height: 24px;
    background: #0f3460;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 12px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-fill.warning {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

/* Activity Section */
.activity-section {
    background: #16213e;
    border-radius: 8px;
    padding: 20px;
}

#activityLog {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #0f3460;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: #aaa;
    font-family: monospace;
}

.activity-device {
    background: #0f3460;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.no-activity {
    color: #666;
    text-align: center;
    padding: 20px;
}

/* Section Header */
.section-header {
    margin-bottom: 20px;
}

.section-desc {
    color: #666;
    font-size: 13px;
    margin-top: 4px;
}

/* Mappings */
.add-mapping {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: #16213e;
    padding: 16px;
    border-radius: 8px;
}

.add-mapping input {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #0f3460;
    color: #fff;
    font-size: 14px;
    width: 150px;
}

.add-mapping select {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #0f3460;
    color: #fff;
    font-size: 14px;
}

.separator {
    color: #666;
    font-family: monospace;
    font-size: 18px;
}

.arrow {
    color: #666;
    font-size: 18px;
}

.mappings-list {
    background: #16213e;
    border-radius: 8px;
    padding: 16px;
}

.mapping-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #0f3460;
}

.mapping-item:last-child {
    border-bottom: none;
}

.mapping-id {
    font-family: monospace;
    font-size: 13px;
    color: #aaa;
    flex: 1;
}

.mapping-kid {
    background: #22c55e;
    color: #000;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
}

.delete-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.delete-btn:hover {
    background: #dc2626;
}

/* Alerts */
.alerts-list {
    background: #16213e;
    border-radius: 8px;
    padding: 16px;
}

.alert-item {
    padding: 12px 0;
    border-bottom: 1px solid #0f3460;
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.alert-user {
    font-family: monospace;
    color: #f87171;
    font-weight: 500;
}

.alert-time {
    color: #666;
    font-size: 12px;
}

.alert-actions {
    display: flex;
    gap: 8px;
}

.quick-map-btn {
    background: #22c55e;
    font-size: 12px;
    padding: 6px 12px;
}

.quick-map-btn:hover {
    background: #16a34a;
}

.dismiss-btn {
    background: #666;
    font-size: 12px;
    padding: 6px 12px;
}

.dismiss-btn:hover {
    background: #888;
}
