/* =========================================================
   INVENTORY – Base Styles
   Palette: yellow #ffff66, pink #FFC6CF, black #000, white #fff
   Typography: system UI for speed and clarity
   ========================================================= */

:root{
  --bg: #ffffff;
  --ink: #000000;
  --paper: #ffffff;
  --accent-yellow: #ffff66;
  --accent-pink:   #FFC6CF;
  --border: #000000;

  --radius: 0;            /* hard edges for retro feel */
  --shadow-window: 20px 28px 0 0 rgba(0,0,0,1);
  --shadow-btn: 4px 4px 0 0 rgba(0,0,0,1);
  --shadow-btn-hover: 6px 6px 0 0 rgba(0,0,0,1);
  --shadow-btn-active: 2px 2px 0 0 rgba(0,0,0,1);

  --gap: 16px;
  --gap-sm: 8px;

  --font-ui: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
}

body{
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: #fff;
  line-height: 1.35;
}

/* Utility */
.hidden,[hidden]{ display: none !important; }
.strong{ font-weight: 800; }
.center{ text-align: center; }
.ml{ margin-left: .75rem; }
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* App root and window frame */
.app-root{
  padding: 24px;
}
.window{
  position: relative;
  margin: 0 auto 40px;
  max-width: 1280px;
  min-height: 85vh;
  background: var(--paper);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-window);
}

/* Titlebar */
.titlebar{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 16px;
  border-bottom: 4px solid var(--border);
  background: var(--accent-yellow);
}
.titlebar-left{ display:flex; align-items:center; gap: 12px; }
.app-title{
  margin:0;
  font-weight: 1000;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -0.02em;
}
.titlebar-actions{
  margin-left:auto;
  display:flex;
  gap: 8px;
}

