/* ==========================================================================
   SKRE UI refresh — visual only, no functional changes
   ========================================================================== */

:root {
  --skre-shell-max: 1440px;
  --skre-radius-sm: .75rem;
  --skre-radius: 1rem;
  --skre-radius-lg: 1.25rem;
  --skre-shadow-sm: 0 6px 18px rgba(15, 23, 42, .06);
  --skre-shadow: 0 14px 36px rgba(15, 23, 42, .08);
  --skre-shadow-lg: 0 24px 60px rgba(15, 23, 42, .12);
  --skre-border: rgba(148, 163, 184, .24);
  --skre-surface: rgba(255, 255, 255, .78);
  --skre-surface-strong: rgba(255, 255, 255, .92);
  --skre-accent-soft: rgba(13, 110, 253, .10);
}

html,
body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, .10), transparent 28%),
    radial-gradient(circle at top right, rgba(111, 66, 193, .10), transparent 24%),
    var(--bs-body-bg);
}

main.container-fluid,
footer .container-fluid,
nav .container-fluid {
  max-width: var(--skre-shell-max);
}

main.container-fluid {
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

/* Surface system */
.card,
.alert,
.modal-content,
.dropdown-menu,
.list-group-item,
.table-responsive,
.offcanvas,
.accordion-item {
  border-radius: var(--skre-radius) !important;
}

.card,
.modal-content,
.dropdown-menu,
.offcanvas,
.accordion-item {
  border: 1px solid var(--skre-border) !important;
  box-shadow: var(--skre-shadow-sm);
}

.card {
  overflow: hidden;
  background: var(--skre-surface-strong);
  backdrop-filter: blur(10px);
}

.card.shadow-sm {
  box-shadow: var(--skre-shadow) !important;
}

.card-header {
  border-bottom-color: rgba(148, 163, 184, .18) !important;
}

.card + .card {
  margin-top: 1rem;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.navbar .navbar-brand {
  letter-spacing: .03em;
}

.navbar .nav-link {
  border-radius: 999px;
  padding-inline: .95rem;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  background: rgba(255, 255, 255, .08);
}

.navbar .nav-link.active {
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

@media (max-width: 576px) {
  .navbar .navbar-text {
    display: none !important;
  }
}

/* Buttons and controls */
.btn {
  border-radius: .85rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.form-control,
.form-select,
.input-group-text,
textarea.form-control {
  border-radius: .85rem;
  min-height: 2.8rem;
  border-color: rgba(148, 163, 184, .35);
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, .02);
}

textarea.form-control {
  min-height: 7rem;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus,
.btn:focus,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.list-group-item:focus-visible {
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .16) !important;
}

.form-label.small,
.form-text {
  color: var(--bs-secondary-color);
}

.form-text {
  line-height: 1.45;
}

/* Tables */
.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table td,
.table th {
  vertical-align: middle;
}

.table thead th {
  border-bottom-width: 1px;
  background: rgba(148, 163, 184, .08);
}

.table-hover > tbody > tr {
  transition: background-color .15s ease, transform .15s ease;
}

.table-hover > tbody > tr:hover {
  background: rgba(13, 110, 253, .04);
}

.table-responsive {
  border: 1px solid var(--skre-border);
  background: var(--skre-surface);
}

.table-bordered > :not(caption) > * {
  border-width: 1px 0;
}

.table-bordered > :not(caption) > * > * {
  border-width: 0 0 1px 0;
}

/* Dashboard and admin helpers */
.flash {
  padding: .8rem 1rem;
  border-radius: .85rem;
  background: var(--bs-info-bg-subtle, #cff4fc);
  color: var(--bs-info-text, #055160);
  border: 1px solid var(--bs-info-border-subtle, #9eeaf9);
}

.toolbar,
.d-flex.gap-2.flex-wrap,
.d-flex.gap-3.flex-wrap {
  gap: .65rem !important;
}

.badge.text-bg-warning-subtle {
  color: #7a4e00;
  border-color: #ffe0a6;
}

.badge.text-bg-info-subtle {
  color: #0b67c2;
  border-color: #c9d8ec;
}

.badge.text-bg-secondary {
  color: #212529;
}

.text-compact {
  line-height: 1.25;
}

.min-w-200 { min-width: 200px; }
.min-w-220 { min-width: 220px; }

/* Auth / profile cards */
.auth-shell {
  min-height: calc(100vh - 11rem);
  align-items: center;
}

.auth-card .card-header,
.profile-card .card-header,
.admin-section-card .card-header {
  background: linear-gradient(135deg, rgba(13, 110, 253, .96), rgba(111, 66, 193, .96)) !important;
  color: #fff !important;
}

.auth-card .card-footer,
.profile-card .card-footer {
  background: transparent;
}

/* Sidebar */
.sidebar-fixed {
  min-height: 100%;
}

.admin-sidebar-stack {
  position: sticky;
  top: 1rem;
}

.admin-sidebar-card {
  border: 1px solid var(--skre-border);
  overflow: hidden;
}

.admin-sidebar-card .card-header {
  font-weight: 700;
  letter-spacing: .02em;
}

.admin-sidebar-card .list-group-item {
  border-left: 0;
  border-right: 0;
  border-top: 0;
  padding: .85rem 1rem;
  transition: background-color .16s ease, padding-left .16s ease, color .16s ease;
}

.admin-sidebar-card .list-group-item:hover,
.admin-sidebar-card .list-group-item:focus-visible {
  background: rgba(13, 110, 253, .06);
  padding-left: 1.15rem;
}

.admin-sidebar-card .list-group-item.active {
  background: linear-gradient(135deg, rgba(13, 110, 253, .12), rgba(111, 66, 193, .10));
  color: var(--bs-emphasis-color);
  border-color: rgba(13, 110, 253, .16);
  font-weight: 700;
}

/* Footer */
footer {
  background: transparent;
}

.footer-shell {
  border: 1px solid var(--skre-border);
  border-radius: 999px;
  background: var(--skre-surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--skre-shadow-sm);
  padding: .8rem 1rem;
}

/* Tooltip and long content fixes */
.tooltip .tooltip-inner {
  text-align: left;
  max-width: 360px;
  white-space: pre-line;
}

/* Matrix / sticky tables */
.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bs-body-bg);
}

.matrix-sticky-col {
  position: sticky;
  left: 0;
  z-index: 25;
  background: var(--bs-body-bg);
  backdrop-filter: blur(3px);
}

.matrix-group-row td {
  position: sticky;
  left: 0;
  z-index: 20;
}

tr.is-today td {
  outline: 2px dashed var(--bs-primary);
  outline-offset: -2px;
}

/* Dark mode */
html[data-bs-theme="dark"] {
  --skre-border: rgba(148, 163, 184, .18);
  --skre-surface: rgba(17, 24, 39, .72);
  --skre-surface-strong: rgba(17, 24, 39, .88);
}

html[data-bs-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, .16), transparent 26%),
    radial-gradient(circle at top right, rgba(111, 66, 193, .16), transparent 22%),
    var(--bs-body-bg);
}

html[data-bs-theme="dark"] .matrix-table thead th,
html[data-bs-theme="dark"] .matrix-sticky-col,
html[data-bs-theme="dark"] .matrix-group-row td {
  background: rgba(33, 37, 41, .92) !important;
}

html[data-bs-theme="dark"] .table thead th {
  background: rgba(255, 255, 255, .04);
}

html[data-bs-theme="dark"] .navbar .nav-link.active {
  background: rgba(255, 255, 255, .10);
}

@media (max-width: 991.98px) {
  .admin-sidebar-stack {
    position: static;
  }
}

@media (max-width: 768px) {
  main.container-fluid {
    padding-top: 1rem;
  }

  .auth-shell {
    min-height: auto;
  }

  textarea.form-control {
    min-height: 5rem;
  }

  .footer-shell {
    border-radius: 1rem;
  }
}
