:root {
  --sidebar-width: 260px;
  --sidebar-bg: #062f39;
  --accent: #0f5563;
  --speed: 0.3s;
}

body {
  background-color: #f8fafc;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, sans-serif;
}

#sidebar {
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1e293b;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1050;
  transition: transform var(--speed) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 25px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

#sidebar.collapsed { transform: translateX(-100%); }

.sidebar-brand {
  padding: 1rem 0.5rem 1.5rem 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--sidebar-bg);
  text-decoration: none;
  display: flex;
  align-items: center;
  letter-spacing: -0.5px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1rem;
}

.sidebar-ribbon1 {
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.03);
  padding: 1.25rem 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.02);
  text-align: center;
}

.sidebar-ribbon1 a {
  color: #475569 !important;
  font-weight: 600;
}

#sidebar .nav-link {
  color: #64748b;
  padding: 0.8rem 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 14px;
  margin-bottom: 6px;
  border: 1px solid transparent;
}

#sidebar .nav-link:hover {
  color: var(--accent);
  background: rgba(15, 85, 99, 0.06);
  transform: translateX(5px);
}

#sidebar .nav-link.active {
  color: var(--accent) !important;
  background: white !important;
  box-shadow: 0 10px 20px -5px rgba(15, 85, 99, 0.22),
              0 4px 6px -2px rgba(15, 85, 99, 0.12);
  border: 1px solid rgba(15, 85, 99, 0.18);
}

#sidebar .nav-link i {
  width: 24px;
  text-align: center;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

#sidebar .nav-link.active i {
  color: var(--accent);
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px rgba(15, 85, 99, 0.42));
}

.search-ribbon {
  margin-top: auto;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 1rem;
}

#sidebar .input-group .form-control {
  background: white !important;
  border: 1px solid #e2e8f0;
  border-radius: 10px 0 0 10px;
  color: #1e293b;
}

#sidebar .input-group .btn {
  border-radius: 0 10px 10px 0;
  background: var(--accent);
  border: none;
}

#main-wrapper {
  margin-left: var(--sidebar-width);
  transition: margin-left var(--speed) ease;
  min-height: 100vh;
  position: relative;
}

#main-wrapper.expanded { margin-left: 0; }

body.no-sidebar-public-home #main-wrapper { margin-left: 0 !important; }
body.no-sidebar-public-home #sidebar,
body.no-sidebar-public-home #sidebarToggle { display: none !important; }

.toggle-btn {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1060;
  background: white;
  border: 1px solid #e2e8f0;
  color: var(--sidebar-bg);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: left var(--speed) ease, background 0.2s, transform 0.2s;
}

.toggle-btn:hover {
  background: #f1f5f9;
  transform: scale(1.05);
}

@media (min-width: 992px) {
  #sidebar:not(.collapsed) ~ #main-wrapper .toggle-btn {
    left: calc(var(--sidebar-width) + 15px);
  }
}

@media (max-width: 991px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.mobile-open { transform: translateX(0); }
  #main-wrapper { margin-left: 0; }
}

@font-face {
  font-family: "Temelyazi";
  src: url("../fonts/TemelYazi.1784cc5c5ad6.woff2") format("woff2"),
       url("../fonts/TemelYazi.a52790c174f6.woff") format("woff"),
       url("../fonts/TemelYazi.e6cc6f0ebf80.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.footer a {
  color: var(--accent);
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.footer a:hover,
.footer a:focus {
  text-decoration: underline !important;
}

.sticky-messages {
  position: sticky;
  top: var(--sticky-messages-top, 72px);
  z-index: 1100;
  pointer-events: none;
}

.sticky-messages .alert {
  pointer-events: auto;
  margin-bottom: 10px;
}

.sticky-messages .container { max-width: 1100px; }

@media (max-width: 576px) {
  .sticky-messages { top: var(--sticky-messages-top-mobile, 60px); }
}

.sidebar-search-btn {
  border-radius: 0 10px 10px 0;
  background: var(--accent);
  border: none;
  color: #fff;
  transition: all .2s ease;
}

.sidebar-search-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
