body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  color: #222;
  min-height: 100vh;
  /* iOS PWA specific styles */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* iOS PWA specific styles */
@supports (padding: max(0px)) {
  body {
    padding-left: max(env(safe-area-inset-left), 0px);
    padding-right: max(env(safe-area-inset-right), 0px);
  }
  
  .container, .dashboard-container, .ledger-container {
    padding-top: max(env(safe-area-inset-top), 0px);
    padding-bottom: max(env(safe-area-inset-bottom), 0px);
  }

  header {
    padding-top: max(env(safe-area-inset-top), 16px);
  }

  .floating-add-btn {
    bottom: max(2rem, env(safe-area-inset-bottom) + 1rem);
    right: max(2rem, env(safe-area-inset-right) + 1rem);
  }
}

/* Disable iOS text size adjustment */
html {
  -webkit-text-size-adjust: none;
}

/* Prevent iOS double-tap zoom */
* { 
  touch-action: manipulation;
}

.container, .dashboard-container, .ledger-container {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Login page specific styles */
.auth-container {
  max-width: 350px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.logo-section {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
}

.logo-section i {
  font-size: 3.5rem;
  color: #4CAF50;
  margin-bottom: 1rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.logo-section h1 {
  margin: 0.5rem 0 0.2rem 0;
  font-size: 2rem;
  background: linear-gradient(45deg, #4CAF50, #2196F3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
}

.logo-section p {
  color: #666;
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.auth-form {
  display: block;
  margin-bottom: 1.5rem;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.auth-form h2 i {
  color: #4CAF50;
  font-size: 1.6rem;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.auth-form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form .btn-primary {
  width: 100%;
  max-width: 200px;
  margin: 1rem auto 0;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  background: linear-gradient(45deg, #4CAF50, #45a049);
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-form .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #45a049, #388e3c);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.auth-form .btn-primary:hover::before {
  opacity: 1;
}

.auth-form .btn-primary i,
.auth-form .btn-primary span {
  position: relative;
  z-index: 1;
}

.auth-form .btn-primary i {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

.auth-form .btn-secondary {
  margin: 1rem 0;
}

.auth-form.hidden {
  display: none;
}

.input-group {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.input-group:focus-within {
  background: #fff;
  border-color: #4CAF50;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.input-group i {
  margin-right: 0.8rem;
  color: #4CAF50;
  font-size: 1.2rem;
}

.input-group input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 1rem;
  padding: 0.5rem 0;
  color: #333;
}

.input-group input::placeholder {
  color: #999;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(45deg, #4CAF50, #45a049);
  color: #fff;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(45deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
  background: #2196F3;
  color: #fff;
}
.btn-secondary:hover {
  background: #1769aa;
}
.btn-add {
  background: #8e24aa;
  color: #fff;
}
.btn-add:hover {
  background: #5c007a;
}
.btn-gave {
  background: #e53935;
  color: #fff;
}
.btn-gave:hover {
  background: #b71c1c;
}
.btn-got {
  background: #43a047;
  color: #fff;
}
.btn-got:hover {
  background: #1b5e20;
}
.auth-links {
  margin-top: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-links a {
  color: #4CAF50;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  padding: 0.3rem;
}

.auth-links a:hover {
  color: #2196F3;
  transform: translateX(3px);
}

/* Card styles */
.cards-row {
  display: flex;
  gap: 1rem;
  margin: 1.5rem;
  padding: 0;
}

.card {
  flex: 1;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  text-align: center;
  transition: all 0.3s ease;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.3), rgba(255,255,255,0.1));
}

.card-get {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.card-give {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-title {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: #555;
}

.card-amount {
  font-size: 1.8rem;
  font-weight: bold;
  background: linear-gradient(45deg, #1a237e, #0d47a1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header styles */
header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Customer list styles */
.customer-list {
  margin: 1rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  overflow: hidden;
}

.customer-list-header h3 {
  margin: 0;
  padding: 1rem;
}

.customer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
  background: #fff;
}

.customer-item:hover {
  background: #f8f9fa;
  transform: translateX(4px);
}

.customer-item:last-child {
  border-bottom: none;
}

.customer-name {
  font-size: 1.1rem;
}
.customer-amount {
  font-size: 1.1rem;
  font-weight: bold;
}
.amount-positive {
  color: #d32f2f;
}
.amount-negative {
  color: #388e3c;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  position: relative;
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
}

.ledger-header {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #f8f9fa;
  margin-bottom: 1rem;
}
.ledger-customer-name {
  font-size: 1.2rem;
  font-weight: bold;
}
.ledger-balance {
  font-size: 1.8rem;
  font-weight: bold;
  color: #333;
}
.ledger-actions {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  margin: 0;
}
.ledger-actions .btn {
  flex: 1;
  padding: 1rem;
  justify-content: center;
}
.ledger-list {
  margin-bottom: 85px;
}
.ledger-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid #eee;
}
.ledger-entry.gave {
  background: #ffebee;
  color: #d32f2f;
}
.ledger-entry.got {
  background: #e8f5e9;
  color: #388e3c;
}
/* Side navigation styles */
.side-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
  z-index: 2000;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}
.side-nav.hidden {
  transform: translateX(-100%);
  pointer-events: none;
}
.side-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  font-weight: bold;
}
.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.side-nav ul li {
  border-bottom: 1px solid #f1f1f1;
}
.side-nav ul li a {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: #333;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background 0.2s;
}
.side-nav ul li a i {
  margin-right: 0.7rem;
}
.side-nav ul li a:hover {
  background: #f7f7f7;
}
.menu-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #4CAF50;
  margin-right: 0.5rem;
}
.back-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #4CAF50;
  margin-right: 0.5rem;
  text-decoration: none;
}

/* Fancy back button */
.fancy-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e3f2fd;
  color: #1976d2;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  margin-right: 1rem;
  border: none;
  transition: background 0.2s, color 0.2s;
}
.fancy-back:hover {
  background: #1976d2;
  color: #fff;
}

/* Passbook ledger layout */
.passbook {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.passbook-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.5rem;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
}
.passbook-row.got {
  background-color: #e8f5e9;
}
.passbook-row.gave {
  background-color: #ffebee;
}
.passbook-row:hover {
  background-color: #f5f5f5;
}
.passbook-row.got:hover {
  background-color: #c8e6c9;
}
.passbook-row.gave:hover {
  background-color: #ffcdd2;
}
.passbook-col {
  flex: 1;
  min-width: 0;
}
.passbook-entry {
  display: flex;
  flex-direction: column;
  background: #f1f1f1;
  border-radius: 7px;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.2rem;
  font-size: 0.98rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.passbook-entry.got {
  background: #e8f5e9;
  color: #388e3c;
  align-items: flex-start;
}
.passbook-entry.gave {
  background: #ffebee;
  color: #d32f2f;
  align-items: flex-end;
}
@media (max-width: 600px) {
  .container, .dashboard-container, .ledger-container {
    border-radius: 20px 20px 0 0;
    margin-top: 1rem;
    min-height: calc(100vh - 1rem);
  }
  
  .auth-container {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .cards-row {
    margin: 1rem;
  }
  
  .floating-add-btn {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  .side-nav {
    width: 80vw;
    min-width: 180px;
  }
  .fancy-back {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
} 

/* Add spacing between icons and text */
.btn i, .side-nav ul li a i, .input-group i {
  margin-right: 0.6em !important;
}
.btn span, .side-nav ul li a span {
  margin-left: 0.2em;
}

.input-group input[type="number"]::-webkit-input-placeholder {
  font-family: 'Segoe UI', Arial, sans-serif;
}
.input-group input[type="number"] {
  padding-left: 0.2em;
}

.input-group i.fas.fa-rupee-sign {
  color: #388e3c;
  font-size: 1.1em;
}
.input-group i.fas.fa-comment {
  color: #888;
}

/* Ledger entry row layout */
.passbook-row.single-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #f9f9f9;
  border-radius: 7px;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.7rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.passbook-row.single-row.got {
  border-left: 4px solid #43a047;
}
.passbook-row.single-row.gave {
  border-right: 4px solid #e53935;
}
.passbook-col.main {
  flex: 2;
}
.passbook-col.amount {
  flex: 1;
  font-weight: bold;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.passbook-row.single-row.gave .passbook-col.amount {
  justify-content: flex-start;
}
.entry-date {
  font-size: 0.98em;
  color: #888;
}
.entry-comment {
  font-size: 0.95em;
  color: #555;
  margin-top: 0.2em;
  font-style: italic;
}
.ledger-balance-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
#customerBalanceLabel {
  font-size: 1rem;
  color: #666;
} 

.btn-danger {
  background: #dc3545;
  color: #fff;
  padding: 0.4rem 0.8rem;
  margin: 0;
}
.btn-danger:hover {
  background: #c82333;
}
.delete-customer {
  margin-left: 1rem;
}
.entry-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 0.8rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.passbook-row:hover .entry-actions {
  opacity: 1;
}
.btn-icon {
  background: none;
  border: none;
  padding: 0.3rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.btn-icon:hover {
  opacity: 1;
}
.passbook-col.amount {
  display: flex;
  align-items: center;
} 

/* Customer actions */
.customer-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  padding: 1rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
  gap: 1rem;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.customer-actions .btn {
  flex: 1;
  padding: 0.8rem;
  justify-content: center;
  font-weight: 500;
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-width: 0;
}
.customer-actions .btn i {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}
.customer-actions .btn-primary, .customer-actions .btn-danger {
  flex: 1;
  font-size: 1rem;
}
.customer-actions .btn-primary {
  background: #2196F3;
}
.customer-actions .btn-primary:hover {
  background: #1976D2;
}
.customer-actions .btn-danger {
  background: #dc3545;
}
.customer-actions .btn-danger:hover {
  background: #c82333;
} 

/* Floating action button */
.floating-add-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(45deg, #4CAF50, #45a049);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  transform-origin: center;
}

.floating-add-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: linear-gradient(45deg, #45a049, #388e3c);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.floating-add-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(76, 175, 80, 0.5);
}

.floating-add-btn:hover::before {
  opacity: 1;
}

.floating-add-btn:active {
  transform: scale(0.95);
}

.floating-add-btn i {
  font-size: 24px;
  position: relative;
  z-index: 1;
  transform: translateY(1px);
}

@media (max-width: 600px) {
  .floating-add-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
  }
  
  .floating-add-btn i {
    font-size: 22px;
  }
} 