/* Zularich portal theme — dotted bg + gradients using site primary (#ad7f00) */

:root {
  --zp-primary: #ad7f00;
  --zp-primary-mid: #c4920a;
  --zp-primary-deep: #7a5a00;
  --zp-primary-soft: #d4a84b;
  --zp-primary-light: #e8c97a;
  --zp-soft-bg: #faf8f2;
  --zp-background: #fbf9f4;
  --zp-surface: #ffffff;
  --zp-surface-low: #f5f1e8;
  --zp-on-surface: #1f1a12;
  --zp-on-surface-variant: #6b6254;
  --zp-outline: #7a7266;
  --zp-outline-variant: #ddd5c4;
  --zp-dot: #d4cbb8;
  --zp-glass: rgba(255, 255, 255, 0.8);
  --zp-glass-border: #e6dfd0;
  --zp-shadow: 0 10px 30px -5px rgba(173, 127, 0, 0.12);
  --zp-shadow-lg: 0 24px 60px -20px rgba(173, 127, 0, 0.22);
  --zp-gradient: linear-gradient(135deg, #7a5a00 0%, #ad7f00 48%, #d4a84b 100%);
  --zp-gradient-vert: linear-gradient(180deg, #c4920a 0%, #7a5a00 100%);
  --zp-sidebar-mid: #ad7f00;
  --zp-sidebar-deep: #1a1408;
  --zp-sidebar-gradient: linear-gradient(180deg, var(--zp-sidebar-mid) 0%, var(--zp-sidebar-deep) 100%);
  --zp-font-headline: "Sora", "Segoe UI", sans-serif;
  --zp-font-body: "Inter", "Segoe UI", sans-serif;
  color-scheme: light;
}

html.dark {
  --zp-primary: #d4a84b;
  --zp-primary-mid: #e8c97a;
  --zp-primary-deep: #ad7f00;
  --zp-primary-soft: #c4920a;
  --zp-primary-light: #f0d78a;
  --zp-soft-bg: #12100c;
  --zp-background: #0c0a07;
  --zp-surface: #1c1810;
  --zp-surface-low: #262116;
  --zp-on-surface: #f5efe3;
  --zp-on-surface-variant: #c2b59a;
  --zp-outline: #8a7d66;
  --zp-outline-variant: #3d3424;
  --zp-dot: #2a2418;
  --zp-glass: rgba(28, 24, 16, 0.88);
  --zp-glass-border: #3d3424;
  --zp-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
  --zp-shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  --zp-sidebar-mid: #ad7f00;
  --zp-sidebar-deep: #0c0a07;
  color-scheme: dark;
}
/* Base type — match FC Partners */
body:not(.login-page):not(.register-page) {
  font-family: var(--zp-font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body:not(.login-page):not(.register-page) h1,
body:not(.login-page):not(.register-page) h2,
body:not(.login-page):not(.register-page) h3,
body:not(.login-page):not(.register-page) h4,
body:not(.login-page):not(.register-page) .content-header h1 {
  font-family: var(--zp-font-headline);
  letter-spacing: -0.02em;
}

/* Dotted canvas behind admin content */
body:not(.login-page):not(.register-page) .wrapper {
  background-color: var(--zp-background);
}

body:not(.login-page):not(.register-page) .content-wrapper {
  background-color: var(--zp-soft-bg) !important;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(173, 127, 0, 0.14), transparent 55%),
    radial-gradient(var(--zp-dot) 1px, transparent 1px) !important;
  background-size: auto, 20px 20px !important;
  background-attachment: fixed, fixed;
}

body:not(.login-page):not(.register-page) .main-footer {
  background: var(--zp-glass);
  border-top: 1px solid var(--zp-glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.content-wrapper .card {
  border: 1px solid var(--zp-outline-variant);
  border-radius: 1rem;
  box-shadow: var(--zp-shadow);
  background: var(--zp-surface);
}

.content-wrapper .content-header h1 {
  color: var(--zp-on-surface);
  font-size: 1.5rem;
  font-weight: 700;
}

.login-page,
.register-page {
  background-color: var(--zp-background) !important;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(173, 127, 0, 0.16), transparent),
    radial-gradient(var(--zp-dot) 1px, transparent 1px) !important;
  background-size: auto, 22px 22px !important;
}

.login-box .card,
.register-box .card {
  border: 1px solid var(--zp-outline-variant);
  border-radius: 1.25rem;
  box-shadow: var(--zp-shadow-lg);
  overflow: hidden;
}

.login-card-body,
.register-card-body {
  background: var(--zp-surface);
}

.btn-primary {
  background: var(--zp-primary) !important;
  border-color: var(--zp-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--zp-primary-deep) !important;
  border-color: var(--zp-primary-deep) !important;
}

/* Side menu — FC Partners–style vertical primary gradient + type */
.main-sidebar {
  background: var(--zp-sidebar-deep) !important;
  background: var(--zp-sidebar-gradient) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 24px rgba(26, 20, 8, 0.25);
  font-family: var(--zp-font-body);
  font-size: 16px;
}

.main-sidebar .brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 1.15rem 1.25rem;
}

.main-sidebar .brand-link .brand-text {
  color: #fff;
  font-family: var(--zp-font-headline);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.main-sidebar .user-panel {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-sidebar .user-panel .info a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  font-weight: 600;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
  color: rgba(255, 255, 255, 0.8);
  border-radius: 0.7rem;
  margin-bottom: 0.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 0.85rem;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link .nav-icon {
  font-size: 0.95rem;
  width: 1.1rem;
  text-align: center;
  opacity: 0.9;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link p {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background-color: rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--zp-primary-light);
}

.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link {
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
}

.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Pin logout/theme to bottom of visible side menu (nav scrolls independently) */
.main-sidebar {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

.main-sidebar > .brand-link {
  flex-shrink: 0;
}

.main-sidebar > .sidebar {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  margin-top: 0 !important;
  overflow: hidden !important;
  overflow-y: hidden !important;
}

.main-sidebar > .sidebar > .user-panel {
  flex-shrink: 0;
}

.main-sidebar > .sidebar > nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.zp-sidebar-footer {
  flex-shrink: 0 !important;
  margin-top: 0 !important;
  padding: 0.85rem 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: transparent;
}

.zp-sidebar-footer .zp-sidebar-theme,
.zp-sidebar-footer .zp-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  color: rgba(255, 255, 255, 0.85) !important;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 0.85rem;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.zp-sidebar-footer .zp-sidebar-theme {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.zp-sidebar-footer .zp-sidebar-theme:hover,
.zp-sidebar-footer .zp-sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff !important;
}

.zp-sidebar-footer .zp-sidebar-logout p,
.zp-sidebar-footer .zp-sidebar-theme span {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.zp-sidebar-footer .zp-sidebar-logout .nav-icon,
.zp-sidebar-footer .zp-sidebar-theme i {
  font-size: 0.95rem;
  width: 1.1rem;
  text-align: center;
  margin-right: 0;
}

/* Floating toggle (auth pages) */
.zp-theme-fab {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--zp-outline-variant);
  background: var(--zp-surface);
  color: var(--zp-on-surface);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-family: var(--zp-font-body);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--zp-shadow);
  cursor: pointer;
}

.zp-theme-fab:hover {
  border-color: var(--zp-primary);
  color: var(--zp-primary);
}

/* Dark mode shell overrides */
html.dark body:not(.login-page):not(.register-page) {
  color: var(--zp-on-surface);
  background: var(--zp-background);
}

html.dark .main-header.navbar {
  background: var(--zp-surface) !important;
  border-bottom-color: var(--zp-outline-variant) !important;
}

html.dark .main-header .nav-link {
  color: var(--zp-on-surface-variant) !important;
}

html.dark .main-header .zp-navbar-theme,
html.dark .main-header .zp-navbar-logout {
  color: var(--zp-on-surface) !important;
}

.main-header .zp-navbar-theme {
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1.5;
}

.main-header .zp-navbar-theme:hover,
.main-header .zp-navbar-logout:hover {
  color: var(--zp-primary) !important;
}

.main-header .zp-navbar-theme:focus {
  outline: none;
  box-shadow: none;
}

html.dark .content-wrapper .card,
html.dark .card {
  background: var(--zp-surface) !important;
  color: var(--zp-on-surface);
  border-color: var(--zp-outline-variant) !important;
}

html.dark .card-header,
html.dark .card-footer {
  background: transparent !important;
  border-color: var(--zp-outline-variant) !important;
  color: var(--zp-on-surface);
}

html.dark .form-control,
html.dark .custom-select,
html.dark .input-group-text {
  background: var(--zp-surface-low) !important;
  color: var(--zp-on-surface) !important;
  border-color: var(--zp-outline-variant) !important;
}

html.dark .form-control::placeholder {
  color: var(--zp-on-surface-variant);
}

html.dark .table,
html.dark .content-wrapper .table {
  color: var(--zp-on-surface);
}

html.dark .modal-content {
  background: var(--zp-surface);
  color: var(--zp-on-surface);
  border-color: var(--zp-outline-variant);
}

html.dark .modal-header,
html.dark .modal-footer {
  border-color: var(--zp-outline-variant);
}

html.dark .dropdown-menu {
  background: var(--zp-surface);
  border-color: var(--zp-outline-variant);
}

html.dark .dropdown-item {
  color: var(--zp-on-surface);
}

html.dark .dropdown-item:hover {
  background: var(--zp-surface-low);
  color: var(--zp-on-surface);
}

html.dark .text-muted {
  color: var(--zp-on-surface-variant) !important;
}

html.dark .breadcrumb {
  background: transparent;
}

html.dark .breadcrumb-item,
html.dark .breadcrumb-item a {
  color: var(--zp-on-surface-variant);
}

html.dark .login-box .card,
html.dark .register-box .card,
html.dark .login-card-body,
html.dark .register-card-body {
  background: var(--zp-surface) !important;
  color: var(--zp-on-surface);
}

html.dark .login-box-msg,
html.dark .login-box a,
html.dark .register-box a {
  color: var(--zp-on-surface-variant);
}

html.dark .login-box a:hover,
html.dark .register-box a:hover {
  color: var(--zp-primary);
}

html.dark .select2-container--default .select2-selection--single,
html.dark .select2-dropdown {
  background: var(--zp-surface-low) !important;
  border-color: var(--zp-outline-variant) !important;
  color: var(--zp-on-surface) !important;
}

html.dark .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--zp-on-surface) !important;
}

html.dark .zp-drive-app,
html.dark .zp-drive-body,
html.dark .zp-drive-main {
  color: var(--zp-on-surface);
}
