:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --bg-color: #f0f2f5;
    --panel-bg: #ffffff;
    --text-main: #111b21;
    --text-muted: #667781;
    --border: #d1d7db;
    --error: #ea0038;
    --success: #25D366;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 24px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.badge.disconnected {
    background-color: #fee2e2;
    color: var(--error);
}

.badge.connected {
    background-color: #dcf8c6;
    color: var(--primary-dark);
}

.panel {
    background: var(--panel-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    background: #f8f9fa;
    border-radius: var(--radius);
    margin: 20px 0;
    border: 1px dashed var(--border);
}

.qr-container img {
    max-width: 260px;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    background-color: #fafafa;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

/* Tabla de alumnos */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    margin-top: 20px;
}

.table-header h3 {
    font-size: 16px;
    color: var(--primary-dark);
}

.table-responsive {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

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

.students-table th, .students-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.students-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.students-table tbody tr:hover {
    background-color: #f0f2f5;
}

.select-all {
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
}

.selection-count {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
    text-align: right;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

small {
    display: block;
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 13px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

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

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

.primary-btn:disabled {
    background-color: #a5d6a7;
    cursor: not-allowed;
}

.secondary-btn {
    background-color: #f0f2f5;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background-color: #e4e6eb;
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Progress styles */
.progress-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
}

.error-text {
    color: var(--error);
}

.log-container {
    margin-top: 15px;
    max-height: 150px;
    overflow-y: auto;
    background: #111b21;
    color: #00ff00;
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
}

.log-item {
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.log-item.success { color: #25D366; }
.log-item.error { color: #ff5252; }

.loader {
    animation: pulse 1.5s infinite;
    color: var(--text-muted);
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}
