    :root {
      --primary: #9d2235;
      --primary-hover: #e5b102;
      --bg-color: #0f172a;
      --card-bg: #1e293b;
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --border-color: #334155;
      --error-color: #ef4444;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }

    body {
      background-color: var(--bg-color);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      padding: 3rem 1rem;
    }

    .container {
      background: var(--card-bg);
      width: 100%;
      max-width: 800px;
      border-radius: 1rem;
      padding: 2.5rem;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
      border: 1px solid var(--border-color);
      position: relative;
    }

    h1 {
      font-size: 1.875rem;
      font-weight: 700;
      margin-bottom: 2rem;
      color: var(--primary);
      
      
      text-align: center;
    }

    .form-group {
      margin-bottom: 1.5rem;
    }

    label { color: #ffc503;
      display: block;
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--text-muted);
      margin-bottom: 0.5rem;
    }

    input,
    select {
      width: 100%;
      padding: 0.75rem 1rem;
      background-color: rgba(15, 23, 42, 0.6);
      border: 1px solid var(--border-color);
      border-radius: 0.5rem;
      color: var(--text-main);
      font-size: 1rem;
      transition: all 0.2s ease;
      appearance: none;
      cursor: pointer;
    }

    select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 1rem center;
      background-size: 1.25rem;
      padding-right: 2.5rem;
    }

    input[type="text"],
    input[type="time"],
    input[type="number"] {
      cursor: text;
    }

    select option {
      background-color: var(--card-bg);
      color: var(--text-main);
    }

    input:focus,
    select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(157, 34, 53, 0.2);
    }

    input:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      background-color: rgba(0, 0, 0, 0.2);
      border-style: dashed;
      color: var(--text-muted);
    }

    input::placeholder {
      color: #475569;
    }

    /* Custom Select Styling */
    .custom-select-container {
      position: relative;
      width: 100%;
    }

    .custom-select-trigger {
      width: 100%;
      padding: 0.75rem 1rem;
      background-color: rgba(15, 23, 42, 0.6);
      border: 1px solid var(--border-color);
      border-radius: 0.5rem;
      color: var(--text-main);
      font-size: 1rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .custom-select-trigger:hover {
      border-color: var(--primary);
    }

    .custom-select-trigger.active {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(157, 34, 53, 0.2);
    }

    .custom-select-options {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background-color: var(--card-bg);
      border: 1px solid var(--border-color);
      border-radius: 0.5rem;
      margin-top: 0.5rem;
      max-height: 200px;
      overflow-y: auto;
      z-index: 50;
      display: none;
      box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    }

    .custom-select-options.show {
      display: block;
      animation: fadeIn 0.15s ease-out;
    }

    .custom-option {
      padding: 0.75rem 1rem;
      cursor: pointer;
      transition: background-color 0.2s;
      color: var(--text-main);
    }

    .custom-option:hover {
      background-color: var(--primary); color: #000; font-weight: 700;
    }

    .custom-option.selected {
      background-color: rgba(157, 34, 53, 0.2);
      color: var(--primary);
    }

    .arrow-icon {
      width: 1.25rem;
      height: 1.25rem;
      stroke: var(--text-muted);
      transition: transform 0.2s ease;
    }

    .custom-select-trigger.active .arrow-icon {
      transform: rotate(180deg);
    }

    .class-inputs {
      display: grid;
      grid-template-columns: 1fr 2fr 1.2fr auto;
      gap: 1rem;
      align-items: flex-end;
      margin-bottom: 1.5rem;
    }

    button.btn {
      background-color: var(--primary); color: #000; font-weight: 700;
      color: white;
      border: none;
      padding: 0.75rem 1.5rem;
      border-radius: 0.5rem;
      font-weight: 600;
      font-size: 1rem;
      cursor: pointer;
      transition: background-color 0.2s, transform 0.1s;
      height: 46px;
    }

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

    .submit-btn {
      background-color: var(--primary) !important;
      color: white !important;
      font-weight: 600 !important;
    }

    .submit-btn:hover {
      background-color: #ffc503 !important;
      color: black !important;
    }

    button.btn:active {
      transform: scale(0.98);
    }

    .tags-container {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      min-height: 50px;
      padding: 1rem;
      background-color: rgba(15, 23, 42, 0.4);
      border: 1px dashed var(--border-color);
      border-radius: 0.5rem;
    }

    .tag {
      background: var(--primary); color: #000; font-weight: 700, rgba(255, 197, 3, 0.2));
      border: 1px solid rgba(157, 34, 53, 0.3);
      padding: 0.5rem 0.875rem;
      border-radius: 9999px;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.875rem;
      animation: fadeIn 0.3s ease-out;
    }

    .tag-id {
      font-weight: 700;
      color: #9d2235;
    }

    .tag-name {
      color: var(--text-main);
    }

    .remove-tag {
      background: none;
      border: none;
      color: #ef4444;
      cursor: pointer;
      font-size: 1.25rem;
      line-height: 1;
      padding: 0 0.25rem;
      margin-left: 0.25rem;
      transition: transform 0.2s ease;
    }

    .remove-tag:hover {
      transform: scale(1.2);
    }

    .empty-state {
      color: #475569;
      font-size: 0.875rem;
      margin: auto;
      user-select: none;
    }

    /* Scroll container — keeps calendar inside the form card on mobile */
    .calendar-scroll-wrapper {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border-radius: 0.5rem;
    }

    /* Block Calendar Styles */
    .calendar-wrapper {
      position: relative;
      background-color: #0f172a;
      border: 1px solid var(--border-color);
      border-radius: 0.5rem;
      min-width: 480px;
      display: flex;
      align-items: stretch;  /* children fill height driven by hour-rows */
      user-select: none;
      margin-bottom: 1rem;
    }

    .time-labels {
      width: 70px;
      align-self: stretch;   /* fills height set by grid columns */
      border-right: 1px solid var(--border-color);
      position: relative;
      background-color: var(--card-bg);
      z-index: 2;
      border-radius: 0.5rem 0 0 0.5rem;
    }

    .time-label { color: #ffc503;
      position: absolute;
      right: 0.5rem;
      font-size: 0.75rem;
      color: var(--text-muted);
      transform: translateY(-50%);
    }

    .calendar-grid {
      flex-grow: 1;
      position: relative;
      align-self: stretch;   /* fills height from hour-row content */
      cursor: crosshair;
      overflow: hidden;
      border-radius: 0 0.5rem 0.5rem 0;
    }

    .weekly-wrapper .time-labels {
      border-radius: 0.5rem 0 0 0.5rem;
    }

    .day-column {
      flex: 1;
      min-width: 0;
      border-left: 1px solid var(--border-color);
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .day-header {
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      font-size: 0.875rem;
      border-bottom: 1px solid var(--border-color);
      color: var(--text-main);
      background-color: var(--card-bg);
    }

    .weekly-grid {
      border-radius: 0;
    }

    .hour-row {
      height: 60px;
      border-bottom: 1px solid var(--border-color);
      box-sizing: border-box;
      width: 100%;
    }

    .hour-row:last-child {
      border-bottom: none;
    }

    .schedule-tile {
      position: absolute;
      left: 10px;
      right: 10px;
      background-color: rgba(157, 34, 53, 0.4);
      border: 2px solid var(--primary);
      border-radius: 6px;
      cursor: pointer;
      transition: background-color 0.1s, transform 0.1s;
      display: flex;
      flex-direction: column;
      padding: 4px 8px;
      overflow: hidden;
      z-index: 10;
    }

    .schedule-tile:hover {
      background-color: rgba(157, 34, 53, 0.6);
      transform: scale(1.01);
    }

    .schedule-tile.ghost {
      background-color: rgba(157, 34, 53, 0.2);
      border: 2px dashed rgba(157, 34, 53, 0.5);
      pointer-events: none;
      z-index: 9;
    }

    .tile-time {
      font-size: 0.75rem;
      font-weight: bold;
      color: #fff;
      pointer-events: none;
    }

    .tile-info {
      font-size: 0.7rem;
      color: #cbd5e1;
      pointer-events: none;
      margin-top: 2px;
      line-height: 1.2;
    }

    .resize-handle {
      position: absolute;
      left: 0;
      right: 0;
      height: 6px;
      cursor: ns-resize;
      z-index: 15;
    }

    .resize-handle.top {
      top: 0;
    }

    .resize-handle.bottom {
      bottom: 0;
    }

    /* Modal Styles */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(4px);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 100;
    }

    .modal-content {
      background: var(--card-bg);
      width: 100%;
      max-width: 400px;
      border-radius: 1rem;
      padding: 2rem;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
      border: 1px solid var(--border-color);
      animation: fadeIn 0.2s ease-out;
    }

    .modal-content h2 {
      margin-bottom: 1.5rem;
      font-size: 1.25rem;
    }

    .toggle-tag {
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid var(--border-color);
      padding: 0.5rem 0.875rem;
      border-radius: 9999px;
      font-size: 0.875rem;
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
    }

    .toggle-tag.active {
      background: var(--primary); color: #000; font-weight: 700, rgba(255, 197, 3, 0.5));
      border-color: var(--primary);
      color: #fff;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    /* ─── Mobile Responsive ─── */
    @media (max-width: 640px) {
      body { padding: 1rem 0.5rem; }

      .container {
        padding: 1.25rem 1rem;
        border-radius: 0.75rem;
      }

      h1 { font-size: 1.35rem; margin-bottom: 1.25rem; }

      /* Stack all grid inputs to single column */
      .class-inputs {
        grid-template-columns: 1fr !important;
      }

      /* Full-width Add Class button */
      #addClassBtn {
        width: 100%;
        height: auto;
        padding: 0.75rem;
      }

      /* Wrap calendar in a horizontal scroll container */
      .form-group > div > .calendar-wrapper,
      .form-group .calendar-wrapper {
        overflow-x: auto !important;
      }

      /* Keep the weekly grid at a minimum width so columns are usable */
      .weekly-wrapper {
        min-width: 500px;
      }

      .day-header {
        font-size: 0.7rem;
      }

      .time-labels { width: 50px; }

      /* Larger touch targets for resize handles */
      .resize-handle { height: 14px; }

      .schedule-tile { left: 3px; right: 3px; }

      .tile-time { font-size: 0.65rem; }

      /* Modal fills screen */
      .modal-content {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
        padding: 1.25rem;
        border-radius: 0.75rem;
      }
    }
  </style>
