/* ==========================================================================
   RSI MARBLE — BİLEŞEN KÜTÜPHANESİ (components.css)
   Kartlar, Tablolar, Formlar, Butonlar, Modallar, Rozetler & Teklif Baskı Görünümü
   ========================================================================== */

/* ==========================================================================
   GRIDLER & DÜZEN
   ========================================================================== */
.grid-cards-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.grid-cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.grid-cards-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

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

.flex-align {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gap-md { gap: 16px; }
.gap-sm { gap: 8px; }
.mb-lg { margin-bottom: 24px; }
.mb-md { margin-bottom: 16px; }
.mb-sm { margin-bottom: 8px; }

/* ==========================================================================
   KARTLAR & KPI PANELLERİ
   ========================================================================== */
.rsi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.rsi-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.rsi-card.gold-border {
  border-color: var(--border-gold);
}

.rsi-card.danger-border {
  border-color: var(--status-danger-border);
}

.rsi-card.card-accent-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rsi-gold), var(--rsi-gold-dark));
}

.rsi-card.card-accent-danger::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--status-danger);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* KPI Kartı */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-main);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--rsi-bej);
  letter-spacing: -0.02em;
}

.kpi-value.gold { color: var(--rsi-gold-light); }
.kpi-value.danger { color: var(--status-danger); }
.kpi-value.success { color: var(--status-success); }
.kpi-value.warning { color: var(--status-warning); }

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--rsi-slate-400);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 2px;
}

/* ==========================================================================
   ALERTLER & EŞİK UYARI BANTLARI (Anayasa §5.37 Uyumlu)
   ========================================================================== */
.rsi-alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.rsi-alert.alert-danger {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: #FFAAA6;
}

.rsi-alert.alert-warning {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-border);
  color: #FFE1B6;
}

.rsi-alert.alert-gold {
  background: var(--rsi-gold-subtle);
  border-color: var(--border-gold);
  color: var(--rsi-bej);
}

.rsi-alert.alert-info {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: #BEE3F8;
}

.alert-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 3px;
  color: white;
}

/* ==========================================================================
   TABLOLAR
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.rsi-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.rsi-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.rsi-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-main);
  vertical-align: middle;
}

.rsi-table tbody tr {
  transition: var(--transition);
}

.rsi-table tbody tr:hover {
  background: var(--bg-subtle);
}

.rsi-table tbody tr.row-urgent {
  background: rgba(230, 57, 70, 0.08);
}

.rsi-table tbody tr.row-urgent:hover {
  background: rgba(230, 57, 70, 0.14);
}

.rsi-table td.mono {
  font-family: var(--font-mono);
  font-weight: 500;
}

.rsi-table td.text-right, .rsi-table th.text-right {
  text-align: right;
}

.rsi-table td.text-center, .rsi-table th.text-center {
  text-align: center;
}

/* ==========================================================================
   BUTONLAR
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--rsi-gold-light), var(--rsi-gold));
  color: var(--rsi-slate-900);
  border-color: var(--rsi-gold-light);
  box-shadow: 0 2px 8px var(--rsi-gold-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #E5C358, var(--rsi-gold-light));
  box-shadow: 0 4px 14px var(--rsi-gold-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-danger {
  background: var(--status-danger);
  color: white;
  border-color: var(--status-danger);
}

.btn-danger:hover {
  background: #C92A37;
}

.btn-success {
  background: var(--status-success);
  color: white;
  border-color: var(--status-success);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   FORMLAR & GİRDİLER
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rsi-slate-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-hint {
  font-size: 0.68rem;
  color: var(--rsi-slate-400);
  font-style: italic;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  transition: var(--transition);
  font-variant-numeric: tabular-nums;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-gold);
  box-shadow: 0 0 0 3px var(--rsi-gold-glow);
  background: #FFFFFF;
}

.form-input.mono {
  font-family: var(--font-mono);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* ==========================================================================
   ROZETLER (BADGES & PILLS)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-gold {
  background: var(--rsi-gold-subtle);
  color: var(--rsi-gold-light);
  border: 1px solid var(--border-gold);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: #FFAAA6;
  border: 1px solid var(--status-danger-border);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: #FFE1B6;
  border: 1px solid var(--status-warning-border);
}

.badge-success {
  background: var(--status-success-bg);
  color: #A7F3D0;
  border: 1px solid var(--status-success-border);
}

.badge-info {
  background: var(--status-info-bg);
  color: #BAE6FD;
  border: 1px solid var(--status-info-border);
}

.badge-slate {
  background: rgba(255, 255, 255, 0.08);
  color: var(--rsi-slate-300);
}

/* ==========================================================================
   MODAL PENCERELERİ
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 850px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.modal-container.modal-xl {
  max-width: 980px;
}

.modal-container.modal-lg {
  max-width: 900px;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-subtle);
}

/* ==========================================================================
   TOAST BİLDİRİMLERİ
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
}

.toast.toast-success { border-color: var(--status-success); }
.toast.toast-danger { border-color: var(--status-danger); }
.toast.toast-warning { border-color: var(--status-warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   TEKLİF BELGE ÇIKTI ALANI (RSI-BS-01 STANDARDINA UYGUN 1:1 A4 GÖRÜNÜM)
   ========================================================================== */
