/* main.css */

/* =========================
   CSS Reset & Base Setup
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

:root {
  /* ==== Colors ==== */
  --color-primary: #376200;
  --sidebar-hovered: #608b32;
  --submenu-hovered: #4c7728;

  --color-light: #f0f0f0;
  --color-font-white: #ffffff;

  --color-dark: #333;

  --color-text: #1f2937;
  --color-heading: #111827;

  --color-success: #376200;
  --color-success-hovered: #437f10;

  --color-error: #b2070a;
  --color-error-hovered: #fb0004;

  --color-blue: #2E5BFF;
  --color-blue-hovered: #4471F1;

  --color-warning: #fef3c7;
  --color-warning-text: #92400e;

  --color-border: #cbd5e1;

  /* ==== Typography ==== */
  --font-base: "Poppins", sans-serif;
  --font-size-base: 16px;
  --font-size-xsm: clamp(0.5rem, 0.6vw, 0.675rem);
  --font-size-sm: clamp(0.75rem, 0.8vw, 0.875rem);
  --font-size-md: clamp(0.875rem, 1vw, 1rem);
  --font-size-lg: clamp(1rem, 1.5vw, 1.25rem);
  --font-size-xl: clamp(1.25rem, 2vw, 1.5rem);
  --font-size-xxl: clamp(1.5rem, 3vw, 2rem);
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 600;

  /* ==== Radius & Shadow ==== */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.8rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: 1.6;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* =========================
   Typography
========================= */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--color-heading);
  /* margin-bottom: 0.5em; */
}

p {
  font-size: var(--font-size-md);
}

a {
  color: inherit;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  outline: none;
  cursor: pointer;
}

.hide-scrollbar {
  overflow: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.scroller-format {
    scrollbar-width: thin;               /* Firefox */
    scrollbar-color: #bbb transparent;   /* Firefox */
}

/* Chrome, Edge, Safari */
.scroller-format::-webkit-scrollbar {
    height: 8px;   /* for horizontal scroll */
    width: 8px;    /* for vertical scroll */
}

.scroller-format::-webkit-scrollbar-track {
    background: transparent;             /* no visible track */
    margin: 4px;                         /* small padding */
}

.scroller-format::-webkit-scrollbar-thumb {
    background-color: #bbb;              /* thumb color */
    border-radius: 10px;                 /* rounded ends */
    transition: background-color 0.3s;
}

.scroller-format::-webkit-scrollbar-thumb:hover {
    background-color: #888;              /* darker on hover */
}



.text-center {
  text-align: center;
}

/* =========================
   Layout Utilities
========================= */

.flex { display: flex; }

.jus-start { justify-content: start; }
.jus-center { justify-content: center; }
.jus-end { justify-content: end; }
.jus-between { justify-content: space-between; }
.jus-around { justify-content: space-around; }

.al-start { align-items: start; }
.al-center { align-items: center; }
.al-end { align-items: end; }

.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }

.flexible {flex: 1;}

.gap-s {gap: 5px;}
.gap-m {gap: 10px;}
.gap-l {gap: 20px;}

/* .layout-container {
  display: flex;
  align-items: center;
  justify-content: center;
} */

.container {
  /* display: flex; */
  width: 100%;
  /* max-width: 1920px; */
  height: 100vh;
}

/* Content */
.content {
  /* flex-grow: 1;
  display: flex;
  flex-direction: column; */
  gap: 10px;
  padding: 0px;
  background-color: #f0f0f0;
  overflow: hidden;
}

.header-container {
  /* height: 120px; */
  padding: 20px 20px 0 20px;
  background-color: #f0f0f0;
}

.header {
  height: 80px;
  background-color: #ffffff;
  color: black;
  /* display: flex;
  align-items: center;
  justify-content: space-between; */

  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.2),
    -4px -4px 15px rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease;
}

.header .left {
  /* display: flex;
  align-items: center;
  justify-content: center; */
  gap: 10px;
}

/* notification */

.notif-badge {
  position: absolute;
  top: -3px;
  right: -1px;
  background-color: green;
  color: white;
  font-size: 9px;
  font-weight: bold;
  border-radius: 100%;
  height: 18px;
  width: 18px;
  display: none; /* hidden if count = 0 */
  justify-content: center;
  align-items: center;
}

