/* Ensure uniform contact card height and grid alignment */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
  align-items: stretch;
}

.contact-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 340px;
  box-sizing: border-box;
}
/* Modal Styles (ensure all modals work) */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.35);
  align-items: center;
  justify-content: center;
}
.modal[style*="display: block"], .modal.active {
  display: flex !important;
}
.modal-content {
  background: #fff;
  margin: auto;
  padding: 32px 28px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  min-width: 320px;
  max-width: 98vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.35);
  align-items: center;
  justify-content: center;
}
.modal[style*="display: block"], .modal.active {
  display: flex !important;
}
.modal-content {
  background: #fff;
  margin: auto;
  padding: 32px 28px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  min-width: 320px;
  max-width: 98vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
/* Professional theme — clean and minimal */
:root{
  --black: #1a1d29;
  --white: #ffffff;
  --muted: #6b7280;
  --panel: #f5f6f8;
  --surface: #fbfbfc;
  --contrast: #1a1d29;
  --sidebar-bg: #f8f9fa;
  --sidebar-text: #5a6c7d;
  --sidebar-hover: #e8eaed;
  --sidebar-active: #e8eaed;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --secondary-dark: #475569;
  --success: #10b981;
  --danger: #ef4444;
  --border-color: #e5e7eb;
  --glass: rgba(0,0,0,0.04);
  --focus: rgba(17,24,39,0.08);
  --radius-sm: 6px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(3,3,3,0.08);
  --transition-fast: 180ms ease;
}

*{box-sizing:border-box}
html,body,#root{height:100%}
body{
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  margin:0;
  background: linear-gradient(180deg,var(--white) 0%, var(--surface) 100%);
  color:var(--contrast);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
}

a{color:inherit;text-decoration:none;transition:color var(--transition-fast)}

.app{display:flex;min-height:100vh}

.sidebar{
  width:260px;
  background:var(--sidebar-bg);
  color:var(--sidebar-text);
  padding:24px 16px;
  position:fixed;
  height:100vh;
  overflow:auto;
  box-shadow:none;
  border-right:1px solid #e5e7eb;
}
.sidebar .logo{display:flex;align-items:center;gap:12px;margin-bottom:28px;padding:0 8px}
.sidebar h2{margin:0;font-size:16px;font-weight:600;color:var(--contrast)}

.nav{list-style:none;padding:0;margin:0}
.nav li{padding:10px 12px;border-radius:6px;cursor:pointer;color:var(--sidebar-text);margin-bottom:4px;font-size:14px;transition:background var(--transition-fast),color var(--transition-fast);display:flex;align-items:center;gap:12px}
.nav li a{color:inherit;text-decoration:none;display:flex;align-items:center;gap:12px;width:100%}
.nav li:hover{background:var(--sidebar-hover);color:var(--contrast)}
.nav .active{background:var(--sidebar-active);color:var(--contrast);font-weight:600}
.nav li .icon{font-size:18px;width:20px;display:inline-flex;align-items:center;justify-content:center;opacity:0.7}
.nav li:hover .icon,.nav .active .icon{opacity:1}

.main{margin-left:260px;flex:1;padding:0;background:var(--panel);min-height:100vh}

.topbar{
  height:64px;
  background:var(--white);
  color:var(--contrast);
  display:flex;align-items:center;justify-content:space-between;padding:0 32px;border-bottom:1px solid #e5e7eb;
  position:sticky;top:0;z-index:100;
}
.topbar .brand{display:flex;align-items:center;gap:12px}
.topbar .brand img{height:28px}
.topbar .breadcrumb{font-size:14px;color:var(--muted);display:flex;align-items:center;gap:8px}
.topbar .breadcrumb span{color:var(--contrast);font-weight:500}
.topbar .user-section{display:flex;align-items:center;gap:16px}
.topbar .user-section .username{font-weight:500;font-size:14px}

.card{background:var(--white);border-radius:var(--radius);padding:24px;margin:20px 32px;box-shadow:var(--shadow-sm);border:1px solid #e5e7eb}
.card.header{display:flex;align-items:center;justify-content:space-between;gap:16px}
.card h3{margin:0 0 20px;font-size:16px;font-weight:600;color:var(--contrast)}

.kpi-grid{display:flex;gap:16px;flex-wrap:wrap}
.kpi{flex:1;min-width:160px;background:linear-gradient(180deg,#fff,#fbfbfd);padding:16px;border-radius:10px;border:1px solid rgba(0,0,0,0.04);box-shadow:0 6px 20px rgba(3,3,3,0.04)}

.form-control{width:100%;padding:10px 14px;border-radius:var(--radius-sm);border:1px solid #d1d5db;background:var(--white);font-size:14px;color:var(--contrast);transition:all 160ms}
.form-control:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,0.08)}
.form-control::placeholder{color:#9ca3af}
.form-row{display:flex;gap:12px}
label{display:block;font-weight:500;margin-bottom:8px;color:var(--contrast);font-size:14px}
select.form-control{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px;cursor:pointer}
textarea.form-control{resize:vertical;min-height:100px}
input[type=file].form-control{border:1px dashed #d1d5db;padding:12px;cursor:pointer}
input[type=file].form-control:hover{border-color:#9ca3af;background:#f9fafb}

/* buttons */
.btn{display:inline-block;padding:10px 20px;background:var(--primary);color:var(--white);border:none;border-radius:6px;cursor:pointer;font-size:14px;font-weight:500;text-decoration:none;transition:all 160ms;text-align:center;box-shadow:0 1px 3px rgba(0,0,0,0.08)}
.btn:hover{background:var(--primary-dark);box-shadow:0 2px 6px rgba(0,0,0,0.12)}
.btn-secondary{background:var(--secondary);color:var(--white)}
.btn-secondary:hover{background:var(--secondary-dark)}
.btn-success{background:var(--success);color:var(--white)}
.btn-success:hover{background:#059669}
.btn-danger{background:var(--danger);color:var(--white)}
.btn-danger:hover{background:#dc2626}
.btn-sm{padding:7px 16px;font-size:13px}
.btn-block{display:block;width:100%}
.btn-outline{background:transparent;border:1px solid #d1d5db;color:var(--contrast);box-shadow:none}
.btn-outline:hover{background:#f9fafb;border-color:#9ca3af}

.table{width:100%;border-collapse:collapse;background:var(--white);border-radius:8px;overflow:hidden}
.table th,.table td{padding:14px 16px;border-bottom:1px solid #f3f4f6;text-align:left}
.table thead th{background:#f9fafb;color:var(--muted);font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:0.025em}
.table tbody tr{transition:background 160ms}
.table tbody tr:hover{background:#f9fafb}
.table tbody tr:last-child td{border-bottom:none}

.small{font-size:13px;color:var(--muted)}
.center{display:flex;align-items:center;justify-content:center}

.login-bg{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#0b0b0c 0%, #0b0b0c 100%)}
.login-card{width:520px;background:var(--white);border-radius:var(--radius);padding:36px;box-shadow:var(--shadow-lg);text-align:center}
.login-card h2{margin:0 0 18px;font-size:24px}

.input-icon{position:relative}
.input-icon input{padding-left:44px}
.input-icon .icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);opacity:0.6}

.footer{margin-top:18px;font-size:13px;color:var(--muted)}

.logo-placeholder{height:72px;width:220px;background:linear-gradient(90deg,#f3f4f6,#fff);display:inline-flex;align-items:center;justify-content:center;border-radius:8px;color:#222;font-weight:700}
.sidebar .small-muted{font-size:12px;color:rgba(255,255,255,0.6);margin-top:8px}

/* badges and status */
.badge{display:inline-block;padding:4px 10px;border-radius:12px;font-size:12px;font-weight:500;line-height:1}
.badge.pending{background:#fef3c7;color:#92400e}
.badge.approved{background:#d1fae5;color:#065f46}
.badge.rejected{background:#fee2e2;color:#991b1b}
.badge.active{background:#dbeafe;color:#1e40af}
.badge.open{background:#e0e7ff;color:#3730a3}
.badge.processing{background:#fef3c7;color:#92400e}
.badge.in-transit{background:#dbeafe;color:#1e40af}
.badge.at-destination-port{background:#e0e7ff;color:#4338ca}
.badge.customs-clearance{background:#fef3c7;color:#b45309}
.badge.out-for-delivery{background:#bbf7d0;color:#15803d}
.badge.delivered{background:#d1fae5;color:#065f46}

/* utilities */
.muted{color:var(--muted)}
.text-right{text-align:right}
.text-center{text-align:center}
.mb-8{margin-bottom:8px}
.mb-12{margin-bottom:12px}
.mb-16{margin-bottom:16px}
.mb-20{margin-bottom:20px}
.mt-12{margin-top:12px}
.mt-16{margin-top:16px}
.mt-20{margin-top:20px}
.flex{display:flex}
.flex-between{display:flex;justify-content:space-between;align-items:center}
.flex-center{display:flex;justify-content:center;align-items:center}
.gap-8{gap:8px}
.gap-12{gap:12px}
.gap-16{gap:16px}

/* Pagination styles */
.pagination{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:20px;justify-content:center}
.pagination .page-item{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 10px;border-radius:6px;background:var(--white);border:1px solid #e5e7eb;color:var(--contrast);text-decoration:none;font-size:14px;font-weight:500;transition:all 160ms}
.pagination .page-item:hover{background:#f9fafb;border-color:var(--primary);color:var(--primary)}
.pagination .page-item.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.pagination .page-item.disabled{opacity:0.4;pointer-events:none;cursor:not-allowed}
.pagination .ellipsis{color:var(--muted);padding:0 6px}


/* Form styles */
.input, .form-control, input[type="text"], input[type="email"], input[type="password"], 
input[type="number"], input[type="date"], input[type="datetime-local"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 160ms, box-shadow 160ms;
}
.input:focus, .form-control:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}
label input, label select, label textarea {
  margin-top: 4px;
}
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 16px;
}

.form-row .form-group {
  margin-bottom: 0;
}

/* Alert messages */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

@media (max-width:1000px){
  .sidebar{width:220px}
  .main{margin-left:220px;padding:20px}
}

@media (max-width:800px){
  .sidebar{display:none}
  .main{margin-left:0;padding:16px}
  .login-card{width:92%}
  .form-row{flex-direction:column}
}

/* Sidebar collapse and mobile slide-in */
.sidebar{transition:width 220ms var(--transition-fast), transform 220ms var(--transition-fast)}
.app.sidebar-collapsed .sidebar{width:72px}
.app.sidebar-collapsed .main{margin-left:72px}
.sidebar h2{transition:opacity 180ms}
.app.sidebar-collapsed .sidebar h2{opacity:0}
.sidebar .nav li{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* topbar hamburger */
.hamburger{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;background:transparent;border:none;border-radius:6px;margin-right:12px;cursor:pointer;flex-direction:column;gap:4px;padding:8px}
.hamburger span{display:block;width:20px;height:2px;background:var(--muted);border-radius:2px;transition:all 160ms}
.hamburger:hover span{background:var(--contrast)}
.app.sidebar-collapsed .hamburger span{background:var(--muted)}

/* mobile open state: sidebar overlays content */
.app .sidebar{transform:none}
@media (max-width:800px){
  .sidebar{position:fixed;left:0;top:0;bottom:0;transform:translateX(-110%);z-index:1200;width:260px}
  .app.sidebar-open .sidebar{transform:translateX(0);box-shadow:2px 0 24px rgba(3,3,3,0.2)}
  .sidebar-overlay{position:fixed;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,0.4);z-index:1100;display:block}
}

/* Layout helpers for pages using main-content/content wrappers */
.main-content{margin-left:260px;flex:1;min-height:100vh;background:var(--panel)}
.content{padding:24px 32px}
@media (max-width:1000px){.main-content{margin-left:220px}}
@media (max-width:800px){.main-content{margin-left:0}}

/* Reusable stat cards */
.stats-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin-bottom:30px}
.stat-card{background:var(--white);border:1px solid var(--border-color);border-radius:12px;padding:24px;box-shadow:var(--shadow-sm);transition:all 0.2s ease}
.stat-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,0.1)}
.stat-card h3{margin:0;font-size:32px;line-height:1.2;font-weight:700;color:var(--primary)}
.stat-card p{margin:8px 0 0;color:var(--muted);font-size:13px;text-transform:uppercase;letter-spacing:.03em;font-weight:500}
@media (max-width:1100px){.stats-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:600px){.stats-row{grid-template-columns:1fr}}

