.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.2s;
}

.sidebar-brand {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #0056b3, #2563eb);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}

.sidebar-brand-text { font-weight: 700; color: var(--color-primary); font-size: 1.1rem; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--color-muted); font-size: 0.9rem; font-weight: 500;
  margin-bottom: 2px; cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit;
}

.nav-item:hover { background: var(--color-primary-light); color: var(--color-primary); }
.nav-item.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.nav-item.disabled { opacity: 0.45; pointer-events: none; cursor: not-allowed; }
.nav-item.disabled:not([data-route="jobs"])::after {
  content: ' (curând)';
  font-size: 0.7rem; font-weight: 400; opacity: 0.85;
}

.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-header {
  height: var(--header-height);
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}

.header-search {
  flex: 1; max-width: 400px; margin: 0 16px;
}

.header-search input {
  width: 100%; padding: 9px 14px 9px 36px;
  border: 1px solid var(--color-border); border-radius: var(--radius-btn);
  font-family: inherit; font-size: 0.9rem; background: #f9fafb;
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.user-menu {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
}

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.85rem;
}

.page-content { padding: 24px; flex: 1; }

.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

.bottom-nav-inner { display: flex; justify-content: space-around; }

.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 0.65rem; color: var(--color-muted);
  padding: 4px 12px; border: none; background: none; cursor: pointer; font-family: inherit;
}

.bottom-nav-item.active { color: var(--color-primary); }
.bottom-nav-item.disabled { opacity: 0.45; pointer-events: none; cursor: not-allowed; }

.notifications-wrap { position: relative; }

.header-notifications {
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
  padding: 8px; border-radius: 8px; line-height: 1; position: relative;
}
.header-notifications:hover { background: #f3f4f6; }

.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff;
  font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.notifications-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, 92vw);
  background: #fff; border: 1px solid var(--color-border); border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12); z-index: 150; max-height: 400px;
  display: flex; flex-direction: column;
}
.notifications-dropdown[hidden] { display: none !important; }

.notifications-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--color-border); font-size: 0.9rem;
}

.notifications-list {
  list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1;
}
.notifications-list li {
  padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 0.85rem; cursor: pointer;
}
.notifications-list li:hover { background: #f9fafb; }
.notifications-list li.unread { background: #eff6ff; }
.notifications-list li .notif-time { font-size: 0.75rem; color: var(--color-muted); margin-top: 4px; }
.notifications-list .notif-empty { padding: 24px; text-align: center; color: var(--color-muted); cursor: default; }

.header-search-toggle {
  display: none;
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
  padding: 8px; border-radius: 8px; line-height: 1; flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 4px;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .bottom-nav { display: block; }
  .mobile-menu-btn { display: block; }
  .page-content { padding: 16px; padding-bottom: 80px; }
  .header-search { display: none; flex: 1; max-width: none; margin: 0 8px; }
  .header-search.open { display: block; }
  .header-search-toggle {
    display: flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px;
  }

  .mobile-menu-btn {
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
  }
  .bottom-nav-item {
    min-width: 48px; min-height: 48px;
    padding: 6px 10px; font-size: 0.7rem;
  }
  #user-name { display: none; }
  .header-search input { font-size: 16px; }
}

@media (max-width: 480px) {
  .login-card input, .login-card select, .login-card textarea { font-size: 16px; }
}

.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f8fbff 0%, #e8f4fd 100%);
  padding: 20px;
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 40px 32px;
  max-width: 420px; width: 100%;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
}

.login-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #0056b3, #2563eb);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
  margin: 0 auto 16px;
}

.login-card h1 { text-align: center; font-size: 1.4rem; margin-bottom: 6px; }
.login-card p.sub { text-align: center; color: var(--color-muted); font-size: 0.9rem; margin-bottom: 24px; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: #f3f4f6; border-radius: 10px; padding: 4px; }
.tab-btn {
  flex: 1; padding: 8px; border: none; background: none;
  border-radius: 8px; font-family: inherit; font-weight: 500; cursor: pointer; font-size: 0.85rem;
}
.tab-btn.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); color: var(--color-primary); }

.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 99;
}
.overlay.open { display: block; }

.ai-chat-toggle {
  position: fixed; right: 20px; bottom: 80px; z-index: 120;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-primary); color: #fff; border: none;
  font-size: 1.4rem; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.ai-chat-toggle.ai-chat-disabled { opacity: 0.65; }
.ai-chat-panel {
  position: fixed; right: 0; top: var(--header-height); bottom: 0; width: 360px; max-width: 100vw;
  background: var(--color-surface); border-left: 1px solid var(--color-border);
  display: flex; flex-direction: column; z-index: 110;
  transform: translateX(100%); transition: transform 0.2s;
  box-shadow: -4px 0 24px rgba(0,0,0,0.06);
}
.ai-chat-panel.open { transform: translateX(0); }
.ai-chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--color-border);
}
.ai-chat-close { border: none; background: none; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; }
.ai-chat-msg { margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; font-size: 0.85rem; max-width: 95%; }
.ai-chat-msg-user { background: var(--color-primary-light); margin-left: auto; }
.ai-chat-msg-assistant { background: #f3f4f6; }
.ai-chat-form {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--color-border);
}
.ai-chat-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px; }

@media (max-width: 768px) {
  .ai-chat-panel { width: 100%; top: auto; height: 55vh; bottom: 56px; border-left: none; border-top: 1px solid var(--color-border); }
  .ai-chat-toggle { bottom: 72px; right: 16px; }
}
