/* main.css */
/* Project-specific styles and Bootstrap 5 overrides */

:root {
  /* Canonical Bootstrap 5 custom variables */
  /* Default Bootstrap Blue: #0d6efd */
  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;

  /* System font stack (crisp dashboard look) */
  --bs-font-sans-serif: Inter, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif,
    'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';

  /* Example: adjust body background */
  /* --bs-body-bg: #f8f9fa; */
}

body {
  font-family: var(--bs-font-sans-serif);
}

/* 
  Canonical Override for Buttons:
  Bootstrap components often hardcode their local variables in the CDN version.
  We explicitly link them back to our global variables here.
  To change branding color, simply update --bs-primary in :root above.
*/
.btn-primary {
  --bs-btn-color: #fff;
  /* White text for blue background */
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0b5ed7;
  /* Slightly darker blue */
  --bs-btn-hover-border-color: #0a58ca;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0a58ca;
  --bs-btn-active-border-color: #0a53be;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

/* Style readonly inputs to look disabled */
.form-control[readonly] {
  background-color: var(--bs-secondary-bg);
  opacity: 1;
  cursor: not-allowed;
}

/*
  App Shell Layout
  - Fixed 100vh viewport
  - 240px sidebar
  - Sticky header
  - Scrollable content area
*/
.app-body {
  height: 100vh;
  overflow: hidden;
  background: #f4f7f6;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.app-topbar {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.app-topbar .navbar {
  background: #ffffff;
}

.app-body-row {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.app-sidebar {
  flex: 0 0 310px;
  width: 310px;
  height: 100%;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  border-right: var(--bs-border-width) solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.app-sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Sidebar navigation (nav-pills) */
.app-sidebar .nav-link {
  color: var(--bs-body-color);
}

.app-sidebar .nav-link:hover {
  background: var(--bs-secondary-bg);
}

.app-sidebar .nav-pills .nav-link.active {
  background: var(--bs-secondary-bg);
  color: var(--bs-primary);
  font-weight: 600;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.app-content-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #f4f7f6;
}

.app-footer {
  flex: 0 0 auto;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.app-content-pad {
  padding: 2rem;
}

@media (min-width: 992px) {
  .app-content-pad {
    padding: 3rem;
  }
}

.app-content-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  background: transparent;
}

/* Buttons: consistent radius */
.btn {
  border-radius: 0.375rem;
}

/* Constrain dashboard search input-groups (prevents over-stretching on wide screens) */
.pp-search {
  width: 100%;
  max-width: 350px;
}

/* Dashboard tables: modern table (horizontal separators, no vertical borders) */
.table-dashboard {
  border: 0;
}

.table-dashboard th,
.table-dashboard td {
  border-left: 0;
  border-right: 0;
  padding: 0.5rem;
  vertical-align: middle;
}

.table-dashboard thead th {
  border-bottom: 1px solid var(--bs-border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  letter-spacing: 0.02em;
}

.table-dashboard tbody tr:hover {
  background: var(--bs-tertiary-bg);
}
