﻿:root {
  --admin-bg: #f4f7fb;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f8fafc;
  --admin-border: #dce4ef;
  --admin-text: #0b1f3a;
  --admin-text-muted: #728198;
  --admin-link: #30435e;
  --admin-hover: #edf4ff;
  --admin-primary: #0869e8;
  --admin-primary-shadow: rgba(8, 105, 232, .2);
  --admin-danger: #cf3346;
  --admin-shadow: rgba(24, 55, 91, .09);
}

[data-bs-theme="dark"] {
  color-scheme: dark;
  --admin-bg: #0c1523;
  --admin-surface: #121e2e;
  --admin-surface-soft: #182638;
  --admin-border: #2a3b51;
  --admin-text: #e9f1fb;
  --admin-text-muted: #9eacc0;
  --admin-link: #c8d5e7;
  --admin-hover: #1b3150;
  --admin-primary: #3c8df5;
  --admin-primary-shadow: rgba(60, 141, 245, .24);
  --admin-danger: #ff7181;
  --admin-shadow: rgba(0, 0, 0, .26);
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--admin-surface), 0 0 0 0.25rem #258cfb;
}

body { margin: 0; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.admin-login-brand { width: fit-content; display: block; margin-bottom: 1.35rem; }
.admin-login-brand img { display: block; width: min(230px, 100%); height: auto; }

.admin-app-body {
  min-height: 100vh;
  background: var(--admin-bg);
  color: var(--admin-text);
  transition: background-color .2s ease, color .2s ease;
}

.admin-shell { min-height: 100vh; }

.admin-sidebar {
  --bs-offcanvas-width: 272px;
  width: 272px !important;
  background: var(--admin-surface);
  color: var(--admin-text);
  border-right: 1px solid var(--admin-border);
  box-shadow: 10px 0 34px var(--admin-shadow);
}

.admin-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem 1rem 1rem;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: .35rem .3rem 1rem;
  margin-bottom: .25rem;
  text-decoration: none;
}

.admin-sidebar-brand img {
  display: block;
  width: 212px;
  max-width: 100%;
  height: auto;
  transition: filter .2s ease, opacity .2s ease;
}

[data-bs-theme="dark"] .admin-sidebar-brand img,
[data-bs-theme="dark"] .admin-login-brand img { filter: brightness(0) invert(1); }

.admin-sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .22rem;
  overflow-y: auto;
  padding: .4rem 0 1rem;
}

.admin-nav-section {
  margin: 1.05rem .75rem .35rem;
  color: var(--admin-text-muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .72rem;
  width: 100%;
  min-height: 44px;
  padding: .62rem .75rem;
  border: 0;
  border-radius: .7rem;
  background: transparent;
  color: var(--admin-link);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.admin-nav-link:hover {
  background: var(--admin-hover);
  color: var(--admin-primary);
  transform: translateX(2px);
}

.admin-nav-link.active {
  background: var(--admin-primary);
  color: #fff;
  box-shadow: 0 8px 18px var(--admin-primary-shadow);
}

.admin-nav-icon {
  display: inline-grid;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  place-items: center;
  font-size: 1.06rem;
  line-height: 1;
}

.admin-nav-form { margin: 0; }
.admin-nav-button { cursor: pointer; }
.admin-nav-logout { color: var(--admin-danger); }
.admin-nav-logout:hover { background: rgba(207, 51, 70, .09); color: var(--admin-danger); }

.admin-workspace {
  min-height: 100vh;
  margin-left: 272px;
}

.admin-topbar {
  position: sticky;
  z-index: 1025;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 2rem;
  border-bottom: 1px solid var(--admin-border);
  background: color-mix(in srgb, var(--admin-surface) 92%, transparent);
  box-shadow: 0 8px 26px var(--admin-shadow);
  backdrop-filter: blur(14px);
}

.admin-topbar-leading,
.admin-topbar-actions {
  display: flex;
  align-items: center;
}

.admin-topbar-leading { min-width: 0; gap: .75rem; }
.admin-topbar-actions { gap: .55rem; }

.admin-page-context {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.admin-page-context span {
  color: var(--admin-text-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.admin-page-context strong {
  overflow: hidden;
  max-width: 42vw;
  color: var(--admin-text);
  font-size: .98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: .7rem;
  background: var(--admin-surface-soft);
  color: var(--admin-link);
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.admin-icon-button:hover {
  border-color: color-mix(in srgb, var(--admin-primary) 52%, var(--admin-border));
  background: var(--admin-hover);
  color: var(--admin-primary);
  transform: translateY(-1px);
}

.admin-icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-to-light { display: none; }
[data-bs-theme="dark"] .theme-icon-to-dark { display: none; }
[data-bs-theme="dark"] .theme-icon-to-light { display: block; }

.admin-profile-button {
  display: flex;
  min-width: 208px;
  align-items: center;
  gap: .65rem;
  padding: .35rem .65rem .35rem .4rem;
  border: 1px solid var(--admin-border);
  border-radius: .75rem;
  background: var(--admin-surface-soft);
  color: var(--admin-text);
  text-align: left;
}

.admin-profile-button::after { margin-left: auto; color: var(--admin-text-muted); }

.admin-account-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--admin-primary);
  color: #fff;
  font-weight: 800;
}

.admin-profile-copy {
  display: block;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}

.admin-profile-copy strong,
.admin-profile-copy span,
.admin-profile-menu-header strong,
.admin-profile-menu-header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile-copy strong { max-width: 145px; font-size: .79rem; }
.admin-profile-copy span { max-width: 145px; margin-top: .18rem; color: var(--admin-text-muted); font-size: .7rem; }

.admin-profile-menu {
  min-width: 250px;
  margin-top: .5rem !important;
  padding: .5rem;
  border-color: var(--admin-border);
  border-radius: .8rem;
  background: var(--admin-surface);
  box-shadow: 0 18px 42px var(--admin-shadow);
}

.admin-profile-menu .dropdown-item { padding: .62rem .7rem; border-radius: .5rem; }
.admin-profile-menu form { margin: 0; }
.admin-profile-menu-header { min-width: 0; padding: .45rem .7rem; line-height: 1.3; }
.admin-profile-menu-header span { margin-top: .15rem; color: var(--admin-text-muted); font-size: .76rem; }

.admin-content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.75rem 2rem 2.5rem;
}

.admin-mobile-menu-button { cursor: pointer; }

.admin-app-body .card {
  background-color: var(--admin-surface);
  border-color: var(--admin-border);
}

.admin-public-body { min-height: 100vh; background: #f4f7fb; }
.admin-public-content { min-height: 100vh; }
.validation-summary-valid { display: none; }

@media (min-width: 992px) {
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    visibility: visible !important;
    transform: none !important;
  }

  .admin-sidebar-mobile-header { display: none; }
}

@media (max-width: 991.98px) {
  .admin-sidebar-inner { min-height: calc(100vh - 58px); }
  .admin-sidebar-mobile-header { border-bottom: 1px solid var(--admin-border); }
  .admin-workspace { margin-left: 0; }
  .admin-topbar { min-height: 64px; padding: .55rem 1rem; }
  .admin-content { padding: 1.35rem 1rem 2rem; }
}

@media (max-width: 575.98px) {
  .admin-page-context span { display: none; }
  .admin-page-context strong { max-width: 34vw; }
  .admin-profile-button { min-width: 0; padding-right: .45rem; }
  .admin-profile-copy { display: none; }
  .admin-profile-button::after { margin-left: .1rem; }
  .admin-topbar-actions { gap: .35rem; }
  .admin-content { padding-right: .75rem; padding-left: .75rem; }
}
