/* Basic modern styles without a framework */
:root {

  --bg: #ffffff;          /* slate-950-ish */
  --panel: #7d88a3;       /* slate-900 */
  --header-bar: rgba(255, 255, 255, 0.7);
  --footer-bar: rgb(62, 78, 91);
  --logo: url("/assets/TaylorLogo-0d13ad4a.png");
  --menu-bar: #5bac99;     /* gray-900 */
  --text-input: #efefef;     /* gray-900 */
  --text: #243b69;        /* gray-200 */
  --pipe: #aeaeae;        /* gray-200 */
  --muted: #243b69;       /* slate-400 */
  --border: #1f2937;      /* gray-800 */
  --primary: #3b82f6;     /* blue-500 */
  --focus: #fb00ff;     /* blue-500 */
  --primary-700: #1d4ed8; /* blue-700 */
  --secondary-button: #86bafa; /* indigo-600 */
  --primary-button-text: #ffffff;
  --success: #22c55e;     /* green-500 */
  --danger: #ef4444;      /* red-500 */
  --warning: #f59e0b;     /* amber-500 */
  --panel-radius: 8px;     /* panel border radius */
  --input-radius: 4px;     /* input border radius */
  --small-button-radius: 4px;     /* small button border radius */
  --large-button-radius: 6px;     /* large button border radius */

--row-hover: #efefef;
  --footer-link: #ffffff;
}


html[data-theme="dark"] {
  --bg: #0b1120;          /* slate-950-ish */
  --panel: #ffffff;       /* slate-900 */
  --header-bar: rgba(2, 6, 23, 0.7);
  --logo: url("/assets/TaylorLogo_reversed-fe74c7ba.png");
  --menu-bar: #5bac99;     /* gray-900 */
  --text-input: #605572;     /* gray-900 */
  --text: #e5e7eb;        /* gray-200 */
  --muted: #94a3b8;       /* slate-400 */
  --border: #1f2937;      /* gray-800 */
  --primary: #3b82f6;     /* blue-500 */
  --focus: #fb00ff;     /* blue-500 */
  --primary-700: #1d4ed8; /* blue-700 */
  --secondary-button: #2c3564; /* indigo-600 */
  --primary-button-text: #b4b4b4;
  --success: #22c55e;     /* green-500 */
  --danger: #ef4444;      /* red-500 */
  --warning: #f59e0b;     /* amber-500 */
  --panel-radius: 8px;     /* panel border radius */
  --input-radius: 4px;     /* input border radius */

  --row-hover: #52506c;
}




* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  /* background: linear-gradient(180deg, var(--bg), #020617); */
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans,
               Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  /* max-width: 1800px;
  margin: 0 auto;
  padding: 24px; */
}

.brand img {
  max-height: 25px;
  object-fit: contain;
}

/* Header styles */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bar);
  backdrop-filter: saturate(180%) blur(4px);
  border-bottom: 1px solid var(--border);
}

header.app-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
}

header .brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-logo {
  width: 120px;
  height: 40px;
  background-image: var(--logo);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center left;
  transition: background-image 0.3s ease;
}


header nav {
display: flex;
flex-direction: row;
}
header nav a, header nav a:visited {
  color: var(--primary-button-text);
  text-decoration: none;
  margin-left: 16px;
}

header nav a:hover {
  color: var(--text);
}

a, a:visited {
  color: var(--text);
  text-decoration: none;
  /* border-bottom: 1px solid transparent; */
}

a:hover {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px pink;
}

a.btn-sml, a.btn-sml:visited {
 color: #2563eb;
  background-color: #c3c4c6;
  border: 1px solid transparent;
  padding: 2px 9px;
  border-radius: 11px;
  text-decoration: none;
  font-size: 14px;
}

a.btn-sml:hover {
  color: var(--text);
  background-color: #c3c4c6cf;
  border: 1px solid transparent;
  text-decoration: none;
}

/* Ensure delete links are properly styled */

a.trash_can, a.trash_can:visited {
  text-decoration: none;
  border-bottom: none;
  display: inline-block;
  padding: 0px;
  cursor: pointer;
  /* vertical-align: baseline; */
}

.trash_can .material-symbols-outlined {
  font-size: 20px;
  vertical-align: text-bottom;
  line-height: 1;
}

.trash_can:hover {
  color: var(--danger);
}



/* Main panel styles */
main.panel {
  /* border: 1px solid var(--border); */
  border-radius: 14px;
  /* box-shadow: 0 10px 25px rgba(0,0,0,0.25), inset 0 1px rgba(255,255,255,0.03); */
  padding: 24px;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 16px;
}

h1.PO-number-in-edit-header{
  font-size: 3.5rem;
  text-align: right;
  margin-right: 50px;
}
.PO-nav-buttons {
  text-align: right;
  margin-right: 50px;    
}
h2 {
  font-size: 1.25rem;
  margin: 18px 0 10px;
  color: var(--muted);
}

p {
  color: var(--muted);
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.purchase-orders-table {
    margin-top: 30px;
}

thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 5px;
}

tbody {
  border-top: 8px solid transparent;
}

tbody td {
  text-align: left;
  padding: 0px;
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(148,163,184,0.06);
}



/* Form styles */
form {
  display: block;
}

