/*
  Global site theme (CoreUI-like, clean dashboard)
  Notes:
  - This file is intentionally self-contained and only overrides visual styles.
  - It avoids copying any third-party proprietary CSS.
*/

:root {
  --app-bg: #f4f6fb;
  --app-surface: #ffffff;
  --app-surface-2: #f9fafb;
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-border: rgba(15, 23, 42, 0.08);
  --app-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --app-radius: 14px;
  --app-radius-sm: 10px;
  --app-focus: 0 0 0 0.25rem rgba(13, 110, 253, 0.18);

  --app-sidebar-bg: #ffffff;
  --app-sidebar-text: #0f172a;
  --app-sidebar-muted: rgba(15, 23, 42, 0.6);
  --app-sidebar-hover: rgba(2, 132, 199, 0.08);
  --app-sidebar-active: rgba(2, 132, 199, 0.14);
  --app-sidebar-icon: rgba(15, 23, 42, 0.7);

  --app-primary: #0d6efd;
  --app-danger: #dc3545;
  --app-success: #198754;
  --app-warning: #ffc107;
}

/* Motion / polish */
:root {
  --app-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-fade-in {
  animation: appFadeIn 260ms var(--app-ease) both;
}

@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Global modern interactions */
.card,
.btn,
.form-control,
.form-select,
.sidebar .nav-link {
  transition: box-shadow 160ms var(--app-ease), transform 160ms var(--app-ease),
    background-color 160ms var(--app-ease), border-color 160ms var(--app-ease),
    color 160ms var(--app-ease);
}

.card {
  border-radius: 14px;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.10);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Landing / welcome hero */
.welcome-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: radial-gradient(1200px 450px at 15% 10%, rgba(13, 110, 253, 0.20), transparent 55%),
    radial-gradient(900px 380px at 85% 15%, rgba(25, 135, 84, 0.18), transparent 55%),
    linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.welcome-hero::before {
  content: "";
  position: absolute;
  inset: -120px -120px auto auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle at 30% 30%, rgba(111, 66, 193, 0.26), transparent 60%);
  filter: blur(8px);
  transform: rotate(12deg);
  pointer-events: none;
}

.welcome-hero::after {
  content: "";
  position: absolute;
  inset: auto auto -140px -160px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 35% 35%, rgba(220, 53, 69, 0.16), transparent 62%);
  filter: blur(10px);
  pointer-events: none;
}

.welcome-hero .welcome-hero-inner {
  position: relative;
  padding: 26px 26px;
  z-index: 1;
}

@media (max-width: 575.98px) {
  .welcome-hero .welcome-hero-inner {
    padding: 18px 16px;
  }
}

/* Navbar toggler icon (for CoreUI navbar) */
.navbar-toggler {
  border-radius: 12px;
}

.navbar-toggler-icon {
  width: 1.25em;
  height: 1.25em;
  background-image: none;
  position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 2px;
}

.navbar-toggler-icon::before {
  top: 35%;
  box-shadow: 0 8px 0 rgba(15, 23, 42, 0.72);
}

.navbar-toggler-icon::after {
  top: 65%;
}

