/* =========================================================
   Restaurant Weekly Manager (RWM) - Weekly Summary Styles
   Used on the Weekly Summary page (summary table + compare popup)
   ========================================================= */

.rwm-summary-wrap {
    max-width: 980px !important;
    margin: 0 auto 24px !important;
    font-family: inherit !important;
}

.rwm-summary-wrap .rwm-summary-top {
    display: flex !important;
    justify-content: flex-end !important;
    margin-bottom: 10px !important;
}

.rwm-summary-wrap .rwm-summary-new-week {
    display: inline-block !important;
    padding: 6px 12px !important;
    background: #356ECC !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 2px !important;
    font-size: 13px !important;
}

.rwm-summary-wrap .rwm-summary-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13px !important;
}

.rwm-summary-wrap .rwm-summary-table th,
.rwm-summary-wrap .rwm-summary-table td {
    border: 1px solid #ddd !important;
    padding: 6px 8px !important;
    text-align: right !important;
}

.rwm-summary-wrap .rwm-summary-table th {
    background: #74839B !important;
    color: #fff !important;
    text-align: center !important;
    font-size:14px;
    font-weight:600;
}

.rwm-summary-wrap .rwm-summary-table td.rwm-summary-date {
    text-align: center !important;
    white-space: nowrap !important;
}

.rwm-summary-wrap .rwm-summary-table td.rwm-summary-actions {
    text-align: center !important;
}

.rwm-summary-wrap .rwm-summary-table a.rwm-summary-link {
    display: inline-block !important;
    margin: 0 3px !important;
    text-decoration: none !important;
    padding: 3px 6px !important;
    border: 1px solid #356ECC !important;
    background: #356ECC !important;
    color: #fff !important;
    font-size: 11px !important;
}

.rwm-summary-wrap .rwm-summary-table tr:nth-child(even) td {
    background: #f9f9f9 !important;
}

.rwm-summary-wrap .rwm-summary-negative {
    color: #c00 !important;
    font-weight: 600 !important;
}

@media (max-width: 768px) {
    .rwm-summary-wrap .rwm-summary-table {
        font-size: 12px !important;
    }
    .rwm-summary-wrap .rwm-summary-table th,
    .rwm-summary-wrap .rwm-summary-table td {
        padding: 4px 5px !important;
    }
}

.rwm-week-date-display {
                    padding: 4px 6px;
                    min-width: 160px;
                    border: 1px solid #ddd;
                    background: #f5f5f5;
                    font-size: 13px;
                }

.rwm-admin-summary-box-value, .rwm-week-date-display, .rwm-workers-tabs input, #rwm-main-purchases input, #rwm-main-fixed input, #rwm-income-epos input, #rwm-income-online input, #rwm-main-wages input, #rwm-main-income input{
  font-size:16px;
  color:#636363;
}

.rwm-summary-wrap .rwm-section-title{
  background: #75839b !important;
}

.rwm-summary-table td.rwm-summary-date{
  padding: 0 !important;
}

.rwm-summary-table .rwm-week-date-btn{
  display: block;
  width: 100%;
  height: 100%;
  background: #356ECC !important;   /* NOTE: Comment translated/cleaned (Arabic removed). */
  color: #fff !important;           /* NOTE: Comment translated/cleaned (Arabic removed). */
  text-align: center;
  padding: 10px 6px;
  text-decoration: none !important;
  font-weight: 600;
}

.rwm-summary-table .rwm-week-date-btn:hover{
  opacity: 0.9;
}

.rwm-summary-table .rwm-week-date-btn.rwm-week-date-danger{
  background:#8b0000 !important;
  color:#fff !important;
}

.rwm-week-date-btn.rwm-week-date-danger{
  background:#8b0000 !important;
  color:#fff !important;
}

.rwm-week-date-btn.rwm-week-date-danger:hover{ filter: brightness(1.05); }

