/* Google Font */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  background: linear-gradient(135deg,#4e8cff,#9d4edd);
  min-height: 100vh;
  color: #333;
}

/* UTILITIES */
.hidden {
  display: none !important;
}
#authContainer.hidden,
#dashboard.hidden {
  display: none;
}

/* AUTH CONTAINER */
#authContainer {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; padding: 1rem;
}
.auth-card {
  background: #fff; padding: 2rem;
  border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  width: 100%; max-width: 360px; text-align: center;
}
.auth-card h2 {
  margin-bottom: 1.5rem; font-size: 1.6rem;
}
.auth-card input {
  width: 100%; padding: .85rem; margin-bottom: 1rem;
  border: 1px solid #ddd; border-radius: 6px;
}
#authSubmit {
  width: 100%; padding: .85rem;
  background: #0f172a; color: #fff;
}
#authSubmit:hover { background: #131c2e; }
.switch-text {
  margin-top: 1rem; font-size: .9rem;
}
.switch-text a { color: #4e8cff; text-decoration: none; }
.switch-text a:hover { text-decoration: underline; }

/* DASHBOARD HEADER */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; background: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
}
.dash-header .title { display: flex; align-items: center; }
.dash-header .title i {
  font-size: 2rem; margin-right: .75rem; color: #fff;
}
.dash-header .title h1 {
  margin: 0; font-size: 1.8rem; color: #fff;
}
.dash-header .title p {
  margin: 0; font-size: .9rem; color: #f0f0f0;
}
.btn-logout {
  background: #fff; color: #0f172a; padding: .6rem 1rem;
}
.btn-logout:hover { background: #f0f0f0; }

/* MAIN GRID */
.dash-main {
  padding: 2rem;
  display: grid;
  grid-gap: 2rem;
}
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 2rem;
}
.card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  padding: 1.5rem; position: relative;
}

/* UPLOAD CARD */
.upload-card h2 {
  margin-top: 0; font-size: 1.3rem; color: #0f172a;
}
.file-drop {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 2px dashed #ccc; border-radius: 8px;
  height: 150px; margin: 1rem 0; cursor: pointer;
  position: relative; overflow: hidden;
}
.file-drop i { color: #999; }
.file-drop p { font-size: .95rem; color: #777; text-align: center; }
.file-drop input {
  position: absolute; width: 100%; height: 100%;
  top: 0; left: 0; opacity: 0; cursor: pointer;
}
.btn-action {
  width: 100%; padding: .7rem; background: #4e8cff; color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
}
.btn-action:hover { background: #3b6fd1; }
.upload-card .hint {
  display: block; text-align: center; margin-top: .5rem;
  color: #aaa; font-size: .8rem;
}

/* Uploaded files list */
.uploaded-files {
  margin-top: .5rem;
  font-size: .9rem;
}
.uploaded-files ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: .25rem 0;
}

/* MANUAL CARD STYLES */
.manual-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.manual-select,
.manual-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}
.circle-btn {
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  margin: 0 auto;
}
.circle-btn:hover { background: #131c2e; }
#newFieldContainer input {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

/* TABLE CARD & ACTIONS */
.table-card {
  grid-column: span 2;
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.table-header h2 {
  margin: 0; font-size: 1.3rem; color: #0f172a;
}
.header-actions {
  display: flex; align-items: center; gap: .5rem;
}
.table-header input {
  padding: .6rem; border: 1px solid #ddd; border-radius: 6px;
  width: 200px;
}
.clear-btn {
  width: auto; padding: .5rem .75rem;
}

/* TABLE STYLES */
#inventoryContainer {
  overflow-x: auto;
}
#inventoryTable {
  width: 100%; border-collapse: collapse;
}
#inventoryTable th,
#inventoryTable td {
  padding: .75rem; border-bottom: 1px solid #eee; text-align: left;
}
#inventoryTable th {
  background: #f9fafb; font-weight: 600; color: #0f172a;
}
#inventoryTable .empty {
  text-align: center; color: #999;
}
.btn-delete {
  background: none;
  border: none;
  color: #e3342f;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  margin-left: 0.5rem;
}
.btn-delete:hover {
  background: rgba(227,52,47,0.1);
}

/* INLINE-EDITING INPUT */
.editable-input {
  width: 100%;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: .9rem;
}

/* DYNAMIC TOASTS */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .8rem 1.2rem;
  border-radius: 6px;
  color: #fff;
  z-index: 1000;
  animation: fadeInOut 3s forwards;
}
@keyframes fadeInOut {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; }
}
.toast.success { background: rgba(0,128,0,0.8); }
.toast.error   { background: rgba(200,0,0,0.8); }
