:root {
    --bg-color: #f3f4f6;
    --slot-height: 40px;
    --color-free: #dcfce7;
    --color-free-text: #166534;
    --color-booked: #fee2e2;
    --color-booked-text: #991b1b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text-main: #374151;
    --panel-border: #e5e7eb;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

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

.app-layout {
    display: block;
    min-height: 100vh;
    width: 100%;
    padding-left: 220px;
}

.sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid rgba(229, 231, 235, 0.9);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 30;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-group-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-group {
    padding: 14px 14px 15px;
    border-radius: 16px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.nav-group-title {
    padding: 0 0 6px;
    font-size: 0.98rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    color: #111827;
    text-align: center;
    line-height: 1.15;
}

.nav-group-media {
    border-color: rgba(37, 99, 235, 0.44);
    background: linear-gradient(180deg, #e0ecff 0%, #f8fbff 100%);
}

.nav-group-digitaitoja {
    border-color: rgba(37, 99, 235, 0.44);
    background: linear-gradient(180deg, #e0ecff 0%, #f8fbff 100%);
}

.nav-group-media .nav-group-title {
    color: #1d4ed8;
}

.nav-group-digitaitoja .nav-group-title {
    color: #1d4ed8;
}

.nav-group-media .nav-btn.active {
    background: #cfe0ff;
    border-color: #7fb0ff;
    color: #1d4ed8;
}

.nav-group-digitaitoja .nav-btn.active {
    background: #cfe0ff;
    border-color: #7fb0ff;
    color: #1d4ed8;
}

.nav-group-media .nav-btn:hover {
    background: #e9f1ff;
    border-color: #aecdff;
    color: #1d4ed8;
}

.nav-group-digitaitoja .nav-btn:hover {
    background: #e9f1ff;
    border-color: #aecdff;
    color: #1d4ed8;
}

.course-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1d4ed8;
    background: linear-gradient(180deg, #e7f0ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
    vertical-align: middle;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}
.course-badge--morning {
    color: #1d4ed8;
}
.course-badge--afternoon {
    color: #7c3aed;
    background: linear-gradient(180deg, #f0e8ff 0%, #e9d5ff 100%);
    border-color: #c4b5fd;
}
.badge-symbol,
.nav-btn-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1rem;
    flex: 0 0 auto;
}
.badge-text,
.nav-btn-label {
    white-space: nowrap;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease, color 0.18s ease;
}

.nav-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.nav-btn.active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.app-shell {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 16px 18px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.top-dashboard,
.student-manager {
    min-width: 0;
}

.top-dashboard > * {
    min-width: 0;
}

.panel {
    background: white;
    padding: 22px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(229, 231, 235, 0.6);
    width: 100%;
    min-width: 0;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-heading h2,
.panel-heading h3 {
    margin: 0;
    line-height: 1.1;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 0.92rem;
}

.week-edit-hint {
    display: none;
    text-align: center;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.95rem;
}

body.edit-mode .week-edit-hint {
    display: block;
}

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

.edit-toggle,
.move-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #4b5563;
}

.edit-toggle input,
.move-toggle input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.top-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.98fr);
    gap: 18px;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.grid-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.grid {
    display: grid;
    position: relative;
    grid-template-columns: 140px repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.header-day {
    text-align: center;
    font-weight: 700;
    color: #6b7280;
    padding-bottom: 5px;
    min-width: 0;
}

.row-group {
    display: contents;
}

.row-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding-right: 4px;
    border-radius: 8px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.18s ease;
}

body.edit-mode .row-label.row-draggable {
    cursor: grab;
}

body.edit-mode .row-group.row-dragging .row-label,
body.edit-mode .row-group.row-dragging .slot {
    opacity: 0.55;
}

body.edit-mode .row-group.row-dragging .row-label {
    cursor: grabbing;
}

body.edit-mode .row-label.row-drop-target {
    background: rgba(239, 246, 255, 0.42);
}

body.edit-mode .row-label.row-drop-before,
body.edit-mode .row-label.row-drop-after {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.20);
}


.row-label-name {
    flex: 1;
    min-width: 0;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-actions {
    display: none;
    gap: 6px;
    align-items: center;
    flex: 0 0 auto;
}

body.edit-mode .row-actions {
    display: inline-flex;
}

.row-edit-btn,
.row-delete-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #4b5563;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 0 0 auto;
}

.row-edit-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: var(--primary);
}

.row-delete-btn {
    color: #ef4444;
}

.row-delete-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.slot {
    height: var(--slot-height);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: box-shadow 0.12s ease, background-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
    border: 1px solid transparent;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 8px;
    min-width: 0;
}

.slot:hover {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.slot.free {
    background-color: var(--color-free);
    color: var(--color-free-text);
    border-color: #86efac;
}

.slot.booked {
    background-color: var(--color-booked);
    color: var(--color-booked-text);
    border-color: #fecaca;
}

.week-footer {
    display: none;
    justify-content: flex-end;
    margin-top: 14px;
}

body.edit-mode .week-footer {
    display: flex;
}

.map-section {
    display: flex;
    flex-direction: column;
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 600;
}

.map-controls label {
    color: #4b5563;
}

.map-controls select {
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    background: white;
}

.map-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 837 / 940;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    touch-action: none;
}

.map-wrapper.move-active {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 0 16px 4px rgba(37, 99, 235, 0.28);
}

.map-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.map-tooltip {
    position: absolute;
    z-index: 35;
    min-width: 150px;
    max-width: 190px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(209, 213, 219, 0.95);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.map-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.map-tooltip-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #111827;
}

.map-tooltip-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.day-chip {
    border-radius: 8px;
    padding: 6px 0;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
    user-select: none;
}

.day-chip.free {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.day-chip.booked {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.day-chip-day {
    letter-spacing: 0.02em;
}

.map-station {
    position: absolute;
    width: clamp(72px, 7vw, 96px);
    height: clamp(46px, 4.5vw, 58px);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px 6px;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
    border: 2px solid white;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    z-index: 10;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.35);
    user-select: none;
}

.map-station:hover {
    transform: scale(1.06);
    z-index: 20;
}

.map-station.station-highlight {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 4px 10px rgba(0, 0, 0, 0.28);
    transform: scale(1.06);
    z-index: 21;
}

.map-station.is-dragging {
    cursor: grabbing !important;
    transform: scale(1.12) !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--primary);
    z-index: 30;
}

.map-station.free {
    background: var(--color-free);
    color: var(--color-free-text);
}

.map-station.booked {
    background: var(--color-booked);
    color: var(--color-booked-text);
}

.station-title {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.station-name {
    font-size: 0.86rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
    text-overflow: ellipsis;
    line-height: 1;
    text-shadow: none;
}

.station-status-free {
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: none;
}

.calendar-highlight {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.55) !important;
    background-color: rgba(219, 234, 254, 0.78);
}

.row-label.calendar-highlight {
    background-color: rgba(219, 234, 254, 0.75);
}

.row-label.calendar-highlight .row-label-name {
    color: var(--primary);
}

.slot.calendar-highlight,
.map-station.station-highlight {
    border-color: rgba(37, 99, 235, 0.8);
}

.student-manager {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.student-manager.panel {
    padding: 16px 16px 14px;
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.student-manager input[type="text"],
.student-manager input[type="number"] {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    flex: 1 1 260px;
    font-size: 1rem;
    min-width: 0;
}

.btn {
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.12s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-small {
    padding: 9px 14px;
    font-size: 0.95rem;
}

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

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

.list-label {
    font-size: 0.88rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.student-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0 0;
}

.student-tag {
    background-color: #f9fafb;
    border: 1px solid var(--panel-border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
}

.delete-x {
    color: #ef4444;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.15rem;
    margin-left: 5px;
    line-height: 1;
}

.empty-list-msg {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 14px;
    width: 340px;
    max-width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.student-list-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.student-select-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
}

.student-select-btn:hover {
    background: #e5e7eb;
}

.customer-actions {
    margin-left: auto;
}

.student-manager .panel-heading {
    margin-bottom: 10px;
}

.student-manager .panel-subtitle {
    margin-top: 2px;
    font-size: 0.86rem;
}

.customer-actions .sort-control {
    gap: 6px;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-weight: 600;
    flex-wrap: wrap;
}

.sort-control span {
    white-space: nowrap;
}

.sort-control {
    font-size: 0.9rem;
}

.sort-control select {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font: inherit;
    color: #374151;
}

.customer-add-group {
    margin-bottom: 0;
}

.customer-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: #fff;
}

.customer-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
}

.customer-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f9fafb;
    color: #374151;
    text-align: left;
    font-size: 0.87rem;
    font-weight: 700;
    padding: 9px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.customer-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
    font-size: 0.92rem;
    line-height: 1.25;
}

.customer-table tbody tr:nth-child(even) {
    background: #fcfcfd;
}

.customer-table tbody tr:hover {
    background: #f8fbff;
}

.customer-row-stale {
    background: #fee2e2 !important;
}

.customer-row-stale:hover {
    background: #fecaca !important;
}

.customer-name-cell {
    font-weight: 700;
    color: #111827;
}

.customer-elapsed-cell {
    white-space: nowrap;
    font-weight: 600;
}

.customer-group-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.customer-actions-cell {
    width: 46px;
    text-align: right;
}

.customer-delete-btn {
    width: 24px;
    height: 24px;
}

.empty-table-cell {
    padding: 12px 12px !important;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
}


@media (max-width: 1200px) {
    .customer-actions {
        margin-left: 0;
    }

    .customer-table {
        min-width: 760px;
    }

    .app-layout {
        padding-left: 0;
    }

    .sidebar {
        width: 100%;
        position: static;
        left: auto;
        top: auto;
        height: auto;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid rgba(229, 231, 235, 0.9);
        flex-direction: row;
    }

    .sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
    }

    .nav-btn {
        flex: 1;
        min-height: 34px;
    }

    .nav-group {
        padding: 10px;
    }

    .top-dashboard {
        grid-template-columns: 1fr;
    }

    .student-manager .panel-heading {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 12px;
    }

    .sidebar {
        padding: 12px;
        gap: 8px;
        min-height: auto;
    }

    .sidebar-auth {
        margin-top: 10px;
    }

    .panel {
        padding: 16px;
    }

    .student-manager.panel {
        padding: 14px;
    }

    .grid {
        min-width: 700px;
    }

    .student-manager input[type="number"] {
        flex: 1 1 180px;
        max-width: none;
    }

    .map-tooltip {
        min-width: 140px;
        max-width: 160px;
    }

    .customer-table {
        min-width: 720px;
    }
}


.auth-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #4b5563;
    font-size: 0.95rem;
}

.sidebar-auth {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    flex-direction: column;
    align-items: stretch;
}

.auth-user {
    font-size: 0.92rem;
    line-height: 1.35;
    word-break: break-word;
}

.logout-btn {
    text-decoration: none;
    justify-content: center;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 440px);
    background: white;
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(229, 231, 235, 0.8);
    padding: 28px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
}