.page-title {
  font-size: var(--font-size-xxl);
  font-weight: var(--font-weight-bold);
}

.page-control {
  /* display: flex;
  align-items: center;
  justify-content: space-between; */

  width: 100%;
  padding: 5px 20px;
}

.page-control .left {
  flex: 1 1 0%;
  /* display: flex;
  justify-content: end;
  align-items: center; */
}

.page-control .right {
  flex: 1 1 0%;
  /* display: flex;
  justify-content: start;
  align-items: center; */
  gap: 20px;
}

.open-sidebar-btn {
  display: none; /* Default hidden, shown on mobile via media query */
}

.main-content {
  gap: 10px;
  padding: 0 20px 20px 20px;
}

.notif-link {
  text-decoration: underline;
}

/* =========================
   Sidebar
========================= */

.sidebar {

  background-color: var(--color-primary);
  /* transition: width 0.3s ease, transform 0.3s ease; */
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  z-index: 100;
  padding: 20px;
  color: var(--color-font-white);
}

/* Sidebar expanded */
.sidebar.expanded {
  width: 310px;
  min-width: 280px;
}
.sidebar.expanded .menu.expanded {
  display: block;
  overflow: scroll;
}

/* Sidebar collapsed */
.sidebar.collapsed {
  width: 80px;
  overflow: visible;
}

.sidebar.collapsed .menu.collapsed {
  display: flex;
}

.sidebar.collapsed .upper-part .sidebar-head {
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar.collapsed .sidebar-head .logo {
  opacity: 0;
  display: none;
  max-width: 170px;
  width: 100%;
}

.burger-icon {
  height: 30px;
  transition: transform 0.3s ease;
}

.sidebar.collapsed .burger-icon.desktop {
  transform: rotate(180deg);
}

.sidebar.collapsed .lower-part .profile-info .text-information {
  display: none;
}

.sidebar.collapsed .lower-part .logout-container span {
  display: none;
}


/* upper part */
.sidebar .upper-part {
  gap: 10px;
  width: 100%;
}

.sidebar .upper-part .sidebar-head {
  height: 104px;
  width: 100%;
}

/* menu expanded */
.menu.expanded {
  flex: 1;
  padding: 10px;
  list-style: none;
  width: 100%;
  display: none;
  max-height: calc(100vh - 280px);
}

.menu.expanded .menu-item {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  cursor: pointer;
  justify-content: space-between;
  transition: background-color 0.3s ease;
}

.menu.expanded .menu-item:hover {
  background-color: #608b32;
}

.menu.expanded .menu-item.active {
  background-color: #608b32;
  color: var(--color-font-white);
}

.menu.expanded .menu-item .left {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-size: var(--font-size-md);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.menu.expanded .menu-item .left .menu-icon {
  height: 24px;
}

.menu.expanded .submenu {
  display: flex;
  flex-direction: column;

  font-size: var(--font-size-sm);
  overflow: hidden;
  max-height: 0;
  /* transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out; */
  margin-left: 30px;
  border-left: var(--sidebar-hovered) solid 2px;
}

.menu.expanded .submenu a {
  text-decoration: none;
  color: var(--color-font-white);
  font-size: var(--font-size-md);
  transition: background-color 0.2s ease;
  padding: 4px 32px;
}

.menu.expanded .submenu a:hover,
.menu.expanded .submenu a.active {
  background-color: var(--submenu-hovered);
  border-radius: 4px;
}

/* Show submenu with smooth animation */
.menu.expanded .menu-item.active + .submenu {
  max-height: 500px; /* Adjust based on expected content height */
}

/* Arrow rotation */
.menu.expanded .menu-item .arrow {
  height: 20px;
  transition: transform 0.3s ease;
}

.menu.expanded .menu-item.active .arrow {
  transform: rotate(180deg);
}

/* menu collapsed */
.menu.collapsed {
  width: 70px;
  display: none;
  flex-direction: column;
  position: relative;
}

.menu.collapsed .menu-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 13px;
  border-radius: var(--radius-sm);
}

.menu.collapsed .menu-item:hover {
  background-color: var(--sidebar-hovered);
}

.menu.collapsed .menu-item.active {
  background-color: var(--sidebar-hovered);
}
.menu.collapsed .menutitle a.active {
  background-color: var(--sidebar-hovered);
}


.menu.collapsed .menu-link {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.menu.collapsed .menu-icon {
  width: 24px;
  height: 24px;
}

/* Tooltip (Floating Menutitle) */
.menu.collapsed .menutitle {
  display: flex;
  align-items: start;
  justify-content: center;
  flex-direction: column;
  gap: 5px;

  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);

  background-color: var(--submenu-hovered);
  color: var(--color-font-white);
  padding: 10px;
  width: 200px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
  z-index: 10;
}

/* Show tooltip on hover */
.menu.collapsed .menu-item:hover .menutitle {
  opacity: 1;
  pointer-events: auto;
}

.menu.collapsed .menutitle a {
  border-radius: var(--radius-sm);
  padding: 4px 20px;
  width: 100%;
  color: var(--color-font-white);
  text-decoration: none;
  font-size: var(--font-size-md);
}

.menu.collapsed .menutitle a:hover {
  background-color: var(--sidebar-hovered);
}

/* lower part */
.sidebar .lower-part {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);

  flex-wrap: nowrap;
  gap: 10px;
  padding: 20px 0;
  width: 100%;

  background-color: var(--color-primary);
}

