/**
 * POWERTRAC Check Management System - Styles
 * Matching UI peg specifications
 */

/* CSS Variables - Color Tokens */
:root {

  /* Branding Colors */
  --bg-grey: #F1F7FD;
  --primary-blue: #012280;

  /* Primary Blues */
  --blue-900: #0b2a6f;
  --blue-800: #123a92;
  --blue-700: #1a4bb7;
  --blue-600: #2f6fe3;
  --blue-500: #4a86ff;
  --blue-50: #eef5ff;
  
  /* Grays */
  --gray-900: #0f172a;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #94a3b8;
  --gray-400: #cbd5e1;
  --gray-300: #e5e7eb;
  --gray-200: #f1f5f9;
  --gray-100: #f8fafc;
  
  /* Semantic Colors */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #0284c7;
  
  /* UI Constants */
  --border-radius: 14px;
  --shadow-soft: 0 8px 24px rgba(2, 10, 60, 0.06);
  --shadow-medium: 0 4px 12px rgba(2, 10, 60, 0.08);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  color: var(--gray-900);
  background-color: var(--gray-100);
}

/* Top Navigation */
.top-nav {
  background: white;
  border-bottom: 1px solid var(--gray-300);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-800);
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--blue-600);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--gray-100);
  border-radius: 24px;
  color: var(--gray-700);
  font-weight: 500;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

/* Primary Tabs */
.primary-tabs {
  background: white;
  border-bottom: 1px solid var(--gray-300);
  padding: 0 24px;
  display: flex;
  gap: 32px;
}

.primary-tab {
  padding: 16px 4px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.primary-tab:hover {
  color: var(--blue-700);
}

.primary-tab.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-600);
}

/* Container */
.container {
  /* max-width: 1200px; */
  margin: 0 auto;
  padding: 24px;
}

/* Card */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-300);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--gray-600);
}

.card-body {
  padding: 24px;
}

/* Segment Tabs (inside cards) */
.segment-tabs {
  display: flex;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--gray-300);
}

.segment-tab {
  padding: 14px 4px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.segment-tab:hover {
  color: var(--blue-700);
}

.segment-tab.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-600);
}

/* Card Actions */
.card-actions {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gray-300);
}

.card-actions-left,
.card-actions-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Buttons */
.login-btn{
  padding: 15px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  align-items: center;
  gap: 8px;
  background: var(--primary-blue);
  color: white;
}


.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--blue-700);
}

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

.btn-success:hover {
  background: #15803d;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  background: #d97706;
}

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

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-400);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-500);
}

.btn-secondary {
  background: var(--gray-700);
  color: white;
}

.btn-secondary:hover {
  background: var(--gray-900);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.icon-btn {
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--gray-200);
  color: var(--blue-700);
}

/* Status Badges */
.badge {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

.badge-accepted {
  background: #dbeafe;
  color: #1e40af;
}

.badge-deposited {
  background: #fef3c7;
  color: #92400e;
}

.badge-cleared {
  background: #d1fae5;
  color: #065f46;
}

.badge-returned {
  background: #fee2e2;
  color: #991b1b;
}

.badge-replaced {
  background: #e9d5ff;
  color: #6b21a8;
}

.badge-pending {
  background: #fed7aa;
  color: #9a3412;
}

.badge-redeposited {
  background: #dbeafe;
  color: #1e40af;
}

.badge-verified {
  background: #e0e7ff;
  color: #3730a3;
}

/* Table */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--gray-100);
}

.table thead th {
  background: #f9fafb;
}

.table th {
  padding: 15px 18px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 11px 18px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
  font-size: 14px;
}

.table tr:hover {
  background: var(--gray-50);
}

.table td.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-300);
}

.pagination-info {
  color: var(--gray-600);
  font-size: 13px;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--gray-400);
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--gray-100);
  border-color: var(--blue-600);
}

.page-btn.active {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--gray-400);
  border-radius: 10px;
  font-size: 14px;
  color: var(--gray-900);
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-50);
}

/* Disable scroll on number inputs */
input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Prevent scroll wheel from changing number values */
input[type="number"]:focus {
  pointer-events: none;
}

input[type="number"]:hover {
  pointer-events: auto;
}

.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-400);
  border-radius: 10px;
  font-size: 14px;
  color: var(--gray-900);
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-50);
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

/* Messages/Alerts */
.messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.message {
  padding: 14px 18px;
  margin-bottom: 10px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-medium);
  animation: slideIn 0.3s ease-out;
}

.message-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.message-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.message-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning);
}

.message-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--info);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Utilities */
.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--gray-600);
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.flex {
  display: flex;
}

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

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

/* Dropdown Component */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0;
  background: white;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 12px rgba(2, 10, 60, 0.15);
  min-width: 180px;
  z-index: 100;
  border: 1px solid var(--gray-300);
  border-top: none;
  overflow: hidden;
}

.dropdown:hover .dropdown-menu {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

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

.dropdown-item {
  display: block;
  padding: 12px 16px;
  color: var(--gray-900);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--gray-100);
}

/* Modal Component */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 14px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(2, 10, 60, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  z-index: 1001;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--gray-600);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-300);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* File Upload Component */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--gray-400);
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: var(--gray-50);
}

.file-upload-area:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.file-upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-prompt {
  pointer-events: none;
}

.file-upload-prompt svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--blue-600);
}

.file-upload-prompt p {
  margin: 8px 0 0;
  color: var(--gray-900);
  font-weight: 500;
}

.file-upload-prompt .text-muted {
  font-size: 13px;
  margin-top: 4px;
}

.file-name {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--blue-50);
  border-radius: 8px;
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 500;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.alert-info {
  background: var(--blue-50);
  color: var(--blue-900);
  border-left: 4px solid var(--blue-600);
}