@media (max-width: 680px){
    
/*

  .rwm-summary-table th:nth-child(4),
  .rwm-summary-table td:nth-child(4),
  .rwm-summary-table th:nth-child(5),
  .rwm-summary-table td:nth-child(5),
  .rwm-summary-table th:nth-child(6),
  .rwm-summary-table td:nth-child(6),
  .rwm-summary-table th:nth-child(7),
  .rwm-summary-table td:nth-child(7),
  .rwm-summary-table th:nth-child(8),
  .rwm-summary-table td:nth-child(8){
    display: table-cell !important;
  }

  .rwm-summary-table th:nth-child(1),
  .rwm-summary-table td:nth-child(1),
  .rwm-summary-table th:nth-child(2),
  .rwm-summary-table td:nth-child(2),
  .rwm-summary-table th:nth-child(3),
  .rwm-summary-table td:nth-child(3){
    display: none !important;
  }
  
  */
  

  .rwm-summary-table th,
  .rwm-summary-table td{
    font-size: 13px;
    padding: 6px 4px;
    white-space: nowrap;
  }

  .rwm-day-col select{
    width:60px !important;
    font-size:16px !important;
  }
}

.rwm-summary-table tbody tr:nth-child(odd){
  background-color: #ffffff;
}

.rwm-summary-table tbody tr:nth-child(even){
  background-color: #F2F2F2;
}

.rwm-summary-csv{
  width: 140px;
  text-align: center;
  vertical-align: middle;
}

.rwm-summary-csv-btn{
  display:inline-block;
  margin-top:6px;
  border:0;
  background:#356ECC;
  color:#fff;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
  font-size:12px;
}

.rwm-summary-csv-btn:hover{ filter: brightness(0.95); }

.rwm-summary-compare-msg{
  margin-top:6px;
  font-size:12px;
  color:#fff600;
  background: none;
}

.rwm-summary-csv input.rwm-csv-week{
  transform: scale(1.05);
}

.rwm-summary-compare{
  width:60px;
  text-align:center;
}

/* =========================================================
   Weekly Summary - Week date field icon (page only)
   ========================================================= */
#rwm-new-week-date.rwm-date-input{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='gray' viewBox='0 0 16 16'%3E%3Cpath d='M3 0a1 1 0 0 1 1 1v1h8V1a1 1 0 1 1 2 0v1h1a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a1 1 0 0 1 1-1h1V1a1 1 0 0 1 1-1zM1 5v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5H1z'/%3E%3C/svg%3E") !important;
  /* Force no-tiling + consistent placement (some themes override background-* on inputs) */
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
  background-color: #fff !important;
  padding-right: 32px;
}

/* =========================================================
   Weekly Summary - Datepicker rules
   - Disable already-used Mondays
   - Highlight suggested Monday (current week Monday unless used)
   ========================================================= */
.datepicker table tr td.day.rwm-used-monday,
.datepicker table tr td.day.rwm-not-monday{
  cursor: not-allowed !important;
  opacity: 0.45;
}

.datepicker table tr td.day.rwm-suggest-monday{
  background: #356ECC !important;
  color: #fff !important;
  border-radius: 6px;
}

.datepicker table tr td.day.rwm-suggest-monday:hover{
  filter: brightness(0.95);
}

.rwm-summary-compare-link{
  display:inline-block;
  width:44px;
  padding:6px 0;
  background:#356ECC;
  color:#fff !important;
  border-radius:4px;
  text-decoration:none;
  font-weight:600;
  font-size:12px;
}

.rwm-summary-compare-link:hover{ opacity:0.92; }

.rwm-summary-compare input[type="checkbox"]{ transform:scale(1.05); }

.rwm-compare-table{
  border-collapse: collapse !important;
  width:100%;
  min-width:980px;
  font-size:13px;
}

.rwm-compare-table th,
.rwm-compare-table td{
  border:1px solid #d9d9d9 !important;
  padding:8px 10px !important;
  white-space:nowrap;
}

.rwm-compare-table thead th{
  background:#f6f7f7 !important;
  font-weight:700;
}

/* Force Compare modal table to use the same style on mobile and desktop */
.rwm-compare-table thead tr th{
  background:#fffadb !important;
}
.rwm-compare-table thead th:first-child{
  background:#dff3e6 !important;
}
.rwm-compare-table tfoot tr.rwm-compare-totals td{
  background:#fffadb !important;
}
.rwm-compare-table tfoot tr.rwm-compare-totals td:first-child{
  background:#dff3e6 !important;
}


.rwm-compare-table tbody tr:nth-child(odd) td{
  background:#ffffff;
}

.rwm-compare-table tbody tr:nth-child(even) td{
  background:#F2F2F2;
}

