:root {
  --primary: #183d68;
  --primary-hover: #102c4e;
  --primary-light: #edf4fc;
  --accent: #087353;
  --accent-light: #eaf6f0;
  --warning: #8a4c12;
  --danger: #b42318;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --card-border: #ccd6e1;
  --text-main: #182a42;
  --text-muted: #506178;
  --text-dark: #182a42;
  --radius: 14px;
  --font-family: 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  direction: rtl;
  text-align: right;
  line-height: 1.6;
}

/* Header & Navigation */
header.app-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 56px;
  height: auto;
  flex: none;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: #182a42;
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Layout */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(250px, .9fr) minmax(0, 3fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}

/* Cards & Panels */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(24, 42, 66, .04);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #233851;
}

/* Product Selection List */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;

}

.product-item {
  background: var(--card-bg);
  width: 100%;
  text-align: start;
  min-height: 56px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  gap: 12px;
  align-items: center;
}

.product-item:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.product-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.product-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #e9eef5;
}

.product-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #182a42;
  margin-bottom: 4px;
}

.product-info .gtin-pill {
  font-family: monospace;
  font-size: 11px;
  background: #e9eef5;
  color: #344861;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Studio Center & Right Panels */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #344861;
  margin-bottom: 6px;
}

.form-label span.badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e9eef5;
  color: #506178;
  margin-right: 6px;
}

.form-input, .form-select {
  width: 100%;
  background: #f4f6f9;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: #075a43;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: #344861;
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Barcode Preview Box */
.barcode-preview-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  color: var(--text-dark);
  margin-bottom: 16px;
}

.barcode-svg-container {
  max-width: 320px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.barcode-svg-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.compliance-badge-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.compliance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  color: var(--text-main);
  font-weight: 600;
}

.compliance-item .status-icon {
  color: #087353;
}

/* Digital Link URI Display Bar */
.uri-display-bar {
  background: #f4f6f9;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.uri-text {
  font-family: monospace;
  font-size: 13px;
  color: #183d68;
  direction: ltr;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabs */
.tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 16px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-color: var(--primary);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Code Snippet Box */
.code-block {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px;
  font-family: monospace;
  font-size: 12px;
  color: #233851;
  direction: ltr;
  text-align: left;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Notification Toast */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 16px;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(24,42,66,.16);
  transform: translateY(100px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 1000;
}
.toast.show {
  visibility: visible;
  transform: translateY(0);
  opacity: 1;
}

.count-badge { padding: 3px 8px; border-radius: 6px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 700; }
.catalog-search { margin-bottom: 12px; }
.catalog-results { color: var(--text-muted); font-size: 13px; }
.catalog-items { display: grid; gap: 8px; max-height: 580px; overflow-y: auto; padding: 4px; }
.product-info { min-width: 0; }
.product-info strong { display: block; line-height: 1.4; margin-bottom: 4px; }
.product-brand { color: var(--text-muted); font-size: 13px; }
.attribute-group { background: var(--bg); border: 1px solid var(--card-border); border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.attribute-group legend { font-weight: 700; padding-inline: 6px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-actions .btn { flex: 1 1 auto; }
.uri-display-bar { flex-wrap: wrap; }
.uri-text { flex: 1 1 180px; min-width: 0; }
.tabs-header { flex-wrap: wrap; gap: 0; }
.tab-btn { padding-inline: 10px; }
.btn, .tab-btn, .form-input { min-height: 44px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.toast { max-width: calc(100% - 32px); }
.code-block { overflow-wrap: anywhere; }

@media (max-width: 1024px) {
  .catalog-items { max-height: 245px; }
}
@media (max-width: 600px) {
  header.app-header { position: static; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .header-actions { flex-wrap: wrap; }
  .main-container { padding: 12px; }
  .panel { padding: 14px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
