@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #3b82f6; /* Blue */
  --primary-hover: #2563eb;
  --success-color: #10b981; /* Green */
  --success-hover: #059669;
  --danger-color: #ef4444; /* Red */
  --danger-hover: #dc2828;
  --bg-color: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --input-bg: #ffffff;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at top right, #e0e7ff, transparent 40%),
                    radial-gradient(circle at bottom left, #dbeafe, transparent 40%);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 16px;
  /* Prevent pull-to-refresh on mobile */
  overscroll-behavior-y: none;
}

.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 
              0 8px 10px -6px rgba(0, 0, 0, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 24px;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.header p {
  font-size: 14px;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

input, select {
  width: 100%;
  height: 48px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text-main);
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input:read-only {
  background-color: #f1f5f9;
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-logout-inline {
  width: 48px;
  height: 48px;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-logout-inline {
  width: 48px;
  height: 48px;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-logout-inline:active {
  transform: scale(0.95);
  background-color: var(--danger-hover);
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: none;
}

.autocomplete-item {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item:active {
  background-color: #f1f5f9;
}

.item-input-section {
  background: #f1f5f9;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px dashed #cbd5e1;
}

.btn-add-item {
  width: 100%;
  height: 44px;
  background-color: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.btn-add-item:active {
  transform: scale(0.98);
  background-color: #eff6ff;
}

.item-list-container {
  margin-bottom: 20px;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.item-details {
  display: flex;
  flex-direction: column;
}

.item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-remove-item {
  background: transparent;
  color: var(--danger-color);
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}

.btn-remove-item:active {
  background: rgba(239, 68, 68, 0.1);
}

.qty-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--input-bg);
  overflow: hidden;
}

.qty-wrapper input {
  border: none;
  border-radius: 0;
  text-align: center;
  font-weight: 600;
  padding: 0;
}

.qty-wrapper input:focus {
  box-shadow: none;
}

.qty-btn {
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.qty-btn:active {
  background-color: rgba(0,0,0,0.05);
}

.btn-submit {
  width: 100%;
  height: 52px;
  background-color: var(--success-color);
  color: white;
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  margin-top: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-submit:active {
  transform: translateY(2px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-submit:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-logout {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.spinner {
  border: 3px solid rgba(255,255,255,0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-main);
  color: white;
  padding: 14px 24px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--success-color);
}
.toast.error {
  background: var(--danger-color);
}

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