.rwm-compare-table tbody td:not(:first-child){
  text-align:right;
}

.rwm-compare-table-wrap{margin-top:12px;}

.rwm-compare-scroll{
  overflow:auto;
  max-height:60vh;
  border:1px solid #e6e6e6;
  border-radius:10px;
}

.rwm-compare-table{
  border-collapse:collapse;
  min-width:980px;
  width:100%;
}

.rwm-compare-table th{
  position:sticky;
  top:0;
  background:#f7f7f7;
  border-bottom:1px solid #e6e6e6;
  padding:10px;
  font-size:13px;
  text-align:left;
  white-space:nowrap;
  z-index:1;
}

/* Keep Week date column fixed while scrolling horizontally (Compare modal) */
.rwm-compare-table th:first-child,
.rwm-compare-table td:first-child{
  position: sticky;
  left: 0;
  z-index: 2;
  background: #cfefff;
}

/* Header first cell sits above other sticky cells */
.rwm-compare-table thead th:first-child{
  z-index: 3;
  background: #dff3e6 !important;
}

/* Totals row first cell keeps totals background */
.rwm-compare-table tfoot tr.rwm-compare-totals td:first-child{
  background: #dff3e6 !important;
}

.rwm-compare-table td{
  border-bottom:1px solid #f0f0f0;
  padding:8px 10px;
  font-size:13px;
  white-space:nowrap;
}

.rwm-compare-table tbody tr:nth-child(even){background:#F2F2F2;}

.rwm-compare-week{font-weight:600;}

.rwm-compare-num{text-align:right;}

.rwm-compare-table tfoot td{
  position: sticky;
  bottom: 0;
  z-index: 3;
  font-weight:700;
  border-top:2px solid #d9d9d9;
  background:#fff;
}

/* Ensure totals first column stays above when both left+bottom sticky */
.rwm-compare-table tfoot td:first-child{
  z-index: 4;
}


.rwm-summary-table th.rwm-compare-th,
.rwm-summary-table th.rwm-compare-th * { box-sizing: border-box; }

.rwm-compare-open-btn{
  display:block !important;
  width:100% !important;
  padding:10px 12px !important;
  background:#356ECC !important;
  color:#fff !important;
  border:1px solid #2c5fb6 !important;
  border-radius:4px !important;
  text-align:center !important;
  font-weight:600 !important;
  line-height:1.2 !important;
}

.rwm-compare-open-btn:hover{ filter:brightness(0.95); }

#rwm-compare-modal .rwm-compare-box{
  width:100% !important;
  max-width:1200px !important;
}

.rwm-compare-box{
  max-width:1200px;
}

.rwm-summary-table th.rwm-summary-compare{
  padding:0 !important;
}

.rwm-summary-compare-link{
  display:block !important;
  width:100% !important;
  height:100% !important;
  padding:12px 10px !important;
  background:#356ECC !important;
  color:#fff !important;
  border:0 !important;
  border-radius:0 !important;
  text-align:center !important;
  font-weight:700 !important;
  line-height:1.2 !important;
}

.rwm-summary-compare-link:hover{ filter:brightness(0.95); }

.rwm-compare-msg-top{
  margin: 8px 0 10px;
  color:#c00;
  font-weight:600;
}

.rwm-summary-monthly{
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}


/* =========================================================
   Weekly Summary - Table horizontal scroll (mobile)
   - Keep top controls fixed (only table scrolls)
   ========================================================= */
