* {
    box-sizing:border-box;
}


body {

    margin:0;

    padding:0;

    font-family:
    Arial,
    Tahoma,
    sans-serif;

    background:#f5f5f5;

    direction:rtl;

}


.app-container {

    width:100%;

    max-width:600px;

    margin:auto;

    padding:10px;

}



/* Buttons */

button,
.btn {

    border:none;

    background:#1976d2;

    color:white;

    padding:12px 18px;

    border-radius:6px;

    cursor:pointer;

    font-size:16px;
margin-bottom: 5px;
}
.btn-a{
    width:100%;margin-top:5px;display:inline-block;
    text-align: center;
    text-decoration: none;
}


button:active {

    opacity:.8;

}



/* Inputs */


input,
select,
textarea {

    width:100%;

    padding:10px;

    margin-bottom:10px;

    border:1px solid #ccc;

    border-radius:5px;

    font-size:16px;

}
.card.filters input,
.card.filters select,
.card.filters textarea{
    padding:5px;

    margin-bottom:6px;
   font-size:12px;
}
select {
    

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23666' stroke-width='2'/%3E%3C/svg%3E");

    background-repeat: no-repeat;

    /* RTL: put arrow on the left */
    background-position: left 12px center;

    background-size: 16px;
}


/* Cards */


.card {

    background:white;

    border-radius:8px;

    padding:12px;

    margin-bottom:10px;

    box-shadow:
    0 1px 4px #ccc;

}




/* Status badges */


.badge {

    padding:4px 8px;

    border-radius:12px;

    font-size:12px;

    color:white;

}
.badge.count{
 top:50px;   
}

.status-new {

    background:#ff9800;

}


.status-received {

    background:#2196f3;

}


.status-cleaned {

    background:#9c27b0;

}

.status-canceled {

    background:#ef4444;

}

.status-deleted {

    background:#333;

}


.status-sent {

    background:#4caf50;

}




/* Loading */


.loading {

    text-align:center;

    padding:20px;

}




/* Hide overflow */

html,body {

    overflow-x:hidden;

}



/* Mobile */

@media(max-width:400px){

    button {

        width:100%;

    }

}

.order-card {
    cursor:pointer;
}

.pagination {
    display:flex;
    gap:5px;
    flex-wrap:wrap;
    margin-top:10px;
}

.pagination button {
    width:auto;
    padding:8px 12px;
}

#customer_results {
    position:relative;
}

.carpet input {
    margin-bottom:8px;
}

#customer_results .card {

    cursor:pointer;

}


#new_customer_box input,
#new_customer_box textarea {

    margin-bottom:8px;

}

.carpet {

    margin-bottom:10px;

}


.carpet button {

    background:#d32f2f;

}

.success {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
}

.danger {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}

.warning {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}

.info {
  background: #3b82f6;
  color: #fff;
  border-color: #2563eb;
}

.primary {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.secondary,
.grey {
  background: #6b7280;
  color: #fff;
  border-color: #4b5563;
}

.light {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.dark {
  background: #1f2937;
  color: #fff;
  border-color: #111827;
}

.filters label{
    width: 30%;
    display: inline-block;
}
.filters select, .filters input{
    width: 60%;
}

.filters {
    direction: rtl;
}

.two-cols label{
    width: 30%;
    display: inline-block;
}
.two-cols label.customer-label{
    width: 20%;
    padding: 5px 0;
   
}
.two-cols  select, .two-cols  input{
    width: 60%;
}

.two-cols  {
    direction: rtl;
}


.order-card{
    position: relative ;
}
.badge{
    position: absolute;
    left: 20px;
    top: 20px;
}
#carpets{
    padding-left: 40px;
    padding-right: 40px;
}
#carpets input {
font-size: 14px;
padding: 3px 10px;
}
#carpets button {
font-size: 16px;
padding: 5px 10px;
}
button.middle-size{
    margin-left: 30px;
    margin-right: 30px;
    width: calc(100% - 60px);
}

h3.narrow-margin{
margin:0;
margin-bottom: 4px;
}
h1.narrow-margin{
margin:0;
margin-bottom: 5px;
}
.order-details div{
    margin-bottom: 5px;
}

/* =========================================
   Monthly Report
   ========================================= */

.monthly-report {
    width: 100%;
}


.report-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px #ccc;
}


.report-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 0.6fr 1fr 1fr 1fr;
    align-items: center;
    min-height: 52px;
    border-bottom: 1px solid #eee;
}


.report-row:last-child {
    border-bottom: none;
}


.report-header {
    min-height: 42px;

    background: #f1f1f1;

    font-weight: bold;

    font-size: 14px;
}