.welcome-kpis {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.welcome-kpis .kpi {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

/* Auth pages */
body.auth-modern {
  background: radial-gradient(900px 420px at 15% 10%, rgba(13, 110, 253, 0.18), transparent 55%),
    radial-gradient(900px 420px at 85% 15%, rgba(25, 135, 84, 0.14), transparent 55%),
    linear-gradient(180deg, #f7f8fc, #f3f5fa);
}

body.auth-modern .py-20 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.auth-modern .card-body {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
  padding: 28px !important;
}

body.auth-modern .form-control.form-control-solid {
  background: rgba(248, 250, 252, 0.90) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
}

body.auth-modern .form-control.form-control-solid:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.18) !important;
  border-color: rgba(13, 110, 253, 0.35) !important;
}

.auth-side {
  position: relative;
  overflow: hidden;
  background: radial-gradient(700px 450px at 25% 20%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(800px 520px at 80% 15%, rgba(255, 255, 255, 0.16), transparent 58%),
    linear-gradient(135deg, #ff4d6d 0%, #f7c948 35%, #4ddf88 70%, #2f80ed 100%);
}

.auth-side::before {
  content: "";
  position: absolute;
  inset: -140px auto auto -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(8px);
  pointer-events: none;
}

.auth-side::after {
  content: "";
  position: absolute;
  inset: auto -160px -160px auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  filter: blur(10px);
  pointer-events: none;
}

/* Sidebar brand behavior (keep logo visible when collapsed) */
.sidebar .sidebar-brand-full {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar .sidebar-brand-narrow {
  display: none;
  align-items: center;
  justify-content: center;
}

body.cui-sidebar-collapsed .sidebar .sidebar-brand-full {
  display: none !important;
}

body.cui-sidebar-collapsed .sidebar .sidebar-brand-narrow {
  display: flex !important;
}

.sidebar .sidebar-brand img {
  max-width: 100%;
  height: auto;
}

/* Auth-side content */
.auth-side .auth-side-inner {
  position: relative;
  z-index: 1;
  padding: 56px 48px;
  color: rgba(255, 255, 255, 0.92);
}

.auth-side .auth-side-card {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  backdrop-filter: blur(10px);
}

.auth-side .auth-side-kpi {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 14px;
}

html, body {
  height: 100%;
}

body {
  background: var(--app-bg) !important;
  color: var(--app-text);
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Layout wrapper spacing */
.wrapper {
  background: var(--app-bg) !important;
}

.body {
  padding-bottom: 1.5rem;
}

/* Header */
.header {
  background: var(--app-surface) !important;
  border-bottom: 1px solid var(--app-border) !important;
}

.header.header-sticky {
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* Breadcrumbs */
.breadcrumb {
  --bs-breadcrumb-divider-color: rgba(100, 116, 139, 0.55);
}

.breadcrumb-item,
.breadcrumb-item a {
  color: var(--app-muted);
  font-weight: 600;
}

.breadcrumb-item.active {
  color: rgba(15, 23, 42, 0.72);
}

.body h1.h4 {
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Sidebar (CoreUI-like) */
.sidebar {
  background: var(--app-sidebar-bg) !important;
  border-right: 1px solid var(--app-border) !important;
  box-shadow: none !important;
}

/* Desktop sidebar collapse (hamburger) */
@media (min-width: 992px) {
  body.cui-sidebar-collapsed .sidebar {
    width: var(--cui-sidebar-width-collapsed, 76px) !important;
  }

  body.cui-sidebar-collapsed .wrapper {
    margin-left: var(--cui-sidebar-width-collapsed, 76px) !important;
  }

  body.cui-sidebar-collapsed .sidebar .sidebar-brand-full,
  body.cui-sidebar-collapsed .sidebar .sidebar-footer,
  body.cui-sidebar-collapsed .sidebar .sidebar-nav .nav-title,
  body.cui-sidebar-collapsed .sidebar .sidebar-nav .nav-link span,
  body.cui-sidebar-collapsed .sidebar .sidebar-nav .nav-group-toggle span {
    display: none !important;
  }

  body.cui-sidebar-collapsed .sidebar .sidebar-brand-narrow {
    display: flex !important;
    justify-content: center;
  }

  body.cui-sidebar-collapsed .sidebar .sidebar-nav .nav-link {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  body.cui-sidebar-collapsed .sidebar .sidebar-nav .nav-group-items {
    display: none !important;
  }
}

.sidebar .sidebar-brand {
  background: var(--app-sidebar-bg) !important;
  border-bottom: 1px solid var(--app-border) !important;
}

.sidebar .sidebar-nav {
  padding: 0.25rem 0;
}

.sidebar .sidebar-nav .nav-title {
  color: var(--app-sidebar-muted) !important;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 0.75rem;
}

.sidebar .sidebar-nav .nav-link {
  color: var(--app-sidebar-text) !important;
  border-radius: 10px;
  margin: 0.15rem 0.75rem;
  padding: 0.65rem 0.75rem;
  transition: background-color .15s ease, color .15s ease;
}

.sidebar .sidebar-nav .nav-link .nav-icon,
.sidebar .sidebar-nav .nav-link .nav-icon * {
  color: var(--app-sidebar-icon) !important;
}

.sidebar .sidebar-nav .nav-link:hover {
  background: var(--app-sidebar-hover) !important;
}

.sidebar .sidebar-nav .nav-link.active,
.sidebar .sidebar-nav .nav-group.show > .nav-link.nav-group-toggle {
  background: var(--app-sidebar-active) !important;
  font-weight: 700;
}

.sidebar .sidebar-nav .nav-group-items .nav-link {
  margin-left: 1.75rem;
  padding-left: 0.75rem;
}

.sidebar .sidebar-footer {
  background: var(--app-sidebar-bg) !important;
  border-top: 1px solid var(--app-border) !important;
}

/* Cards */
.card {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.card-header {
  background: var(--app-surface) !important;
  border-bottom: 1px solid var(--app-border) !important;
  font-weight: 700;
}

.card-footer {
  background: var(--app-surface) !important;
  border-top: 1px solid var(--app-border) !important;
}

/* Alerts: slightly softer */
.alert {
  border-radius: var(--app-radius-sm) !important;
}

/* Forms */
.form-control,
.form-select,
.input-group-text {
  border-radius: 12px !important;
}

.form-control:focus,
.form-select:focus {
  box-shadow: var(--app-focus) !important;
}

/* Buttons */
.btn {
  border-radius: 12px !important;
}

.btn.btn-pill {
  border-radius: 999px !important;
}

/* Tables */
.table {
  color: var(--app-text);
}

.table thead th {
  color: var(--app-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
  border-bottom: 1px solid var(--app-border) !important;
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--app-border);
}

/* DataTables (works with multiple builds) */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 12px !important;
}

/* Code blocks in docs */
pre {
  background: #0b1220;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  overflow: auto;
}

code {
  color: inherit;
}

/* Service server list: make SV + price clearer */
.form-check input[name="server_service"] + label {
  color: var(--bs-body-color, #1f2937);
}

.form-check input[name="server_service"] + label b,
.form-check input[name="server_service"] + label .fw-semibold {
  font-weight: 700;
}

.form-check input[name="server_service"] + label .badge {
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.form-check input[name="server_service"] + label .badge.badge-light-success {
  background: rgba(25, 135, 84, 0.16);
  color: #146c43;
  border-color: rgba(25, 135, 84, 0.25);
}

.form-check input[name="server_service"] + label .badge.badge-light-info,
.form-check input[name="server_service"] + label .badge.badge-info {
  background: rgba(13, 110, 253, 0.14);
  color: #0b5ed7;
  border-color: rgba(13, 110, 253, 0.22);
}
/* Page title block (optional, for pages that include .app-page-title) */
.app-page-title {
  margin-bottom: 1rem;
}

.app-page-title .page-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-page-title .page-title-heading {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.app-page-title .page-title-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(13, 110, 253, 0.12);
  color: var(--app-primary);
}

.app-page-title .page-title-subheading {
  color: var(--app-muted);
  margin-top: 0.15rem;
}

/* Small utilities */
.text-body-secondary {
  color: var(--app-muted) !important;
}

/* Mobile sidebar overlay behavior (keep existing JS toggle) */
@media (max-width: 991.98px) {
  .sidebar {
    box-shadow: var(--app-shadow) !important;
  }
}
