/* ═══════════════════════════════════════════════════════
   Variables
════════════════════════════════════════════════════════ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --sidebar-bg: #0f172a;
  --sidebar-w: 250px;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════════════════════
   Base
════════════════════════════════════════════════════════ */
* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════
   Login Page
════════════════════════════════════════════════════════ */
.login-bg {
  background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.login-card h4 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.login-card .form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card .form-control {
  border-radius: 10px;
  border: 1.5px solid var(--border);
  padding: 11px 14px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.login-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-login {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  margin-top: 8px;
}

.btn-login:hover {
  background: var(--primary-dark);
}
.btn-login:active {
  transform: scale(0.98);
}
.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════
   Dashboard Layout
════════════════════════════════════════════════════════ */
.dashboard-body {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-hidden {
  transform: translateX(var(--sidebar-w));
}

.sidebar-header {
  padding: 28px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.sidebar-logo {
  font-size: 2rem;
}

.sidebar-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.88rem;
  border-right: 3px solid transparent;
  transition: all 0.18s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
}

.sidebar-link.active {
  background: rgba(37, 99, 235, 0.2);
  color: #fff;
  border-right-color: var(--primary);
  font-weight: 600;
}

.sidebar-link-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
}

.sidebar-section-label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.25);
  padding: 14px 20px 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 10px;
  text-align: center;
}

.btn-logout {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.83rem;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.3);
}

/* ── Main Content ── */
.main-content {
  margin-right: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Topbar ── */
.topbar {
  background: var(--card-bg);
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 14px;
}

.topbar-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.btn-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  transition: all 0.18s;
}

.btn-toggle:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Content Area ── */
.content-area {
  flex: 1;
  padding: 24px;
}

/* ═══════════════════════════════════════════════════════
   Cards
════════════════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-body {
  padding: 20px;
}

/* ═══════════════════════════════════════════════════════
   Buttons
════════════════════════════════════════════════════════ */
.btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 9px 20px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}
.btn-success:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.btn-ghost {
  background: #fff;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.btn-ghost:hover {
  background: #f8fafc;
  color: var(--text);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
  border-radius: 8px;
}
.btn-lg {
  padding: 12px 28px;
  font-size: 0.95rem;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Table action buttons */
.btn-tbl-edit,
.btn-tbl-del,
.btn-tbl-view,
.btn-tbl-send {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.btn-tbl-edit {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.btn-tbl-edit:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.btn-tbl-del {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-tbl-del:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.25);
}

/* ═══════════════════════════════════════════════════════
   Form Controls
════════════════════════════════════════════════════════ */
.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: block;
}

.form-control,
.form-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 0.88rem;
  color: var(--text);
  background: #fff;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
  outline: none;
  font-family: inherit;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* ═══════════════════════════════════════════════════════
   Orders Table
════════════════════════════════════════════════════════ */
.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.orders-table th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: #64748b;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 12px 14px;
  border-bottom: 2px solid #e2e8f0;
  text-align: center;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.orders-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  vertical-align: middle;
  color: var(--text);
}

