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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
nav {
    background: #2c3e50;
    padding: 15px 20px;
    margin-bottom: 20px;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    margin-right: 20px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

nav a:hover, nav a.active {
    background: #34495e;
}

nav .brand {
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3em;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 25px;
}

.stat-card .number {
    font-size: 2.5em;
    font-weight: bold;
    color: #3498db;
}

.stat-card .label {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-hot { background: #27ae60; color: white; }
.status-warm { background: #f39c12; color: white; }
.status-cold { background: #e74c3c; color: white; }
.status-unknown { background: #95a5a6; color: white; }
.status-working { background: #27ae60; color: white; }
.status-scan_qr_code { background: #f39c12; color: white; }
.status-stopped { background: #e74c3c; color: white; }
.status-starting { background: #3498db; color: white; }
.status-failed { background: #c0392b; color: white; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.9em;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

tr:hover {
    background: #f8f9fa;
}

/* QR Code */
.qr-container {
    text-align: center;
    padding: 30px;
}

.qr-container img {
    max-width: 300px;
    border: 4px solid #ecf0f1;
    border-radius: 8px;
}

/* Forms */
input[type="file"] {
    margin: 10px 0;
}

.upload-zone {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-zone:hover {
    border-color: #3498db;
}

.upload-zone.dragover {
    border-color: #27ae60;
    background: #f0fff4;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* Utility */
.text-muted {
    color: #7f8c8d;
}

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }

.flex {
    display: flex;
    gap: 10px;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}
