:root {
    --primary: #00838f;
    --primary-dark: #00695c;
    --accent: #4dd0e1;
    --bg-gradient: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 50%, #80deea 100%);
    --white: #ffffff;
    --text-main: #546e7a;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
}

/* 1. COMPACT CONTAINER: Frees up horizontal space for cards */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px; /* Reduced from 20px */
}

/* 2. FORCED SIDE-BY-SIDE GRID */
.grid-layout {
    display: grid;
    /* Force exactly 2 columns on small/medium screens */
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; /* Tighter gap */
    margin-top: 15px;
    width: 100%;
}

/* Tablet & Desktop: Switch to 3 columns if screen is wide enough */
@media (min-width: 800px) {
    .grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 3. COMPACT CANDIDATE CARDS: No more scrolling */
.candidate-card {
    background: var(--white);
    border-radius: 12px;
    padding: 12px; /* Tighter padding */
    text-align: center;
    cursor: pointer;
    border: 3px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 90px; /* Shortened to fit on screen */
    transition: transform 0.1s ease, border-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.candidate-card:active {
    transform: scale(0.98);
    border-color: var(--primary);
}

.name-label {
    font-size: 1.1em; /* Scaled down slightly to stay on one line */
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.class-label {
    font-size: 0.85em;
    color: #78909c;
}

/* 4. TIGHTER DEPUTY SECTION */
.rm-section {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #b2ebf2;
}

.rm-title {
    font-size: 0.65em;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
}

/* 5. SLIM PROGRESS BAR */
.progress-bar {
    height: 8px; /* Slimmer to save vertical space */
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

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