/* ===== GENERAL BODY ===== */
body {
  font-family: Arial, sans-serif;
  background: #f7f8fa;
  margin: 0;
  padding: 20px 0;
  display: flex;
  justify-content: center;
}

/* ===== AUTH CONTAINERS ===== */
.auth-container {
  max-width: 400px;
  width: 90%;
  margin: 60px auto;
  padding: 30px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-container h2 { margin-bottom: 15px; font-size: 24px; color: #333; }
.auth-container input {
  padding: 10px 12px; font-size: 14px; border-radius: 6px;
  border: 1px solid #ccc; width: 100%; box-sizing: border-box;
}
.auth-container button {
  padding: 10px; font-size: 14px; border-radius: 6px; border: none;
  background-color: #4a90e2; color: #fff; cursor: pointer; transition: 0.2s;
}
.auth-container button:hover { background-color: #357ABD; }
.auth-container a { color: #4a90e2; text-decoration: none; }
.auth-container a:hover { text-decoration: underline; }

/* ===== MAIN INVENTORY ===== */
#main-container {
  max-width: 1200px; width: 95%; padding: 25px;
  background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.08); border-radius: 10px;
}

#main-container > div:first-child {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 15px; font-weight: bold;
}

/* ===== TABS ===== */
#tabs { display: flex; flex-wrap: wrap; margin-bottom: 10px; }
.tab-btn {
  padding: 10px 20px; margin-right: 5px; border-radius: 8px 8px 0 0;
  border: 1px solid #ccc; background: #f2f2f2; cursor: pointer; transition: all 0.2s;
  margin-bottom: -1px;
}
.tab-btn:hover { background: #e0e0e0; }
.tab-btn.active {
  background: #fff; border-bottom: 2px solid #fff; font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ===== SEARCH ===== */
#search-input {
  margin-left: auto; padding: 6px 10px; border-radius: 6px; border: 1px solid #ccc;
  font-size: 14px;
}

/* ===== INVENTORY TABLE ===== */
table.inventory-table { border-collapse: collapse; width: 100%; table-layout: auto; }
table.inventory-table th, table.inventory-table td {
  padding: 10px; text-align: left; max-width: none; white-space: normal;
  word-wrap: break-word; overflow-wrap: break-word; position: relative; border-bottom: 1px solid #ddd;
}
table.inventory-table td input {
  width: 100%; box-sizing: border-box; padding: 5px 8px; font-size: 13px;
  border-radius: 4px; border: 1px solid #ccc;
}

/* ===== CONDITIONAL COLORING ===== */
input.low-stock { background: #FFA500; }
input.expired { background: #FF0000; color: #fff; }
input.exp30 { background: #FFFF00; }
input.exp60 { background: #00FFFF; }

/* ===== INVALID DATE ===== */
.invalid-date { color: red; font-size: 11px; margin-top: 2px; }

/* ===== TABLE SORT ARROWS ===== */
.sort-arrow { font-size: 12px; margin-left: 5px; }

/* ===== ROW STRIPING / HOVER ===== */
table.inventory-table tr:nth-child(even) td { background-color: #f9f9f9; }
table.inventory-table tr:hover td { background-color: #f1f3f5; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  table.inventory-table th, table.inventory-table td { padding: 8px; font-size: 12px; }
  .tab-btn { padding: 6px 12px; font-size: 12px; }
  #search-input { margin-top: 5px; width: 100%; }
}

/* ===== DROPDOWN HEADER / FILTER ===== */
th.dropdown-header {
  cursor: pointer; user-select: none; position: relative; padding: 6px 12px;
  border-radius: 6px; background-color: #f2f2f2; transition: background 0.2s;
}
th.dropdown-header:hover { background-color: #e0e0e0; }
th.dropdown-header::after { content: " ▼"; font-size: 0.75em; opacity: 0.7; }

.filter-dropdown {
  position: absolute; background: #fff; border: 1px solid #ccc;
  border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 9999;
  min-width: 160px; max-height: 240px; overflow-y: auto; font-size: 14px;
}

.filter-option { padding: 8px 12px; cursor: pointer; }
.filter-option:hover { background: #f1f5f9; }
.filter-option.active { background: #dbeafe; font-weight: 600; }

/* ===== TABLE ACTIONS ===== */
.actions .table-action-btn {
  width: 28px; height: 28px; font-weight: bold; font-size: 14px;
  border-radius: 4px; border: 1px solid #666; cursor: pointer;
  background-color: #f0f0f0; color: #333; transition: background 0.2s;
}
.actions .table-action-btn:hover { background-color: #e0e0e0; }
