/* SKP Supplier Portal - Custom Styles */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; }

body { font-family: 'Segoe UI', system-ui, sans-serif; }

/* Sidebar */
.sidebar { transition: all 0.3s ease; }
.sidebar .nav-item { 
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
  color: #cbd5e1; font-size: 14px; font-weight: 500;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar .nav-item.active { background: rgba(59,130,246,0.3); color: #93c5fd; border-left: 3px solid #3b82f6; }
.sidebar .nav-item i { width: 20px; text-align: center; }

/* Status Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-draft { background: #f1f5f9; color: #64748b; }
.badge-pending_signature { background: #fef3c7; color: #92400e; }
.badge-pending_approval { background: #dbeafe; color: #1e40af; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-invoiced { background: #ede9fe; color: #5b21b6; }
.badge-signed { background: #d1fae5; color: #065f46; }
.badge-sent { background: #dbeafe; color: #1e40af; }
.badge-payment_pending { background: #fef3c7; color: #92400e; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-promosi { background: #fce7f3; color: #9d174d; }
.badge-training { background: #e0e7ff; color: #3730a3; }
.badge-rebate { background: #dcfce7; color: #14532d; }

/* Cards */
.stat-card { 
  background: white; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1e293b; }
.stat-card .stat-label { font-size: 13px; color: #94a3b8; margin-top: 4px; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f8fafc; padding: 11px 14px; text-align: left; font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e2e8f0; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.data-table tr:hover td { background: #f8fafc; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-input { width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: #1e40af; color: white; }
.btn-primary:hover { background: #1e3a8a; }
.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-outline { background: transparent; color: #1e40af; border: 1.5px solid #1e40af; }
.btn-outline:hover { background: #1e40af; color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: white; border-radius: 16px; width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.25); }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 10px; }

/* Signature pad */
.sig-area { border: 2px dashed #94a3b8; border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; }
.sig-area:hover { border-color: #3b82f6; background: #f0f9ff; }
.sig-area.signed { border-color: #10b981; background: #f0fdf4; }

/* Progress steps */
.step-line { display: flex; align-items: center; gap: 0; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.step-dot.done { background: #10b981; color: white; }
.step-dot.active { background: #3b82f6; color: white; box-shadow: 0 0 0 4px rgba(59,130,246,0.2); }
.step-dot.pending { background: #e2e8f0; color: #94a3b8; }
.step-connector { flex: 1; height: 2px; }
.step-connector.done { background: #10b981; }
.step-connector.pending { background: #e2e8f0; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Notification badge */
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; position: absolute; top: -2px; right: -2px; }

/* Print */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { background: white; }
  .invoice-print { max-width: 100%; }
}

/* Loading spinner */
.spinner { width: 24px; height: 24px; border: 3px solid #e2e8f0; border-top-color: #3b82f6; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 60px !important; }
  .sidebar .nav-label { display: none; }
  .stat-card .stat-value { font-size: 22px; }
  .modal-box { margin: 10px; max-height: 95vh; }
}

/* Invoice layout */
.invoice-header { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); color: white; padding: 30px; border-radius: 12px 12px 0 0; }
.invoice-body { padding: 30px; }
.invoice-table th { background: #f8fafc; }
.invoice-stamp { border: 3px solid #10b981; color: #10b981; padding: 8px 16px; border-radius: 4px; font-weight: 700; font-size: 13px; transform: rotate(-5deg); display: inline-block; }

/* Chip */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #e2e8f0; color: #475569; }
