:root {
  --erp-dark: #0b4f3a;
  --erp-accent: #f4b400;
  --erp-white: #ffffff;
  --btn-primary: #4CAF50;
}

body {
  background: var(--erp-white);
  color: #222;
  min-height: 100vh;
  margin: 0;
  font-family: calibri, roboto, sans-serif;
}

.topbar {
  background: var(--erp-dark);
  color: var(--erp-white);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  gap: 1rem;
}

.logo {
  height: 48px;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.logo img {
  height: 48px;
  width: auto;
  border-radius: 6px;
}

.brand {
  font-weight: 700;
  color: var(--erp-white);
  font-size: 1.125rem;
}

.topbar .user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.user .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--erp-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--erp-dark);
  font-weight: 700;
}

.app-shell {
  display: flex;
  height: calc(100vh - 64px);
}

.sidebar {
  width: 260px;
  background: linear-gradient(to bottom, #E8F5E9, #EFF8F0);
  color: var(--erp-white);
  padding: 1rem;
  overflow: auto;
}

/* Collapsed sidebar styles */
.sidebar.collapsed {
  width: 64px !important;
  padding: 0.6rem 0.4rem;
}
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .nav-link .nav-text { display: inline-block; }
.sidebar.collapsed .nav-link .nav-text { display: none; }
.sidebar .nav-link i { width: 24px; text-align: center; }
.sidebar.collapsed .nav-link { justify-content: center; padding: .45rem .35rem; }

/* Ensure the page content doesn't shrink awkwardly when sidebar collapsed */
.app-shell .page-container { transition: margin-left .15s ease; }

/* On small screens, keep sidebar collapsed by default and make it overlay when opened */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 64px; bottom: 0; z-index: 1050; height: calc(100% - 64px); }
  /* On mobile, treat "collapsed" as fully hidden */
  .sidebar.collapsed { display: none !important; }
  .app-shell { padding-left: 0; }
}

.sidebar .nav-link {
  color: #1D351D;
  border-radius: 1px;
  margin-bottom: 6px;
  display: block;
  padding: .5rem;
  text-decoration: none;
}

.sidebar .nav-link:hover {
  color: var(--erp-dark) !important;

}

.sidebar .nav-link.active:hover {
  color: white !important;
}


.sidebar .nav-link i {
    margin-right: 8px; /* Adds 8 pixels of space to the right of the icon */
    width: 16px; /* Ensures all icons take up the same space for perfect vertical alignment */
    text-align: center;
}

.sidebar .nav-link.active {
  /* background: #388e3c90; */
  /* color: white; */
  font-weight: 600;
  background: #4CAF50;
  color: white;
}

.page-container {
  flex: 1;
  padding: 1.25rem;
  overflow: auto;
  background: #f7fbf8;
}

.module-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.module-actions {
  margin-left: auto;
  display: flex;
  gap: .5rem;
}

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

table thead th{
  /* background: var(--erp-dark);
  color: var(--erp-white); */

  background: #E0F2F1 !important;
  color: #004D40 !important;
  
}

table th,
table td {
  padding: 8px !important;
  border: 1px solid #e9ecef !important;
  text-align: left !important;
}

table td {
  background: white !important;
}

.table-responsive {
  overflow: auto;
  max-height: 70vh;
}

/* Inventory table specific styles */
.category-header:hover {
  background-color: #e3f2fd !important;
}

.product-row {
  border-left: 3px solid #e9ecef;
}

.btn {
  display: inline-block;
  padding: .4rem .6rem;
  border-radius: .375rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-sm {
  font-size: .85rem;
  padding: .25rem .5rem;
}

.btn-success {
  background: #4CAF50 !important;
  color: white !important;
  border-color: #4CAF50 !important;
}

.btn-outline-secondary {
  background: transparent !important;
  border: 1px solid #6c757d !important;
  color: #6c757d !important;
}

.btn-primary {
  background: #4CAF50 !important;
  color: white !important;
  border-color: #4CAF50 !important;
}

.btn-primary-rev{
  background-color: white !important;
  border:2px var(--btn-primary) solid !important;
  color: var(--btn-primary) !important;
  font-weight: bold !important;
}

.btn-danger {
  background: #E57373 !important;
  color: white !important;
  border-color: #E57373 !important;
}

.btn-danger-rev {
  background: white !important;
  color: #E57373 !important;
  border:2px #E57373 solid !important;
  font-weight: bold !important;
}

.btn-xs {
  padding: 0px 6px !important;
  font-size: 0.75rem !important;
  border-radius: 0.2rem !important;
}

.form-control {
  padding: .45rem .6rem;
  border-radius: .375rem;
  border: 1px solid #ced4da;
}

.search-inline {
  min-width: 220px;
}

.card {
  background: white;
  border-radius: .5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04) !important;
  padding: 1rem;
}

.modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  background: white;
  border-radius: .5rem;
  padding: 1rem;
  max-width: 800px;
  width: 100%;
}

.small-input {
  max-width: 120px;
}

.item-actions .btn {
  margin-right: 4px;
}

#itemsTable input {
  min-width: 80px;
}

