/*
 * Kebun Payroll - Responsive Readability
 * Desktop base: 14px
 * Mobile base : 16px
 * Tujuan      : nyaman digunakan pengguna lanjut usia tanpa merusak template.
 */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body,
button,
input,
select,
textarea,
table {
  font-size: 14px;
}

body {
  min-width: 320px;
  line-height: 1.55;
}

/* Identitas aplikasi */
.br-logo a {
  letter-spacing: .2px;
  font-size: 22px;
}
.br-logo .brand-mark { color: #17a2b8; }

/* Navigasi */
.sidebar-label {
  font-size: 12px !important;
  letter-spacing: .7px;
}
.br-sideleft-menu .br-menu-link {
  min-height: 50px;
  font-size: 15px !important;
}
.br-sideleft-menu .menu-item-icon {
  width: 30px;
  text-align: center;
}
.br-sideleft-menu .menu-item-label,
.br-sideleft-menu .sub-link {
  font-size: 15px !important;
  line-height: 1.45;
}
.br-sideleft-menu .sub-link {
  min-height: 42px;
  display: flex;
  align-items: center;
}

.br-mainpanel { min-height: 100vh; }

/* Judul halaman */
.app-page-title {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  color: #343a40;
  margin: 0;
}
.app-page-subtitle {
  color: #6f7782;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
}
.breadcrumb,
.breadcrumb-item {
  font-size: 13px !important;
}

/* Form */
label,
.form-control-label,
.col-form-label,
.custom-control-label,
.ckbox span,
.rdiobox span {
  font-size: 14px !important;
  line-height: 1.45;
}
.form-control,
.custom-select,
.input-group-text {
  min-height: 44px;
  font-size: 14px !important;
  line-height: 1.45;
}
textarea.form-control {
  min-height: 110px;
}
.form-control::placeholder {
  font-size: inherit;
  opacity: .72;
}

/* Tombol */
.btn {
  min-height: 42px;
  font-size: 14px !important;
  line-height: 1.35;
  padding: .62rem 1rem;
}
.btn-sm {
  min-height: 36px;
  font-size: 13px !important;
  padding: .42rem .72rem;
}

/* Checkbox agar mudah disentuh */
.permission-check,
input[type="checkbox"],
input[type="radio"] {
  width: 19px;
  height: 19px;
  cursor: pointer;
}
.ckbox span::before,
.ckbox span::after,
.rdiobox span::before,
.rdiobox span::after {
  width: 19px;
  height: 19px;
}

/* Card, tabel, dropdown */
.app-card {
  border: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.app-stat-number {
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
}
.table,
.app-table,
.permission-table {
  font-size: 14px !important;
}
.app-table th { white-space: nowrap; }
.table th,
.table td {
  line-height: 1.45;
  vertical-align: middle;
}
.permission-table th,
.permission-table td { vertical-align: middle; }
.permission-table .page-name {
  min-width: 220px;
  font-weight: 500;
}
.dropdown-menu,
.dropdown-item {
  font-size: 14px !important;
}
.logged-name {
  font-size: 14px !important;
}
.role-note { border-left: 4px solid #17a2b8; }

/* Utility template yang sebelumnya dapat turun ke 10-11px */
.tx-10,
.tx-11,
.tx-12,
small,
.small {
  font-size: 12px !important;
  line-height: 1.45;
}
.tx-13 { font-size: 13px !important; }

/* Login */
.login-shell {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef3f6 0%, #dfe8ed 100%);
}
.login-wrapper { width: 100%; max-width: 430px; }
.login-brand {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  color: #343a40;
}
.login-brand span { color: #17a2b8; }
.login-caption {
  color: #6f7782;
  font-size: 14px;
  line-height: 1.5;
}
.password-toggle { cursor: pointer; user-select: none; }

/* Fire alert */
.fire-modal-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
}
.fire-success { background: #e6f8ed; color: #20a05a; }
.fire-error { background: #fdeaea; color: #d64545; }
.fire-warning { background: #fff5df; color: #d28a00; }
.fire-info,
.fire-question { background: #e8f4fb; color: #1784b8; }

/* HP dan tablet sempit: dibuat lebih besar untuk pengguna lanjut usia */
@media (max-width: 767.98px) {
  html,
  body,
  button,
  input,
  select,
  textarea,
  table {
    font-size: 16px;
  }

  body { line-height: 1.6; }

  .br-logo a { font-size: 22px; }
  .sidebar-label { font-size: 13px !important; }
  .br-sideleft-menu .br-menu-link {
    min-height: 54px;
    font-size: 16px !important;
  }
  .br-sideleft-menu .menu-item-label,
  .br-sideleft-menu .sub-link {
    font-size: 16px !important;
  }
  .br-sideleft-menu .sub-link { min-height: 48px; }

  .br-mainpanel .br-pagebody {
    margin-left: 14px;
    margin-right: 14px;
  }
  .br-pagetitle {
    padding-left: 18px;
    padding-right: 18px;
  }
  .app-page-title { font-size: 22px; }
  .app-page-subtitle {
    font-size: 15px;
    line-height: 1.6;
  }
  .breadcrumb,
  .breadcrumb-item {
    font-size: 14px !important;
  }

  label,
  .form-control-label,
  .col-form-label,
  .custom-control-label,
  .ckbox span,
  .rdiobox span {
    font-size: 16px !important;
  }
  .form-control,
  .custom-select,
  .input-group-text {
    min-height: 50px;
    font-size: 16px !important;
  }
  .btn {
    min-height: 48px;
    font-size: 16px !important;
    padding: .7rem 1rem;
  }
  .btn-sm {
    min-height: 42px;
    font-size: 15px !important;
  }

  .table,
  .app-table,
  .permission-table {
    font-size: 15px !important;
  }
  .dropdown-menu,
  .dropdown-item,
  .logged-name {
    font-size: 15px !important;
  }

  .tx-10,
  .tx-11,
  .tx-12,
  .tx-13,
  small,
  .small {
    font-size: 14px !important;
  }

  .card-body { padding: 20px; }
  .table-responsive { border: 0; }
  .login-wrapper { max-width: 100%; }
  .login-brand { font-size: 28px; }
  .login-caption { font-size: 15px; }
}

/* HP sangat sempit */
@media (max-width: 359.98px) {
  .br-mainpanel .br-pagebody {
    margin-left: 10px;
    margin-right: 10px;
  }
  .card-body { padding: 16px; }
}

/* Master data CRUD */
.app-filter-actions {
  align-items: flex-end;
  padding-bottom: 0;
}
.app-form-actions {
  gap: 0;
}
.btn-detail-eye {
  min-width: 38px;
  min-height: 34px;
  padding: .35rem .6rem;
  font-size: 14px !important;
  line-height: 1;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.detail-grid > div {
  border: 1px solid #edf0f2;
  border-radius: 6px;
  padding: 14px 16px;
  background: #fbfcfd;
}
.detail-grid span {
  display: block;
  color: #7b8491;
  font-size: 12px;
  margin-bottom: 4px;
}
.detail-grid strong {
  display: block;
  color: #343a40;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.detail-grid .detail-wide {
  grid-column: 1 / -1;
}
.modal-action-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.modal-action-footer form {
  margin: 0;
}
.app-pagination {
  border-top: 1px solid #edf0f2;
}
.app-pagination .page-link {
  min-height: 34px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767.98px) {
  .app-filter-actions {
    margin-top: 4px;
  }
  .app-form-actions {
    flex-direction: column-reverse;
  }
  .app-form-actions .btn,
  .app-form-actions .btn + .btn {
    width: 100%;
    margin-left: 0 !important;
    margin-bottom: 8px;
  }
  .btn-detail-eye {
    min-width: 42px;
    min-height: 40px;
    font-size: 14px !important;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .detail-grid .detail-wide {
    grid-column: auto;
  }
  .detail-grid span {
    font-size: 14px;
  }
  .modal-action-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-action-footer .btn,
  .modal-action-footer form,
  .modal-action-footer form .btn {
    width: 100%;
  }
  .app-pagination .pagination {
    flex-wrap: wrap;
    gap: 4px;
  }

  .master-table,
  .master-table tbody,
  .master-table tr,
  .master-table td {
    display: block;
    width: 100%;
  }
  .master-table thead {
    display: none;
  }
  .master-table tbody {
    padding: 12px;
  }
  .master-table tbody tr {
    border: 1px solid #e4e8eb;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.035);
  }
  .master-table tbody tr:last-child {
    margin-bottom: 0;
  }
  .master-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 14px;
    border-top: 1px solid #edf0f2;
    text-align: right !important;
  }
  .master-table tbody td:first-child {
    border-top: 0;
  }
  .master-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    text-align: left;
    color: #6f7782;
    font-size: 14px;
    font-weight: 600;
  }
  .master-table tbody td[colspan] {
    display: block;
    text-align: center !important;
  }
  .master-table tbody td[colspan]::before {
    display: none;
  }
  .master-table tbody td.action-cell {
    align-items: center;
  }
  .master-table tbody td.action-cell .btn-detail-eye {
    margin-left: auto;
  }
}
.permission-group-row td {
  background: #f2f5f7;
  color: #4f5965;
  font-weight: 700;
  letter-spacing: .15px;
}
