html {
  background-color: #fff8f0; /* Base background color */
}
html::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/Imagen de WhatsApp 2025-07-11 a las 20.37.04_17285adc.jpg');
  background-repeat: repeat;
  background-size: 250px; /* Adjust size for a subtle pattern */
  opacity: 0.1; /* Make the background image very subtle */
  z-index: -1; /* Ensures it's behind all other content */
}
body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0; padding: 0;
  min-height: 100vh;
}
.container {
  max-width: 500px;
  background: #fff; /* Ensure container has a solid background to obscure the pattern behind it */
  margin: 32px auto;
  padding: 2em 2.5em 2.5em 2.5em;
  box-shadow: 0 4px 18px #0002;
  border-radius: 12px;
}
h1 {
  text-align: center;
  color: #c25118;
  margin-top: 0;
}
form {
  display: flex;
  flex-direction: column;
  gap: 1em;
}
label {
  font-weight: bold;
}
input[type="text"], input[type="number"], input[type="password"], select {
  padding: 0.5em;
  border-radius: 4px;
  border: 1px solid #ddd;
  width: 100%;
}
/* Enhance password hiding */
input[type="password"] {
  -webkit-text-security: disc; /* Ensures text is shown as dots/discs for WebKit browsers */
  text-security: disc; /* Standard property for text masking */
  appearance: none; /* Attempt to reset default browser styles, might help with some native controls */
  -webkit-appearance: none;
  -moz-appearance: none;
}
/* Style for disabled price input to make it clear it's not editable */
input[type="number"]:disabled {
  background-color: #f0f0f0;
  cursor: not-allowed;
}
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}
.items-table th, .items-table td {
  border: 1px solid #eee;
  padding: 0.6em;
  text-align: center;
}
.add-btn {
  background: #eeaf21;
  color: #fff;
  font-weight: bold;
  border: none;
  padding: 0.6em 1.4em;
  border-radius: 4px;
  cursor: pointer;
}
.add-btn:hover {
  background: #e88c17;
}
.remove-btn {
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 0.3em 0.6em;
  cursor: pointer;
}
.remove-btn:hover {
  background: #b91c1c;
}
.total-container {
  margin-top: 2em;
  text-align: right;
  font-size: 1.15em;
  color: #1a202c;
}
/* New styles for payment details */
#paymentDetails {
  margin-top: 1em; /* Adjusted margin to prevent double-spacing with total-container */
  text-align: right;
  font-size: 1.15em;
  color: #1a202c;
}
#paymentDetails input {
  width: calc(100% - 12px); /* Account for padding */
  max-width: 150px;
  text-align: right;
  padding: 0.5em; /* Match other inputs */
  border-radius: 4px;
  border: 1px solid #ddd;
}
/* End new styles */
#resultFactura {
  margin-top: 2em;
  background: #ffe6bb;
  border-radius: 7px;
  padding: 1.2em;
  box-shadow: 0 2px 8px #0002;
}
.print-btn {
  margin-top: 1.5em;
  padding: 0.8em 1.8em;
  border: none;
  background: #c25118;
  color: #fff;
  font-size: 1.1em;
  border-radius: 6px;
  cursor: pointer;
}
.print-btn:hover {
  background: #94360b;
}
/* Login styles */
#loginOverlay {
  position: fixed; z-index: 2200; left:0; top:0; right:0; bottom:0;
  background: rgba(241, 186, 82, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-width: 100vw;
}
#loginBox {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 30px 8px #c2511815;
  max-width: 340px;
  padding: 2.6em 2em 2em 2em;
  display:flex; flex-direction:column; gap:1em;
}
#loginBox h2 {
  text-align: center;
  color: #c25118;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 1.6em;
  letter-spacing:0.01em;
}
#loginBox .login-error {
  color: #d32f2f;
  background: #fff6f6;
  border-radius: 4px;
  padding: 0.45em 0.7em;
  font-size: 1em;
  display: none;
  margin-bottom: -1em;
  text-align: center;
  border: 1px solid #ffe0e0;
}
#loginBox label {
  font-weight: bold;
  color: #65361e;
}
#loginBox input[type="text"], #loginBox input[type="password"] {
  font-size: 1em;
  margin-top: 0.1em;
  margin-bottom: 0.7em;
}
#loginBox .login-btn {
  margin-top: 1.2em;
  background: #c25118;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  font-size: 1.1em;
  padding: 0.7em;
  cursor: pointer;
  width: 100%;
}
#loginBox .login-btn:hover {
  background: #ae4112;
}
/* Hide the "show password" icon in Webkit browsers (Chrome, Edge, Safari) */
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-input-decoration,
input[type="password"]::-webkit-textfield-decoration-container,
input[type="password"]::-webkit-clear-button,
input[type="password"]::-webkit-inner-spin-button,
input[type="password"]::-webkit-outer-spin-button,
input[type="password"]::-webkit-input-speech-button,
input[type="password"]::-webkit-password-toggle-button {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  visibility: hidden !important;
}

