/* Clearline Supplier & Admin Portal Stylesheet
   Design system matching ../site/css/style.css
   WCAG AA/AAA Compliant • Mobile-First (375px) • Zero Jargon */

:root {
  --bg-deep: #060b13;
  --bg-navy: #0b1524;
  --bg-surface: #0f1c30;
  --bg-surface-elevated: #152640;
  --bg-surface-glass: rgba(15, 28, 48, 0.92);

  --border-subtle: #1e2f47;
  --border-medium: #2a4163;
  --border-focus: #a3e635;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dark: #060b13;

  --accent-lime: #a3e635;
  --accent-lime-hover: #bbf451;
  --accent-lime-glow: rgba(163, 230, 53, 0.25);

  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --electric-blue: #38bdf8;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info-bg: rgba(56, 189, 248, 0.15);

  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.55);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--accent-lime);
  color: var(--text-dark);
  padding: 12px 20px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid #ffffff;
}

/* Header */
.portal-header {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--electric-blue);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Container */
.main-container {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

/* Buttons */
button, .btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 20px;
  min-height: 48px; /* Touch target */
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.btn-lime {
  background-color: var(--accent-lime);
  color: var(--text-dark);
  box-shadow: 0 0 16px var(--accent-lime-glow);
}
.btn-lime:hover {
  background-color: var(--accent-lime-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}
.btn-secondary:hover {
  background-color: #1b3052;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 8px 14px;
  min-height: 38px;
  font-size: 0.875rem;
}

.btn-full {
  width: 100%;
}

/* Search and Filters Bar */
.search-bar-wrap {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-input-box {
  position: relative;
  width: 100%;
}

.search-input-box input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px 12px 42px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Product Cards Grid */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.product-card:hover, .product-card:focus-within {
  border-color: var(--border-medium);
  background: var(--bg-surface-elevated);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.product-name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.product-code-badge {
  font-size: 0.75rem;
  padding: 3px 6px;
  background: rgba(37, 99, 235, 0.2);
  color: var(--electric-blue);
  border-radius: var(--radius-sm);
  font-weight: 600;
  white-space: nowrap;
}

.product-specs {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Card metrics */
.metrics-row {
  display: flex;
  gap: 12px;
  background: var(--bg-deep);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: auto;
}

.metric-col {
  flex: 1;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-val {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Status Chips */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.chip-live {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.chip-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.chip-rejected {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.chip-disabled {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Slide-up Sheet / Modal */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 19, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.sheet-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

.sheet-backdrop.active .sheet-content {
  transform: translateY(0);
}

.sheet-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sheet-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-glass);
  position: sticky;
  bottom: 0;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-help {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  min-height: 48px;
  background: var(--bg-deep);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  width: 100%;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* Auth Modal Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pin-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pin-digit {
  width: 48px;
  height: 56px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  background: var(--bg-deep);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.pin-digit:focus {
  border-color: var(--accent-lime);
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-lime);
}

/* Alert Boxes */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: 24px;
  max-width: 400px;
  margin: 0 auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.9375rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.2s ease;
  pointer-events: auto;
}

.toast-success {
  border-left: 4px solid var(--success);
}
.toast-error {
  border-left: 4px solid var(--danger);
}

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

/* polish 2026-09-17 */
.search-input-box input { padding-left: 46px; }
.metric-label { display:block; }
.metric-val { display:block; font-size:1.0625rem; white-space:nowrap; }
.header-actions .btn { white-space:nowrap; }
@media (max-width: 420px) { #add-product-btn span { display:none; } .brand-title { font-size:1.05rem; } }