.orders-table tbody tr:hover {
  background: #f8fafc;
}
.orders-table tbody tr:last-child td {
  border-bottom: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   Filters Bar
════════════════════════════════════════════════════════ */
.filters-bar {
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
  border-radius: 16px;
  border: 1.5px solid var(--border);
  padding: 18px 22px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  position: relative;
}

.filters-bar::before {
  content: "🔍";
  position: absolute;
  top: -12px;
  right: 18px;
  background: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 150px;
}

.filter-group .form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-group .form-control,
.filter-group .form-select {
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.84rem;
  background: #fff;
  transition: all 0.18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-group .form-control:focus,
.filter-group .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.filters-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

/* ═══════════════════════════════════════════════════════
   Step Form (Multi-step order form)
════════════════════════════════════════════════════════ */

/* Progress steps */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 20px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-item.done:not(:last-child)::after,
.step-item.active:not(:last-child)::after {
  background: var(--primary);
}

.step-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all 0.25s;
}

.step-item.active .step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.step-item.done .step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.step-item.active .step-label {
  color: var(--primary);
}
.step-item.done .step-label {
  color: var(--primary);
}

/* Step panels */
.step-panel {
  display: none;
}
.step-panel.active {
  display: block;
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.step-heading-icon {
  font-size: 1.4rem;
}

.step-heading-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

/* Step nav buttons */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════
   Lookup Table Page
════════════════════════════════════════════════════════ */
.lookup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.lookup-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  text-align: right;
}

.lookup-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.lookup-table tbody tr:last-child td {
  border-bottom: none;
}
.lookup-table tbody tr:hover {
  background: #f8fafc;
}

/* Inline add/edit form */
.inline-form {
  background: var(--primary-soft);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════
   Toast
════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast-item {
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  min-width: 240px;
  max-width: 380px;
  text-align: center;
  justify-content: center;
}

.toast-item.success {
  background: #14532d;
  border: 1px solid #16a34a;
}
.toast-item.danger {
  background: #7f1d1d;
  border: 1px solid #dc2626;
}
.toast-item.warning {
  background: #78350f;
  border: 1px solid #d97706;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
}

/* ═══════════════════════════════════════════════════════
   Empty state
════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.empty-state-text {
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════
   Quick add option in select
════════════════════════════════════════════════════════ */
.add-new-option {
  color: var(--primary);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   Responsive
════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(var(--sidebar-w));
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-right: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .step-label {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════
   Order View (Read-only)
════════════════════════════════════════════════════════ */
.view-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px 24px;
}

.view-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.view-value {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}

/* View button in table */
.btn-tbl-view {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-tbl-view:hover {
  background: var(--success);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════
   Role Badges
════════════════════════════════════════════════════════ */
.role-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.role-admin {
  background: #fef3c7;
  color: #92400e;
}
.role-finance {
  background: #dbeafe;
  color: #1e40af;
}
.role-shipping {
  background: #d1fae5;
  color: #065f46;
}
.role-receiver {
  background: #ede9fe;
  color: #5b21b6;
}

/* ═══════════════════════════════════════════════════════
   Readonly section indicator
════════════════════════════════════════════════════════ */
.readonly-section .step-heading-text {
  color: var(--text-muted);
}

.readonly-badge {
  font-size: 0.72rem;
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  margin-right: auto;
  font-weight: 600;
}

.form-control:disabled,
.form-select:disabled {
  background: #f8fafc;
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* ═══════════════════════════════════════════════════════
   Layout root — fills full viewport
════════════════════════════════════════════════════════ */
#layout-root {
  display: flex;
  min-height: 100vh;
  width: 100%;
  flex: 1;
}

body.dashboard-body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.btn-tbl-view {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.btn-tbl-view:hover {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.25);
}

.btn-tbl-send {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}
.btn-tbl-send:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

.role-logistics {
  background: #fff7ed;
  color: #9a3412;
}
/* ═══════════════════════════════════════════════════════
   Documents Panel
════════════════════════════════════════════════════════ */
.docs-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  transition: border-color 0.15s;
}
.doc-row:hover {
  border-color: #94a3b8;
}

.doc-row-pending {
  border-style: dashed;
  background: #fffbeb;
  border-color: #fde68a;
}

.doc-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.doc-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  flex: 1;
}

.doc-name-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  min-width: 0;
}
.doc-name-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.doc-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.doc-filename {
  font-size: 0.72rem;
  color: #94a3b8;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-doc-download {
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-doc-download:hover {
  background: #2563eb;
  color: #fff;
}

.btn-doc-del {
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.8rem;
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-doc-del:hover {
  background: #dc2626;
  color: #fff;
}

.doc-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  margin-top: 4px;
  transition: border-color 0.15s;
}
.doc-add-row:hover {
  border-color: var(--primary);
}

.btn-doc-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-doc-pick:hover {
  background: var(--primary-dark);
}

.docs-empty {
  text-align: center;
  padding: 24px;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ── PDF View button ──────────────────────────────────── */
.btn-doc-view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #f5f3ff;
  color: #7c3aed;
  border: 1.5px solid #ddd6fe;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-doc-view:hover {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

/* ── PDF Viewer Modal ─────────────────────────────────── */
.pdf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.pdf-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.pdf-modal-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-modal-close {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.pdf-modal-close:hover {
  background: #dc2626;
  color: #fff;
}

.pdf-modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
}

/* ═══════════════════════════════════════════════════════
   Orders Sections (3 tables)
════════════════════════════════════════════════════════ */
.orders-section {
  margin-bottom: 28px;
}

.orders-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: -1px;
}

.orders-section-header.pending {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
  border: 1.5px solid #fde68a;
}
.orders-section-header.active {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: #166534;
  border: 1.5px solid #bbf7d0;
}
.orders-section-header.closed {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  color: #475569;
  border: 1.5px solid #e2e8f0;
}

.orders-section-count {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

/* Approve button */
.btn-tbl-approve {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  background: #f0fdf4;
  color: #16a34a;
  border: 1.5px solid #bbf7d0;
}
.btn-tbl-approve:hover {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.25);
}

/* ═══════════════════════════════════════════════════════
   Floating Docs Button & Panel
════════════════════════════════════════════════════════ */
.btn-floating-docs {
  position: fixed;
  top: 80px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.2s;
}
.btn-floating-docs:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.floating-docs-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: #dc2626;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.floating-docs-panel {
  position: fixed;
  top: 136px;
  left: 20px;
  width: 320px;
  max-height: 480px;
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  z-index: 999;
  flex-direction: column;
  overflow: hidden;
  animation: slideDown 0.18s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating-docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.floating-docs-panel > div:last-child {
  overflow-y: auto;
  flex: 1;
}

/* ── Mini Docs Widget (inside each step) ─────────────────── */
.mini-docs-widget {
  margin-top: 20px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  transition: border-color 0.2s;
}
.mini-docs-widget:hover {
  border-color: var(--primary);
}

.mini-docs-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* ── Custom Fee Rows ─────────────────────────────────────── */
.custom-fee-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.custom-fee-row .custom-fee-label {
  flex: 1;
}
/* ── Sign button ─────────────────────────────────────────── */
.btn-tbl-sign {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  background: #eff6ff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
}
.btn-tbl-sign:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}
.highlight-input:not(:placeholder-shown) {
  background-color: #d4edda !important; /* أخضر خفيف */
  border-color: #28a745 !important; /* حدود خضراء */
  color: #155724 !important; /* لون الخط */
  font-weight: bold;
}
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}

.fees-subsection-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.fees-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
}

.add-fee-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  margin-top: 6px;
}

.add-fee-btn {
  white-space: nowrap;
  font-weight: bold;
  height: 32px;
  display: flex;
  align-items: center;
}
