/* =========================================================
   KGM Dashboard — Main Stylesheet
   Breakpoints: mobile-first → tablet (600px) → desktop (1024px)
   ========================================================= */

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

body {
  font-family: var(--paragraph, system-ui, sans-serif);
  background-color: #f0f2f5;
  color: #1a1a1a;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================================================
   NAV / LEFT SIDEBAR
   ========================================================= */
nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  height: 100%;
  width: 0;
  background-color: #0f1117;
  overflow: hidden;
  transition: width 0.25s ease;
}

nav.open {
  width: 220px;
}

@media (min-width: 1024px) {
  nav {
    width: 200px;
  }
}

.sb-inner {
  width: 220px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
}

/* Logo */
.sb-logo {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.sb-logo span {
  color: #6c8fff;
}

/* Hamburger button — fixed top-left, mobile only */
.sb-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 10px;
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 1100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: background 0.15s;
}

.sb-toggle:hover {
  background: #f0f2f5;
}

.sb-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: #1a1a1a;
  border-radius: 2px;
  transform-origin: center;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.sb-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.sb-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.sb-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (min-width: 1024px) {
  .sb-toggle {
    display: none;
  }
}

/* Nav links */
.sb-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.5rem 0;
}

.sb-buttons {
  width: 100%;
  background: none;
  border: none;
  border-right: 2px solid transparent;
  cursor: pointer;
  padding: 0.65rem 1.25rem;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}

.sb-buttons:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.sb-buttons.active {
  color: #fff;
  background: rgba(108, 143, 255, 0.12);
  border-right-color: #6c8fff;
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

/* Mobile overlay backdrop */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}

.nav-overlay.visible {
  display: block;
}

@media (min-width: 1024px) {
  .nav-overlay {
    display: none !important;
  }
}

/* =========================================================
   PAGE WRAPPER
   Sits to the right of the fixed nav on desktop.
   On mobile it's full width with top padding for the hamburger.
   ========================================================= */
.page-wrapper {
  width: 100%;
  min-height: 100vh;
  padding: 4rem 1rem 2rem; /* top clears hamburger on mobile */
}

@media (min-width: 1024px) {
  .page-wrapper {
    margin-left: 200px;
    width: calc(100% - 200px); /* key fix: prevents horizontal overflow */
    padding: 1.5rem;
  }
}

/* =========================================================
   TAB CONTENT
   ========================================================= */
.tabcontent {
  display: none;
}

.tabcontent.active {
  display: block;
}

/* Monix tab: two-column layout on desktop */
@media (min-width: 1024px) {
  #Monix.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px; /* minmax(0) prevents overflow */
    gap: 1.25rem;
    align-items: start;
  }
}

/* =========================================================
   PLACEHOLDER PAGES (Home, KGM, Folktrek)
   ========================================================= */
.placeholder-page {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 2rem;
}

.placeholder-page h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.placeholder-page p {
  color: #6b7280;
  font-size: 14px;
}

/* =========================================================
   MONIX MAIN COLUMN
   ========================================================= */
.monix-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0; /* prevents grid blowout */
}

.business-title {
  font-size: 20px;
  font-weight: 600;
  color: #0f1117;
}

/* =========================================================
   STAT CARDS
   ========================================================= */
