﻿:root {
  --primary-color:   #ba0208;
  --secondary-color: #fc0008;
  --tertiary-color:  #ffabae;
  --header-bg:       #384049;
  --footer-bg:       #384049;
  --link-color:      #4B5563;
  --text-muted:      #666;
}


a:not(.btn):not([role="button"]),
a:visited:not(.btn):not([role="button"]) {
  color: var(--primary-color);
  text-decoration: underline; /* Optional, for clarity */
}


html, body {
    height: 100%;
    overflow-x: hidden;
    font-family: 'Nunito', sans-serif;
}
input:focus {
    outline: none;
}

#loadingIndicator {
    position: fixed;      /* this is KEY for full screen centering */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
    display: none;        /* stays hidden unless triggered */
}


.header-left,
.header-middle,
.header-right {
  display: flex;
  align-items: center;
}
.header-middle {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* or center/whatever you prefer */
}

/* BUTTONS */
.btn-edit {
    border-radius: 3px !important;
    background: var(--primary-color) !important;
    color: #fff !important;
    padding: 6px !important;
}
.btn-edit:hover {
    background: var(--secondary-color) !important; 
    color: #fff !important;
    border: 1px solid #fff;
}

.general-btn {
    padding: 7px 15px !important;
    border: none !important;
    background: var(--primary-color) !important;
    color: #fff !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
    height: 40px !important;
}

.general-btn:hover{
    background: var(--secondary-color) !important;
    color: #fff !important;
}

.clear-btn {
  position: absolute;
  top: 50%;
  right: 0.5em;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1em;
  cursor: pointer;
  visibility: hidden;
  color: #666;
}

.clear-btn.visible {
  visibility: visible;
}



/* ── Menu toggle button ── */
.menu-toggle {
  position: fixed;
  top: 115px; 
  left: 0;
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.5rem;
  font-size: 1.25rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
}
.menu-toggle.open i {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.menu-toggle i {
    transition: transform 0.3s ease;
}

/* only tables with class="selectable" get these styles */
table.selectable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0; 
}

/* 3) Pin the header exactly at the top of the wrapper */
table.selectable thead th {
  position: sticky;
  top: 0;                    /* flush to the very top */
  z-index: 2;                /* above body rows */
  background: #384049;       /* match your header color */
  color: #fff;
}

table.selectable tfoot {
  min-height: 60px;
}

table.selectable tbody tr:nth-child(even) {
  background-color: #eee;
}

table.selectable tbody tr.selected {
  background-color: var(--tertiary-color);
}

table.selectable tbody tr:hover {
  background-color: var(--tertiary-color);
  cursor: pointer;
}

/* you can leave generic th/td rules alone, or scope them too: */
table.selectable th,
table.selectable td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

table.selectable th {
    background: #384049;
    color: #fff;
    font-size: 16px;
    font-weight: 300;
    white-space:nowrap;
}

/* if you had a footer-bar for that table you could scope it similarly */
.selectable-footer-bar {
  background: #384049;       /* match your header color */
}

/* make the wrapper scrollable */
.table-wrapper {
  max-height: 75vh;        /* or whatever fits your layout */
  overflow-y: auto;
  margin-top:0px;
}

/* keep the header stuck at the top of that scrollable area */
table.selectable thead th {
  position: sticky;
  top: 0;
  z-index: 2;              /* above the rows */
  background: #384049;      /* same as your header bg */
  color: #fff;              /* same as your header text */
}

/* if you have a <tfoot> you want fixed at the bottom too, you can do: */
table.selectable tfoot th {
  position: sticky;
  bottom: 0;
  background: #384049;
  color: #fff;
  z-index: 2;
}
table.selectable th[data-col] { cursor: pointer; user-select: none; }
.btn-pages { margin: 0 2px; padding: 0.25em 0.75em; border-radius: 5px; border: 1px solid #ddd; background: #f9f9f9; }
.btn-pages-current { background: #555; color: #fff; font-weight: bold; }
.button-container { display: inline-block; }

textarea {
    resize: vertical;
    min-height: 80px;
}
select {
    background: #fff;
}
/* Special styles for dropdowns (like the screenshot) */
select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
}

button {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: var(--secondary-color);
}

/* Red Confirm Button for SweetAlert2 */
.swal2-confirm {
  background-color: #d32f2f !important; /* Material Red 700 */
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
}

.swal2-confirm:hover,
.swal2-confirm:focus {
  background-color: #b71c1c !important; /* Darker red on hover/focus */
  box-shadow: none !important;
}


@media (max-width: 768px) {
    /* Hide non-essential sections */
    .site-footer,
    .header-right,
    .data-viewer {
        display: none !important;
    }

    .page-title {
      font-size: 1rem;
    }

    .data-container {
      height: 100vh;
    }

    #loadingIndicator {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10002 !important;
    }

    .row-info .product {
      max-width: 50%;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
    }

    .form-section {
        max-width: 95%;
    }


}

/* ── Desktop (≥769px): side-by-side layout ── */
@media (min-width: 768px) {
    .data-container {
        flex-direction: row;
    }
    .data-list {
        width: 100%;
        max-width: 35%;
        overflow-y: auto;
        border-right: 1px solid #ccc;
    }
    .data-viewer {
        display: block;
        width: 70%;
        padding: 1rem;
    }
    .data-viewer iframe {
        display: block !important;
        width: 100%;
        height: 100%;
    }

}

