* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: #f5f7fa; color: #1a1a2e; min-height: 100vh; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login */
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a5f 0%, #1a1a2e 100%); }
.login-card { background: white; border-radius: 16px; padding: 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h1 { font-size: 22px; color: #1a1a2e; font-weight: 700; }
.login-logo p { font-size: 14px; color: #666; margin-top: 4px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; font-family: inherit; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-error { color: #dc2626; font-size: 13px; margin-top: 4px; }

/* Buttons */
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }

/* Layout */
.app-header { background: #1a1a2e; color: white; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.app-header h1 { font-size: 16px; font-weight: 600; }
.app-header .user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.app-header .user-info span { color: #94a3b8; }
.app-content { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Page headers */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 600; }
.page-header p { font-size: 14px; color: #666; margin-top: 2px; }

/* Cards */
.card { background: white; border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { padding: 10px 16px; text-align: left; font-weight: 500; background: #f9fafb; color: #6b7280; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.table td { padding: 10px 16px; border-top: 1px solid #f3f4f6; }
.table tr:hover td { background: #f9fafb; }
.table .text-right { text-align: right; }
.table .text-center { text-align: center; }
.table .mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }

/* Status badges */
.badge { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; display: inline-block; }
.badge-pending { background: #f3f4f6; color: #6b7280; }
.badge-sent { background: #dbeafe; color: #1e40af; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-accepted { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #92400e; }

/* PO Card (dashboard) */
.po-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; margin-bottom: 12px; cursor: pointer; transition: all 0.15s; }
.po-card:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,0.08); }
.po-card .po-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.po-card .po-number { font-size: 16px; font-weight: 600; color: #2563eb; }
.po-card .po-date { font-size: 13px; color: #666; }
.po-card .po-meta { display: flex; gap: 24px; font-size: 13px; color: #666; }
.po-card .po-meta strong { color: #1a1a2e; }

/* Line item confirmation */
.line-row { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; margin-bottom: 8px; background: white; }
.line-row.confirmed { border-left: 3px solid #16a34a; }
.line-row.pending { border-left: 3px solid #d1d5db; }
.line-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.line-sku { font-weight: 600; font-family: monospace; font-size: 14px; }
.line-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.line-fields .form-group { margin-bottom: 0; }
.line-fields input, .line-fields select { padding: 8px 10px; font-size: 13px; }

/* Summary cards */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.summary-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.summary-card .label { font-size: 12px; color: #666; margin-bottom: 4px; }
.summary-card .value { font-size: 22px; font-weight: 600; }
.summary-card .value.small { font-size: 16px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Loading */
.loading { text-align: center; padding: 60px; color: #999; }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #e5e7eb; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty h3 { font-size: 16px; color: #666; margin-bottom: 8px; }

/* Price change highlight */
.price-up { color: #dc2626; }
.price-down { color: #16a34a; }
.price-same { color: #666; }

/* Responsive */
@media (max-width: 768px) {
  .app-content { padding: 16px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .line-fields { grid-template-columns: 1fr 1fr; }
}
