.app-container {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: row;
  position: relative;
}

.app-sidebar {
  width: 280px;
  min-width: 280px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
}

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

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #0a844a 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.sidebar-brand-logo svg {
  width: 22px;
  height: 22px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.sidebar-brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

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

.sidebar-nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 12px 8px 12px;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-normal);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-nav-link:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.sidebar-nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.sidebar-nav-link.active svg {
  stroke: var(--primary);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid #86efac;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: var(--transition-normal);
}

.sidebar-logout-btn:hover {
  background-color: var(--accent-danger-bg);
  color: var(--accent-danger);
}

.app-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.mobile-menu-toggle:hover {
  background-color: var(--bg-subtle);
}

.header-page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

.header-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  width: 320px;
}

.header-search-box svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.header-search-input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-main);
}

.header-search-input::placeholder {
  color: var(--text-muted);
}

.icon-notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: #475569;
  transition: var(--transition-normal);
}

.icon-notif-btn:hover {
  background-color: var(--bg-subtle);
}

.notif-badge-dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 9px;
  height: 9px;
  background-color: #ef4444;
  border-radius: var(--radius-full);
  border: 2px solid #ffffff;
}

.header-user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-normal);
}

.header-user-dropdown:hover {
  background-color: var(--bg-subtle);
}

.header-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
}

.header-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.header-user-email {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.avatar-mini {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid #86efac;
}

.content-body {
  flex: 1;
  padding: 32px 40px 48px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 1200px) {
  .content-body {
    padding: 36px 48px 56px 48px;
  }
}

@media (min-width: 1400px) {
  .content-body {
    padding: 40px 56px 64px 56px;
  }
}

.app-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.app-screen-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.subpage-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 8px 0;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--primary);
  background: var(--primary-light);
  transition: var(--transition-normal);
}

.back-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.subpage-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .subpage-header {
    gap: 18px;
    padding: 0 0 12px 0;
  }

  .back-btn {
    width: 48px;
    height: 48px;
  }

  .subpage-title {
    font-size: 1.85rem;
  }
}

@media (min-width: 1200px) {
  .subpage-title {
    font-size: 2.1rem;
  }
}

.main-app-header {
  display: none;
}

.main-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bottom-navigation-bar {
  display: none;
}

@media (max-width: 767px) {
  .app-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-modal);
  }

  .app-sidebar.mobile-open {
    transform: translateX(280px);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .header-search-box {
    width: auto;
    max-width: 200px;
  }

  .header-user-info {
    display: none;
  }

  .content-body {
    padding: 20px 16px 90px 16px;
  }

  .bottom-navigation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: #ffffff;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 12px 14px 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  }

  .bottom-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    flex: 1;
    max-width: 90px;
  }

  .bottom-tab-item svg {
    width: 22px;
    height: 22px;
  }

  .bottom-tab-item.active {
    color: var(--primary);
    background-color: var(--primary-light);
  }

  .bottom-tab-item.active span {
    color: var(--primary);
  }
}

@media (max-width: 480px) {
  .app-top-header {
    padding: 12px 16px;
  }

  .header-search-box {
    display: none;
  }

  .header-page-title {
    font-size: 1rem;
  }

  .subpage-title {
    font-size: 1.25rem;
  }
}

.bottom-tab-item svg {
  width: 22px;
  height: 22px;
}

.bottom-tab-item.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.bottom-tab-item.active svg {
  stroke: var(--primary);
}

.bottom-tab-item.active svg[fill] {
  fill: var(--primary);
}

.bottom-tab-item.active span {
  color: var(--primary);
}
