
/*====================
Blok 1 — Card Mobile Agenda: mengubah tabel agenda menjadi kartu di HP, termasuk judul, deskripsi, tanggal, waktu, dan tombol aksi.
======================*/
@media (max-width: 768px) {
  #kegiatanTableBody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .table-container:has(#kegiatanTableBody) {
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .table-container:has(#kegiatanTableBody) .data-table {
    display: block;
    width: 100%;
  }

  .table-container:has(#kegiatanTableBody) .data-table thead {
    display: none;
  }

  .table-container:has(#kegiatanTableBody) .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .kegiatan-table-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title action"
      "description description"
      "date date"
      "time time";
    gap: 8px 12px;
    width: 100%;
    padding: 15px 16px 15px 18px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
  }

  .kegiatan-table-row:hover {
    background: var(--bg-card, #ffffff);
  }

  .kegiatan-table-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    background: var(--primary, #2563eb);
    border-radius: 0 4px 4px 0;
  }

  .kegiatan-col-no {
    display: none;
  }

  .kegiatan-table-row td {
    min-width: 0;
    padding: 0 !important;
    border: none;
  }

  .kegiatan-col-title {
    grid-area: title;
    align-self: center;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main, #1e293b);
    overflow-wrap: anywhere;
  }

  .kegiatan-col-title strong {
    font-weight: 600;
  }

  .kegiatan-col-description {
    grid-area: description;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .kegiatan-col-description::before {
    content: "Deskripsi";
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-main, #475569);
  }

  .kegiatan-col-date {
    grid-area: date;
    padding-top: 7px !important;
    border-top: 1px solid var(--border-color, #e2e8f0) !important;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-main, #334155);
  }

  .kegiatan-col-date::before {
    content: "Tanggal";
    display: inline-block;
    width: 62px;
    color: var(--text-muted, #64748b);
  }

  .kegiatan-col-time {
    grid-area: time;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-main, #334155);
  }

  .kegiatan-col-time::before {
    content: "Waktu";
    display: inline-block;
    width: 62px;
    color: var(--text-muted, #64748b);
  }

  .kegiatan-col-action {
    grid-area: action;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 4px;
  }

  .kegiatan-col-action .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
  }

  .kegiatan-col-action .btn-action svg {
    width: 16px;
    height: 16px;
  }

  #kegiatanTableBody tr:not(.kegiatan-table-row) {
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  #kegiatanTableBody tr:not(.kegiatan-table-row) td {
    display: block;
    padding: 2rem 1rem !important;
    border: none;
    text-align: center;
  }
}



/*====================
Blok 2 — Card Agenda Hari Ini Mobile: menyusun agenda dalam dua kolom dengan jarak dan pemisah yang rapi.
======================*/
@media (max-width: 768px) {
  .agenda-today-card {
    padding: 16px;
    border-radius: 14px;
  }

  .agenda-today-header {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }

  .agenda-today-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  .agenda-today-label {
    font-size: 14px;
    line-height: 1.5;
  }

  .agenda-today-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 0;
  }

  .agenda-today-empty {
    grid-column: 1 / -1;
    padding: 22px 12px;
    text-align: center;
    border: 1px dashed var(--border-color, #e2e8f0);
    border-radius: 12px;
  }

  .agenda-today-empty p {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.5;
  }

  .agenda-today-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-card, #ffffff);
    overflow-wrap: anywhere;
  }

  .agenda-today-item-time {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    font-size: 10px;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
    overflow-wrap: anywhere;
  }

  .agenda-today-item-time svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
  }

  .agenda-today-item-info {
    min-width: 0;
  }


  .agenda-today-item-info h4 {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-main, #1e293b);
    overflow-wrap: anywhere;
  }

  .agenda-today-item-info h4::before {
    content: "";
    width: 4px;
    min-width: 4px;
    height: 16px;
    margin-top: 2px;
    border-radius: 4px;
    background: var(--primary, #2563eb);
  }

  .agenda-today-item-info p {
    position: relative;
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-muted, #f8fafc);
    font-size: 11px;
    line-height: 1.65;
    color: var(--text-muted, #64748b);
    overflow-wrap: anywhere;
    white-space: normal;
  }

}

@media (max-width: 380px) {
  .agenda-today-content {
    grid-template-columns: minmax(0, 1fr);
  }
}

/*====================
Blok 3 — Toolbar Histori Agenda Mobile: menyusun pencarian, filter tanggal, dan tombol reset secara vertikal.
======================*/
@media (max-width: 768px) {
  .agenda-history-section {
    min-width: 0;
  }

  .agenda-history-header {
    margin-bottom: 12px;
  }

  .agenda-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }

  .agenda-search,
  .agenda-filter {
    width: 100%;
    min-width: 0;
  }

  .agenda-search input,
  .agenda-filter input,
  .agenda-filter select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 13px;
  }

  #btnResetAgendaFilter {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }
}

/*====================
Blok 4 — Label Divisi Agenda Mobile: membedakan informasi divisi dari judul dan deskripsi agenda.
======================*/
@media (max-width: 768px) {
  .agenda-today-item-division {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    max-width: 100%;
    margin-top: 10px;
    padding: 5px 8px;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .agenda-today-item-division svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
  }
}


/*====================
Blok 5 — Label Divisi Histori Agenda Mobile: menampilkan divisi sebagai badge ringkas di bawah judul kegiatan.
======================*/
@media (max-width: 768px) {
  .kegiatan-item-division {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-top: 6px;
    padding: 4px 7px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
}
