/* Layout */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  flex-shrink: 0;
  min-height: 100vh;
  align-self: stretch;
}

.logo-container {
  padding: 0 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background-color: var(--primary-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-menu {
  list-style: none;
  flex: 1;
}

.nav-item {
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
  vertical-align: unset;
  line-height: 1;
  display: flex;
  align-items: center;
}

.nav-item:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.nav-item.active {
  background-color: #f8fafc;
  color: var(--primary-color);
  border-right: 3px solid var(--primary-color);
  font-weight: 600;
}

.user-profile-widget {
  margin: 1.5rem 1.5rem 0;
  padding: 1rem;
  background-color: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #cbd5e1;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info .user-name {
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
}
.user-info .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

/* Main Content */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.top-header {
  height: 72px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  width: 320px;
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  border: 1px solid var(--primary-color);
  box-shadow: 0 0 0 3px rgba(15, 56, 110, 0.1);
}

.search-bar span.search-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.search-bar:focus-within span.search-icon {
  color: var(--primary-color);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  margin-left: 0.5rem;
  width: 100%;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.875rem;
  caret-color: #2563eb; /* Matches the blue cursor in the image */
}

.search-bar input::placeholder {
  color: #94a3b8;
}

.search-bar .clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #94a3b8;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 0.5rem;
}

.search-bar .clear-btn:hover {
  background-color: #64748b;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Content Area */
.content-area {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.history-block {
  background-color: var(--primary-color);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.history-title {
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}
.history-subtitle {
  color: #94a3b8;
  font-size: 0.875rem;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Utility / Generic */
.d-none { display: none !important; }
.d-flex { display: flex !important; }

/* Collapsible Content */
.collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background-color: #f1f5f9;
  border-radius: 8px;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  transition: background-color 0.2s;
}
.collapsible-header:hover {
  background-color: #e2e8f0;
}
.collapsible-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.collapsible-content.expanded {
  display: block;
}
