body{
  padding-top:60px;
}

/* COMBINED HEADER */

.main-header{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  background:#fff;
  z-index:1000;
  padding:10px 24px;
  border-bottom:1px solid #ccc;
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:10px;
  box-shadow:0 2px 5px rgba(0,0,0,0.1);
}

.main-header {
  box-sizing: border-box;
  padding: 10px 32px;
}

.header-filter {
  padding-right: 10px;
}

.main-header.minimized{
  max-height:40px;
  padding:4px 16px;
}

.headerSection{
  display:flex;
  flex-direction:column;
  margin:5px;
}

#toggleHeader{
  padding:2px 12px;
  font-size:12px;
  border:1px solid #ccc;
  border-radius:4px;
  background:green;
  cursor:pointer;
}

  .hidden {
    display: none;
  }
  
/* FILTER HEADER INLINE FIXED */
.header-filter {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;      /* prevent stacking on desktop */
  align-items: center;
  gap: 8px;
  overflow-x: auto;       /* scroll if too wide */
  justify-content: center; /* center horizontally */
  padding-right: 15px;    /* add some margin from the right edge */
}

.header-filter label {
  white-space: nowrap;
  font-weight: 500;
  margin-right: 3px;
}

.header-filter select,
.header-filter input {
  padding: 4px 6px;
  font-size: 0.9em;
}

.header-filter button {
  padding: 4px 10px;
  font-size: 0.9em;
  cursor: pointer;
}

.header-filter #codeapptBalance {
  font-size: 0.8em;
  font-style: italic;
  color: #FFA500;
  margin-right: 10px;
}

/* RESPONSIVE: stack only on small screens */
@media (max-width: 768px) {
  .header-filter {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    justify-content: flex-start; /* align items to top on small screens */
    padding-right: 0;
  }

  .header-filter label,
  .header-filter select,
  .header-filter input,
  .header-filter button,
  .header-filter #codeapptBalance {
    width: 100%;
    margin-right: 0;
  }
}

/* SUMMARY LAYOUT */
.summary-wrapper {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.summary-left {
  flex: 1;
  min-width: 250px;
}

.summary-right {
  flex: 1;
  min-width: 250px;
}

.summary-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 6px;
}

.summary-section {
  margin-bottom: 10px;
}

.appt-item {
  margin-bottom: 6px;
  font-size: 13px;
}

.appt-item a {
  cursor: pointer;
  color: #007bff;
  text-decoration: underline;
}

/* ✅ MOBILE STACK */
@media (max-width: 768px) {
  .summary-wrapper {
    flex-direction: column;
  }
}

/* MAIN LAYOUT */

.login-container {
  width: 100%;
  max-width: 400px;          /* prevents full width */
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin: 100px auto;
}

.container{
  display:flex;
  height:100vh;
  gap:12px;
  padding:10px;
}


/* LEFT PANEL (FORM) */

.left-panel{
  width:50%;
  overflow-y:auto;
}

.left-panel input:disabled,
.left-panel select:disabled,
.left-panel textarea:disabled{
  background-color:#e0e0e0;
  color:#666;
}

/* RIGHT PANEL (TABLE) */

.right-panel{
  width:50%;
  display:flex;
  flex-direction:column;
}

/* TABLE SCROLL AREA */

.table-container{
  flex:1;
  overflow:auto;
  border:1px solid #ddd;
}

/* EXTRA STYLES */

.light-red{
  background-color:#fff0f0;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.summary-section {
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  max-height: 420px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto; /* prevent overflow issues */
  }

  .left-panel,
  .right-panel {
    width: 100%;
  }
}

@media (max-width: 768px) {

  /* hide filter section on mobile */
  .toggle-area {
    display: none;
  }

  /* keep only code section clean */
  .always-visible {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 5px;
  }

  /* header layout cleanup */
  .header-filter {
    flex-direction: column;
    align-items: stretch;
  }

  /* keep logout aligned nicely */
  .headerSection {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
  }
}


@media (max-width: 768px) {
  .main-header {
    position: relative;   /* removes fixed behavior */
    top: auto;
    left: auto;
    width: 100%;
  }

  body {
    padding-top: 0;      /* remove header offset on mobile */
  }
}