/* Sidebar + Main layout */
.grid{
  display:grid;
  grid-template-columns: 1fr;
}
.body.grid{
  grid-template-columns: 240px 1fr;
}
@media (max-width: 900px){
  .body.grid{
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.sidebar{
  position: relative;                /* allows inner absolute line if needed */
  display: flex;
  flex-direction: column;            /* stack nav at top, accent at bottom */
  border-right: 4px solid var(--border);
  padding: 16px;
  height: 100%;                      /* ensure sidebar stretches full height */
}

/* keeps Accent preview anchored at bottom */
.accent-preview{
  margin-top: auto;
}




@media (max-width: 900px){
  .sidebar{
    border-right: 0;
    border-bottom: 4px solid var(--border);
  }
}
.nav{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.nav__item{
  text-align:left;
  padding: 10px 12px;
  border: 2px solid var(--border);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}
.nav__item[aria-current="page"],
.nav__item.is-active{
  background: var(--accent-pink);
}
.nav__label{}

/* Accent preview */
.accent-preview{ margin-top: 24px; }
.accent-preview__title{
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
}
.accent-preview__swatches{
  display:flex; gap: 8px; align-items:center; margin-top: 8px;
}
.swatch{
  width: 24px; height: 24px;
  border: 2px solid var(--border);
}
.swatch--pink{ border-radius: 999px; background: var(--accent-pink); }
.swatch--yellow{ background: var(--accent-yellow); }

/* Main area */
.main{
  padding: 16px;
}

/* Views */
.view{ }
.section-heading{
  font-weight: 800;
  margin: 8px 0 12px;
}

/* Toolbar */
.toolbar{
  display:flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

/* Inputs */
.input{
  width: min(100%, 380px);
  padding: 10px 12px;
  border: 2px solid var(--border);
  background: #fff;
  font: inherit;
}
.input--lg{
  width: 100%;
  padding: 14px 14px;
}

/* Badges */
.badge{
  display:inline-block;
  padding: 2px 8px;
  border: 1.8px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.badge--yellow{ background: var(--accent-yellow); color: #000; }
.badge--pink{ background: var(--accent-pink); color: #000; }

/* Links */
.link{
  all: unset;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 800;
}

/* Buttons */
.btn{
  border: 2px solid var(--border);
  font-weight: 1000;
  padding: .5rem .8rem;
  background: #fff;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  transition: transform .05s ease, box-shadow .05s ease, filter .1s ease;
  user-select: none;
}
.btn:hover{
  transform: translate(-1px,-1px);
  box-shadow: var(--shadow-btn-hover);
  text-decoration: underline;
}
.btn:active{
  transform: translate(0,0);
  box-shadow: var(--shadow-btn-active);
}
.btn[data-variant="pink"]{ background: var(--accent-pink); }
.btn[data-variant="white"]{ background: #fff; }

/* Tables */
.table-wrap{
  border: 2px solid var(--border);
  overflow: auto;
  background: #fff;
}
.table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table thead{
  position: sticky; top: 0; z-index: 1;
  background: #fff;
  border-bottom: 2px solid var(--border);
}
.table th, .table td{
  padding: 10px;
  border-right: 2px solid rgba(0,0,0,.85);
  vertical-align: top;
}
.table th:last-child, .table td:last-child{ border-right: 0; }
.table tbody tr{
  border-bottom: 1px solid rgba(0,0,0,.4);
}
.table tbody tr:nth-child(odd){ background: #ffffff; }
.table tbody tr:nth-child(even){ background: #fafafa; }

.row-actions{
  display:flex; flex-wrap: wrap; gap: 8px;
}

.th-sort{
  all: unset;
  font-weight: 800;
  cursor: pointer;
}

/* Empty states */
.empty{
  padding: 24px;
  text-align: center;
}

/* Cart & actions */
.actions{
  display:flex; gap: 8px; flex-wrap: wrap; align-items:center;
}
.actions--end{ justify-content: flex-end; }

/* CSV header preview */
.csv-header{ margin-top: 8px; }
.csv-header__text{
  margin-top: 8px;
  padding: 8px;
  border: 2px solid var(--border);
  font-size: 12px;
  word-break: break-all;
  background: #fff;
}

/* Scan block */
.scan .tip{
  margin-top: 16px;
  padding: 12px;
  border: 2px solid var(--border);
  background: var(--paper);
  border-color: var(--accent-yellow);
}
.tip__title{ font-weight: 800; }
.tip__text{ font-size: 14px; }

/* Forms */
.form{ gap: 12px; }
.field{ display:block; font-size: 14px; }
.field__label{
  display:inline-block;
  font-weight: 800;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--border);
  padding: 2px 6px;
  background: var(--accent-yellow);
}
.field--full{ grid-column: 1 / -1; }

/* Simple grid helpers used in modals */
.grid--2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 780px){
  .grid--2{ grid-template-columns: 1fr; }
}

/* Product quick-view image/placeholder */
.img-cover{
  width: 100%;
  height: 256px;
  object-fit: cover;
  border: 2px solid var(--border);
  background: #f7f7f7;
}
.no-image{
  width: 100%;
  height: 256px;
  border: 2px dashed var(--border);
  display:flex; align-items:center; justify-content:center;
}

/* Pack list */
.pack{ margin-top: 8px; }
.pack__title{ font-weight: 800; margin-bottom: 4px; }
.pack__list{ margin:0; padding-left: 20px; }

/* Modals (native <dialog>) */
.modal{
  width: min(100% - 24px, 960px);
  border: 2px solid var(--border);
  padding: 0;
  background: var(--paper);
  box-shadow: 10px 10px 0 0 rgba(0,0,0,1);
}
.modal::backdrop{
  background: rgba(0,0,0,.4);
}
.modal[open]{ display:block; }

.modal__header{
  display:flex; align-items:center; justify-content: space-between;
  padding: 12px;
  border-bottom: 2px solid var(--border);
  background: var(--accent-yellow);
}
.modal__title{
  margin:0; font-size: 20px; font-weight: 1000;
}
.modal__body{
  padding: 16px;
}
.modal__footer{
  padding: 12px;
  border-top: 2px solid var(--border);
  display:flex; justify-content: flex-end; gap: 8px;
}


.modal .form{
  display: grid;
  grid-template-columns: 1fr 1fr;   /* two even columns */
  column-gap: 16px;
  row-gap: 12px;
  align-items: start;
}

.modal .field{
  display: flex;
  flex-direction: column;
}

.modal .field--full{               /* e.g., Pack components */
  grid-column: 1 / -1;
}

/* Remove the yellow chips only inside dialogs */
.modal .field__label{
  background: transparent;
  border: 0;
  padding: 0 0 4px 0;
  font-weight: 800;
  line-height: 1.1;
}

/* Make inputs align perfectly and span full width */
.modal .input{
  width: 100%;
}

/* Tighten header buttons so they don’t jiggle the layout */
.modal__header .btn{
  margin-left: 8px;
}

/* Optional: keep number inputs visually consistent */
.modal input[type="number"]{
  text-align: left;
}


/* Badges inside headers etc. */
.kv{ margin: 4px 0; }

/* Note / helper text */
.note{
  margin: 6px 0 12px;
  font-size: 13px;
  background: #fff7f9;
  border: 2px solid var(--border);
  padding: 8px 10px;
}



.table th {
  font-weight: 800;
  text-transform: none;
  font-size: 0.9rem;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  background: #fff;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.table th:last-child {
  border-right: none;
}

/* Match "Products" tab style across all data tables */
.table thead tr {
  border-bottom: 2px solid #000;
}
.table td {
  padding: 0.5rem 0.75rem;
}

/* ===== Add spacing below the Current cart form ===== */
#view-export .section-heading + .table-wrap {
  margin-bottom: 1rem;
}
#view-export .cart-buttons {
  margin-top: 1rem; /* pushes buttons down a bit */
}

/* ===== Add spacing below the Recent Exports tables ===== */
#view-recent .table-wrap {
  margin-bottom: 1rem;
}

/* ===== Better vertical spacing for consistency ===== */
.section-heading {
  margin-bottom: 0.75rem;
}

/* Optional: a little breathing room below details summary */
details {
  margin-top: 1rem;
}




/* ===== 1) Compact buttons only inside data tables (Products, Export, Recent) ===== */
.table .row-actions { 
  display: flex; 
  flex-wrap: nowrap;         /* prevent stacking */
  gap: 6px; 
}
.table .row-actions .btn,
#view-export .table .btn {    /* includes the "Set" buttons in Export table */
  font-size: 0.85rem;
  padding: .35rem .6rem;      /* slightly smaller but same style */
  box-shadow: 3px 3px 0 0 rgba(0,0,0,1);
}
.table .row-actions .btn:hover,
#view-export .table .btn:hover {
  box-shadow: 5px 5px 0 0 rgba(0,0,0,1);
}
.table .row-actions .btn:active,
#view-export .table .btn:active {
  box-shadow: 2px 2px 0 0 rgba(0,0,0,1);
}
.table .row-actions .btn { white-space: nowrap; }

/* Optional: make the "Set" column a bit wider to reduce crowding */
#view-export .table td:nth-child(5),
#view-export .table th:nth-child(5) { width: 110px; }

/* ===== 2) Sidebar nav buttons: more space + same pop effect as .btn ===== */
.nav { gap: 14px; }                 /* extra space between items for shadows */
.sidebar { padding-bottom: 24px; }  /* breathing room at bottom */

.nav__item{
  background: #fff;
  box-shadow: 4px 4px 0 0 rgba(0,0,0,1);
  transition: transform .05s ease, box-shadow .05s ease, text-decoration .05s ease;
}
.nav__item:hover{
  transform: translate(-1px,-1px);
  box-shadow: 6px 6px 0 0 rgba(0,0,0,1);
  text-decoration: underline;
}
.nav__item:active{
  transform: translate(0,0);
  box-shadow: 2px 2px 0 0 rgba(0,0,0,1);
}
.nav__item.is-active{               /* keep your pink active state */
  background: var(--accent-pink);
}

/* (Keeps all other buttons—titlebar, dialogs, footer actions—unchanged) */






/* Accessibility focus */
:focus-visible{
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Prevent dialog content from growing off-screen on tiny heights */
@media (max-height: 560px){
  .modal__body{ max-height: 50vh; overflow:auto; }
}

/* Make number inputs consistent */
input[type="number"]{
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none; margin: 0;
}




/* Make the window column-based so the body can fill all remaining height */
.window{
  display: flex;
  flex-direction: column;
  min-height: 85vh;            /* or 100vh if you prefer full viewport */
}

/* The titlebar sits on top; the body stretches down */
.titlebar{ flex: 0 0 auto; }
.body{
  flex: 1 1 auto;              /* <-- this is the key: fill the column */
  align-items: stretch;        /* grid children (sidebar, main) fill height */
}

/* Sidebar: stack content, draw the right border full height */
.sidebar{
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;                /* match the body’s height */
  border-right: 4px solid var(--border);
  padding: 16px;
}

/* Keep "Accent preview" parked at the bottom of the sidebar */
.accent-preview{ margin-top: auto; }




/* Pink Logout button (non-functional) */
.btn--logout {
  background: var(--accent-pink);
  border: 2px solid #000;
  font-weight: 900;
  width: 100%;
  padding: 0.5rem 0;
  margin-top: 12px;             /* small gap above Accent Preview */
  margin-bottom: 8px;           /* small breathing room before bottom edge */
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  align-self: flex-end;          /* ensures correct vertical alignment */
}

.btn--logout:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 #000;
}

.btn--logout:active {
  transform: translate(0, 0);
  box-shadow: 2px 2px 0 #000;
}



/* Highlight table headers (thead) in yellow */
.table thead th {
  background-color: var(--accent-yellow);
  color: #000;
  font-weight: 900;
  text-align: left;
  border-bottom: 2px solid #000;
  padding: 8px;
}

/* Optional: keep the borders consistent */
.table th, .table td {
  border: 1px solid #000;
}

/* Slight improvement: make header buttons (like sorting) match */
.table thead th button {
  background: none;
  border: none;
  font-weight: 900;
  cursor: pointer;
  color: #000;
}


.disclaimer {
  text-align: center;
  font-size: 0.8rem;
  font-style: italic;
  color: #555; /* slightly grey, subtle */
  margin-top: 1rem;
  margin-bottom: 1rem;
}
