:root {
  --ink: #17201b;
  --paper: #f7f6f1;
  --card: #ffffff;
  --line: #deded6;
  --olive: #245c48;
  --olive-dark: #194535;
  --rust: #a65a3a;
  --rust-light: #f3e7df;
  --muted: #68716c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
/* =========================
   TOP NAVBAR
   ========================= */

   .top {
    min-height: 70px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
}


/* =========================
   BRAND
   ========================= */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.store-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
}

.store-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.brand-separator {
    margin: 0 6px;
    color: #f28c18;
}

.brand-subtitle {
    font-weight: 400;
}


/* =========================
   DESKTOP NAVIGATION
   ========================= */

.top-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
    transition: 0.2s ease;
}


/* Change Password */

.top-nav a[href="change_password.php"] {
    background: #f3f3f3;
    color: #333;
    border: 1px solid #ddd;
}

.top-nav a[href="change_password.php"]:hover {
    background: #e8e8e8;
}


/* Log out */

.top-nav a[href="logout.php"] {
    background: #b94a3a;
    color: #fff;
    border: 1px solid #b94a3a;
}

.top-nav a[href="logout.php"]:hover {
    background: #9f3e31;
}


/* =========================
   HAMBURGER BUTTON
   ========================= */

   .menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;

    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;

    flex-shrink: 0;

    -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    border-radius: 2px;

    transform-origin: center;
    transition:
        transform 0.25s ease,
        opacity 0.2s ease;
}


/* Hamburger → X */

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* =========================
   MOBILE MENU
   ========================= */

   .mobile-menu {
    position: absolute;
    top: 85px;
    right: 12px;

    width: 220px;
    padding: 8px;

    background: var(--card);

    border: 1px solid var(--line);
    border-radius: var(--radius);

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);

    z-index: 1000;

    /* Hidden state */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-15px);

    pointer-events: none;

    /* Smooth drop */
    transition:
        opacity 0.25s ease,
        transform 0.3s ease,
        visibility 0.3s ease;
}

/* =========================
   OPEN MENU
   ========================= */

.mobile-menu.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);

    pointer-events: auto;
}

/* Open menu */

.mobile-menu.active {
    display: flex;
    flex-direction: column;
    gap: 6px;

    opacity: 1;
    transform: translateY(0);
}


/* Menu links */

.mobile-menu a {
    display: flex;
    align-items: center;

    min-height: 42px;
    padding: 10px 12px;

    border-radius: 8px;

    text-decoration: none;

    color: var(--ink);
    background: transparent;

    font-size: 0.9rem;
    font-weight: 600;

    box-sizing: border-box;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


/* Hover */

.mobile-menu a:hover {
    background: #f3f3ef;
}


/* Logout */

.mobile-menu .mobile-logout {
    background: #a65a3a;
    color: #fff;
}

.mobile-menu .mobile-logout:hover {
    background: #8f4930;
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

    .top {
        position: relative;
    }

    .top-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}


/* =========================
   SMALL PHONES
   ========================= */

@media (max-width: 420px) {

    .mobile-menu {
        right: 10px;
        width: 210px;
    }
}


/* =========================
   VERY SMALL PHONES
   ========================= */

@media (max-width: 360px) {

    .mobile-menu {
        right: 8px;
        width: 200px;
    }
}
.login-logo {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 15px;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--olive);
  color: #fff;
}

header.top .store-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

header.top a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
}

h1 { font-size: 1.5rem; margin: 20px 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 24px 0 10px; }

a { color: var(--olive-dark); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-row .card {
  margin-bottom: 0;
  text-align: left;
}

.summary-row .figure {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--olive-dark);
}

.summary-row .label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
}

.btn-primary { background: rgb(1, 101, 1); color: #fff; }
.btn-primary:hover { background:rgba(1, 101, 1, 0.755); }

.btn-rust { background: var(--rust); color: #fff; }
.btn-rust:hover { background:  #fb0a0ac6; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn-block {
   width: 100%;
   background: transparent;
   color: #111;
   outline: 1px solid green;
   }
   .btn-block:hover{
    outline: 1px solid rgba(243, 8, 8, 0.81);
   }

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--olive);
}

textarea { resize: vertical; min-height: 70px; }

.customer-list { list-style: none; margin: 0; padding: 0; }

.customer-list li {
  display: block;
}

.customer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.customer-list li:last-child .customer-row { border-bottom: none; }

.customer-row .name { font-weight: 600; }
.customer-row .phone { font-size: 0.85rem; color: var(--muted); }

.balance { font-weight: 700; font-variant-numeric: tabular-nums; }
.balance.owing { color: var(--rust); }
.balance.clear { color: var(--muted); font-weight: 500; }

.search-box { margin-bottom: 6px; }

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.tx-list { list-style: none; margin: 0; padding: 0; }

.tx-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.tx-list li:last-child .tx-item { border-bottom: none; }

.tx-desc { font-size: 0.92rem; }
.tx-date { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.tx-amount { font-weight: 700; white-space: nowrap; text-align: right; }
.tx-amount.charge { color: var(--rust); }
.tx-amount.payment { color: var(--olive-dark); }
.tx-running { font-size: 0.75rem; color: var(--muted); margin-top: 2px; text-align: right; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--rust-light);
  color: var(--rust);
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.alert-error { background: #fbe4dd; color: #8a341a; }
.alert-success { background: #e5ecdd; color: var(--olive-dark); }

.top-balance-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.top-balance-item:last-child { border-bottom: none; }

.print-only { display: none; }

@media print {
  header.top, .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: 100%; }
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.login-wrap {
  max-width: 360px;
  margin: 60px auto;
  padding: 0 16px;
}

/* =========================
   Forgot Password
   ========================= */

.forgot-password {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 600px) {
  .forgot-password {
    margin-top: 14px;
    font-size: 0.88rem;
    padding: 5px;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .forgot-password {
    font-size: 0.84rem;
  }
}

.center-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 16px;
}
