/* ==========================================================================
   Luna Merdin - Envanter ve Multi-Store Eşitleme Denetim Raporu
   Bespoke Editorial & Luxury Atelier Design (100% Mobile Responsive & High Clarity)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Atelier Color Palette */
  --bg-page: #f8f6f0;
  --bg-surface: #ffffff;
  --bg-subtle: #f2efe9;
  --bg-hover: #faf9f6;
  
  --border-light: #e8e4dc;
  --border-medium: #dcd6cb;
  --border-focus: #9e7d3b;
  
  --text-main: #1c1917;
  --text-secondary: #44403c;
  --text-muted: #66615b;
  --text-faint: #8c857b;
  
  /* Brand Accents */
  --gold: #9e7d3b;
  --gold-light: #bfa15f;
  --gold-subtle: rgba(158, 125, 59, 0.08);
  --gold-border: rgba(158, 125, 59, 0.25);
  
  /* Status Accents (Refined, Muted Tones) */
  --status-red-text: #991b1b;
  --status-red-bg: #fef2f2;
  --status-red-border: #fecaca;
  
  --status-amber-text: #92400e;
  --status-amber-bg: #fffbeb;
  --status-amber-border: #fde68a;
  
  --status-blue-text: #1e40af;
  --status-blue-bg: #eff6ff;
  --status-blue-border: #bfdbfe;
  
  --status-purple-text: #6b21a8;
  --status-purple-bg: #faf5ff;
  --status-purple-border: #e9d5ff;

  --status-green-text: #166534;
  --status-green-bg: #f0fdf4;
  --status-green-border: #bbf7d0;

  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px;
}

.container {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   Header & Brand Identity
   ========================================================================== */

header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-logo-img {
  height: 34px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-separator {
  width: 1px;
  height: 28px;
  background: var(--border-medium);
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-doc-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.brand-doc-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 3px;
}

.header-progress-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 8px 18px;
  border-radius: 24px;
}

.progress-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 110px;
  height: 7px;
  background: #e2ded5;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ==========================================================================
   Executive Memo / Guidance Notes
   ========================================================================== */

.memo-section {
  margin: 30px 0 26px 0;
}

.memo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.memo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.memo-card:hover {
  border-color: var(--border-medium);
}

.memo-num {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}

.memo-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.memo-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  flex-grow: 1;
}

.memo-body strong {
  color: var(--text-main);
}

.memo-pill {
  display: inline-block;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 4px;
  color: var(--gold);
  font-weight: 600;
  margin-top: 12px;
  width: fit-content;
}

/* ==========================================================================
   Navigation & Filter Tabs
   ========================================================================== */

.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 11px 14px 11px 40px;
  font-size: 14.5px;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s;
}

.search-input:focus {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(158, 125, 59, 0.12);
}

.search-icon-svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  fill: var(--text-faint);
}

.filter-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--gold);
}

.filter-tabs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.filter-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.filter-tab:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.filter-tab.active {
  background: var(--text-main);
  color: #fff;
  font-weight: 600;
}

.filter-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.tab-count {
  font-size: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ==========================================================================
   Master Audit Table (Desktop View >= 992px)
   ========================================================================== */

.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14.5px;
}

.audit-table thead th {
  background: #fbf9f6;
  border-bottom: 1px solid var(--border-medium);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.audit-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text-main);
}

.audit-table tbody tr:hover td {
  background: var(--bg-hover);
}

.audit-table tbody tr.is-resolved td {
  opacity: 0.42;
}

.audit-table tbody tr.is-resolved td:first-child {
  opacity: 1;
}

/* Table Cells */
.td-check {
  width: 48px;
  text-align: center;
  padding-top: 20px !important;
}

.row-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--gold);
}

/* Product Column */
.td-product {
  min-width: 260px;
}

.product-cell-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.product-img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.product-info-wrap {
  display: flex;
  flex-direction: column;
}

.product-name-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.product-category-text {
  font-size: 12.5px;
  color: var(--gold);
  font-weight: 600;
  margin-top: 3px;
}

/* Store Data Columns */
.td-store {
  min-width: 190px;
}