.report-name,
.report-paid,
.report-paid-amount,
.report-total {
    padding: 8px;
}



.report-name {
    min-width: 0;
}


.report-paid,
.report-total {
    text-align: center;

    white-space: nowrap;
}
.report-paid{
    text-align: right;
}
.report-total{
    text-align: left;
}


/*
    Customer name:
    initially one line and truncated
*/
.customer-name {
    cursor: pointer;

    overflow: hidden;
}


.customer-name-short {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/*
    When tapped:
    expand vertically instead of horizontally.
*/
.customer-name.expanded {
    white-space: normal;

    overflow: visible;

    word-break: break-word;
}


.customer-name.expanded
.customer-name-short {

    white-space: normal;

    overflow: visible;

    text-overflow: clip;
}


/* Paid / unpaid */

.report-paid-badge,
.report-unpaid-badge {

    display: inline-block;

    padding: 4px 8px;

    border-radius: 12px;

    font-size: 13px;
}


.report-paid-badge {
    background: #e8f5e9;

    color: #2e7d32;
}


.report-unpaid-badge {
    background: #ffebee;

    color: #c62828;
}


/* Summary */

.report-summary {
    margin-top: 12px;
}


.report-summary-item {

    display: flex;

    justify-content: space-between;

    align-items: center;

    background: #fff;

    padding: 13px;

    margin-bottom: 8px;

    border-radius: 8px;

    box-shadow: 0 1px 3px #ddd;
}


.report-summary-item strong {
    white-space: nowrap;
}


.report-summary-total {

    font-size: 17px;

}


/* Empty report */

.report-empty {

    text-align: center;

    padding: 25px;

}

/* =========================================
   Login
   ========================================= */

.login-page {
    width: 100%;
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 15px;
}


.login-card {
    width: 100%;
    max-width: 420px;
}


.login-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}


.login-card button {
    width: 100%;
}


.login-message {
    color: #c62828;

    margin-bottom: 10px;

    min-height: 20px;
}



/* header */ 
/* =========================
   HEADER
========================= */

.mobile-header {
  position: relative;
  background: #1f2937;
  color: #fff;
  padding: 10px 14px;
  border-bottom: 3px solid #d32f2f;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  font-weight: bold;
}


/* =========================
   TOP AREA
========================= */

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}


/* =========================
   LEVEL
========================= */

.level {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-label {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}

.level-value {
  min-width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 8px;

  background: #d32f2f;
  color: #fff;

  border-radius: 7px;

  font-size: 14px;
  font-weight: 700;

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}


/* =========================
   USER + MENU
========================= */

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  gap: 10px;
}

.username {
  display: flex;
  align-items: center;
  gap: 7px;
}

.username-name {
  font-size: 13px;
  font-weight: 600;
  color: #f9fafb;
}

.username-icon {
  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #3b82f6;
  color: #fff;

  font-size: 14px;
}


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

.menu-toggle {
  width: 38px;
  height: 38px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 5px;

  border: 1px solid #4b5563;
  border-radius: 8px;

  background: #374151;
  cursor: pointer;

  transition: 0.2s ease;
}

.menu-toggle span {
  display: block;

  width: 18px;
  height: 2px;

  border-radius: 5px;

  background: #fff;

  transition: 0.25s ease;
}

.menu-toggle:hover {
  background: #d32f2f;
  border-color: #dc2626;
}


/* =========================
   HAMBURGER ANIMATION
========================= */

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

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

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


/* =========================
   DROPDOWN NAVIGATION
========================= */

.mobile-nav {
  position: absolute;

  top: calc(100% + 3px);
  left: 10px;
  right: 10px;

  padding: 7px;

  background: #1f2937;

  border: 1px solid #374151;
  border-radius: 10px;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);

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

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}


/* Open menu */

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


/* =========================
   NAV ITEMS
========================= */

.nav-item {
  display: flex;
  align-items: center;

  gap: 12px;

  padding: 11px 12px;

  color: #d1d5db;
  text-decoration: none;

  border-radius: 7px;

  font-size: 14px;
  font-weight: 500;

  transition: 0.2s ease;
}

.nav-item:hover {
  background: #374151;
  color: #fff;
}


/* Active item */

.nav-item.active {
  background: #d32f2f;
  color: #fff;
}


/* Icons */

.nav-icon {
  width: 25px;
  height: 25px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 6px;

  background: rgba(255, 255, 255, 0.08);

  font-size: 13px;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.15);
}


/* update user form */
#userFormContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-radius: 16px;
  padding: 24px;

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);

  z-index: 9999;
}
#userFormContainer::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: -1;
}