.rwm-summary-table-scroll{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.rwm-summary-table{
  min-width: 500px; /* do not shrink below 500px */
}

.rwm-summary-table{direction:rtl;}

.rwm-summary-table .rwm-summary-monthly{font-size:12px;}

th.rwm-col-monthly,
td.rwm-summary-monthly {
  max-width: 200px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

td.rwm-summary-monthly {
  font-size: 12px;
}

.rwm-summary-table .rwm-col-monthly,
.rwm-summary-table td.rwm-col-monthly {
  max-width: 200px;
  white-space: normal;
  word-break: break-word;
  min-width:100px;
}

.rwm-summary-table td.rwm-summary-monthly{ text-align: left; }

.rwm-compare-table thead th{
  background:#F2F2F2 !important;
  font-weight:700;
}

.rwm-compare-table tfoot tr.rwm-compare-totals td{
  font-weight:700 !important;
  border-top:2px solid #bdbdbd !important;
}

/* sticky header cell (Week date) */
  .rwm-compare-table thead th:first-child{
    position: sticky;
    left: 0;
    z-index: 5;
    background:#dff3e6 !important;
    text-align:left;
  }
  
/* sticky body cells (Week date column) */
  .rwm-compare-table tbody td:first-child{
    position: sticky;
    left: 0;
    z-index: 4;
    text-align:left;
  }
  
  .rwm-compare-totals td{
      background:#fffadb !important;
  }

.rwm-compare-table thead tr th{
    background:#fffadb !important;
}

  /* sticky totals "Total" cell = dark green */
  .rwm-compare-table tfoot tr.rwm-compare-totals td:first-child{
    background:#dff3e6 !important;
  }



/* =========================
   Weekly Summary - Search Bar
   ========================= */
.rwm-summary-top{
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: center !important;
}

.rwm-week-search{
  display:flex;
  align-items:center;
  gap:10px;
  margin-right:auto;
}

#rwm-week-search{
  width: 380px;
  max-width: 60vw;
  padding: 8px 12px;
  border: 2px solid #356ECC;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
}

#rwm-week-search:focus{
  box-shadow: 0 0 0 2px rgba(53,110,204,0.2);
}

#rwm-week-search-clear{
  padding: 7px 18px;
  border-radius: 999px;
  border: 0;
  background: #356ECC;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

#rwm-week-search-clear:hover{ filter: brightness(0.95); }
#rwm-week-search-clear:active{ filter: brightness(0.9); }

.rwm-week-search-count{
  flex: 0 0 100%;
  order: 100;
  display: inline-block;
  width: fit-content;
  border: 0;
  background: #f1f1f1;
  color: #333;
  padding: 6px 12px;
  border-radius: 999px;
  margin: -2px 0 0 0;
}

@media (max-width: 640px){
  #rwm-week-search{
    width: 100%;
    max-width: 100%;
  }
  .rwm-week-search{
    width: 100%;
  }
}


/* =========================================================
   Compare Modal - Short Height Scroll Fix
   Allows the whole popup to scroll vertically on short screens
   (e.g. mobile landscape) so the table can always be reached.
   ========================================================= */
@media (max-height: 520px){
  .rwm-modal-overlay{
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}


td{
	font-weight:600!important;
	color:#2d2d2d!important;
}

.rwm-summary-wrap .rwm-summary-table td{
	text-align:center!important;
}

.rwm-compare-table td{
	text-align:center!important;
}

.rwm-summary-compare input[type="checkbox"]{
  width: 20px!important;
  height: 20px !important;
  cursor: pointer !important;
}

.rwm-summary-actions .rwm-summary-print-btn{
  background:#497CD1 !important;
  color:#fff !important;
}

.elementor-widget-text-editor .rwm-summary-wrap h2{
	display:none !important;
}

.rwm-summary-wrap .rwm-logout-bar a{
		background:#356ECC !important;
	color:#fff !important;
	border:none !important;
}

#rwm-week-search-clear{
  width:70px !important;
  font-weight:500 !important;
  text-align:center !important;
}

.rwm-summary-wrap .rwm-summary-table tr td{
  font-size:14px !important;
}


.rwm-summary-table .rwm-week-date-btn{
  font-size:14px !important;
  padding:15px !important;
  margin:0px !important;
}


@media (max-width: 800px){
 .rwm-week-search{
    order: 4 !important;
    flex: 1 0 100% !important;
    width: 90% !important;
    margin-top: 10px !important;
  }

   .rwm-week-search input{
    width: 90% !important;
    box-sizing: border-box !important;
  }
}

/* =========================================================
   PWA Install button (Weekly Summary only)
   ========================================================= */
.rwm-install-wrap{
    margin: 12px 0 18px;
    text-align: center;
    background:#00d815;
}
.rwm-install-btn{
    min-width: 180px;
    background:none !important;
}
.rwm-install-help{
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.9;
}
.rwm-install-help code{
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
}

/* === Sticky header (Weekly Summary) === */
.rwm-summary-sticky-wrap{
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  background: transparent;
  display: none;
  overflow-x: auto;
  overflow-y: hidden;
  pointer-events: none; /* allow clicks to pass through */
}
.rwm-summary-sticky-wrap table{
  margin: 0;
}
.rwm-summary-sticky-wrap thead th{
  background: #7a8ca3 !important; /* match header style */
  color: #fff !important;
}


