/* =========================================================
   transaction.css  —  Add Transaction Page
   Matches KGM Dashboard theme
   ========================================================= */

*, *::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;
}

/* =========================================================
   NAV
   ========================================================= */
nav {
  background-color: #0f1117;
  padding: 0 1.25rem;
  height: 52px;
  display: flex;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}

.nav-links a::before {
  content: '←';
  font-size: 14px;
}

.nav-links a:hover,
.nav-links a:visited:hover {
  color: #fff;
}

.nav-links a:visited {
  color: rgba(255, 255, 255, 0.6);
}

/* =========================================================
   MAIN SECTION
   ========================================================= */
.main-section {
  max-width: 780px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

/* =========================================================
   TABS
   ========================================================= */
.tab {
  display: flex;
  gap: 4px;
  background: transparent;
  border: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tablinks {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  transition: color 0.15s, background 0.15s;
  font-family: var(--paragraph, system-ui, sans-serif);
}

.tablinks:hover {
  color: #0f1117;
  background: #f8f9fb;
}

.tablinks.active {
  background: #fff;
  color: #0f1117;
  border-color: rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Active tab covers the card's top border */
.tablinks.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

/* Tab content card */
.tabcontent {
  display: none;
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 0 8px 8px 8px;
  padding: 1.5rem;
}

.tabcontent.active {
  display: block;
}

/* =========================================================
   FORM SHARED STYLES
   ========================================================= */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 540px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-column > p:first-child {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

.form-column input,
.form-column select {
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #1a1a1a;
  font-family: var(--paragraph, system-ui, sans-serif);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.form-column input:focus,
.form-column select:focus {
  outline: none;
  border-color: #6c8fff;
  box-shadow: 0 0 0 3px rgba(108, 143, 255, 0.12);
}

/* Balance display */
#balance {
  font-size: 18px;
  font-weight: 600;
  color: #0f6e56;
  padding: 6px 0;
}

/* =========================================================
   ORDER ITEMS (Add Transaction tab)
   ========================================================= */
.order-item-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.order-item-row {
  background: #f8f9fb;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 1rem;
}

.order-item-row:nth-child(even) {
  background: #f0f2f5;
}

.order-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
}

@media (max-width: 540px) {
  .order-item {
    grid-template-columns: 1fr;
  }
}

/* Labels inside order items */
.order-item > p:nth-child(odd) {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 4px;
}

.order-item select,
.order-item input[type="number"] {
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #1a1a1a;
  font-family: var(--paragraph, system-ui, sans-serif);
  background: #fff;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.order-item select:focus,
.order-item input:focus {
  outline: none;
  border-color: #6c8fff;
  box-shadow: 0 0 0 3px rgba(108, 143, 255, 0.12);
}

/* Price display */
.price-display {
  font-size: 15px;
  font-weight: 600;
  color: #0f6e56;
  padding: 8px 0;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.add-row-button {
  background: #f0f2f5;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  color: #0f1117;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--paragraph, system-ui, sans-serif);
  transition: background 0.15s;
  margin-right: 8px;
}

.add-row-button:hover {
  background: #e2e5ea;
}

.submit-button {
  background: #0f1117;
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--paragraph, system-ui, sans-serif);
  transition: background 0.15s;
}

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

/* =========================================================
   EXPENSES TAB
   ========================================================= */
.expenses .form-column input,
.expenses .form-column select {
  width: 100%;
}

/* =========================================================
   WAITER DEBT TAB
   ========================================================= */
.balance-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.balance-card {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.balance-card:nth-child(even) {
  background: #f8f9fb;
}

.balance-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

@media (max-width: 540px) {
  .balance-row {
    grid-template-columns: 1fr;
  }
}

.balance-row p {
  font-size: 13px;
  font-weight: 500;
  color: #0f1117;
}

.balance-row span {
  font-size: 12px;
  color: #993c1d;
  font-weight: 600;
}

.balance-row input {
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--paragraph, system-ui, sans-serif);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.balance-row input:focus {
  outline: none;
  border-color: #6c8fff;
  box-shadow: 0 0 0 3px rgba(108, 143, 255, 0.12);
}