  :root {
    --primary: #2c5282;
    --primary-dark: #1a365d;
    --accent: #ed8936;
    --bg: #ffffff;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #cccccc;
    --shadow: rgba(0, 0, 0, 0.1);
  
    --h9-orange: #FF9900;
    --h9-blue: #4A85E9;
  }
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
   body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: var(--text);
  }
   .container {
    max-width: 100%;
    margin: 0 auto;
  }
   /* Rom-navigasjon - skjules ved nedscroll, vises ved oppscroll */
  .room-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
  }
   .room-nav.hidden {
    transform: translateY(-100%);
  }
   .room-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
   .room-tab {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
  }
 
  .room-teachers {
    display: flex;
    gap: 2px;
    margin-left: auto;
  }
 
  .teacher-avatar-wrapper {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
 
  .teacher-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
  }
 
  .teacher-avatar.inactive {
    filter: grayscale(100%) brightness(0.9);
    opacity: 0.8;
  }
   .room-tab.active {
    outline: 3px solid var(--primary);
    outline-offset: -5px;
    box-shadow: 0 0 0 1px var(--primary) inset;
  }
   /* Elevkort container - responsivt grid som gammel versjon */
  .students-grid {
    padding: 0 6px;
    display: block;
    width: 100%;
  }
   .students-grid::after {
    content: "";
    display: table;
    clear: both;
  }
   /* Elevkort - responsive som i gammel versjon */
  .student-card {
    padding: 6px 6px;
    float: left;
    width: 9.99999%;
    box-sizing: border-box;
  }
   @media only screen and (max-width: 1080px) {
    .student-card {
      width: 24.99999%;
      margin: 6px 0;
    }
  }
   @media only screen and (max-width: 500px) {
    .student-card {
      width: 50%;
    }
  }
   .gallery {
    border: 2px solid #ccc;
    background: white;
    cursor: pointer;
    overflow: hidden;
  }
   .student-photo {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4 / 6;
    object-fit: cover;
    object-position: 50% 25%;
  }
   .student-name {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    background: white;
  }
   /* Status-farger for navneboks - GAMMEL LOGIKK */
  /* Grå for elever uten LV eller på pause */
  .student-card[data-status="not-active"] .student-name {
    color: darkgray;
  }
   .student-card[data-status="not-active"] .student-photo {
    filter: grayscale(100%) opacity(40%);
  }
   /* Blå for elever som ikke har blitt besøkt i dag */
  .student-card[data-status="not-visited"] .student-name {
    background: deepskyblue;
    color: white;
  }
   /* Rød for tidsbot (mer enn 15 min siden besøk) */
  .student-card[data-status="timeout"] .student-name {
    background: red;
    color: white;
  }
   /* Lyserød for tidsbot (mindre enn 15 min siden besøk) */
  .student-card[data-status="timeout-recent"] .student-name {
    background: lightpink;
    color: black;
  }

   /* Modal for vurdering */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
  }
   .modal-overlay.active {
    display: flex;
  }
   .modal {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
  }
   @keyframes modalSlideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
   .modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
  }
   .modal-student-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
  }
 
  .modal-teachers-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
  }
 
  .modal-teachers-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
  }
 
  .modal-teachers-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 200px;
    justify-content: flex-end;
  }
 
  .modal-teacher-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    display: block;
  }
 
  .modal-teacher-avatar-wrapper {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
 
  .modal-teacher-avatar-wrapper::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 3px solid;
  }
 
  /* Farger for ulike visit-typer */
  .visit-god_morgen::before { border-color: #3b82f6; }  /* Blå */
  .visit-thumbs_up::before { border-color: #22c55e; }   /* Grønn */
  .visit-not_found::before { border-color: #dc2626; }   /* Knallrød */
  .visit-other::before { border-color: #f97316; }       /* Oransje-rød */
  .visit-not_looking::before { border-color: #f97316; } /* Oransje-rød */
  .visit-noise::before { border-color: #f97316; }       /* Oransje-rød */
  .visit-phone::before { border-color: #f97316; }       /* Oransje-rød */
  .visit-off_task::before { border-color: #f97316; }    /* Oransje-rød */
  .visit-prokrastinering::before { border-color: #f97316; } /* Oransje-rød */
   .modal-student-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 25%;
    border: 3px solid var(--primary);
  }
   .modal-student-info h2 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
  }
   .modal-student-info p {
    color: var(--text-light);
    font-size: 0.9rem;
  }
   .modal-body {
    padding: 1.5rem;
  }
   .action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 100px));
    gap: 0.75rem;
    justify-content: center;
  }
   .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
    font-size: 0.75rem;
    font-weight: 600;
    width: 100px;
  }
   .action-btn:hover:not(:disabled) {
    border-color: var(--primary);
  }
   .action-btn:disabled {
    cursor: not-allowed;
    opacity: 1;
    border-color: #ccc !important;
    color: #999 !important;
  }
   .action-btn:disabled img {
    filter: grayscale(100%) opacity(40%);
  }
   .action-btn.positive {
    border-color: #48bb78;
    color: #48bb78;
  }
   .action-btn.positive:hover:not(:disabled) {
    border-color: #48bb78;
  }
 
  .action-btn.god-morgen {
    border-color: deepskyblue;
    color: deepskyblue;
  }
   .action-btn.god-morgen:hover:not(:disabled) {
    border-color: deepskyblue;
  }
   .action-btn.negative {
    border-color: #ed8936;
    color: #ed8936;
  }
   .action-btn.negative:hover:not(:disabled) {
    border-color: #ed8936;
  }
   .action-btn.timeout {
    border-color: #f56565;
    color: #f56565;
  }
   .action-btn.timeout:hover:not(:disabled) {
    border-color: #f56565;
  }
   .action-btn img {
    width: 80px;
    height: 80px;
    object-fit: contain;
  }
   .close-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    border: none;
    background: var(--border);
    color: var(--text);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }
   .close-btn:hover {
    background: var(--text-light);
    color: white;
  }
   /* Loading state - H9 farger */
  .loading {
    text-align: center;
    padding: 3rem;
    color: var(--text);
    font-size: 1.1rem;
  }
   .spinner {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border: 16px solid #f3f3f3;
    border-top: 16px solid var(--h9-orange);
    border-bottom: 16px solid var(--h9-blue);
    border-radius: 50%;
    animation: spin 3s linear infinite;
  }
   @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
   /* Empty state */
  .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    margin: 1rem;
  }
   .empty-state h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
  }
   .empty-state p {
    color: var(--text-light);
  }
 
  /* KUL PÅLOGGINGSSIDE */
  .loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
  }
 
  .loading-screen.hidden {
    display: none;
  }
 
  .login-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--h9-blue) 0%, var(--h9-orange) 100%);
    align-items: center;
    justify-content: center;
    z-index: 9998;
  }
 
  .login-screen.active {
    display: flex;
  }
 
  .login-box {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
  }
 
  .login-box h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
  }
 
  .login-box p {
    color: var(--text-light);
    margin-bottom: 2rem;
  }
 
  .google-signin-btn {
    background: white;
    border: 2px solid #ddd;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    font-weight: 500;
  }
 
  .google-signin-btn:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
 
  .google-icon {
    width: 20px;
    height: 20px;
  }
 
  .error-message {
    display: none;
    background: #fee;
    color: #c00;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
  }
 
  .error-message.active {
    display: block;
  }

  .student-room {
    padding: 3px 8px 6px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
  }

  /* ITO-modal */
  .ito-radio-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .ito-radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    padding: 0.6rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
  }

  .ito-radio-item:has(input:checked) {
    border-color: var(--primary);
    background: #ebf4ff;
  }

  .ito-timer-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
  }

  .ito-start-btn, .ito-stop-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
  }

  .ito-start-btn { background: #48bb78; color: white; }
  .ito-stop-btn  { background: #f56565; color: white; }

  .ito-start-btn:disabled, .ito-stop-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
  }

  .ito-timer-display {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
  }

.update-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.update-overlay-box {
  background-color: #fff;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.update-overlay-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #222;
}

.update-overlay-text {
  font-size: 14px;
  color: #555;
  margin-bottom: 24px;
}

.update-overlay-button {
  padding: 12px 32px;
  background-color: #2c5282;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.update-overlay-button:hover {
  background-color: #1a365d;
}
