/* Custom Page Banner */
.page-hero {
  background-color: var(--primary);
  color: var(--white);
  padding: 4rem 0 2rem;
  position: relative;
  overflow: hidden;
  background-image: url('../images/admin/sliderimages/202309201695204552B03.jpg'); /* fallback bg */
  background-size: cover;
  background-position: center;
}
.page-hero-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to right, var(--primary-dark) 20%, rgba(15,37,64,0.7) 100%);
  z-index: 1;
}
.page-hero .container {
  position: relative;
  z-index: 2;
}
.page-title {
  font-family: var(--font-display);
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: var(--white);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #a0aec0;
  align-items: center;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* Page Layout */
.page-wrapper {
  display: flex;
  gap: 3rem;
  padding: var(--section-gap) 0;
}
.page-sidebar {
  width: 300px;
  flex-shrink: 0;
}
.sidebar-menu {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--surface-alt);
}
.sidebar-title {
  background: var(--primary-dark);
  color: var(--white);
  padding: 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
}
.sidebar-link {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--surface-alt);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--surface);
  color: var(--primary);
  padding-left: 2rem;
  border-left: 3px solid var(--accent);
}
.page-content {
  flex: 1;
  min-width: 0; /* critical: prevents flex child from overflowing */
  overflow: hidden;
}

/* Content Typography & Elements */
.content-section {
  margin-bottom: 3rem;
  max-width: 100%;
  overflow: hidden;
}
.content-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--surface-alt);
  position: relative;
}
.content-section h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--accent);
}
.content-section h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.content-section p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Hard override for legacy inline-widthed tables from OLD-WEBSITE */
.content-section table,
.content-section table * {
  max-width: 100% !important;
  box-sizing: border-box;
}
.content-section table {
  width: 100% !important;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.content-section table td,
.content-section table th {
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
  word-break: break-word;
}
.content-section img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}
/* Prevent any element from breaking out of the content box */
.content-section * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Tabs */
.tabs-header {
  display: flex;
  border-bottom: 2px solid var(--surface-alt);
  margin-bottom: 2rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 1rem 2rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  font-size: 1.05rem;
}
.tab-btn:hover {
  color: var(--primary);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}
.tab-content.active {
  display: block;
}

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

/* Filters */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-alt);
}
.filter-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  min-width: 200px;
}
.filter-search {
  flex: 2;
  position: relative;
  min-width: 250px;
}
.filter-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.filter-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-alt);
  background: var(--white);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-alt);
  text-align: left;
}
.data-table th {
  background-color: var(--surface-alt);
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
}
.data-table tr:hover {
  background-color: var(--surface);
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-new {
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.badge-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
}
.badge-pdf:hover {
  background-color: #dc2626;
  color: var(--white);
}

@media (max-width: 1024px) {
  .page-wrapper {
    flex-direction: column;
  }
  .page-sidebar {
    width: 100%;
  }
  .page-title {
    font-size: 2.5rem;
  }
}