.store-mobile-label {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sku-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.sku-badge.default {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.sku-badge.danger {
  background: var(--status-red-bg);
  color: var(--status-red-text);
  border: 1px solid var(--status-red-border);
}

.sku-badge.warning {
  background: var(--status-amber-bg);
  color: var(--status-amber-text);
  border: 1px solid var(--status-amber-border);
}

.sku-badge.purple {
  background: var(--status-purple-bg);
  color: var(--status-purple-text);
  border: 1px solid var(--status-purple-border);
}

/* Stock Badges (Mevcut, Ayrılmış, Portekiz, Toplam) */
.stock-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stock-components {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.badge-stock-avail {
  display: inline-block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12.5px;
}

.badge-stock-comm {
  display: inline-block;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12.5px;
}

.badge-stock-port {
  display: inline-block;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12.5px;
}

.badge-stock-zero {
  display: inline-block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12.5px;
}

.badge-stock-warn {
  display: inline-block;
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12.5px;
}

.stock-total {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-light);
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
}

.stock-total strong {
  color: var(--text-main);
  font-weight: 700;
}

/* Problem Diagnosis Column */
.td-issue {
  min-width: 250px;
}

.issue-mobile-label {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.issue-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 7px;
}

.issue-badge.danger { background: var(--status-red-bg); color: var(--status-red-text); border: 1px solid var(--status-red-border); }
.issue-badge.warning { background: var(--status-amber-bg); color: var(--status-amber-text); border: 1px solid var(--status-amber-border); }
.issue-badge.purple { background: var(--status-purple-bg); color: var(--status-purple-text); border: 1px solid var(--status-purple-border); }
.issue-badge.blue { background: var(--status-blue-bg); color: var(--status-blue-text); border: 1px solid var(--status-blue-border); }

.issue-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Action / Solution Column (High Clarity & Direct Steps) */
.td-action {
  min-width: 320px;
  background: #fdfcf9;
  border-left: 2px solid var(--border-light);
}

.action-mobile-label {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.action-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.action-badge-ok {
  background: var(--status-green-bg);
  color: var(--status-green-text);
  border: 1px solid var(--status-green-border);
}

.action-badge-urgent {
  background: var(--status-red-bg);
  color: var(--status-red-text);
  border: 1px solid var(--status-red-border);
}

.action-badge-warn {
  background: var(--status-amber-bg);
  color: var(--status-amber-text);
  border: 1px solid var(--status-amber-border);
}

.action-badge-decision {
  background: var(--status-purple-bg);
  color: var(--status-purple-text);
  border: 1px solid var(--status-purple-border);
}

.action-target-pill {
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.action-text {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
}

.action-text strong {
  color: #000;
}

.action-text u {
  text-decoration-color: var(--gold);
}

/* Footer Counter */
.table-footer {
  padding: 16px 20px;
  background: #faf8f5;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Responsive Breakpoints: Tablets & Mobile (< 992px Card View)
   ========================================================================== */

@media (max-width: 991px) {
  .container {
    padding: 0 16px;
  }

  .memo-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Table transforms into clean mobile cards */
  .table-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .audit-table, 
  .audit-table tbody, 
  .audit-table tr, 
  .audit-table td {
    display: block;
    width: 100%;
  }

  .audit-table thead {
    display: none; /* Hide desktop table headers */
  }

  .audit-table tbody tr {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    padding: 18px;
    box-shadow: var(--shadow-card);
    position: relative;
  }

  .audit-table tbody tr:hover td {
    background: transparent;
  }

  .audit-table tbody td {
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-subtle);
  }

  .audit-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Mobile Checkbox & Product Top Row */
  .td-check {
    position: absolute;
    top: 18px;
    right: 18px;
    width: auto !important;
    padding: 0 !important;
  }

  .row-checkbox {
    width: 24px;
    height: 24px;
  }

  .td-product {
    padding-top: 0 !important;
    padding-right: 40px; /* Space for checkbox */
  }

  /* Mobile Store Comparison: Side by Side or Stacked */
  .store-mobile-label, 
  .issue-mobile-label, 
  .action-mobile-label {
    display: block;
  }

  .td-store {
    background: #faf9f6;
    padding: 12px 14px !important;
    border-radius: 6px;
    margin-top: 8px;
  }

  .td-issue {
    padding: 14px 0 !important;
  }

  .td-action {
    background: #fdfcf9;
    border-left: none;
    border-top: 2px solid var(--gold-border);
    padding: 14px !important;
    border-radius: 6px;
    margin-top: 8px;
  }
}

@media (max-width: 600px) {
  header {
    padding: 14px 0;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .brand-wrapper {
    gap: 12px;
  }

  .brand-logo-img {
    height: 28px;
  }

  .brand-doc-title {
    font-size: 19px;
  }

  .header-progress-box {
    width: 100%;
    justify-content: space-between;
  }

  .filter-actions-row {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