.sidebar .lower-part .profile-info {
  flex-wrap: nowrap;
  gap: 20px;
  width: 100%;
  font-size: var(--font-size-sm);
}

.sidebar .lower-part .profile-info img {
  width: 100%;
  max-width: 40px;
  height: 40px;
  border-radius: 100%;
}

.profile-info .text-information .name {
  font-weight: 600;
  white-space: nowrap;
}
.profile-info .text-information .position {
  font-weight: light;
  white-space: nowrap;
}

.sidebar .lower-part .logout {
  gap: 10px;
  color: var(--color-font-white);
  font-size: var(--font-size-lg);
}

/* =========================
   Buttons
========================= */

.primary-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  
  padding: 8px 16px;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  height: 100%;
}

.primary-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.primary-btn:active,
.page-control .right .main-dropdown-toggle:active,
.pagination a:active
{
  transform: scale(0.98);
}

.primary-btn img {
  height: 22px;
}

.solid-green {
  background: var(--color-primary);
  color: var(--color-font-white);
  border: 1px solid var(--color-primary);
}
.solid-green:hover {
  background: var(--color-success-hovered);
  color: var(--color-font-white);
}

.hollow-red {
  background: none;
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.hollow-red:hover {
  background: var(--color-error);
  color: var(--color-font-white);
}

.solid-red {
  background: var(--color-error);
  color: var(--color-font-white);
  border: 1px solid var(--color-error);
}
.solid-red:hover {
  background: var(--color-error-hovered);
  color: var(--color-font-white);
}

.solid-blue {
  background: var(--color-blue);
  color: var(--color-font-white);
  border: 1px solid var(--color-blue);
}
.solid-blue:hover {
  background: var(--color-blue-hovered);
  color: var(--color-font-white);
}

/* Disabled state */
.primary-btn:disabled,
.primary-btn.disabled {
  background: #ccc;
  border-color: #ccc;
  color: #666;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* table buttons */
.table-container .btn {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: 
    background 0.3s ease,
    color 0.3s ease,
    transform 0.1s ease,
    box-shadow 0.3s ease;
}



/* Edit button */

.table-container .blue-btn {
  background-color: #d6e4ff;
  color: #2E5BFF;             
  margin-right: 5px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
}

.table-container .blue-btn:hover {
  background-color: #b3ccff;  
  box-shadow: 0 4px 12px rgba(46, 91, 255, 0.2);
}

.table-container .blue-btn:active {
  transform: scale(0.98);
  background-color: #99bbff;  
}

.table-container .green-btn {
  background-color: #c2eed5;  
  color: #0b8457;
  margin-right: 5px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.table-container .green-btn:hover {
  background-color: #a8e2c1;  
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.table-container .green-btn:active {
  transform: scale(0.98);
}

/* Terminate Button */
.table-container .red-btn {
  background-color: #fbeaea;
  color: #d9534f;
  border: 1px solid #d9534f;
}

.table-container .red-btn:hover {
  background-color: #f5c7c7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.table-container .red-btn:active {
  transform: scale(0.98);
}


/* svg icon button */
.basic-icon-button {
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.icon-button:hover {
  background-color: #f0f0f0; 
}
.icon-button:active {
  background-color: #e0e0e0; 
}
.icon-img {
  height: 28px;
  display: block;
  pointer-events: none; 
}

/* pagination button */
.pagination a {
  display: block;
  padding: 4px 8px;
  text-decoration: none;
  background: none;
  color: #acb8c7;
  border: #acb8c7 solid 0.1px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.pagination a:hover {
  background: #acb8c7;
  color: var(--color-font-white);
  border: var(--color-font-white) solid 0.1px;
}

.pagination.active a {
  background: #acb8c7;
  color: var(--color-font-white);
  border: var(--color-font-white) solid 0.1px;
}


/* drop down button */

.page-control .right .dropdown {
  position: relative;
  display: inline-block;
}

.page-control .right .main-dropdown-toggle {
  color: var(--color-font-white);
  padding: 12px 16px;
  min-width: 180px;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-control .right .dropdown-menu {
  display: none;
  
  position: absolute;
  top: 50px;
  left: 0;
  background-color: var(--submenu-hovered); 
  min-width: 180px;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
  z-index: 10;
}

  .page-control .right .dro.pdown-menu {
    display: none;
  }
  .page-control .right .dropdown-menu.show {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

.page-control .right .dropdown-item {
  display: block;
  padding: 4px 16px;
  color: var(--color-font-white);
  text-decoration: none;
  font-size: 16px;
}

.page-control .right .dropdown-item:hover {
  background-color: var(--sidebar-hovered);
  border-radius: 5px;
}

.page-control .right .dropdown-item.active {
  background-color: var(--sidebar-hovered); 
  border-radius: 5px;
}


/* =========================
   Cards / Panels
========================= */
.card {
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
  margin: 1rem 0;
}

/* =========================
   Forms
========================= */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[list],
textarea,
select {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
  font-size: 1rem;
  transition: 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type="search"] {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background-color: #ffffff;
  font-size: 1rem;
  transition: 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}


input:focus,
textarea:focus,
select:focus,
input[type="search"]:focus 
{
  border-color: #376200;
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(55, 98, 0, 0.2);
}

select::placeholder,
input::placeholder,
textarea::placeholder {
  color: #999;
  font-size: 0.95rem;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
}

.input-group {
  width: 100%;
  margin-bottom: 20px;
}

/* search input */
.search-form {
  width: 100%;
  max-width: 400px;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-button {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.search-icon {
  width: 24px;
  height: 24px;
  opacity: 0.6;
}

/* Dropdown Search input */
.combo-box {
  position: relative;

  width: 100%;
  max-width: 300px;
  font-family: sans-serif;
}

.combo-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background-color: #fff;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dropdown-options div {
  padding: 10px 14px;
  cursor: pointer;
}

.dropdown-options div:hover {
  background-color: #f0f0f0;
}

.hidden {
  display: none;
}

/* =========================
   Tables
========================= */

/* hide check-box */
.hide-column {
  display: none !important;
}

/* Main table */
.table-container {
  height: calc(100vh - 187px);

  width: 100%;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.2),
    -4px -4px 15px rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease;
  position: auto;
  overflow: scroll;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container thead th {
  position: sticky;
  top: 0;
  background: #d1f0af;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
  z-index: 2;
}

.table-container tbody tr:hover {
  background-color: #f0f8e7;
  cursor: pointer;
}

.table-container tbody td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: center;
  word-break: break-word;
  max-width: 180px;
}

.table-container tbody td:nth-child(1) {
  text-align: center;
  width: 100px;
}

.table-container .click-cell {
  cursor: pointer;
}

.table-container .expanded {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: initial !important;
}

.table-container .status {
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.table-container .received,
.table-container .completed,
.table-container .released,
.table-container .purchased,
.table-container .approved,
.table-container .active,
.table-container .in-stock {
  background-color: #d4edda;
  color: #155724;
}
.table-container .disapproved,
.table-container .out-of-stock {
  background-color: #f8d7da;
  color: #721c24;
}
.table-container .processing,
.table-container .low-stock {
  background-color: #fff3cd;
  color: #856404;
}
.table-container .warning {
  background-color: #fde2c8;
  color: #9b3f00;
}
.table-container .inactive {
  background-color: #dce3ea;
  color: #5d6a78;          
}
.table-container .purchasing,
.table-container .pending {
  background-color: #d9e8f7; 
  color: #3a6fca;           
}


input[type="checkbox"].checkAll {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.table-container .dropdown {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.table-container .table-dropdown-toggle {
  padding: 2px;
  border: none;
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

.table-container .table-dropdown-toggle img {
  width: 9px;
}

.table-container .dropdown-menu {
  display: none;
  position: absolute;
  top: 37px;

  background-color: var(--color-font-white);
  min-width: 160px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1;
  padding: 6px 0;
}
.table-container .dropdown-menu button {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}
.table-container .dropdown-menu button:hover {
  background-color: #f1f1f1;
}
.table-container .dropdown-menu.show {
  display: flex;
  flex-direction: column;
}

.read {
    background-color: #f5f5f5;
}
.unread {
    background-color: #ffffff;
    font-weight: bold;
}


/* sub table */
.table-container .sub-table-row td {
  background-color: #f6fff0;
  padding: 0 !important;
  border-bottom: none;
}

.table-container .sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-lg);
}

.table-container .sub-table thead {
  background: #e3f6c5;
}

.table-container .sub-table th,
.table-container .sub-table td {
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
}

.table-container tr.selected-row {
  box-shadow: inset 0 0 0 2px #376200;
  background-color: #f1f5ef;
  border-radius: 7px;
  position: relative;
  z-index: 1;
}

.table-container .sub-table tbody tr:hover {
  background-color: #e8f5d0;
  cursor: default;
}

.table-container tr.sub-table td {
  padding: 10px;
}

.table-container .inner-sub-table {
  width: 100%;
  border-collapse: collapse;
}

.view-item-requests {
  cursor: pointer;
}


.view-item-requests span {
  margin-left: 10px;
}


.sort-btn {
  background: none;
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sort-arrow {
  transition: transform 0.3s ease;
}

.sort-asc .sort-arrow {
  transform: rotate(180deg);
}

.sort-desc .sort-arrow {
  transform: rotate(0deg);
}

.sort-btn {
  background: none;
  border: none;
  font-weight: 600;
  cursor: pointer;
  gap: 15px;
}

.sort-arrow {
  transition: transform 0.3s ease;
}

.sort-asc .sort-arrow {
  transform: rotate(180deg);
}

.sort-desc .sort-arrow {
  transform: rotate(0deg);
}



/* pagination */
.pagination-holder {
  position: sticky;
  bottom: 0;
  left: 0 ;
  background: #fff;
  border-top: 1px solid #ddd;
  z-index: 3;
  padding: 0 20px 20px 20px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: end;

  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  gap: 10px;
  font-size: var(--font-size-sm);
}

.pagination li {
  display: inline;
  color: #acb8c7;
}


/* requests form table */
.request-container {
  width: 100%;
}
.request-container table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;  
}

/* Sticky header */
.request-container thead th {
  /* background: white; */
  position: sticky;
  top: 0;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
  z-index: 2;
}

/* Body cell styling */
.request-container tbody td {
  padding: 10px;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: middle;
}

.request-container tbody td:nth-child(1) {
  min-width: 300px; 
}
.request-container tbody td:nth-child(2),
.request-container tbody td:nth-child(3) {
  min-width: 160px; 
}
.request-container tbody td:nth-child(4),
.request-container tbody td:nth-child(5),
.request-container tbody td:nth-child(6) {
  min-width: 100px; 
}


/* =========================
   Alerts / Notifications
========================= */
.custom-alert {
  position: relative;
  padding: 15px 45px 15px 15px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.alert-success {
  background-color: #e6f9ec;
  color: #276749;
  border-left: 5px solid #38a169;
}

.alert-danger {
  background-color: #fdecea;
  color: #a94442;
  border-left: 5px solid #e53e3e;
}

.alert-close {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}



/* =========================
   Modal
========================= */

.modal {
  position: fixed;
  z-index: 1000;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1.5rem;
}

/* =========================
   With Form page
========================= */

.form-container {
  background: white;
  border-radius: 10px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  /*height: calc(100vh - 120px); */
}

.profile-header {
  background-color: #e6f9dd;
  border-radius: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 20px;
  gap: 10px;
  margin-bottom: 20px;
}

.page-header {
  background-color: var(--color-primary);
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 5px;
  gap: 10px;
  margin-bottom: 20px;
  text-align: center;
}
.page-header h2 {
  color: var(--color-font-white);
  font-size: var(--font-size-lg);
}

.avatar img {
  width: 80px;
  height: 80px;
}

.profile-info h2 {
  font-size: 1.4rem;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  flex: 1;
  padding: 12px 40px 12px 44px; /* 40px on right, same style as search input */
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  transition: 0.3s ease;
}

/* Eye icon button */
.password-wrapper button {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Adjust SVG size if needed */
.password-wrapper svg {
  width: 20px;
  height: 20px;
}

.form-container .input-container {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
}

.input-container .left,
.input-container .right,
.input-pair .input-group
{
  flex: 1 1 0%;
}

.input-pair {
  display: flex;
  gap: 10px;
}

.form-container .button-container-right {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}
.form-container .button-container-left {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 10px;
}

.request-container {
  display: flex;
  flex-direction: column;
  gap: 20px;

  flex: 1 1 0%;
}

.request-container .row1,
.request-container .row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  width: 100%;
}

/* =========================
   Login page
========================= */

.login-container {
  min-height: 100vh;
  flex-direction: row;
}

.login-container .left {
  flex: 2;
  background-color: #fff;
  flex-direction: column;
  padding: 40px;
}

.login-container .text-container {
  margin-bottom: 30px;
  text-align: center;
}

.login-container .text-container h3 {
  font-size: 2rem;
  color: #376200;
  margin-bottom: 10px;
  font-weight: 700;
}

.login-container .text-container p {
  color: #808080;
}

.login-container .login-form {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Wrapper for icon + input */
.login-container .icon-wrapper,
 .input-container .icon-wrapper{
  position: relative;
  width: 100%;
}

/* Style input fields */
.login-container .icon-wrapper input[type="text"],
.login-container .icon-wrapper input[type="email"],
.login-container .icon-wrapper input[type="password"] {
  width: 100%;
  padding: 12px 16px 12px 44px; /* left padding for icon */
  border: 1px solid #ddd;
  border-radius: 10px;
  background-color: #ffffff;
  font-size: 1rem;
  transition: 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Focus effect */
.login-container .icon-wrapper input:focus,
 .input-container .icon-wrapper input:focus{
  border-color: #376200;
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(55, 98, 0, 0.2);
}

/* Static input icon */
.login-container .input-icon,
 .input-container .input-icon{
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  opacity: 0.6;
  pointer-events: none;
}

/* Password toggle  */
.login-container .eye-toggle,
 .input-container .eye-toggle{
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.login-container .login-btn {
  cursor: pointer;
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  transition: background 0.3s;
}

.login-container .right {
  flex: 3;
  position: relative;
  padding: 20px;
}

.login-container .overlay {
  background-color: #2d631d;
  position: relative;
  width: 100%;
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
}

.login-container .bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 20px;
}

.login-container .overlay-content {
  position: relative;
  z-index: 1;
  color: white;
  text-align: center;
}

.login-container .login-form-mobile {
  display: none;
}


/* =========================
   Profile page
========================= */

 .image-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 150px;
    height: 150px;
    cursor: pointer;
  }

  .image-upload-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ccc;
  }

  .upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s ease;
    font-size: 24px;
  }

  .image-upload-wrapper:hover .upload-overlay {
    opacity: 1;
  }

  #imageUpload {
    display: none;
  }


/* =========================
   Mapping page
========================= */
#map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #f0f0f0;
}

#grid-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    pointer-events: none;
}

#warehouse-map {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    z-index: 2; /* above grid */
}


.shelf-wrapper {
    position: absolute;
    cursor: grab;
}

.shelf-label {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.shelf {
  background-color: rgba(144, 238, 144, 0.5);
  position: relative;
  padding: 8px;
  border: 1px solid #3c763d;
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 50px);
  grid-template-rows: repeat(auto-fill, 50px);
  gap: 4px;
  box-sizing: border-box;
}

.shelf-wrapper.selected {
  outline: 3px solid #007bff;
  border-radius: 4px;
  z-index: 10;
}

.bin {
  display: flex;
  justify-content: center;
  flex-direction: column;

  width: 50px;
  height: 50px;
  border: 1px solid #696969;
  border-radius: 5px;
  padding: 4px;
  font-size: 12px;
  box-sizing: border-box;
  pointer-events: none;
  transition: transform 0.2s ease;
}

/* Bin interaction states */
.bin.selected {
  outline: 2px dashed #ff6600;
  border-radius: 3px;
}

.bin:active {
  opacity: 0.7;
  cursor: grabbing;
}

.bin.dragging {
  opacity: 0.5;
}

/* Hover & animation */
.bin.hover-preview {
  outline: 2px dashed #00f;
  transform: scale(1.1);
}

.bin.preview-swap {
  outline: 2px dashed #4caf50;
}

.bin.swapping {
  transform: scale(1.1);
}

.bin-swap-anim {
  transition: all 0.3s ease-in-out;
}



/* RIGHT SIDEBAR MAP */

/* Top bar dropdowns and buttons */
.top-bar {
  position: absolute;
  top: 15px;
  right: 360px;
  display: flex;
  align-content: center;
  gap: 20px;
  z-index: 10;
}

.top-bar .dropdown,
#filter-report {
  padding: 8px 30px 8px 12px;
  background-color: #365c00;
  color: white;
  border: none;
  border-radius: 7px;
  font-weight: 500;
  width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Use absolute/static path instead of {% static %} */
  background-image: url("/static/images/svg/sidebar_icons/arrow-down.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px 20px;
}
/* Style the dropdown options */
.dropdown option {
  background-color: #365c00; /* same as dropdown background */
  color: white;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 14px;
  border: none;
}

/* Hover and focus effect on options */
.dropdown option:hover,
.dropdown option:focus,
.dropdown option:checked {
  background-color: #4a7a00; /* lighter green when hovered/selected */
  color: #fff;
}

/* For Firefox to apply padding properly */
.dropdown option {
  padding-block: 10px;
  padding-inline: 12px;
}


 #filter-report {
    width: 180px;
    height: 43px;
 }

.btn.update,
.btn.cancel {
  display: none;
}

/* Zoom Controls */
.warehouse-controls {
  position: absolute;
  top: 80px;
  right: 360px;
  background-color: white;
  border-radius: 10px;

  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}

.wh-btn {
  height: 40px;
  width: 40px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 25px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.wh-btn:hover {
  background: #f1f1f1;
}

.btn.edit.hidden,
.wh-btn.createShelf.hidden {
  position: absolute;
  opacity: 0;
  z-index: -999;
  pointer-events: none;
}

.btn.edit,
.wh-btn.createShelf {
  position: static;   /* or relative/flex default, depending on layout */
  opacity: 1;
  z-index: auto;
  pointer-events: auto;
}



/* Info Button */
.info-btn {
  position: absolute;
  top: 40%;
  right: 360px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: var(--color-primary);
  color: var(--color-font-white);
  border: 1px solid var(--color-primary);
  padding: 8px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  z-index: 3;
}

.info-btn:hover {
  background: var(--color-success-hovered);
  color: var(--color-font-white);
}

/* rightSidebar
.rightsidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background-color: #ffffff;
  padding: 20px 20px 200px 20px;
  border-left: 1px solid #ddd;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  z-index: 3;
}
*/

.rightsidebar {
  position: fixed; /* absolute → fixed for mobile scrolling */
  top: 0;
  right: 0;
  width: 340px;
  height: 100%; /* use 100% instead of 100vh */
  max-height: 100vh; /* prevent overflow beyond viewport */
  background-color: #ffffff;
  padding: 20px 20px 200px 20px;
  border-left: 1px solid #ddd;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto; /* keep scrollable */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  z-index: 3;
}


.rsidebar-content {
  display: none;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #bebebe;
}

.wh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wh-header h3 {
  margin: 0;
}

.bins-btns button,
.icon-btns button {
  border: none;
  cursor: pointer;
  margin-left: 5px;
  display: none;
}

.bins-btns button .bin-btn,
.icon-btns button .shelf-btn {
    width: 20px;
    height: 20px;
}

.bins-btns.show button,
.icon-btns.show button {
  display: flex;
}

.bins-btns .delete,
.icon-btns .delete {
  color: red;
}

.delete-bin-btn,
.delete-shelf-btn {
    background: var(--color-error);
    border-radius: 5px;
    padding: 6px 9px;
}

.delete-bin-btn:hover,
.delete-shelf-btn:hover {
    background: var(--color-error-hovered);
}



.backtoshelf {
    background: none;
    border: none;
    cursor: pointer;
}

.rightsidebar label {
  display: block;
  margin-top: 15px;
  font-size: 14px;
  color: #555;
}

.rightsidebar input[type="text"],
.rightsidebar input[type="number"] {
  width: 100%;
  padding: 6px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* X/Y Coordinates */
.coords {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.coords div {
  flex: 1;
}

/* Bins */
.bins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #bebebe;
}

.bins-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.create-btn {
  display: none;
  background-color: #d7f3d7;
  color: #365c00;
  border: 1px solid #b8e6b8;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  width: 100px;
}

.bins-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* max-height: calc(100vh - 530px); */
  overflow-y: auto;
  padding-right: 5px;
}


.bin-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background-color: #f9f9f9;
}



/* rightSidebar collapsed */
.rightsidebar.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border: none;
}

body.rightsidebar-collapsed .top-bar,
body.rightsidebar-collapsed .warehouse-controls,
body.rightsidebar-collapsed .info-btn {
  right: 10px;
}

body:not(.rightsidebar-collapsed) .top-bar,
body:not(.rightsidebar-collapsed) .warehouse-controls,
body:not(.rightsidebar-collapsed) .info-btn {
  right: 360px;
}

.bin.highlighted {
  outline: 3px solid #2E5BFF; /* bright blue border */
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { box-shadow: 0 0 5px #2E5BFF; }
  to { box-shadow: 0 0 15px #2E5BFF; }
}


/* =========================
   Animations
========================= */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =========================
   Responsive
========================= */
@media (max-width: 1500px) {
  .sidebar {
    padding: 20px 10px;
    color: var(--color-font-white);
  }
  .sidebar .upper-part .sidebar-head {
    height: 80px;
  }
  .sidebar-head .logo {
    max-width: 130px;
  }
  .sidebar .upper-part {
    gap: 5px;
  }
  .menu-item .left {
    gap: 10px;
    font-size: var(--font-size-md);
  }
  .menu-item .left .menu-icon {
    height: 20px;
  }
  .login-container .login-logo {
    max-width: 300px;
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.show-mobile {
    transform: translateX(0);
  }

  .sidebar.expanded,
  .sidebar.collapsed {
    width: 70%;
  }

  .menu.expanded {
    display: block;
  }

  .open-sidebar-btn {
    display: inline-block;
  }

  .pie-container,
  .bar-container {
    flex: 1 1 100%;
  }

  .header-container {
    text-align: center;
  }

   /* Login css */
  .login-container {
    flex-direction: column;
  }

  .login-container .left {
    justify-content: start;
    order: 2;
    padding: 10px;
  }

  .login-container .right {
    flex: 1;
    padding: 70px 70px 20px 70px;
    order: 1;
  }

  .login-container .overlay {
    border-radius: 20px;
    padding: 40px 20px;
  }

  .login-container .login-form-mobile {
    display: block;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
  }

  .login-container .login-form-mobile .text-container {
    margin-bottom: 30px;
  }

  .login-container .login-form-mobile .login-btn {
    margin-top: 20px;
  }

  .login-container .bg-image {
    border-radius: 20px;
    opacity: 0.1;
  }

}

/* Desktop only hide the open-sidebar button */
@media (min-width: 1025px) {
  .open-sidebar-btn {
    display: none;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .main-content {
    padding: 0 20px;
  }

  /* page control */
  .page-control {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-control .right {
    gap: 7px;
    order: 2;
  }
  .page-control .left{
    order: 1;
    justify-content: center;
    width: 100%;
  }

  .search-form {
    max-width: unset;
  }


  /* Profile page responsiveness */
  .form-container {
    background: none;
    padding: 20px 0 0 0;
    box-shadow: unset;
  }

  .form-container .input-container {
    flex-direction: column;
  }


  /* request form */

  .request-container .row1,
  .request-container .row2 {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  /* login page */
  .login-container .left {
    justify-content: start;
    order: 2;
    padding: 20px;
  }

  .login-container .right {
    flex: 1;
    padding: 20px;
    order: 1;
  }
}


/* mobile mode */
@media (max-width: 680px) {

    .top-bar .dropdown{
        width: 50px;
    }
    .downloadText {
        display: none;
    }
    .page-title {
        font-size: var(--font-size-l);
    }

    body:not(.rightsidebar-collapsed) .info-btn {
      right: 330px;
      z-index: 5;
    }

}