.cursor-pointer {
  cursor: pointer;
}

.dt-button {
  margin-right: 6px;
}

.is-required-error {
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25);
}

.select2-container {
  width: 100% !important;
}


/* module pages css */
.d-none {
  display: none !important;
}

#pageTitle{
  color: var(--erp-dark) !important;
}

.btnDelete{
  margin-left: 10px;
}

/* Highlight edited rows */
.rate-changed {
    background-color: #fff3cd; /* Light yellow */
}

#pageTitle {
  font-weight: 600;
  font-size: 1.2rem;
  color: #333; /* Ensure it’s visible against your background */
}

#btnBackToAdmin {
  display: inline-block; /* Show when jQuery removes d-none */
}

#adminLinksCard {
  transition: all 0.3s ease;
}

#adminSubModuleContainer {
  transition: all 0.3s ease;
}


#purchaseForm .input-group{
  flex-wrap: nowrap;
}

.btn_dropdown{
    margin-left: 5px !important;
    border-radius: 5px !important;
    padding: 0px 6px !important;
    font-weight: bold !important;
}

.btn-quick-action{
  background-color: #f4b400 !important;
  color: white !important;
}

.btn-print{
  margin-right: 10px;
}

.no-spinner::-webkit-inner-spin-button,
.no-spinner::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinner {
    -moz-appearance: textfield;
}

.fa-file-excel{
  font-size: 20px;
  padding: 0px 5px;
}





























/* Mobile-friendly adjustments */
@media (max-width: 576px) {
    #dailyRatesTable input.rate-input {
        font-size: 1rem;
        padding: 0.5rem;
    }

    #btnSaveAllRates {
        width: 100%;
        font-size: 1rem;
    }

    #pageTitle {
        font-size: 1.1rem;
    }
}

/* DataTables search input fix */
.dataTables_wrapper .dataTables_filter input {
    height: auto !important;
    min-height: 38px;
    max-height: 38px;
}

/* Prevent cursor issues in tables */
table.dataTable tbody td {
    cursor: default;
}

table.dataTable tbody td input,
table.dataTable tbody td select,
table.dataTable tbody td textarea {
    cursor: text;
}

/* Fix for tall cursor/input in tables */
table input[type="text"],
table input[type="number"],
table input[type="search"] {
    height: 38px;
    line-height: normal;
}

/* RBAC tables - prevent cell editing behavior */
#usersTable td,
#rolesTable td,
#permissionsTable td,
.table td {
    cursor: default !important;
}

#usersTable td:focus,
#rolesTable td:focus,
#permissionsTable td:focus {
    outline: none;
}

/* Ensure table cells are not contenteditable */
table td:not(:has(input)):not(:has(select)):not(:has(textarea)) {
    -webkit-user-select: text;
    user-select: text;
}

#branch-dropdown option {
    color: black;
}

#branch-dropdown option:selected {
    color: white;
}

#expectedOutput label {
    margin-right: 40px;
}

#itemsTable thead tr > th{
  border: 1px solid #c3c8cc !important;
}

/* Chevron rotate animation for collapsible sections */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

#bulkToggleIcon.rotate {
  animation: rotate 0.3s ease-in-out forwards;
}

#bulkToggleIcon {
  transition: transform 0.3s ease-in-out;
}

/* Responsive daily rates: switch table to stacked cards on small screens */
@media (max-width: 768px) {
  #dailyRatesTable thead { display: none; }
  #dailyRatesTable tbody tr { display: block; border: 1px solid #eee; margin-bottom: 8px; padding: 10px; border-radius: 6px; background: white; }
  #dailyRatesTable tbody tr td { display: block; width: 100%; border: none !important; padding: 4px 0 !important; }
  #dailyRatesTable tbody tr td:nth-child(1) { display: none; }
  #dailyRatesTable tbody tr td:nth-child(2) { font-weight: 600; font-size: 14px; }
  #dailyRatesTable tbody tr td:nth-child(3) { display: block; }
  #dailyRatesTable input[type="number"], #dailyRatesTable input[type="text"] { width: 100%; padding: 10px; font-size: 16px; }
  /* Make save button visible as a fixed action at bottom for thumb reach */
  #btnSaveAllRates { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1200; border-radius: 8px; padding: 12px 16px; font-size: 16px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); display: block; }
  /* Add safe spacing so content isn't hidden behind the fixed save button */
  .page-container, .container { padding-bottom: 80px; }
  .table-responsive { overflow: visible; }
}

/* Stat boxes for invoice totals */
.stat-box {
  min-width: 140px;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-label {
  font-size: 13px;
  font-weight: bold;
  opacity: 0.9;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 18px;
  font-weight: 700;
}
.stat-total {
  background: linear-gradient(90deg, #2e7d32, #66bb6a);
}
.stat-cash {
  background: linear-gradient(90deg, #1565c0, #42a5f5);
}
.stat-credit {
  background: linear-gradient(90deg, #ef6c00, #ffb74d);
}

@media (max-width: 768px) {
  .stat-box { min-width: 110px; padding: 8px 10px; }
  .stat-value { font-size: 16px; }
}