.quote-paper {
  background: #FFFFFF !important;
  color: #1F2937 !important;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 42px 48px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  box-sizing: border-box;
}

.quote-paper-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
}

.quote-title-main {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #111827;
  line-height: 1.1;
  margin-bottom: 4px;
}

.quote-company-legal {
  font-size: 10.5px;
  font-weight: 700;
  color: #1F2937;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.quote-company-sub {
  font-size: 9px;
  color: #4B5563;
  line-height: 1.4;
  margin-top: 1px;
}

.quote-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.quote-divider {
  height: 1px;
  background: #E5E7EB;
  margin-top: 8px;
  margin-bottom: 14px;
}

.quote-customer-box {
  background: #FAF8F5;
  border-radius: 4px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 2.3fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.quote-cust-label {
  font-size: 10px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}

.quote-cust-val {
  font-size: 10.5px;
  color: #374151;
  line-height: 1.35;
}

.quote-table-modern {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.quote-table-modern th {
  background: #E8ECEF;
  color: #1F2937;
  font-size: 10.5px;
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  border: none;
}

.quote-table-modern td {
  padding: 10px 12px;
  font-size: 10.5px;
  color: #374151;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: top;
}

.quote-section-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #B58900;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.quote-terms-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.quote-terms-list li {
  font-size: 9.5px;
  color: #374151;
  line-height: 1.5;
  margin-bottom: 3.5px;
  padding-left: 12px;
  position: relative;
}

.quote-terms-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #111827;
  font-weight: bold;
}

.quote-images-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.quote-image-card {
  display: flex;
  flex-direction: column;
}

.quote-image-frame {
  height: 155px;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
  background: #F9FAFB;
}

.quote-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quote-image-caption {
  font-size: 8.5px;
  color: #6B7280;
  margin-top: 4px;
  font-style: italic;
}

.quote-binding-notice {
  font-size: 8.8px;
  color: #4B5563;
  line-height: 1.45;
  margin-top: 14px;
  margin-bottom: 14px;
}

.quote-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 10px;
}

.quote-footer-contact {
  font-size: 9px;
  color: #6B7280;
  font-weight: 600;
}

.quote-footer-sign {
  text-align: right;
}

.quote-sign-company {
  font-size: 10.5px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 2px;
}

.quote-sign-sub {
  font-size: 9px;
  color: #6B7280;
}
/* ==========================================================================
   FASON KESİM & VERİM PDF RAPORU (A4 KURUMSAL RAPOR ŞABLONU)
   ========================================================================== */
.fason-report-paper {
  background: #FFFFFF !important;
  color: #1A202C !important;
  border-radius: var(--radius-sm);
  padding: 32px 36px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.fason-report-paper * {
  color: #1A202C;
}

.fason-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.8rem;
}

.fason-table th {
  background: #2D3748 !important;
  color: #FFFFFF !important;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  border: 1px solid #CBD5E0;
}

.fason-table td {
  padding: 8px 10px;
  border: 1px solid #E2E8F0;
  font-size: 0.8rem;
}

.fason-table tr:nth-child(even) {
  background: #F7FAFC;
}

@media print {
  body * { visibility: hidden; }
  .quote-paper, .quote-paper *,
  .fason-report-paper, .fason-report-paper * { 
    visibility: visible; 
  }
  .fason-report-paper, .quote-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 15px;
    box-shadow: none;
  }
  .modal-header, .modal-footer, .no-print {
    display: none !important;
  }
}

