/* =====================================================================
   DKPRINT - Core stylesheet
   Modern blue/indigo SaaS theme, AdminLTE-style dashboard, responsive.
   ===================================================================== */

:root {
  --brand-primary: #4f46e5;
  --brand-secondary: #0ea5e9;
  --dk-bg: #f4f6fb;
  --dk-card-radius: 16px;
  --dk-shadow: 0 6px 24px rgba(17, 24, 39, 0.06);
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--dk-bg);
  color: #1f2937;
}

a { text-decoration: none; }

.text-brand-primary { color: var(--brand-primary); }

.btn-brand-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-brand-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,70,229,.35); color:#fff; }

.dk-navbar { border-bottom: 1px solid rgba(0,0,0,.05); }
.dk-brand img { max-height: 36px; }

/* ---------- Hero ---------- */
.dk-hero {
  background: radial-gradient(1200px 400px at 20% -10%, rgba(79,70,229,.12), transparent),
              radial-gradient(1200px 400px at 90% 0%, rgba(14,165,233,.12), transparent);
  padding: 80px 0 60px;
}
.dk-hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.2rem);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dk-hero .lead { color: #4b5563; }
.dk-hero-illustration {
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(14,165,233,.08));
  padding: 40px;
}

/* ---------- Cards ---------- */
.dk-card {
  border: none;
  border-radius: var(--dk-card-radius);
  box-shadow: var(--dk-shadow);
  background: #fff;
  transition: box-shadow .15s ease;
}

/* Lift effect is only for standalone clickable tiles (service grid, related links) -
   applying it to generic .dk-card containers made table rows/forms shift and flicker on hover. */
.dk-service-card,
.dk-related-link {
  transition: transform .15s ease, box-shadow .15s ease;
}
.dk-service-card:hover,
.dk-related-link:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(17,24,39,.1); }

.dk-service-card { height: 100%; padding: 24px; text-align: center; }
.dk-service-icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(14,165,233,.12));
  color: var(--brand-primary);
  font-size: 28px;
}
.dk-service-card .use-service-link { font-weight: 600; }

.dk-category-pill {
  border-radius: 999px;
  padding: 6px 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: .875rem;
  transition: all .15s ease;
}
.dk-category-pill.active,
.dk-category-pill:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ---------- Footer ---------- */
.dk-footer { background: #111827; }
.dk-footer-links li { margin-bottom: 8px; }
.dk-footer-links a { color: rgba(255,255,255,.65); }
.dk-footer-links a:hover { color: #fff; }

/* ---------- Modals ---------- */
.dk-modal { border-radius: 18px; border: none; }

/* ---------- Dashboard Shell (AdminLTE-style) ---------- */
.dk-dashboard-wrapper { display: flex; min-height: 100vh; }
.dk-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #111827;
  color: #cbd5e1;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .2s ease;
}
.dk-sidebar-brand {
  padding: 20px; font-weight: 800; font-size: 1.25rem; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.dk-sidebar .nav-link {
  color: #cbd5e1; padding: 10px 20px; border-radius: 0; font-size: .92rem;
  display: flex; align-items: center; gap: 10px;
}
.dk-sidebar .nav-link i { width: 18px; text-align: center; }
.dk-sidebar .nav-link:hover,
.dk-sidebar .nav-link.active {
  background: rgba(79,70,229,.18);
  color: #fff;
  border-right: 3px solid var(--brand-primary);
}
.dk-content {
  margin-left: 260px;
  width: calc(100% - 260px);
  padding: 24px;
}
.dk-topbar {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--dk-shadow);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dk-stat-card {
  border-radius: var(--dk-card-radius);
  padding: 20px;
  background: #fff;
  box-shadow: var(--dk-shadow);
  height: 100%;
}
.dk-stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
}
.dk-stat-card .stat-value { font-size: 1.6rem; font-weight: 800; }

.dk-sidebar-toggle { display: none; }

@media (max-width: 991.98px) {
  .dk-sidebar { transform: translateX(-100%); }
  .dk-sidebar.show { transform: translateX(0); }
  .dk-content { margin-left: 0; width: 100%; }
  .dk-sidebar-toggle { display: inline-flex; }
  .dk-sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1020;
  }
  .dk-sidebar-backdrop.show { display: block; }
}

/* ---------- Tables ---------- */
/* overflow must stay visible on both axes (mixing auto-x/visible-y gets coerced to auto/auto by the
   CSS spec) - a hidden/auto container here clips dropdown action menus in the last table rows. */
.table-responsive { border-radius: 14px; overflow: visible; }
.dk-table thead { background: #f9fafb; }
.dk-table thead tr:first-child th:first-child { border-top-left-radius: 14px; }
.dk-table thead tr:first-child th:last-child { border-top-right-radius: 14px; }

/* ---------- Service result display ---------- */
.dk-result-table { border: 1px solid #eef0f4; border-radius: 10px; overflow: hidden; }
.dk-result-table th { width: 40%; background: #f9fafb; color: #6b7280; font-weight: 600; font-size: .85rem; }
.dk-result-table td { font-weight: 600; color: #1f2937; }
.dk-result-list-label { font-weight: 700; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: #6b7280; margin-bottom: 6px; }
.dk-result-scroll { overflow-x: auto; max-width: 100%; border-radius: 10px; }
.dk-result-list { border: 1px solid #eef0f4; border-radius: 10px; overflow: hidden; }
.dk-result-list thead th { background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(14,165,233,.08)); color: var(--brand-primary); font-size: .8rem; font-weight: 700; border-bottom: none; }
.dk-result-list tbody tr:nth-child(odd) { background: #f9fafb; }

/* ---------- Pagination (overrides Bootstrap's default plain blue look) ---------- */
.pagination { gap: 6px; flex-wrap: wrap; }
.pagination .page-link {
  border: none;
  border-radius: 10px;
  color: var(--brand-primary);
  font-weight: 600;
  padding: 8px 16px;
  background: #f4f6fb;
  transition: all .15s ease;
}
.pagination .page-link:hover { background: rgba(79,70,229,.12); color: var(--brand-primary); }
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.pagination .page-item.disabled .page-link { background: #f4f6fb; color: #c1c5cd; }

/* ---------- Quick period filter buttons (Today / This Month / This Year) ---------- */
.dk-period-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.dk-period-btn {
  border-radius: 999px;
  padding: 6px 18px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: .85rem;
  font-weight: 600;
  transition: all .15s ease;
}
.dk-period-btn:hover,
.dk-period-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ---------- Loaders / Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #e4e7ee 37%, #eef0f4 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spinner-btn {
  width: 1rem; height: 1rem; border-width: .15em;
}

/* ---------- Badges ---------- */
.badge-status-active { background: #dcfce7; color: #166534; }
.badge-status-inactive { background: #fee2e2; color: #991b1b; }
.badge-status-pending { background: #fef9c3; color: #854d0e; }

/* Utility */
.cursor-pointer { cursor: pointer; }