fieldset {
  flex: 1;
  border: 0px solid var(--border);
  border-radius: 10px;
  padding: 0px;
  margin-bottom: 30px;
}

/* FOR GRAND TOTAL */
fieldset.fieldset-grand-total {
    max-width: 330px;
    /* border: 1px solid red; */
}
#purchase_order_grand_total {
  width: 210px;
  font-size: 2.25em;
}
.fieldset-grand-total div.form-row {
    /* max-width: 230px; */
}
.fieldset-grand-total div.form-row label{
    font-size: 2em;
    min-width: 210px;
}



.form-section {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  max-width: 100%;
  overflow: hidden;
}

legend {
  color: var(--muted);
  padding-bottom: 5px;
  font-weight: 600;
}

#align-right-form label, #vendor label {
  flex: 0 0 110px; 
  text-align: right;
  margin-right: 16px;
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-right: 8px;
}

#align-right-form input[type="text"],
#align-right-form input[type="number"],
#align-right-form input[type="date"],
#align-right-form input[type="tel"],
#align-right-form textarea,
#align-right-form select {
min-width: 150px;
width:220px;
}







input[type="text"],
input[type="number"],
input[type="date"],
input[type="tel"],
textarea,
select {
  flex: 1;
  background: var(--text-input);
  border: 1px solid transparent;
  color: var(--text);
  padding: 2px 3px;
  border-radius: 5px;
  outline: none;
}

/* Override max-width for table textareas */
table textarea {
  max-width: none;
}

input:focus,
textarea:focus,
select:focus {
    border: 1px solid var(--focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

textarea {
  resize: vertical;
}

.bottom-right-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-direction: row-reverse;
}

button,
.btn,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--secondary-button);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
}

/* Flash/notice helpers */
.notice,
.alert {
  padding: 10px 20px;
  border-radius: 10px;
  margin: 8px 0 16px;
}

.notice {
  background: rgba(34,197,94,1);
  color: #ffffff;
  border: 1px solid rgba(34,197,94,0.5);
}

.alert {
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
}








/* Nested items */
[data-nested-form-item] {
    display: flex;
    flex-direction: row;

}

/* Ensure consistent alignment for table headers and rows */
table {
  table-layout: fixed;
  width: 100%;
}

table th, table td {
  text-align: left;
  padding: 0px 10px;
}


/* Utility shims for a few Tailwind-like classes used in views */
.text-green-600 {
  color: #16a34a;
}

.border {
  border: 1px solid var(--border);
}

.p-2 {
  padding: 0.5rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

/* Form row layout */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.form-row-spacer {
  height: 12px;
}




/* Line item input styles for table alignment */
table input[type="text"],
table input[type="number"],
table textarea {
  background: #0b1220;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
}

table input:focus,
table textarea:focus {
  border-color: var(--primary);
  /* box-shadow: 0 0 0 2px rgba(59,130,246,0.15); */
}

/* Hide number input spinner arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Custom date picker icon styling */
.date-input-wrapper {
  position: relative;
  display: inline-block;
}

.date-input-wrapper input[type="date"] {
  position: relative;
  color-scheme: dark;
  padding-right: 35px;
}

.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
  background: transparent;
  bottom: 0;
  color: transparent;
  cursor: pointer;
  height: auto;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
}

.date-input-wrapper::after {
  content: "calendar_month";
  font-family: 'Material Symbols Outlined';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 18px;
  font-weight: 400;
}

/* Table column widths using td classes */
td.line-item-quantity,
th.line-item-quantity {
  width: 60px;
}

td.line-item-quantity input {
  width: 50px;
}

td.line-item-product,
th.line-item-product {
  width: 140px;
}

td.line-item-product input {
  width: 130px;
}

td.line-item-size-w,
td.line-item-size-h,
th.line-item-size-w,
th.line-item-size-h {
  width: 60px;
}

td.line-item-size-w input,
td.line-item-size-h input {
  width: 50px;
}

td.line-item-material,
th.line-item-material {
  width: 120px;
}

td.line-item-material input {
  width: 110px;
}

td.line-item-print-process,
th.line-item-print-process {
  width: 120px;
}

td.line-item-print-process input {
  width: 110px;
}

td.line-item-description,
th.line-item-description {
  width: 320px;
}

td.line-item-description textarea {
  width: 310px;
}

td.line-item-unit-price,
th.line-item-unit-price {
  width: 90px;
}

td.line-item-unit-price input {
  width: 80px;
}

td.line-item-line-total,
th.line-item-line-total {
  width: 100px;
}

td.line-item-line-total input {
  width: 90px;
}

/* Footer styles */
footer.app-footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  background-color: var(--footer-bar);
}

.footer-content {
  color: var(--footer-link);
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

a.footer-link {
  color: var(--footer-link);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
  margin: 0 8px;
}

a.footer-link:hover {
  color: var(--footer-link);
  text-decoration: underline;
}

/* Theme Toggle Switch */
.theme-toggle {
  display: flex;
  align-items: center;
  margin-left: 16px;
}

.theme-toggle-checkbox {
  display: none;
}

.theme-toggle-label {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  cursor: pointer;
}

.theme-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.theme-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-slider {
  background-color: var(--primary);
}

.theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-slider:before {
  transform: translateX(26px);
}

.theme-toggle-label:hover .theme-toggle-slider {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 0 0 3px rgba(59,130,246,0.15);
}