/* Remove the "eye" button from showing password in Microsoft Edge Chromium */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none !important;
}

/* General overlay/modal styles for Daily Sales */
.overlay {
  position: fixed; z-index: 2100; left:0; top:0; right:0; bottom:0; /* Z-index lower than login, higher than content */
  background: rgba(0,0,0,0.5); /* Darker background for daily sales */
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-width: 100vw;
  overflow-y: auto; /* Allow scrolling if content is long */
  padding: 20px 0;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 30px 8px #00000033;
  max-width: 700px; /* Wider for invoices */
  width: 90%;
  padding: 2.6em 2em 2em 2em;
  display:flex; flex-direction:column; gap:1em;
  position: relative;
}
.modal-box h2 {
  text-align: center;
  color: #c25118;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 1.6em;
  letter-spacing:0.01em;
}
#dailySalesContent, #top10Content {
  max-height: 70vh; /* Limit height and allow scrolling */
  overflow-y: auto;
  padding-right: 10px; /* For scrollbar */
}
#dailySalesContent .daily-invoice {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.2em;
  margin-bottom: 1.5em;
  background: #fff8f0;
  box-shadow: 0 2px 10px #00000010;
}
#dailySalesContent .daily-invoice:last-child {
  margin-bottom: 0;
}

/* Styles for Tables Modal (Planta Baja / Planta Alta) */
#tablesBox {
  max-width: 900px; /* Wider for tables layout */
}
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  justify-content: center;
}
.table-card {
  background: #fdfaf7;
  border: 1px solid #f0d7c2;
  border-radius: 10px;
  padding: 1.2em;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 120px; /* Ensure consistent height */
}
.table-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: #e88c17;
}
.table-card.active {
  background-color: #ffeccf;
  border-color: #eeaf21;
  box-shadow: 0 0 0 3px rgba(238, 175, 33, 0.4);
}
.table-card.occupied {
  background-color: #f7e1d1;
  border-color: #e88c17;
  color: #333;
}
.table-card.occupied h3 {
  color: #a84210;
}
.table-card.occupied p {
  color: #777;
}
/* New styles for Annulment Prompt */
#annulmentCodePromptOverlay {
  position: fixed; z-index: 2300; left:0; top:0; right:0; bottom:0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
#annulmentCodePromptBox {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.3);
  max-width: 380px;
  width: 90%;
  padding: 1.8em 1.5em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  text-align: center;
}
#annulmentCodePromptBox p {
  margin: 0 0 1em 0;
  font-size: 1.1em;
  color: #333;
}
#annulmentCodePromptBox input[type="password"] {
  width: calc(100% - 20px); /* Adjust for padding */
  padding: 0.7em 10px;
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 0.5em;
}
#annulmentCodePromptBox .button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1em;
}
#annulmentCodePromptBox .button-group button {
  padding: 0.7em 1.5em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
}
#annulmentCodePromptBox .button-group .confirm-btn {
  background: #c25118;
  color: #fff;
}
#annulmentCodePromptBox .button-group .confirm-btn:hover {
  background: #94360b;
}
#annulmentCodePromptBox .button-group .cancel-btn {
  background: #ccc;
  color: #333;
}
#annulmentCodePromptBox .button-group .cancel-btn:hover {
  background: #bbb;
}

