:root {
  --app-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --primary-color: #75472d;
  --secondary-color: #c27b43;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #fbf8f3;
  --dark-color: #34251c;
}

body {
  font-family: var(--app-font);
  background-color: #f7f4ef;
  color: #34251c;
}

.navbar-brand {
  font-weight: bold;
}

.app-brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 5px;
  background: #fff;
}

.sidebar {
  min-height: 100vh;
  background-color: var(--dark-color);
}

.sidebar .nav-link {
  color: #adb5bd;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin: 0.125rem 0;
}

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

.main-content {
  margin-left: 250px;
  padding: 20px;
}

.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.table th {
  border-top: none;
  font-weight: 600;
  color: var(--dark-color);
}

/* Shared gijbake type, color and control styling. */
html,
body,
button,
input,
select,
textarea,
.btn,
.form-control,
.form-select,
.dropdown-menu,
.table,
.card,
.modal,
.alert,
.badge {
  font-family: var(--app-font);
}

body {
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand,
.card-header {
  font-family: var(--app-font);
  color: #34251c;
}

a {
  color: var(--primary-color);
}

a:hover {
  color: #a86434;
}

.navbar.bg-dark,
.bg-dark {
  background-color: #34251c !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.text-white {
  color: #fff !important;
}

.text-muted {
  color: #75675d !important;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #a86434;
  border-color: #a86434;
}

.form-control:focus,
.form-select:focus {
  border-color: #c27b43;
  box-shadow: 0 0 0 0.2rem rgba(194, 123, 67, 0.18);
}

.card {
  background-color: #fff;
}

.app-brand-logo {
  background: transparent;
}

.badge {
  font-size: 0.75em;
}

.alert {
  border: none;
  border-radius: 0.5rem;
}

/* Dropdown styling */
.dropdown-menu {
  border-radius: 0.375rem;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  padding: 0.5rem 1rem;
}

.dropdown-item:hover,
.dropdown-item.active {
  background-color: var(--primary-color);
  color: white;
}

.dropdown-item.text-danger:hover {
  background-color: var(--danger-color) !important;
  color: white !important;
}

/* User button styling */
.btn-user {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-user:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-user:focus {
  color: white;
  box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
}

.btn-user::after {
  margin-left: 0.5rem;
}

/* Dropdown menu styling for user dropdown */
#userDropdown ~ .dropdown-menu {
  min-width: 250px;
}

/* Sidebar toggle button styling */
#sidebarToggle {
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

#sidebarToggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Close button for mobile sidebar */
#sidebarClose {
  z-index: 1000;
}

/* =========================
   MOBILE RESPONSIVE LAYOUT
========================= */

@media (max-width: 767px) {

  body {
    overflow-x: hidden;
  }

  .main-content {
    margin-left: 0;
    padding: 15px;
  }

  /* Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: -270px;
    width: 260px;
    height: 100vh;
    z-index: 1050;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s ease;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
  }

  .sidebar.show {
    left: 0;
  }

  /* Sidebar Links */
  .sidebar .nav-link {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    min-height: 45px;
  }

  /* Navbar */
  .navbar {
    position: sticky;
    top: 0;
    z-index: 1060;
  }

  /* User dropdown */
  .dropdown-menu {
    min-width: 220px;
    max-width: 95vw;
  }

  /* Remove broken fullscreen dropdown */
  .dropdown-menu-end {
    right: 0;
    left: auto;
  }

  /* Sidebar Toggle */
  #sidebarToggle {
    border: none;
  }

  #sidebarToggle:focus {
    box-shadow: none;
  }

  /* Cards */
  .card {
    margin-bottom: 1rem;
  }

  /* Tables */
  .table-responsive {
    overflow-x: auto;
  }
}


/* =========================
   DESKTOP
========================= */

@media (min-width: 768px) {

  body {
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 250px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .main-content {
    margin-left: 250px;
    padding: 20px;
  }

  #sidebarToggle,
  #sidebarClose {
    display: none !important;
  }
}