.login-subtitle {
    margin: 0 0 18px;
    color: #6b7280;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 10px;
}

.login-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: #374151;
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

.login-form input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

.login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

.login-alert, .login-hint {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.login-alert {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.login-hint {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.login-hint code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 900px) {
    .sidebar {
        min-height: auto;
    }

    .sidebar-auth {
        margin-top: 12px;
    }
}


/* Compact main content layout without changing font sizes */
:root {
    --slot-height: 34px;
}

.app-shell {
    width: min(100%, 1500px);
    padding: 14px;
    gap: 14px;
}

.top-dashboard {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 14px;
}

.left-column {
    gap: 14px;
}

.panel {
    padding: 16px;
    border-radius: 14px;
}

.panel-heading {
    margin-bottom: 12px;
}

.week-edit-hint {
    margin-bottom: 10px;
    padding: 8px 12px;
}

.panel-actions {
    gap: 8px;
}

.grid-wrap {
    overflow-x: hidden;
}

.grid {
    grid-template-columns: 126px repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.row-label {
    gap: 4px;
    padding-right: 2px;
}

.slot {
    padding: 0 6px;
    border-radius: 7px;
}

.map-controls {
    gap: 8px;
}

.map-controls select {
    padding: 7px 9px;
}

.map-wrapper {
    border-width: 1px;
    border-radius: 9px;
}

.map-station {
    width: clamp(64px, 6vw, 86px);
    height: clamp(42px, 4vw, 52px);
    padding: 3px 5px;
    border-radius: 7px;
}

.student-manager {
    gap: 8px;
}

.student-manager.panel {
    padding: 14px 14px 12px;
}

.student-manager .panel-heading {
    margin-bottom: 8px;
}

.input-group {
    gap: 8px;
}

.student-manager input[type="text"],
.student-manager input[type="number"] {
    padding: 9px 11px;
    flex: 1 1 240px;
}

.btn {
    padding: 9px 15px;
}

.customer-actions {
    align-self: flex-start;
}

.sort-control {
    gap: 6px;
}

.sort-control select {
    padding: 6px 9px;
}

.customer-table-wrap {
    overflow-x: hidden;
    border-radius: 10px;
}

.customer-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.customer-table thead th,
.customer-table tbody td {
    padding: 6px 9px;
}

.customer-table th,
.customer-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.customer-table th:nth-child(1),
.customer-table td:nth-child(1) {
    width: 23%;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
    width: 25%;
}

.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
    width: 21%;
}

.customer-table th:nth-child(4),
.customer-table td:nth-child(4) {
    width: 23%;
}

.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
    width: 42px;
}

.customer-group-pill {
    max-width: 100%;
    white-space: nowrap;
    line-height: 1.1;
    text-align: center;
}

.map-tooltip {
    min-width: 140px;
    max-width: 175px;
}

@media (max-width: 1200px) {
    .top-dashboard {
        grid-template-columns: 1fr;
    }

    .app-shell {
        width: min(100%, 1500px);
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 12px;
    }

    .panel {
        padding: 14px;
    }

    .student-manager.panel {
        padding: 12px;
    }

    .grid {
        min-width: 0;
    }

    .customer-table {
        min-width: 0;
    }
}


/* compact customer manager overrides */
.customer-table thead th,
.customer-table tbody td { padding-top: 6px; padding-bottom: 6px; }
.customer-table tbody tr { line-height: 1.1; }
.customer-table tbody td { padding-left: 9px; padding-right: 9px; }
.customer-row-stale { background: #fee2e2 !important; }
.customer-row-stale:hover { background: #fecaca !important; }
.customer-actions-cell { width: 42px; }
.customer-delete-btn { width: 22px; height: 22px; }