/* === Fix: Sticky Week Date header + column (horizontal scroll) === */
.rwm-summary-table th.rwm-week-date,
.rwm-summary-table td.rwm-week-date{
    position: sticky;
    left: 0;
    z-index: 25;
    background: #3b6fc4;
}

.rwm-summary-table thead th.rwm-week-date{
    z-index: 30; /* above body cells */
}


/* === Fix: make Week date HEADER sticky too (match the Week date column) === */
.rwm-summary-wrap .rwm-summary-table thead th:nth-child(7),
.rwm-summary-sticky-wrap .rwm-summary-table thead th:nth-child(7){
  position: sticky !important;
  left: 0 !important;
  z-index: 60 !important;
  background: #7a8ca3 !important; /* match header background */
}

/* Ensure the Week date body cells are sticky (in case class changes) */
.rwm-summary-wrap .rwm-summary-table tbody td.rwm-summary-date{
  position: sticky !important;
  left: 0 !important;
  z-index: 40 !important;
  background: #356ECC !important; /* match Week date column colour */
}


/* Hide scrollbar for sticky header (still scrolls programmatically) */
.rwm-summary-sticky-wrap::-webkit-scrollbar{ height: 0; }
.rwm-summary-sticky-wrap{ scrollbar-width: none; }

/* ✅ Allow line breaks in Compare modal Monthly payment cell (names on top, total under) */
.rwm-compare-table td.rwm-compare-text{ white-space: pre-line !important; }


/* Compare popup toggles (Summary page) */
.rwm-compare-box .rwm-toggle-group{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.rwm-compare-box .rwm-toggle-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  cursor:pointer;
  user-select:none;
}

.rwm-compare-box .rwm-toggle-btn input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.rwm-compare-box .rwm-toggle-btn span{
  background:#F3F4F6;
  border:1px solid #D1D5DB;
  color:#111827;
  padding:8px 12px;
  border-radius:12px;
  font-weight:700;
  line-height:1;
}

.rwm-compare-box .rwm-toggle-btn input:checked + span{
  background:#4177A6;
  border-color:#4177A6;
  color:#FFFFFF;
}

/* Override sticky first column background for totals row */
.rwm-compare-table tfoot tr.rwm-compare-totals td:first-child{
  background:#dff3e6 !important;
}
.rwm-compare-table tfoot tr.rwm-compare-totals td{
  background:#fffadb !important;
}


/* Summary totals row */
.rwm-summary-table .rwm-summary-total-row td{
  background:#F3F4F6;
  font-weight:700;
}
.rwm-summary-table .rwm-decimals{
  font-size:0.8em;
  vertical-align:baseline;
}

/* =========================================================
   Weekly Summary: Show/Hide columns popup
   ========================================================= */
.rwm-summary-wrap .rwm-logout-bar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  position:relative;
}

.rwm-summary-wrap .rwm-summary-showhide-btn{
  background:#356ECC !important;
  color:#fff !important;
  border:none !important;
}

.rwm-summary-columns-popup{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:10px;
  box-shadow:0 10px 30px rgba(0,0,0,0.12);
  z-index:10000;
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  min-width:180px;
}

.rwm-summary-columns-popup .rwm-summary-coltoggle{
  background:#356ECC;
  color:#fff;
  border:none;
  border-radius:8px;
  padding:10px 12px;
  font-weight:600;
  cursor:pointer;
}

.rwm-summary-columns-popup .rwm-summary-coltoggle.is-disabled{
  background:#E5E7EB;
  color:#111;
}

/* Hide columns when disabled (affects main table + sticky header clone) */
body.rwm-sum-hide-compare .rwm-col-compare,
body.rwm-sum-hide-moneyin .rwm-col-moneyin,
body.rwm-sum-hide-moneyout .rwm-col-moneyout,
body.rwm-sum-hide-profit .rwm-col-profit,
body.rwm-sum-hide-monthly .rwm-col-monthly,
body.rwm-sum-hide-print .rwm-col-print,
body.rwm-sum-hide-delete .rwm-col-delete{
  display:none !important;
}
