/* ===== Dashboard polish: kalender + filter, kartu Akses Cepat, kartu profil =====
   Lapisan akhir setelah gaya kalender yang sudah terpasang. */

/* ---------- 1. Kalender ---------- */
.dashboard-page .dashboard-calendar::before { content: none; }
.dashboard-page .dashboard-activity > .dashboard-calendar { display: flex; flex-direction: column; overflow: visible; padding: 16px 18px; background: #fff; border-color: #e1e9f2; }
.dashboard-page .dashboard-calendar .panel-head { margin: 0; }

/* Pemilih bulan memakai dialog kalender yang sama dengan filter tanggal. */
.dashboard-page .dashboard-calendar-head { position: relative; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin: 12px 0 8px; padding: 0; border: 0; background: none; }
.dashboard-page .dashboard-calendar-filters,
.dashboard-page .dashboard-calendar-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dashboard-page .dashboard-calendar-filters .crm-range-picker { width: 240px; max-width: 100%; }
.dashboard-page .dashboard-calendar-filters .crm-date-trigger { display: flex; align-items: center; width: 100%; min-width: 0; height: 34px; min-height: 34px; padding: 0 9px; border: 1px solid #dce4ed; border-radius: 9px; background: #fff; color: #263a52; font-size: 13px; font-weight: 650; }
.dashboard-page .dashboard-calendar-filters .crm-date-trigger span { flex: 1; min-width: 0; white-space: nowrap; overflow: visible; text-align: left; }
.dashboard-page .dashboard-calendar-filters .crm-date-trigger:hover { border-color: #9cb8d4; }
.dashboard-page .dashboard-calendar-filters .crm-date-trigger:focus-visible { outline: 2px solid #1762bb; outline-offset: 2px; }
.dashboard-page .dashboard-calendar-nav button {
  display: inline-grid; place-items: center; height: 34px; min-width: 34px; padding: 0 8px;
  border: 1px solid #dce4ed; border-radius: 9px; background: #fff; color: #52647a;
  font-size: 13px; font-weight: 650; transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.dashboard-page .dashboard-calendar-nav button svg { width: 16px; height: 16px; }
.dashboard-page .dashboard-calendar-nav button:not(:disabled):hover { background: #eef5fc; border-color: #b7d0ea; color: #1762bb; }
.dashboard-page .dashboard-calendar-nav button:disabled { opacity: .5; cursor: default; }

/* Grid tanggal — logo K jadi watermark di tengah */
.dashboard-page .dashboard-calendar-grid { position: relative; isolation: isolate; flex: 1; align-content: center; gap: 2px; padding: 4px 0 0; }
.dashboard-page .dashboard-calendar-grid::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 55%;
  width: clamp(130px, 44%, 210px); aspect-ratio: 384 / 398; transform: translate(-50%, -50%);
  background: url('/legacy/images/logo-k.png') center / contain no-repeat;
  opacity: .13; pointer-events: none; user-select: none;
}
.dashboard-page .dashboard-calendar-grid b { min-height: 26px; background: none; border-radius: 0; color: #7a8ba0; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.dashboard-page .dashboard-calendar-grid span { min-height: 35px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #263a52; transition: background-color .18s ease, border-color .18s ease; }
.dashboard-page .dashboard-calendar-grid span:not(:empty):not(.today):hover { background: rgba(234, 244, 253, .85); border-color: #cfe2f4; }
.dashboard-page .dashboard-calendar-grid .weekend:not(.today) { color: #8394a8; }
.dashboard-page .dashboard-calendar-grid .today { color: #fff; font-weight: 800; border-color: transparent; background: linear-gradient(135deg, #1762bb, #2798dc); box-shadow: 0 4px 12px rgba(23, 98, 187, .28); }
.dashboard-page .dashboard-calendar-grid button { display: grid; place-items: center; min-height: 35px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #263a52; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dashboard-page .dashboard-calendar-grid button.weekend:not(.selected) { color: #8394a8; }
.dashboard-page .dashboard-calendar-grid button:not(.selected):hover { background: rgba(234, 244, 253, .85); border-color: #cfe2f4; }
.dashboard-page .dashboard-calendar-grid button.selected { color: #fff; font-weight: 800; background: linear-gradient(135deg, #1762bb, #2798dc); box-shadow: 0 4px 12px rgba(23, 98, 187, .28); }
.dashboard-page .dashboard-calendar-grid button.selected.weekend { color: #fff; }
.dashboard-page .dashboard-calendar-grid button.today:not(.selected) { color: #1762bb; border-color: #b7d0ea; }
.dashboard-page .dashboard-calendar-grid button:focus-visible { outline: 2px solid #1762bb; outline-offset: 2px; }
@media (max-width: 1100px) { .dashboard-page .dashboard-calendar-grid::before { width: clamp(120px, 34%, 190px); } }
@media (max-width: 430px) { .dashboard-page .dashboard-calendar-grid::before { width: 46%; } .dashboard-page .dashboard-calendar-grid span { min-height: 33px; } }

/* ---------- 2. Akses Cepat ---------- */
.dashboard-page .dashboard-activity .dashboard-shortcuts { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); gap: 18px; align-items: stretch; padding: 16px 18px; }
.dashboard-page .dashboard-activity .dashboard-shortcuts .panel-head { display: flex; align-items: center; margin: 0; padding-right: 18px; border-right: 1px solid #edf1f6; }
.dashboard-page .dashboard-activity .dashboard-shortcut-grid { container: shortcuts / inline-size; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; align-content: center; }
.dashboard-page .dashboard-activity .dashboard-shortcut-grid > .dashboard-shortcut:last-child:nth-child(odd) { grid-column: auto; }

.dashboard-page .dashboard-activity .dashboard-shortcut {
  position: relative; display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 16px; grid-template-rows: auto auto;
  align-items: center; align-content: center; column-gap: 12px; row-gap: 1px;
  min-height: 70px; padding: 12px 14px;
  border: 1px solid #e3ebf3; border-radius: 13px; background: #fff;
  box-shadow: 0 1px 2px rgba(24, 64, 112, .04);
  text-align: left; text-decoration: none; transform: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .2s ease;
}
.dashboard-page .dashboard-activity .dashboard-shortcut:nth-child(3n+1) { --tone-bg: #e9f2fc; --tone-fg: #1762bb; --tone-line: #b9d3ee; --tone-soft: #f6faff; }
.dashboard-page .dashboard-activity .dashboard-shortcut:nth-child(3n+2) { --tone-bg: #e8f6ef; --tone-fg: #248053; --tone-line: #b4dcc6; --tone-soft: #f6fbf8; }
.dashboard-page .dashboard-activity .dashboard-shortcut:nth-child(3n+3) { --tone-bg: #fdf1e4; --tone-fg: #a86923; --tone-line: #ecd0a5; --tone-soft: #fffaf3; }
.dashboard-page .dashboard-activity .dashboard-shortcut:hover { border-color: var(--tone-line); background: var(--tone-soft); box-shadow: 0 8px 20px rgba(24, 64, 112, .08); transform: translateY(-1px); }

.dashboard-page .dashboard-activity .dashboard-shortcut-icon { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; margin: 0; border: 0; border-radius: 12px; background: var(--tone-bg); color: var(--tone-fg); }
.dashboard-page .dashboard-activity .dashboard-shortcut-icon svg { display: block; width: 20px; height: 20px; margin: 0; color: inherit; stroke-width: 2; }
.dashboard-page .dashboard-activity .dashboard-shortcut strong { grid-column: 2; grid-row: 1; align-self: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 750; line-height: 1.25; color: #1c2b3e; }
.dashboard-page .dashboard-activity .dashboard-shortcut small { grid-column: 2; grid-row: 2; align-self: start; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; line-height: 1.25; color: #66788d; }
.dashboard-page .dashboard-activity .dashboard-shortcut .dashboard-shortcut-arrow { grid-column: 3; grid-row: 1 / 3; width: 16px; height: 16px; margin: 0; color: #9aabbd; transition: transform .2s ease, color .2s ease; }
.dashboard-page .dashboard-activity .dashboard-shortcut:hover .dashboard-shortcut-arrow { color: var(--tone-fg); transform: translateX(3px); }

/* Kartu menyesuaikan lebar areanya sendiri (bukan lebar layar) */
@container shortcuts (max-width: 679px) {
  .dashboard-page .dashboard-activity .dashboard-shortcut { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: start; justify-items: start; row-gap: 2px; min-height: 108px; padding: 14px; }
  .dashboard-page .dashboard-activity .dashboard-shortcut-icon { grid-column: 1; grid-row: 1; margin-bottom: 8px; }
  .dashboard-page .dashboard-activity .dashboard-shortcut strong { grid-column: 1; grid-row: 2; max-width: 100%; }
  .dashboard-page .dashboard-activity .dashboard-shortcut small { grid-column: 1; grid-row: 3; max-width: 100%; }
  .dashboard-page .dashboard-activity .dashboard-shortcut .dashboard-shortcut-arrow { position: absolute; top: 14px; right: 14px; }
}
@container shortcuts (max-width: 419px) {
  .dashboard-page .dashboard-activity .dashboard-shortcut { justify-items: center; align-content: center; min-height: 92px; padding: 12px 6px; text-align: center; }
  .dashboard-page .dashboard-activity .dashboard-shortcut-icon { margin-bottom: 6px; }
  .dashboard-page .dashboard-activity .dashboard-shortcut small,
  .dashboard-page .dashboard-activity .dashboard-shortcut .dashboard-shortcut-arrow { display: none; }
}
@media (max-width: 1240px) {
  .dashboard-page .dashboard-activity .dashboard-shortcuts { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-page .dashboard-activity .dashboard-shortcuts .panel-head { padding: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-page .dashboard-activity .dashboard-shortcut,
  .dashboard-page .dashboard-activity .dashboard-shortcut .dashboard-shortcut-arrow { transition-duration: .01ms; }
}

/* ---------- 3. Profil: tombol di topbar + kartu menu ---------- */
.app-shell .top-actions .profile .avatar { background: linear-gradient(135deg, #1762bb, #2798dc); color: #fff; font-weight: 800; letter-spacing: .02em; }
.app-shell .top-actions .profile > svg { color: #64758a; transition: transform .2s ease; }
.app-shell .top-actions .profile[aria-expanded="true"] > svg { transform: rotate(180deg); }

.app-shell .role-menu { padding: 0; overflow: hidden; border: 1px solid #dfe7f0; border-radius: 16px; background: #fff; box-shadow: 0 20px 48px rgba(18, 37, 63, .18), 0 2px 6px rgba(18, 37, 63, .05); }
.app-shell .role-menu .pcard { display: block; }
.app-shell .role-menu .pcard-top { padding: 18px 16px 16px; background: linear-gradient(160deg, #f2f8ff 0%, #e8f4fb 100%); border-bottom: 1px solid #e3ecf5; }
.app-shell .role-menu .pcard-id { display: flex; align-items: center; gap: 13px; min-width: 0; }
.app-shell .role-menu .pcard-avatar { position: relative; flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, #1762bb, #2798dc); color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(23, 98, 187, .25); }
.app-shell .role-menu .pcard-avatar::after { content: ''; position: absolute; right: -1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #2bb673; border: 2px solid #fff; }
.app-shell .role-menu .pcard-name { min-width: 0; }
.app-shell .role-menu .pcard-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 750; color: #16283e; }
.app-shell .role-menu .pcard-name small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #607087; }
.app-shell .role-menu .pcard-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.app-shell .role-menu .pcard-role { padding: 3px 10px; border: 1px solid #cfe0f2; border-radius: 999px; background: #fff; color: #4d6580; font-size: 13px; font-weight: 650; text-transform: capitalize; }
.app-shell .role-menu .pcard-role.primary { border-color: transparent; background: #1762bb; color: #fff; }
.app-shell .role-menu .pcard-body { padding: 8px 8px 4px; }
.app-shell .role-menu .pcard-foot { padding: 4px 8px 8px; }
.app-shell .role-menu .pcard-action { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 9px 10px; border: 0; border-radius: 11px; background: transparent; box-shadow: none; color: #26394d; font: inherit; font-size: 13px; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer; transition: background-color .18s ease; }
.app-shell .role-menu .pcard-action:hover { background: #f1f7fd; }
.app-shell .role-menu .pcard-action .pcard-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e9f2fc; color: #1762bb; }
.app-shell .role-menu .pcard-action .pcard-icon svg { width: 17px; height: 17px; }
.app-shell .role-menu .pcard-action .pcard-chevron { width: 15px; height: 15px; margin-left: auto; color: #8ba0b8; transition: transform .2s ease; }
.app-shell .role-menu .pcard-action:hover .pcard-chevron { transform: translateX(2px); color: #1762bb; }
.app-shell .role-menu .pcard-action.danger { color: #9d3a42; }
.app-shell .role-menu .pcard-action.danger .pcard-icon { background: #fdeeee; color: #b4414a; }
.app-shell .role-menu .pcard-action.danger:hover { background: #fff4f4; }
@media (prefers-reduced-motion: reduce) { .app-shell .role-menu .pcard-action, .app-shell .role-menu .pcard-chevron, .app-shell .top-actions .profile > svg { transition-duration: .01ms; } }
