:root {
  --bg:#3E4858;
  --panel:#12151b;
  --panel-2:#151923;
  --text:#e6e6e6;
  --muted:#9aa3ae;
  --accent:#7aa2ff;
  --border:#232938;
  --danger:#ff5d5d;
  --shadow:0 6px 24px rgba(0,0,0,.35);
  --radius:14px;
}



html, body {
  margin:0;
  height:100%;
  width:100%;
  background:var(--bg);
  color:var(--text);
  font:15px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
}

.wrap {
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.btn-purple {
    background-color: #6d28d9 !important; /* indigo-700 */
    color: #ffffff !important;
    border: 1px solid #6d28d9 !important;
}
.btn-purple:hover {
    background-color: #7c3aed !important;
}


a {
  color:var(--accent);
  text-decoration:none;
}
a:hover {
  text-decoration:underline;
}



/* ---------------- Header ---------------- */
header.site-header {
  position:sticky;
  top:0;
  z-index:1000;
  background:linear-gradient(180deg,rgba(18,21,27,.94),rgba(18,21,27,.88));
  border-bottom:1px solid var(--border);
  box-shadow:var(--shadow);
}
.header-inner {
  max-width:none;
  margin:0;
  width:96%;
  padding:12px 16px;
  display:flex;
  align-items:center;
  gap:12px;
}
.brand {
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
}
.brand-mark {
  width:28px;
  height:28px;
  border-radius:8px;
  background:radial-gradient(120% 120% at 20% 10%,#86b1ff 0%,#4c72ff 45%,#24355f 100%);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.06),0 8px 20px rgba(76,114,255,.35);
}
.brand-name {
  color:#fff;
  font-size:18px;
}

/* ---------------- Layout ---------------- */
.layout {
  flex:1;
  display:flex;
}
nav.sidebar {
  width:220px;
  background:var(--panel);
  border-right:1px solid var(--border);
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
nav.sidebar a {
  padding:10px 12px;
  border-radius:10px;
  color:var(--text);
  font-weight:500;
}
nav.sidebar a:hover {
  background:var(--panel-2);
}
main {
  flex:1;
  padding:24px;
  background:var(--bg);
}

/* ---------------- Cards ---------------- */
.card {
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
  margin-bottom:20px;
}
h1 { font-size:22px; margin:0 0 12px }
h2 { font-size:18px; margin:0 0 10px }
.muted { color:var(--muted) }

/* ---------------- Footer ---------------- */
footer.site-footer {
  border-top:1px solid var(--border);
  background:var(--panel);
}
.footer-inner {
  max-width:none;
  margin:0;
  width:96%;
  padding:18px 16px;
  display:flex;
  flex-wrap:wrap;
  gap:12px 20px;
  align-items:center;
  justify-content:space-between;
  color:var(--muted);
  font-size:13px;
}
.footer-links {
  display:inline-flex;
  gap:16px;
}

/* ---------------- Login Form ---------------- */
.auth-card {
  width:min(420px,100%);
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
  display:grid;
  gap:16px;
  margin:0 auto; /* centers login form in content area */
}
.auth-card h1 {
  margin:0;
  font-size:22px;
  line-height:1.2;
}
.sub {
  color:var(--muted);
  font-size:13px;
}
.field {
  display:grid;
  gap:8px;
}
label {
  font-weight:600;
  font-size:14px;
}
input[type="text"],
input[type="password"] {
  width:98%;
  background:#0e1219;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 12px;
  outline:none;
}
input[type="text"]:focus,
input[type="password"]:focus {
  border-color:#3a4a66;
  box-shadow:0 0 0 3px rgba(122,162,255,.15);
}
.row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.remember {
  color:var(--muted);
  font-size:13px;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:12px;
  padding:12px 14px;
  border:1px solid transparent;
  background:linear-gradient(135deg,#6f8bff,#5a76ff);
  color:#fff;
  font-weight:700;
  cursor:pointer;
  width:100%;
  box-shadow:var(--shadow);
}
.btn:active {
  transform:translateY(1px);
}
/* Alert box for login errors */
.alert {
  display:none; /* set to block dynamically when needed */
  background:#2a1212;
  color:#ffd9d9;
  border:1px solid #5a1c1c;
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
}


/* --- Cart buttons: compact, inline --- */
.inline-form { display: inline; }                 /* forms shouldn't force full width */

.table .btn,
.inline-form .btn,
.actions .btn {
    display: inline-flex;                         /* inline, not block */
    align-items: center;
    justify-content: center;
    width: auto !important;                       /* override any 100% width */
    min-width: 0;
    padding: 6px 10px;                            /* smaller padding */
    font-size: 14px;                              /* smaller text */
    line-height: 1.2;
    border-radius: 8px;                           /* less pill-y */
}

/* small variant used in cart.pl */
.btn-small {
    padding: 4px 8px;
    font-size: 13px;
}

/* danger/secondary/primary should not expand */
.btn-primary,
.btn-secondary,
.btn-danger {
    width: auto !important;
}

/* quantity input width */
.input-qty {
    width: 72px;
    text-align: right;
    padding: 6px 8px;
}

/* action bar spacing (Clear / Checkout / Continue) */
.actions .btn { margin-right: 8px; }


.page-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}

.page-header-left {
  display:flex;
  align-items:center;
  gap:12px;
}

.status-bar {
  padding:6px 10px;
  border-radius:8px;
  font-size:14px;
  font-weight:600;
}

.status-ok {
  background:#1e402a;
  color:#b3ffb3;
  border:1px solid #2e7d32;
}

.status-error {
  background:#40201e;
  color:#ffb3b3;
  border:1px solid #c62828;
}

/* --- Catalog quantity input --- */
.qty-input {
  width: 60px;
  height: 32px;
  padding: 4px 6px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f4f6fa;        /* light background for contrast */
  color: #000;
  text-align: right;
  -moz-appearance: textfield; /* hide default Firefox spinners */
}

/* Chrome / Edge: style the spin buttons */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  opacity: 1;                      /* make them visible */
  background: #e0e6f0;             /* lighter gray background */
  border-left: 1px solid #ccc;     /* divider line */
  width: 18px;
  height: 28px;
  cursor: pointer;
}

/* Optional: hover effect to make them pop */
.qty-input::-webkit-inner-spin-button:hover,
.qty-input::-webkit-outer-spin-button:hover {
  background: #d0d8e0;
}

/* Firefox: fake spinner with up/down arrows */
.qty-input {
  position: relative;
}
.qty-input[type=number] {
  -moz-appearance: number-input;
}

.catalog-table th {
  text-align: left;
}

.page-header .btn {
  width: auto !important;   /* donâ€™t stretch */
  padding: 8px 14px;        /* slightly smaller padding to fit */
}



/* -------- Dark Themed Select (reusable) -------- */
.select-dark {
    background-color: var(--panel, #0f172a) !important; /* explicit bg */
    color: inherit !important;
    border: 1px solid rgba(148,163,184,0.30) !important;
    border-radius: 10px !important;
    height: 36px !important;
    padding: 8px 34px 8px 10px !important; /* room for caret */
    box-sizing: border-box !important;

    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;

    /* Layer 1: background color, Layer 2: caret */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa3af' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    
    background-size: 16px;
    background-origin: content-box; /* ensures caret sits inside padding */

    color-scheme: dark;
    cursor: pointer;
}


.select-dark:focus {
    border-color: rgba(148,163,184,0.55) !important;
    box-shadow: 0 0 0 2px rgba(122,162,255,.25) !important;
    outline: none !important;
}
.select-dark:disabled {
    opacity: .65 !important;
    cursor: not-allowed !important;
}

/* Tight variant for inline forms on the edit page */
#inventory-edit .select-dark.select-dark--sm {
    height: 28px !important;
    padding: 3px 28px 3px 8px !important;
    border-radius: 6px !important;
    background-position: right 6px center !important;
    background-size: 14px !important;
}

/* Make the date picker icon light on dark backgrounds — Chrome/Edge/Safari */
#restocks-page input[type="date"]::-webkit-calendar-picker-indicator,
#restock-edit  input[type="date"]::-webkit-calendar-picker-indicator,
#inventory-edit input[type="date"]::-webkit-calendar-picker-indicator
{
    filter: invert(1) contrast(1.4) brightness(1.2);
    opacity: 0.95;
    cursor: pointer;
}

/* Firefox fallback: inject a light calendar glyph */
@-moz-document url-prefix()
{
    #restocks-page input[type="date"],
    #restock-edit  input[type="date"]
    {
        background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'>\
<path d='M7 2h2v2h6V2h2v2h3v18H4V4h3V2zm12 8H5v10h14V10zm-2 2v6H7v-6h10z'/>\
</svg>");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 18px 18px;
    }
}



.btn-danger,
a.btn-danger,
button.btn-danger {
    background: #ef4444 !important;   /* red */
    color: #ffffff !important;         /* white text */
    border: 1px solid rgba(239,68,68,.5) !important;
    text-decoration: none !important;
}

.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover {
    background: #dc2626 !important;    /* darker on hover */
}

.btn-danger:focus {
    outline: 2px solid rgba(239,68,68,.6) !important;
    outline-offset: 2px !important;
}

.btn-danger:active {
    transform: translateY(1px);
}