/* NEW CARD PAYMENT MODAL STYLES (similar to other modals) */
#cardPaymentOverlay {
  position: fixed; z-index: 2150; left:0; top:0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-width: 100vw;
}

#cardPaymentBox {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 30px 8px #00000033;
  max-width: 450px; /* Slightly wider than login, smaller than daily sales */
  width: 90%;
  padding: 2.6em 2em 2em 2em;
  display:flex; flex-direction:column; gap:1em;
  position: relative;
  text-align: left; /* Adjust text alignment within box */
}

#cardPaymentBox h2 {
  text-align: center;
  color: #006b52; /* Green color for card payments */
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 1.6em;
  letter-spacing:0.01em;
}

#cardPaymentBox label {
  font-weight: bold;
  color: #333;
}

#cardPaymentBox input[type="number"] {
  margin-top: 0.1em;
  margin-bottom: 0.7em;
  text-align: right; /* Align numbers to the right */
}

#cardPaymentBox .button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1em;
}
#cardPaymentBox .button-group button {
  padding: 0.7em 1.5em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
}
#cardPaymentBox .button-group .confirm-btn {
  background: #006b52; /* Green for confirm */
  color: #fff;
}
#cardPaymentBox .button-group .confirm-btn:hover {
  background: #004d39;
}
#cardPaymentBox .button-group .cancel-btn {
  background: #ccc;
  color: #333;
}
#cardPaymentBox .button-group .cancel-btn:hover {
  background: #bbb;
}

/* NEW EXPENSES MODAL STYLES */
#expensesOverlay {
  position: fixed; z-index: 2150; left:0; top:0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-width: 100vw;
  overflow-y: auto;
  padding: 20px 0;
}
#expensesBox {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 30px 8px #00000033;
  max-width: 600px;
  width: 90%;
  padding: 2.6em 2em 2em 2em;
  display:flex; flex-direction:column; gap:1em;
  position: relative;
}
#expensesBox h2 {
  text-align: center;
  color: #a04f00; /* Brown color for expenses */
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 1.6em;
  letter-spacing:0.01em;
}
#expensesBox .items-table th, #expensesBox .items-table td {
    padding: 0.5em;
    font-size: 0.9em;
}
#expensesBox .items-table th {
    background-color: #f8e5d3;
}
#expensesTableBody tr:nth-child(odd) {
    background-color: #fcf6f0;
}
#expensesTableBody tr:hover {
    background-color: #fff0e0;
}

/* NEW CLOSURE AUTH CODE PROMPT UI STYLES (similar to annulment code prompt) */
#closureAuthCodePromptOverlay {
  position: fixed; z-index: 2300; left:0; top:0; right:0; bottom:0;
  background: rgba(0,0,0,0.6);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
}
#closureAuthCodePromptBox {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.3);
  max-width: 380px;
  width: 90%;
  padding: 1.8em 1.5em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  text-align: center;
}
#closureAuthCodePromptBox p {
  margin: 0 0 1em 0;
  font-size: 1.1em;
  color: #333;
}
#closureAuthCodePromptBox input[type="password"] {
  width: calc(100% - 20px); /* Adjust for padding */
  padding: 0.7em 10px;
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 0.5em;
}
#closureAuthCodePromptBox .button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1em;
}
#closureAuthCodePromptBox .button-group button {
  padding: 0.7em 1.5em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
}
#closureAuthCodePromptBox .button-group .confirm-btn {
  background: #2c5282; /* Use the same blue as closure modal */
  color: #fff;
}
#closureAuthCodePromptBox .button-group .confirm-btn:hover {
  background: #1a365d;
}
#closureAuthCodePromptBox .button-group .cancel-btn {
  background: #ccc;
  color: #333;
}
#closureAuthCodePromptBox .button-group .cancel-btn:hover {
  background: #bbb;
}

@media (max-width: 600px){
  .container {
    padding: 1em;
  }
  #loginBox, #cardPaymentBox, #expensesBox, #cashRegisterClosureBox { /* Add expensesBox here */
    padding: 1.8em 0.9em 1.3em 0.9em;
  }
  .modal-box {
    padding: 1.8em 0.9em 1.3em 0.9em;
  }
  .tables-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
  }
}