/*
  La Famiglia Katonah - Professional Inventory System
  Optimized for Digital Management & 11x17 Landscape Printing
*/

:root {
  --green-primary: #1b4d3e;
  --green-header: #5c9261;
  --green-category: #e8f5e9;
  --orange-accent: #bf360c;
  --border-color: #d1d1d1;
  --row-alt: #f8faf8;
  --text-main: #333333;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #0f172a;
  color: #f8fafc;
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
}

.app-container {
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

/* Controls Section */
.controls-panel {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.search-box {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 10px 15px 10px 35px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: white;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  color: #94a3b8;
}

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary { background: #3b82f6; color: white; }
.btn-secondary { background: rgba(255,255,255,0.1); color: white; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Table Viewport */
.table-viewport {
  background: white;
  color: var(--text-main);
  border-radius: 8px;
  overflow: auto;
  max-height: calc(100vh - 250px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.inventory-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

/* Header Styling */
.inventory-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.inventory-table th {
  background: var(--green-header);
  color: white;
  font-weight: 700;
  padding: 12px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  text-align: left;
  font-size: 0.9rem;
}

.inventory-table th.date-col {
  text-align: center;
  background: #4a7c4f;
}

.day-cell {
  display: block;
  font-size: 0.7rem;
  opacity: 0.9;
  margin-top: 2px;
}

.badge {
  font-size: 0.6rem;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: 4px;
  text-transform: uppercase;
}

.badge-order { background: #fff3e0; color: #e65100; }

/* Sticky Columns */
.sticky-col-1 { position: sticky; left: 0; z-index: 5; background: inherit; width: 90px; }
.sticky-col-2 { position: sticky; left: 90px; z-index: 5; background: inherit; width: 300px; border-right: 2px solid #999 !important; }

th.sticky-col-1, th.sticky-col-2 { z-index: 11; background: var(--green-header) !important; }

/* Row Styling */
.inventory-table td {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  height: 40px;
  vertical-align: middle;
}

.row-odd { background: var(--row-alt); }
.row-even { background: white; }

.category-row {
  background: var(--green-category) !important;
  font-weight: 800;
  color: var(--green-primary);
}

.category-row td {
  height: 45px;
  font-size: 1rem;
}

/* Product Icons */
.product-cell-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-icon-badge {
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid #e2e8f0;
}

.product-desc-text {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Input Styling */
.count-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-family: 'Roboto Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

.count-input:focus {
  background: #fff9c4;
  box-shadow: inset 0 0 0 2px var(--green-header);
}

/* Print Header Card */
.sheet-print-header {
  background: white;
  color: var(--green-primary);
  padding: 20px;
  border-bottom: 3px solid var(--green-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-radius: 8px 8px 0 0;
}

.vendor-title { font-size: 1.8rem; font-weight: 900; }

/* PRINT STYLES */
@media print {
  @page {
    size: 17in 11in;
    margin: 0.25in;
  }

  body { background: white !important; color: black !important; padding: 0 !important; }
  .no-print, .controls-panel { display: none !important; }
  .app-container { width: 100% !important; padding: 0 !important; max-width: none !important; }
  
  .table-viewport {
    overflow: visible !important;
    max-height: none !important;
    box-shadow: none !important;
  }

  .inventory-table { width: 100% !important; border: 2px solid black !important; }
  
  .inventory-table th, .inventory-table td {
    border: 1px solid black !important;
    color: black !important;
  }

  .inventory-table th {
    background: #eeeeee !important;
    height: 50px !important;
    font-size: 13pt !important;
  }

  .inventory-table td {
    height: 0.55in !important; /* Forces 15-18 rows per page on 11" height */
    font-size: 13pt !important;
  }

  .category-row td {
    background: #dddddd !important;
    font-size: 13pt !important;
    height: 0.6in !important;
  }

  .sticky-col-1, .sticky-col-2 {
    position: static !important;
    background: transparent !important;
  }

  .product-desc-text { font-size: 13pt !important; font-weight: 700 !important; }
  
  .footer-print-text { display: block !important; margin-top: 15px; font-weight: 700; }
}

/* Sight Mode / Accessibility */
.accessibility-mode {
  background-color: white !important;
  color: black !important;
}

.accessibility-mode .app-container {
  max-width: 100% !important;
}

.accessibility-mode .inventory-table td {
  height: 60px !important;
  font-size: 1.2rem !important;
}

.accessibility-mode .product-desc-text {
  font-size: 1.2rem !important;
}

.accessibility-mode .count-input {
  font-size: 1.5rem !important;
}
