:root {
  /* Color Variables */
  --primary-color: #008097;
  --secondary-color: #6c757d;
  --sidebar-color: #343a40;
  --accent-color: #008097;
  --border-color: #e0e0e0;
  --text-color: #212529;
  --light-gray: #f8f9fa;
  --light-bg: #ffffff;
  --medium-gray: #e9ecef;
  --dark-gray: #495057;
  --white: #ffffff;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --sidebar-active-bg: rgba(0, 128, 151, 0.7);

  /* Sizing Variables */
  --base-size: 1rem;
  --space-xs: calc(var(--base-size) * 0.5);
  --space-sm: calc(var(--base-size) * 0.75);
  --space-md: var(--base-size);
  --space-lg: calc(var(--base-size) * 1.5);
  --space-xl: calc(var(--base-size) * 2);
  --border-radius: 0.25rem;
  --box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.1);

  /* Layout Variables */
  --sidebar-collapsed-width: 4.375rem; /* 70px */
  --sidebar-expanded-width: 15.625rem; /* 250px */
  --header-height: 4rem; /* 64px */
  --transition-speed: 0.3s;
}

/* Base Styles */
body {
  background-color: var(--light-bg, #ffffff);
  color: var(--text-color, #212529);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  transition: margin-left var(--transition-speed) ease;
}

.existing-session-alert {
    background: #fff8e6;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.existing-session-alert h5 {
    margin-top: 0;
    color: #856404;
    font-weight: 600;
    margin-bottom: 15px;
}

.session-details {
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
}

.detail-label {
    font-weight: 600;
    width: 150px;
    color: #555;
}

.detail-value {
    flex-grow: 1;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-sm i {
    margin-right: 5px;
}

.text-accent{
    color: var(--accent-color, #008097) !important;
}

.header,
.main-content {
    transition: left var(--transition-speed) ease, 
    margin-left var(--transition-speed) ease;
}

/* Prevent initial transitions (handled by JS) */
body:not(.loaded) .header,
body:not(.loaded) .main-content {
  transition: none !important;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-collapsed-width);
  height: 100vh;
  background: var(--sidebar-color, #343a40);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: width var(--transition-speed) ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hamburger-btn {
  background: transparent;
  border: none;
  color: var(--white, #ffffff);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--border-radius);
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-xs);
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-nav a,
.logout-btn {
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-xs);
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: var(--border-radius);
  margin: 0 var(--space-xs) var(--space-xs);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sidebar-nav a:hover,
.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--white, #ffffff);
}

.sidebar-nav i,
.logout-btn i {
  min-width: 1.5625rem;
  text-align: center;
  margin-right: var(--space-sm);
  font-size: 1.1rem;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-xs);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Expanded State */
.sidebar.expanded {
  width: var(--sidebar-expanded-width);
}

body.loaded .sidebar {
  transition: width var(--transition-speed) ease;
}

.menu-text {
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.sidebar.expanded .menu-text {
  opacity: 1;
}

/* Header Styles */
.header {
  background-color: var(--light-gray, #f8f9fa);
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: var(--sidebar-collapsed-width);
  right: 0;
  z-index: 1050;
  transition: left var(--transition-speed) ease;
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

/* Logo Container */
.header-logo {
  width: 9.375rem; /* 150px → 9.375rem (150/16) */
  height: 2.5rem; /* 40px → 2.5rem */
}

.header-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Search Styling */
.search-container {
  flex: 1;
  min-width: 15.625rem; /* 250px → 15.625rem */
  padding: 0.625rem 0; /* 10px → 0.625rem */
  border-radius: 0.25rem; /* 4px → 0.25rem */
  margin: 0; /* Remove any default margins */
  width: 100%; /* Ensure full width */
}

.search-box.input-group {
  width: 100% !important;
  margin: 0; /* Remove margins */
  padding: 0; /* Remove paddings */
}

.page-header {
  margin: 0;
  padding: 0;
  width: 100%;
}

.search-results-dropdown {
  display: none;
  position: absolute;
  width: 100%;
  max-height: 18.75rem; /* 300px → 18.75rem */
  overflow-y: auto;
  background: var(--light-bg, #ffffff);
  border: 1px solid var(--border-color, #dddddd);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  z-index: 1000;
  margin-top: var(--space-xs);
  padding: var(--space-xs) 0;
}

.search-results-dropdown a {
  display: block;
  padding: var(--space-xs) var(--space-md);
  text-decoration: none;
  transition: background-color var(--transition-speed) ease;
}

.search-results-dropdown a:hover {
  background-color: var(--light-gray, #f8f9fa);
}

/* Search result items */
.search-result-item {
  padding: var(--space-sm) 1.25rem; /* Keeping 1.25rem as it's likely a design choice */
  display: flex;
  align-items: center;
  gap: var(--space-md); /* Using your space variable */
}

.search-result-category {
  font-weight: 600;
  margin-right: var(--space-xs);
}

.search-result-text {
  color: var(--text-color);
}

/* Main Content */
/*.main-content {*/
/*  align-items: left;*/
/*  margin-top: var(--header-height);*/
/*  margin-left: var(--sidebar-collapsed-width);*/
/*  padding: var(--space-md);*/
/*  transition: margin-left var(--transition-speed) ease;*/
/*}*/

.main-content {
  margin-top: var(--header-height);
  margin-left: var(--sidebar-collapsed-width);
  padding: var(--space-md);
  transition: margin-left var(--transition-speed) ease;
  text-align: left; /* Force text alignment */
  align-items: flex-start; /* If using flexbox */
  justify-content: flex-start; /* If using flexbox */
}

/* Expanded States */
body.sidebar-expanded .main-content{
  left: var(--sidebar-expanded-width);
  margin-left: var(--sidebar-expanded-width);
}

body.sidebar-expanded .header{
  left: var(--sidebar-expanded-width);
  /*margin-left: var(--sidebar-expanded-width);*/
}



body:not(.sidebar-expanded) .header {
  left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}



/* Cards */
.menu-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}


.hidden-card {
    display: none !important;
}



.menu-icon {
    width: 50px;
    height: 50px;
    background: rgba(0,128,151,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--accent-color);
    font-size: 1.5rem;
}

.menu-category {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.menu-actions a {
    text-decoration: none;
    text-align: left;
}

.menu-action {
    padding: 8px 12px;
    background: var(--accent-color);
    border-radius: 4px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.menu-action-gray {
    padding: 8px 12px;
    background: var(--light-gray);
    border-radius: 4px;
    color: var(--text-color) !important;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.menu-action-gray::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
               transparent, 
               rgba(0, 128, 151, 0.1), 
               transparent);
    transition: all 0.6s ease;
}

.menu-action-gray:hover {
    background: var(--accent-color);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    border-color: var(--accent-color);
}

.menu-action-gray:hover::before {
    left: 100%;
}

.menu-action-gray:hover i {
    color: white !important;
    transform: translateX(3px);
}



.menu-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.menu-action:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.menu-action:hover::before {
    left: 100%;
}

.menu-action i {
    transition: all 0.3s ease;
}

.menu-action:hover i {
    transform: translateX(3px);
    text-decoration: none;
}

/* If you want a more dramatic effect on the chevron */
.menu-action:hover i.fa-chevron-right {
    transform: translateX(5px);
}


.menu-info {
    font-size: 0.8rem;
    color: var(--text-color);
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.info-item span {
    font-weight: 600;
    color: var(--accent-color);
}

/* Form Elements */
.form-control {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: var(--border-radius);
}

.form-control:focus {
  border-color: var(--primary-color, #008097);
  box-shadow: 0 0 0 0.2rem rgba(0, 138, 162, 0.2);
}

.btn {
  padding: var(--space-sm);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--primary-color, #008097);
  border-color: var(--primary-color, #008097);
}

.btn-primary:hover {
  background-color: #00758a;
  border-color: #006b7f;
}

/* Accent-colored button (matches logo) */
.btn-accent {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: var(--white) !important;
  transition: all var(--transition-speed) ease;
}

.btn-accent:hover {
  background-color: var(--sidebar-active-bg); /* Slightly transparent version */
  border-color: var(--accent-color);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--box-shadow);
}

.btn-accent:active {
  transform: translateY(0);
  box-shadow: none;
}

/* If you want an outline version alternative */
.btn-outline-accent {
  background-color: transparent;
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.btn-outline-accent:hover {
  background-color: var(--accent-color);
  color: var(--white);
}

/* Password requirements styling */
.password-requirements {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.password-requirements ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.department-permissions {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.department-permissions h5 {
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

.text-muted .form-check-label {
    opacity: 0.6;
    cursor: not-allowed;
}


.form-text ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.form-text li {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Error styling */
.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}



/* SUPPLIER */

.supplier-container h3 {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 15px;
}



/* PROJECT */
.dashboard-project {
    font-family: 'Arial', sans-serif;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 10px;
}
.filters-project {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-item-project {
    min-width: 150px;
}

.dashboard-project select, 
.dashboard-project button {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
}
.chart-container {
    position: relative;
    height: 350px;
    margin-top: 20px;
}
.machine-icon {
    width: 30px;
    height: 30px;
    vertical-align: middle;
    margin-right: 5px;
}
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}
.machine-in-stock { background-color: #4bc0c0; color: white; }
.machine-running { background-color: #36a2eb; color: white; }
.machine-stopped { background-color: #ff6384; color: white; }
.machine-planned { background-color: #ffcd56; color: #333; }



/* Responsive Breakpoints */
@media (max-width: 48rem) { /* 768px */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-expanded-width);
  }
  
  .sidebar.expanded {
    transform: translateX(0);
    box-shadow: 0.3125rem 0 0.9375rem rgba(0, 0, 0, 0.2);
  }
  
  .main-content {
    left: 0 !important;
    margin-left: 0 !important;
  }
  
  .header {
    left: 0 !important;
    width: 100% !important;
  }
  
  .sidebar-expanded .header {
    left: 0 !important;
  }
  
}

/* Utility Classes */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}


/* Dashboard Specific */
.dashboard-project {
  max-width: 75rem;
  margin: 0 auto;
  padding: var(--space-md);
}

.chart-container {
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}