/* navbar-modern.css */
:root {
  --navbar-height: 64px;
  --siderail-width: 200px;
  --siderail-collapsed-width: 72px;
  --navbar-bg: #ffffff;
  --navbar-border: #e5e7eb;
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --active-bg: #eff6ff;
  --active-border: #3b82f6;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --transition-speed: 120ms;
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-speed: 0ms;
  }
}

.navbar-modern {
  height: var(--navbar-height);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0 1.5rem;
  z-index: 1030;
}

.navbar-modern .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 100%;
  padding: 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition-speed);
}

.navbar-brand:hover {
  opacity: 0.8;
}

.navbar-logo {
  height: 32px;
  width: 32px;
  object-fit: contain;
  display: block;
}

.navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 400px;
  margin: 0 2rem;
}

.company-switcher {
  width: 100%;
}

.btn-company {
  width: 100%;
  background: #f9fafb;
  border: 1px solid var(--navbar-border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  text-align: left;
  color: var(--text-primary);
  font-weight: 500;
  transition: all var(--transition-speed);
}

.btn-company:hover {
  background: #f3f4f6;
  border-color: var(--primary-color);
}

.btn-company:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.company-switcher .dropdown-menu {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--navbar-border);
}

.company-switcher .dropdown-item {
  padding: 0.625rem 1rem;
  transition: background var(--transition-speed);
}

.company-switcher .dropdown-item.active {
  background: var(--active-bg);
  color: var(--primary-color);
  font-weight: 500;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-buttons {
  display: flex;
  align-items: center;

  .btn {
    font-weight: 500;    
    padding: 0.5rem 1.25rem;
  }
}

.btn-user {
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--navbar-border);
  border-radius: 12px;
  padding: 0.375rem 0.75rem;
}

.btn-user:hover {
  background: #f9fafb;
  border-color: var(--primary-color);
}

.btn-user:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
}

.user-menu .dropdown-menu {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--navbar-border);
  min-width: 200px;
}

#sidebarToggle {
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 0.5rem;
}

.siderail-modern {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: var(--siderail-width);
  height: calc(100vh - var(--navbar-height));
  background: var(--navbar-bg);
  border-right: 1px solid var(--navbar-border);
  overflow-y: auto;
  z-index: 1020;
  transition: width var(--transition-speed);
}

.siderail-nav {
  padding: 1rem 0;
}

.siderail-item {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-speed);
  border-left: 3px solid transparent;
  font-weight: 500;
}

.siderail-item i {
  font-size: 1.25rem;
  width: 24px;
  margin-right: 1rem;
}

.siderail-item:hover {
  background: #f9fafb;
  color: var(--text-primary);
}

.siderail-item.active {
  background: var(--active-bg);
  color: var(--primary-color);
  border-left-color: var(--active-border);
}

.siderail-item:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

.siderail-offcanvas {
  width: 280px;
}

.offcanvas-nav {
  display: flex;
  flex-direction: column;
}

.offcanvas-item {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 0.25rem;
  transition: all var(--transition-speed);
  font-weight: 500;
}

.offcanvas-item:hover {
  background: #f9fafb;
  color: var(--text-primary);
}

.offcanvas-item.active {
  background: var(--active-bg);
  color: var(--primary-color);
}

@media (min-width: 768px) and (max-width: 1199px) {
  .siderail-modern {
    width: var(--siderail-collapsed-width);
  }
  
  .siderail-label {
    display: none;
  }
  
  .siderail-item {
    justify-content: center;
    padding: 1rem;
  }
  
  .siderail-item i {
    margin-right: 0;
  }
}

@media (max-width: 767px) {
  .navbar-center {
    margin: 0 1rem;
  }

  .navbar-brand span {
    display: none;
  }
}

body {
  padding-top: var(--navbar-height);
}

body.has-siderail {
  padding-left: 0;
}

@media (min-width: 992px) and (max-width: 1199px) {
  body.has-siderail {
    padding-left: var(--siderail-collapsed-width);
  }
}

@media (min-width: 1200px) {
  body.has-siderail {
    padding-left: var(--siderail-width);
  }
}

main {
  transition: margin-left var(--transition-speed);
}

@media (min-width: 1200px) {
  main {
    margin-left: 0;
  }
}

/* Ensure footer spans full width by pulling it left to compensate for body padding */
body.has-siderail .footer {
  margin-left: calc(-1 * var(--siderail-width));
  width: 100vw;
  position: relative;
  z-index: 1025;
}

@media (max-width: 1199px) {
  body.has-siderail .footer {
    margin-left: 0;
    width: 100%;
  }
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.nav-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.siderail-item .nav-icon {
  width: 24px;
  height: 24px;
  margin-right: 1rem;
}

.offcanvas-item .nav-icon {
  width: 24px;
  height: 24px;
}

.btn-company .nav-icon {
  width: 18px;
  height: 18px;
}

.dropdown-item .nav-icon {
  width: 16px;
  height: 16px;
}

body.has-siderail .footer {
  margin-left: 0;
  width: 100%;
}

@media (min-width: 1200px) {
  .main-wrapper {
    margin-left: var(--siderail-width);
  }
}
