/* === COLOR VARIABLES & FONT === */
:root {
  --color-white: #ffffff;
  --color-black: #1f2937;
  /* Very dark grey/near black for text */
  --color-grey-light: #f9fafb;
  /* Off-white for background */
  --color-grey-border: #e5e7eb;
  /* Light border */
  --color-grey-text: #6b7280;
  --color-accent-active: #000000;
  /* Pure black for active state */
  --color-danger: #ef4444;
  --color-success: #10b981;
  font-family: 'Inter', sans-serif;
}

/* === BASE STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--color-grey-light);
  color: var(--color-black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utility for centering text */
.text-center {
  text-align: center;
}

/* === HEADER / TOP NAV === */
.header {
  background-color: var(--color-white);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-grey-border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-black);
}

.menu-toggle,
.user-menu-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s;
}

.menu-toggle:hover,
.user-menu-button:hover {
  background-color: var(--color-grey-light);
}

/* User Dropdown */
.dropdown-container {
  position: relative;
}

.user-menu {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 0.5rem;
  width: 12rem;
  background-color: var(--color-white);
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-grey-border);
  z-index: 100;
  overflow: hidden;
}

.user-menu.show {
  display: block;
}

.user-info {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-black);
  border-bottom: 1px solid var(--color-grey-border);
}

.logout-btn {
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--color-black);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logout-btn:hover {
  background-color: var(--color-grey-light);
}

/* === MAIN LAYOUT === */
.layout-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* === SIDEBAR NAVIGATION === */
.sidebar {
  background-color: var(--color-white);
  width: 16rem;
  /* 256px */
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  border-right: 1px solid var(--color-grey-border);
}

/* Sidebar links container */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}

.nav-list-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-grey-text);
  padding: 0.75rem 0.75rem 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  color: var(--color-black);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover {
  background-color: var(--color-grey-light);
}

.nav-link.active {
  background-color: var(--color-black);
  color: var(--color-white);
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* === MAIN CONTENT AREA === */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.page-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 2rem;
}

.page-header p {
  color: var(--color-grey-text);
  margin-bottom: 2rem;
}

/* === CARDS LAYOUT === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.card {
  background-color: var(--color-white);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-grey-border);
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-icon-wrapper {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-grey-light);
  border-radius: 9999px;
  /* Full circle */
}

.card-icon-wrapper svg {
  color: var(--color-black);
  width: 1.25rem;
  height: 1.25rem;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-grey-text);
  letter-spacing: 0.05em;
}

.card-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-black);
  margin-top: 0.25rem;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--color-grey-text);
  margin-top: 0.25rem;
}

/* Specific card colors */
.value-red {
  color: var(--color-danger);
}

.value-green {
  color: var(--color-success);
}


/* === TABLE STYLES === */
.table-wrapper {
  background-color: var(--color-white);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-grey-border);
  margin-bottom: 2.5rem;
  overflow-x: auto;
}

.table-wrapper h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--color-black);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead {
  background-color: var(--color-grey-light);
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-grey-border);
}

th {
  font-weight: 600;
  color: var(--color-grey-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background-color: var(--color-grey-light);
}

/* Status Badges */
.badge {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1;
  text-align: center;
}

.badge.received {
  background-color: #d1fae5;
  /* Light green */
  color: #059669;
  /* Darker green */
}

.badge.debit {
  background-color: #fee2e2;
  /* Light red */
  color: #dc2626;
  /* Darker red */
}

/* === FOOTER === */
.footer {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.875rem;
  color: var(--color-grey-text);
}

/* === RESPONSIVENESS (Mobile View) === */
/* Hide sidebar on small screens by default */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 40;
  width: 16rem;
  padding-top: 5rem;
  /* Space for the close button */
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: none;
  /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* Overlay for mobile */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
}

.overlay.show {
  display: block;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .sidebar {
    box-shadow: 10px 0 20px rgba(0, 0, 0, 0.2);
  }

  .sidebar-close-btn {
    display: block;
    /* Show close button on mobile */
  }

  .main-content {
    padding: 1rem;
  }

  .page-header h2 {
    font-size: 1.5rem;
  }

  .sidebar-desktop {
    display: none;
  }
}

/* Desktop-specific adjustments */
@media (min-width: 769px) {
  .menu-toggle {
    display: none;
    /* Hide hamburger on desktop */
  }

  .sidebar {
    position: relative;
    /* Keep sidebar in normal flow on desktop */
    transform: translateX(0);
    padding-top: 1.5rem;
    height: auto;
    /* Allow height to adapt */
  }

  .layout-wrapper {
    height: calc(100vh - 58px);
    /* Adjust height for top header */
  }
}

/* View / Action Button Style */
.view-btn {
  /* background-color: var(--color-primary, #007bff);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out; */
}




/* You can also define your theme color variable if not already in css root */
:root {
  --color-primary: #2563eb;
  /* Nice blue tone */
  --color-primary-dark: #1e40af;
}

.action-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.action-icons button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: 0.2s;
}


/* Colors */
.action-icons .view-btn {
  color: #2563eb !important;
  /* Blue */
}

.action-icons .edit-btn {
  color: #10b981 !important;
  /* Green */
}

.action-icons .delete-btn {
  color: #ef4444 !important;
  /* Red */
}

/* Hover effects */



/* Optional: hover effect */
.action-icons button:hover i {
  opacity: 0.8;
  transform: scale(1.1);
  transition: 0.2s;
}

.action-icons i {
  width: 18px;
  height: 18px;
  /* color: #444; */
}


.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 12px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.modal-actions {
  text-align: right;
  margin-top: 10px;
}

.btn {
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #007bff;
  color: #fff;
}

.btn-secondary {
  background: #ccc;
}

.btn {
  background: var(--accent, #2563eb);
  color: #fff;
  border: none;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  transition: 0.2s;
  margin-bottom: 20px;
}

.btn:hover {
  opacity: .9;
}

.btn.green {
  background: #10b981;
}

.btn.gray {
  background: #6b7280;
}

.btn.red {
  background: #ef4444;
}

.page-header {
  display: flex;
  justify-content: space-between;
}

/* ===== UNIVERSAL SEARCH BAR (ENHANCED) ===== */
.search-filter.single {
  margin: 1rem 0;
  display: flex;
  justify-content: flex-end;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 420px;
  background: var(--color-white);
  border: 1px solid var(--color-grey-border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-box input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 0.95rem;
  color: var(--color-black);
}

.btn-search {
  background: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

.btn-search:hover {
  background: var(--color-accent-hover, #0d6efd);
}

.btn-reset {
  background: var(--color-light-grey);
  color: var(--color-black);
  border-radius: 6px;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.btn-reset:hover {
  background: var(--color-grey-border);
}

.btn.gray {
  background: #6b7280;
  color: #fff;
  border: none;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn.gray:hover {
  opacity: .9;
}

.action-buttons {
  display: flex;
  gap: 20px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.pagination {
  margin-top: 15px;
  text-align: center;
}

.page-btn {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 4px;
  border-radius: 6px;
  background: #f2f2f2;
  color: black;
  text-decoration: none;
  border: 1px solid #ccc;
  font-size: 14px;
}

.page-btn:hover {
  background: #ddd;
}

.page-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}