﻿/* ==========================================================================
   khotwa LOGISTICS ERP - EXTENDED VIEWS STYLESHEET (extended-views.css)
   Adds support for all 16 views, data tables, thermal AWB printing,
   warehouse rack grids, courier fleet cards, and interactive toasts.
   ========================================================================== */

/* Active View Containers */
.ops-view-container {
  display: none;
  animation: fadeInView 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ops-view-container.active-view {
  display: block;
}

@keyframes fadeInView {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb & Section Navigation */
.view-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0f2fe;
}

.view-header-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-header-title i {
  color: #0284c7;
}

.view-header-actions {
  display: flex;
  gap: 8px;
}

/* Premium Data Tables */
.ops-table-card {
  background: #ffffff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.table-toolbar {
  padding: 1rem 1.25rem;
  background: #f0f9ff;
  border-bottom: 1px solid #e0f2fe;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-search-input {
  height: 36px;
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  min-width: 240px;
  outline: none;
}

.table-search-input:focus {
  border-color: #0284c7;
}

.ops-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.86rem;
}

.ops-data-table th {
  background: #f0f9ff;
  color: #881337;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid #e0f2fe;
  user-select: none;
}

.ops-data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f8fafc;
  color: #334155;
  vertical-align: middle;
}

.ops-data-table tbody tr:hover {
  background: #fff5f7;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-status-delivered { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-status-sorting { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-status-transit { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-status-returned { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-status-scrapped { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* Warehouse Rack Visual Grid */
.warehouse-rack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.bin-rack-card {
  background: #ffffff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.bin-rack-card:hover {
  transform: translateY(-2px);
  border-color: #0284c7;
  box-shadow: 0 8px 20px rgba(2, 132, 199,  0.1);
}

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

.bin-barcode-code {
  font-family: var(--font-en);
  font-weight: 700;
  color: #0284c7;
  font-size: 0.95rem;
}

.bin-progress-wrap {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 6px;
}

.bin-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  transition: width 0.3s;
}

/* Courier Fleet Cards */
.courier-fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.courier-card {
  background: #ffffff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.courier-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.courier-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #1d4ed8);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.courier-stats-row {
  display: flex;
  justify-content: space-between;
  background: #f0f9ff;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* Thermal Air Waybill (AWB) 4x6 / A6 Style */
.thermal-awb-box {
  width: 360px;
  background: #ffffff;
  border: 2px dashed #000;
  border-radius: 4px;
  padding: 16px;
  margin: 0 auto;
  font-family: var(--font-arabic), var(--font-en);
  color: #000000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.awb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.awb-barcode-display {
  text-align: center;
  padding: 8px 0;
  border-bottom: 1px solid #000;
  margin-bottom: 8px;
}

.awb-barcode-lines {
  height: 44px;
  background: repeating-linear-gradient(
    90deg,
    #000 0px,
    #000 2px,
    #fff 2px,
    #fff 4px,
    #000 4px,
    #000 7px,
    #fff 7px,
    #fff 9px
  );
  margin-bottom: 4px;
}

.awb-cod-box {
  border: 2px solid #000;
  background: #f8fafc;
  padding: 8px;
  text-align: center;
  margin: 8px 0;
}

.awb-cod-amount {
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--font-en);
}

/* Branch & Action Dropdowns */
.ops-dropdown-menu-box {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 100;
  padding: 6px 0;
  margin-top: 6px;
}

.ops-dropdown-menu-box.active {
  display: block;
}

.ops-dropdown-item {
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ops-dropdown-item:hover {
  background: #e0f2fe;
  color: #0284c7;
}

/* Toast Notifications */
.khotwa-toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.khotwa-toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 4px solid #0284c7;
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes slideToast {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Modal Max Width Expansion */
.ops-modal-window.large-modal {
  max-width: 850px;
}
