* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

h1 {
    color: #00d4ff;
    margin: 0;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

h2 { margin: 0 0 15px 0; color: #fff; }
h3 { margin: 0 0 10px 0; color: #888; }

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 800px) {
    .grid { grid-template-columns: 1fr; }
}

.card {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Display items */
.display-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #0f3460;
    border-radius: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.display-info {
    flex: 1;
    min-width: 200px;
}

.display-id {
    font-size: 16px;
    font-weight: bold;
    color: #00d4ff;
}

.display-ids {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.display-status {
    font-size: 12px;
    margin-top: 4px;
}

.display-status.active { color: #4ade80; }
.display-status.inactive { color: #f87171; }

.display-value {
    font-size: 36px;
    font-weight: bold;
    color: #ffd700;
    min-width: 80px;
    text-align: center;
}

.display-mapping {
    font-size: 11px;
    color: #a78bfa;
    margin-top: 4px;
}

/* Microzone items */
.microzone-item {
    padding: 12px;
    background: #0f3460;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.microzone-item:hover { background: #1a4a7a; }
.microzone-item.selected {
    background: #1e5a2e;
    border: 1px solid #4ade80;
}

.microzone-name {
    font-weight: bold;
    color: #fff;
}

.microzone-key {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.microzone-stats {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 13px;
}

.microzone-free {
    color: #4ade80;
    font-weight: bold;
}

.microzone-total { color: #888; }

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

input[type="number"], select {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    background: #1a1a2e;
    color: #fff;
}

input[type="number"] {
    width: 80px;
    text-align: center;
}

select { min-width: 120px; }

button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: #00d4ff; color: #000; }
.btn-primary:hover { background: #00a8cc; }
.btn-success { background: #4ade80; color: #000; }
.btn-success:hover { background: #22c55e; }
.btn-danger { background: #f87171; color: #000; }
.btn-danger:hover { background: #ef4444; }
.btn-secondary { background: #4b5563; color: #fff; }
.btn-secondary:hover { background: #6b7280; }

/* Settings */
.settings-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.settings-label {
    color: #888;
    min-width: 120px;
}

.settings-value {
    color: #4ade80;
    font-weight: bold;
}

/* Status messages */
.status-msg {
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    text-align: center;
}

.status-msg.success { background: #065f46; color: #4ade80; }
.status-msg.error { background: #7f1d1d; color: #fca5a5; }
.status-msg.info { background: #1e3a5f; color: #60a5fa; }

.no-items {
    text-align: center;
    color: #666;
    padding: 30px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: #16213e;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 { margin-bottom: 20px; }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* Refresh indicator */
.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.refresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Scrollable lists */
.scrollable-list {
    max-height: 400px;
    overflow-y: auto;
}

.scrollable-list::-webkit-scrollbar {
    width: 8px;
}

.scrollable-list::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.scrollable-list::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.scrollable-list::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Live logs */
.logs-container {
    background: #0a0a15;
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

.logs-container::-webkit-scrollbar {
    width: 8px;
}

.logs-container::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #1a1a2e;
    word-break: break-all;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #666;
    margin-right: 10px;
}

.log-info { color: #60a5fa; }
.log-success { color: #4ade80; }
.log-error { color: #f87171; }
.log-warning { color: #fbbf24; }
.log-send { color: #a78bfa; }

.btn-delete {
    background: transparent;
    color: #f87171;
    border: 1px solid #f87171;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-delete:hover {
    background: #f87171;
    color: #fff;
}