.business-stats-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .business-stats-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.business-stats-card {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.business-stats-card p {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.business-stats-card h2 {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--paragraph, system-ui, sans-serif);
  display: flex;
  align-items: center;
  gap: 6px;
}

.business-stats-card h2::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.revenue h2 {
  color: #0f6e56;
}
.revenue h2::before {
  background: #1d9e75;
}

.expenditure h2 {
  color: #993c1d;
}
.expenditure h2::before {
  background: #d85a30;
}

/* =========================================================
   DAILY REPORT
   ========================================================= */
.daily-report-stat {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.daily-report-stat > h2 {
  font-size: 14px;
  font-weight: 600;
  color: #0f1117;
  margin-bottom: 0.75rem;
}
.daily-header {
  display: flex;
  flex-direction: column;
  gap: var(--sizing-2);
  padding: var(--sizing-1) 0;
}
.daily-header input{
  border-radius: var(--sizing-1);
  padding: var(--sizing-1) 10px;
  font-size: 13px;
  font-family: var(--paragraph);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.1s;
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  color: #1a1a1a;
}
.daily-header button{
  border-radius: var(--sizing-1);
  padding: var(--sizing-1) 10px;
  font-size: 13px;
  font-family: var(--paragraph);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.1s;
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  color: #1a1a1a;

}
.daily-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.9rem;
}

.daily-title h3 {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.daily-title p {
  font-size: 16px;
  font-weight: 600;
  color: #0f1117;
}

.daily-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.daily-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.daily-column > h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  font-weight: 500;
}

.daily-column > p {
  font-size: 18px;
  font-weight: 600;
  color: #0f1117;
}

#sales-column > p {
  color: #0f6e56;
}
#expense-column > p {
  color: #993c1d;
}

.daily-column h4 {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

.daily-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.daily-column ul li {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #374151;
  padding: 4px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
}

.daily-report-stat hr {
  border: none;
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  margin: 1rem 0 0.75rem;
}

/* Not paid */
.daily-report-stat > h3 {
  font-size: 12px;
  font-weight: 600;
  color: #0f1117;
  margin-bottom: 0.5rem;
}

.not-paid-cards {
  display: flex;
  flex-direction: column;
}

.not-paid-card {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr;
  font-size: 12px;
  color: #374151;
  padding: 5px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
  gap: 4px;
}

.not-paid-header p {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.submit-button {
  background: #0f1117;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.submit-button:hover {
  background: #2a2f3d;
}

/* =========================================================
   RECENT TRANSACTIONS
   ========================================================= */
.recent-transactions {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.recent-transactions > h2 {
  font-size: 14px;
  font-weight: 600;
  color: #0f1117;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.transaction-card-header {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1fr;
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 6px 6px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

.transaction-cards {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}

.transaction-card {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1fr;
  align-items: center;
  padding: 9px 6px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
  font-size: 13px;
  gap: 4px;
}

.transaction-card:last-child {
  border-bottom: none;
}

.transaction-card .tx-date {
  color: #9ca3af;
  font-size: 12px;
}
.transaction-card .tx-desc {
  color: #1a1a1a;
}
.transaction-card .tx-amount {
  text-align: right;
  font-weight: 500;
}
.transaction-card .tx-amount.income {
  color: #0f6e56;
}
.transaction-card .tx-amount.expense {
  color: #993c1d;
}

/* Add button (lives inside the h2 of recent transactions) */
.add-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0f1117;
  color: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.add-button:hover {
  background: #2a2f3d;
}

/* =========================================================
   RIGHT SIDEBAR
   ========================================================= */
.side-details-section {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1.25rem 1rem;
}

@media (min-width: 1024px) {
  .side-details-section {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
  }
  .daily-header {
    flex-direction: row;
  }
}

.side-details-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.payments,
.birthdays {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 0.5rem;
  font-family: var(--paragraph, system-ui, sans-serif);
}

.side-details-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-details-card {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.card-title {
  font-size: 12px;
  font-weight: 500;
  color: #0f1117;
  margin-bottom: 2px;
}
.card-amount {
  font-size: 13px;
  font-weight: 600;
  color: #993c1d;
}
.card-date {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.side-details-card.birthday {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e6f1fb;
  color: #185fa5;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-info .name {
  font-size: 12px;
  font-weight: 500;
  color: #0f1117;
}
.avatar-info .when {
  font-size: 11px;
  color: #9ca3af;
}

/* =========================================================
   SCROLLBAR STYLING (webkit)
   ========================================================= */
.transaction-cards::-webkit-scrollbar,
.side-details-section::-webkit-scrollbar {
  width: 4px;
}

.transaction-cards::-webkit-scrollbar-track,
.side-details-section::-webkit-scrollbar-track {
  background: transparent;
}

.transaction-cards::-webkit-scrollbar-thumb,
.side-details-section::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

/* =========================================================
   UTILITY
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
