/* Sakuin layout polish — follows Sneat theme-default, no gradients */

:root {
  --sakuin-border: rgba(67, 89, 113, 0.12);
  --sakuin-border-soft: rgba(67, 89, 113, 0.08);
  --sakuin-surface: #fff;
  --sakuin-page-bg: #f5f5f9;
}

/* ── Page shell ─────────────────────────────────────────────────────────── */
.content-wrapper {
  background-color: var(--sakuin-page-bg);
}

.container-p-y {
  padding-top: 1.25rem !important;
  padding-bottom: 2rem !important;
}

@media (max-width: 767.98px) {
  .container-p-y {
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
  }

  .container-xxl {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.layout-navbar {
  border: 1px solid var(--sakuin-border-soft);
  box-shadow: 0 1px 3px rgba(67, 89, 113, 0.06);
}

.layout-navbar .fw-semibold {
  font-size: 0.95rem;
}

@media (max-width: 575.98px) {
  .layout-navbar .fw-semibold {
    font-size: 0.85rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Page titles ────────────────────────────────────────────────────────── */
.page-header,
.content-wrapper > h4.fw-bold {
  margin-bottom: 1.25rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.page-header h4,
.content-wrapper > h4.fw-bold {
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.page-header .text-muted,
.content-wrapper > h4.fw-bold .text-muted {
  font-weight: 500 !important;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--sakuin-border);
  box-shadow: 0 1px 4px rgba(67, 89, 113, 0.05);
  border-radius: 0.75rem;
  overflow: hidden;
}

.card.border-primary {
  border-color: rgba(var(--bs-primary-rgb), 0.35) !important;
  background-color: rgba(var(--bs-primary-rgb), 0.04);
}

.card-header {
  padding: 1rem 1.25rem;
  background-color: transparent;
  border-bottom: 1px solid var(--sakuin-border-soft);
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

@media (max-width: 575.98px) {
  .card-body {
    padding: 1rem;
  }

  .card-header {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
}

/* Stat / metric tiles */
.metric-card .avatar {
  width: 2.5rem;
  height: 2.5rem;
}

.metric-card .card-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin-bottom: 0.25rem;
}

.metric-card small {
  font-size: 0.8rem;
}

/* ── Dashboard sections ─────────────────────────────────────────────────── */
.dashboard-section {
  margin-bottom: 1.5rem;
}

.dashboard-welcome img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 575.98px) {
  .dashboard-welcome .card-body {
    text-align: center;
  }

  .dashboard-welcome img {
    max-height: 120px;
  }
}

/* Notice / banner blocks */
.notice-card {
  border-left: 4px solid var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.notice-card .card-body {
  padding: 1rem 1.25rem;
}

/* Push notification banner */
.push-banner {
  background-color: rgba(var(--bs-success-rgb), 0.12);
  border: 1px solid rgba(var(--bs-success-rgb), 0.25);
  border-radius: 0.75rem;
}

.push-banner.is-active {
  background-color: rgba(var(--bs-success-rgb), 0.14);
}

.push-banner.is-denied {
  background-color: rgba(var(--bs-secondary-rgb), 0.1);
  border-color: rgba(var(--bs-secondary-rgb), 0.2);
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-page {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.form-page .card-header + .card-header {
  border-top: 1px solid var(--sakuin-border-soft);
}

.form-page .notice-text {
  font-size: 0.875rem;
  color: var(--bs-secondary);
  margin: 0;
  padding: 0.75rem 1.25rem;
  background-color: rgba(var(--bs-warning-rgb), 0.08);
  border-bottom: 1px solid var(--sakuin-border-soft);
}

.form-actions .btn {
  min-height: 2.75rem;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-responsive {
  border-radius: 0 0 0.75rem 0.75rem;
}

.table > :not(caption) > * > * {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bs-secondary);
  background-color: rgba(67, 89, 113, 0.04);
  border-bottom-width: 1px;
}

@media (max-width: 767.98px) {
  .table-mobile-stack thead {
    display: none;
  }

  .table-mobile-stack tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    border: 1px solid var(--sakuin-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    background: var(--sakuin-surface);
  }

  .table-mobile-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border: 0;
    text-align: right;
  }

  .table-mobile-stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--bs-secondary);
    text-align: left;
    flex-shrink: 0;
  }

  .table-mobile-stack tbody td[data-label="Aksi"] {
    flex-direction: column;
    align-items: stretch;
  }

  .table-mobile-stack tbody td[data-label="Aksi"]::before {
    margin-bottom: 0.25rem;
  }

  .table-mobile-stack tbody td:last-child {
    border-bottom: 0;
  }
}

/* DataTables mobile */
@media (max-width: 767.98px) {
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: left;
    margin-bottom: 0.75rem;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 0.35rem;
  }
}

/* ── Buttons & actions ─────────────────────────────────────────────────── */
.btn-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-group-actions .btn {
  flex: 1 1 auto;
}

@media (max-width: 575.98px) {
  .btn-group-actions .btn {
    flex: 1 1 100%;
  }

  .d-flex.gap-2:not(.btn-group-actions) {
    flex-direction: column;
  }

  .d-flex.gap-2:not(.btn-group-actions) .btn {
    width: 100%;
  }
}

/* ── Admin settings grid ─────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .admin-settings-side {
    margin-top: 1rem;
  }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.content-footer.footer {
  border-top: 1px solid var(--sakuin-border-soft);
  background-color: var(--sakuin-surface) !important;
}

/* ── Misc utilities ─────────────────────────────────────────────────────── */
.g-section {
  --bs-gutter-y: 1.25rem;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
