/*====================
Blok 1 — Layout Dashboard Mobile: mengatur jarak dan susunan utama dashboard pada layar HP.
======================*/
@media (max-width: 767px) {
  .dash-container {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    gap: 16px;
    margin: 0;
  }

  .dash-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dash-stat-card {
    min-width: 0;
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .dash-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .dash-stat-icon i {
    width: 18px;
    height: 18px;
  }

  .dash-stat-info {
    min-width: 0;
    gap: 2px;
  }

  .dash-stat-label {
    font-size: 11px;
    line-height: 1.3;
  }

  .dash-stat-value {
    font-size: 20px;
    letter-spacing: -0.3px;
  }

  .dash-section-block {
    width: 100%;
    min-width: 0;
  }

  .dash-section-heading {
    gap: 8px;
  }

  .dash-section-link {
    flex-shrink: 0;
    font-size: 11px;
  }
  .text-center {
    font-size: 10px;
  }
}
/*====================
Blok 2 — Welcome Mobile: menyesuaikan card selamat datang untuk layar HP.
======================*/

@media (max-width: 767px) {
  .dash-welcome {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 20px;
    border-radius: 18px;
  }

  .dash-welcome::after {
    top: -100px;
    right: -90px;
    width: 190px;
    height: 190px;
  }

  .dash-eyebrow {
    margin-bottom: 8px;
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .dash-welcome h2 {
    font-size: 21px;
    line-height: 1.35;
    letter-spacing: -0.5px;
  }

  .dash-welcome p {
    margin-top: 8px;
    font-size: 12px;
  }

  .dash-welcome-date {
    gap: 7px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12px;
  }
}

/*====================
Blok 3 — Kartu Absensi Mobile: memperjelas label, angka, dan ikon dalam kartu ringkas.
======================*/

@media (max-width: 767px) {
  .dash-attendance-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dash-attendance-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    min-height: 100px;
    padding: 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.035);
    transition: none;
  }

  .dash-attendance-card:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.035);
  }

  .dash-attendance-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .dash-attendance-icon svg {
    width: 15px;
    height: 15px;
  }

  .dash-attendance-card > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 0;
  }

  .dash-attendance-card span {
    max-width: 100%;
    color: var(--text-muted, #64748b);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: normal;
  }

  .dash-attendance-card strong {
    color: var(--text-main, #1e293b);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
  }
}

/*====================
Blok 4 — Planning Dashboard Mobile: menyesuaikan card utama agenda untuk layar HP.
======================*/
@media (max-width: 767px) {
  .dash-planning-card {
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
  }

  .dash-planning-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .dash-planning-icon svg {
    width: 19px;
    height: 19px;
  }

  .dash-planning-content {
    flex: 1;
    min-width: 0;
  }

  .dash-planning-content > strong {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .dash-planning-agenda-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .dash-planning-agenda-list > p {
    font-size: 12px;
  }

  .dash-agenda-item {
    gap: 8px;
    padding: 12px;
  }

  .dash-agenda-item > strong {
    font-size: 14px;
  }

  .dash-agenda-division {
    gap: 5px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .dash-agenda-division svg {
    width: 13px;
    height: 13px;
  }

  .dash-agenda-item > small {
    font-size: 11px;
  }

  .dash-planning-badge {
    display: none;
  }
  #dashPlanningPlaceholder {
    font-size: 12px;
  }
}

/*====================
Blok 5 — Section Heading Mobile: menjaga hierarki judul dan tombol aksi pada layar kecil.
======================*/

@media (max-width: 767px) {
  .dash-section-block {
    gap: 12px;
    margin-bottom: 22px;
  }

  .dash-section-heading {
    gap: 8px;
    align-items: center;
  }

  .dash-section-heading h3 {
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: -0.3px;
  }

  .dash-section-heading p {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.45;
  }

  .dash-section-link {
    padding: 7px 8px;
    gap: 4px;
    border-radius: 9px;
    font-size: 10px;
  }

  .dash-section-link svg {
    width: 12px;
    height: 12px;
  }
}

/*====================
Blok 6 — Aktivitas Terbaru Mobile: menampilkan aktivitas sebagai kartu ringkas dengan informasi yang mudah dibaca.
======================*/

@media (max-width: 767px) {
  .dash-activity-card {
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .dash-activity-card .table-container {
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .dash-activity-card .data-table {
    display: block;
    width: 100%;
    border: 0;
  }

  .dash-activity-card .data-table thead {
    display: none;
  }

  .dash-activity-card .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .dash-activity-card .data-table tbody tr.recent-activity-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name amount"
      "code type"
      "footer footer";
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    margin: 0;
    padding: 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.035);
  }

  .dash-activity-card .data-table tbody tr.recent-activity-row:hover {
    background: var(--bg-card, #ffffff);
  }

  .dash-activity-card .recent-activity-row td {
    display: block;
    min-width: 0;
    padding: 0;
    border: none;
    font-size: 12px;
    line-height: 1.45;
  }

  .dash-activity-card .activity-name {
    grid-area: name;
    color: var(--text-main, #1e293b);
    font-size: 13px !important;
    font-weight: 650;
    overflow-wrap: anywhere;
  }

  .dash-activity-card .activity-code {
    grid-area: code;
    color: var(--text-muted, #64748b);
    font-size: 11px !important;
    overflow-wrap: anywhere;
  }

  .dash-activity-card .activity-code code {
    padding: 0;
    color: inherit;
    background: transparent;
    font-size: 11px;
  }

  .dash-activity-card .activity-amount {
    grid-area: amount;
    color: var(--text-main, #1e293b);
    text-align: right;
    white-space: nowrap;
  }

  .dash-activity-card .activity-amount strong {
    font-size: 15px;
    font-weight: 700;
  }

  .dash-activity-card .activity-masuk .activity-amount {
    color: #15803d;
  }

  .dash-activity-card .activity-keluar .activity-amount {
    color: #dc2626;
  }

  .dash-activity-card .activity-perubahan .activity-amount {
    color: #475569;
  }

  .dash-activity-card .activity-type {
    grid-area: type;
    justify-self: end;
    text-align: right;
    font-size: 10px !important;
    font-weight: 600;
  }

  .dash-activity-card .activity-masuk .activity-type {
    color: #15803d;
  }

  .dash-activity-card .activity-keluar .activity-type {
    color: #dc2626;
  }

  .dash-activity-card .activity-perubahan .activity-type {
    color: #475569;
  }

  .dash-activity-card .activity-type::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 5px 1px 0;
    background: currentColor;
    border-radius: 50%;
  }

  .dash-activity-card .activity-date,
  .dash-activity-card .activity-operator {
    grid-area: footer;
    display: flex !important;
    align-items: center;
    color: var(--text-muted, #64748b);
    font-size: 10px !important;
  }

  .dash-activity-card .activity-date {
    display: none !important;
  }

  .dash-activity-card .activity-operator {
    display: none !important;
  }

  .dash-activity-card .recent-activity-row::after {
    content: "";
    grid-area: footer;
    align-self: stretch;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #e2e8f0);
  }

  .dash-activity-card .recent-activity-row .activity-date,
  .dash-activity-card .recent-activity-row .activity-operator {
    display: block !important;
    position: relative;
    z-index: 1;
    margin-top: 0;
  }

  .dash-activity-card .recent-activity-row .activity-date {
    grid-column: 1;
    grid-row: 3;
  }

  .dash-activity-card .recent-activity-row .activity-operator {
    grid-column: 2;
    grid-row: 3;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .dash-activity-card .data-table tbody tr:not(.recent-activity-row) {
    display: block;
    padding: 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
  }

  .dash-activity-card .data-table tbody tr:not(.recent-activity-row) td {
    display: block;
    padding: 0;
    border: none;
  }
}
