/* ============================================
   POLYMORPH LAYOUT STYLESHEET
   Color Scheme: #026565 (main) with lighter shades
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Roboto', 'Open Sans', Arial, Verdana, Helvetica, sans-serif;
  font-size: 14px;
  background-color: #f5f5f5;
}

body {
  padding-top: 60px;
}

/* ============================================
   NAVBAR (TOP)
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, #026565 0%, #024d4d 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  gap: 10px;
}

.navbar-brand:hover {
  color: #e0f2f1;
}

.navbar-brand img {
  height: 40px;
  width: auto;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-left: auto;
}

.navbar-item {
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.navbar-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-badge-new {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: #e65100;
  border-radius: 3px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-user-info {
  color: #ffffff;
  font-size: 12px;
}

.navbar-user-name {
  display: block;
  font-weight: 500;
  color: #ffffff;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  padding: 8px 12px;
  margin-right: 8px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.sidebar-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   SIDEBAR (LEFT) — Bootstrap 5 collapsible style
   ============================================ */
.main-wrapper {
  display: flex;
  height: calc(100vh - 60px);
  margin-top: 0;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  min-width: 250px;
  background-color: #ffffff;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
  transition: width 0.3s ease, min-width 0.3s ease;
}

.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-menu {
  list-style: none;
  padding: 15px 0;
}

.sidebar-menu-item {
  position: relative;
}

/* --- Top-level menu link (leaf, no submenu) --- */
.sidebar-menu-item > a {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  color: rgba(0, 0, 0, .65);
  text-decoration: none;
  font-size: 13px;
  gap: 8px;
  border-radius: 4px;
  margin: 1px 8px;
}

.sidebar-menu-item > a:hover {
  background-color: #e0f2f1;
  color: rgba(0, 0, 0, .85);
}

.sidebar-menu-item > a i.fa {
  width: 18px;
  text-align: center;
  color: #026565;
}

.sidebar-menu-item > a .menu-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}

/* --- Toggle items (has-submenu): btn-toggle style --- */
.sidebar-menu-item.has-submenu > a,
.sidebar-submenu-item.has-submenu > a {
  font-weight: 600;
  color: rgba(0, 0, 0, .65);
  background-color: transparent;
}

.sidebar-menu-item.has-submenu > a::before,
.sidebar-submenu-item.has-submenu > a::before {
  content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
  width: 1.25em;
  line-height: 0;
  flex-shrink: 0;
  transition: transform .35s ease;
  transform-origin: .5em 50%;
}

.sidebar-menu-item.has-submenu.active > a::before,
.sidebar-submenu-item.has-submenu.active > a::before {
  transform: rotate(90deg);
}

.sidebar-menu-item.has-submenu > a:hover,
.sidebar-submenu-item.has-submenu > a:hover {
  color: rgba(0, 0, 0, .85);
  background-color: #e0f2f1;
}

.sidebar-menu-item.has-submenu.active > a,
.sidebar-submenu-item.has-submenu.active > a {
  color: rgba(0, 0, 0, .85);
}

/* --- Submenu container --- */
.sidebar-submenu {
  list-style: none;
  display: none;
  padding: 0;
}

.sidebar-menu-item.active > .sidebar-submenu,
.sidebar-submenu-item.active > .sidebar-submenu {
  display: block;
}

/* --- Submenu leaf links --- */
.sidebar-submenu-item {
  list-style: none;
  position: relative;
}

.sidebar-submenu-item > a {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  margin: 1px 8px 1px 36px;
  color: rgba(0, 0, 0, .65);
  text-decoration: none;
  font-size: 12px;
  border-radius: 4px;
  gap: 6px;
}

.sidebar-submenu-item > a:hover {
  background-color: #e0f2f1;
  color: rgba(0, 0, 0, .85);
}

/* Active link highlight (current page) */
.sidebar-submenu-item.current-page > a {
  background-color: #e0f2f1;
  color: #026565;
  font-weight: 500;
}

/* --- Nested submenu toggle items (level 2+) --- */
.sidebar-submenu-item.has-submenu > a {
  margin-left: 28px;
}

/* --- Deeper nested links (level 2) --- */
.sidebar-submenu .sidebar-submenu .sidebar-submenu-item > a {
  margin-left: 52px;
}

/* --- Even deeper nested links (level 3) --- */
.sidebar-submenu .sidebar-submenu .sidebar-submenu .sidebar-submenu-item > a {
  margin-left: 68px;
}

/* --- Menu badge (e.g. "NEW") --- */
.menu-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: #e65100;
  border-radius: 3px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-container {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px;
  background-color: #f5f5f5;
}

.main-content {
  background-color: #ffffff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 30px;
  overflow-x: auto;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
}

.breadcrumb {
  list-style: none;
  display: flex;
  gap: 5px;
  font-size: 12px;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin: 0 5px;
  color: #cccccc;
}

.breadcrumb a {
  color: #026565;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ============================================
   HEADER SECTIONS
   ============================================ */
.section-header {
  background-color: #026565;
  color: #ffffff;
  padding: 15px 20px;
  border-radius: 4px 4px 0 0;
  font-weight: 500;
  font-size: 14px;
}

.header-title {
  font-size: 28px;
  font-weight: 500;
  color: #024d4d;
  margin-bottom: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-primary {
  background-color: #026565;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #024d4d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background-color: #04897b;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #026565;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   TABLES
   ============================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.table thead th {
  background-color: #f0f7f7;
  color: #026565;
  padding: 12px;
  text-align: left;
  font-weight: 500;
  border-bottom: 2px solid #026565;
}

.table tbody td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
  background-color: #f9f9f9;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background-color: #f0f7f7;
  color: #666666;
  padding: 20px;
  text-align: center;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  margin-top: 30px;
}

.footer a {
  color: #026565;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
    min-width: 200px;
  }

  .main-content {
    padding: 15px;
  }

  .main-container {
    padding: 15px;
  }

  .navbar {
    padding: 0 10px;
  }

  .navbar-menu {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .main-wrapper {
    position: relative;
  }

  .sidebar {
    position: fixed;
    left: -250px;
    top: 60px;
    bottom: 0;
    transition: left 0.3s ease;
    width: 250px;
    min-width: 250px;
    z-index: 900;
  }

  /* Override desktop collapse — mobile uses left positioning instead */
  .sidebar-collapsed .sidebar {
    width: 250px;
    min-width: 250px;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 899;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .navbar-menu {
    gap: 10px;
  }

  .navbar-user {
    display: none;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}
