@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131a2d;
  --bg-tertiary: #1e294b;
  --primary: #f97316; /* Cargo Safety Orange */
  --primary-hover: #ea580c;
  --accent-green: #10b981; /* Success / Paid */
  --accent-blue: #3b82f6; /* Info / Transit */
  --accent-yellow: #f59e0b; /* To Pay / Pending */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(249, 115, 22, 0.4);
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & general rules */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* login page styles */
.login-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  background: rgba(19, 26, 45, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), #b45309);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.logo-text span {
  color: var(--primary);
}

.header-tracking {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-primary);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.header-tracking input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 160px;
}

.header-tracking button {
  background: var(--primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
}
.header-tracking button:hover {
  background: var(--primary-hover);
}

/* Login Main Container */
.login-main {
  flex: 1;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.login-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .login-grid-2x2 {
    grid-template-columns: 1fr;
  }
  .login-header {
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 15px;
  }
  .login-main {
    padding: 1.5rem;
  }
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: var(--transition);
}

.login-card:hover::before {
  opacity: 1;
}

.login-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.login-card-title i {
  color: var(--primary);
}

/* Auth Toggle */
.auth-toggle-group {
  display: flex;
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.auth-toggle-btn {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
}

.auth-toggle-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 10px 38px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
  outline: none;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #ea580c);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
  margin-top: 1rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.btn-submit:active {
  transform: translateY(0);
}

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

.news-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.news-table th {
  padding: 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.news-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.news-date {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  font-size: 0.85rem;
}

.news-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.news-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Support and Download Grid Items */
.support-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}

.support-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.support-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.support-info p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.download-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
}

.download-item:hover {
  border-color: var(--primary);
  background: rgba(249, 115, 22, 0.03);
}

.download-item i {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.download-item span {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Footer style */
.login-footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Error/Notification Alerts */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}


/* dashboard page styles */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar navigation */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-menu {
  padding: 1.5rem 1rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}

.menu-item a i {
  font-size: 1.1rem;
}

.menu-item.active a,
.menu-item a:hover {
  background: rgba(249, 115, 22, 0.08);
  color: var(--text-main);
}

.menu-item.active a {
  border-left: 3px solid var(--primary);
  padding-left: 9px;
  color: var(--primary);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid var(--border);
}

.user-info h5 {
  font-size: 0.85rem;
  font-weight: 600;
}
.user-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 4px;
}
.btn-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Dashboard main content */
.main-content {
  flex: 1;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-title h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.content-body {
  padding: 2rem;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-tab {
  display: none;
}
.dashboard-tab.active {
  display: block;
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.metric-details h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-details h3 {
  font-size: 1.8rem;
  font-weight: 700;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
}

/* parcel booking form */
.booking-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 1100px) {
  .booking-grid {
    grid-template-columns: 1fr;
  }
}

.section-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.panel-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.booking-form-select {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
}
.booking-form-select:focus {
  border-color: var(--primary);
  outline: none;
}

.booking-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  resize: vertical;
  height: 70px;
}
.booking-textarea:focus {
  border-color: var(--primary);
  outline: none;
}

/* Tariff & Billing Breakdown Display */
.tariff-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.tariff-row span {
  color: var(--text-muted);
}

.tariff-row input {
  width: 120px;
  text-align: right;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
}
.tariff-row input:focus {
  border-color: var(--primary);
  outline: none;
}

.total-row {
  border-top: 2px dashed var(--border);
  margin-top: 10px;
  padding-top: 10px;
  font-size: 1.15rem;
  font-weight: 700;
}
.total-row span {
  color: var(--text-main);
}
.total-row .total-value {
  color: var(--primary);
}

/* Action Buttons bar */
.actions-bar {
  display: flex;
  gap: 10px;
  margin-top: 1.5rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
}

/* table grids */
.table-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(19, 26, 45, 0.9);
  padding: 14px 16px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-paid {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.badge-topay {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
}

.badge-account {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.badge-status {
  border-radius: 12px;
  padding: 3px 10px;
}

.badge-status.booked {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-status.transit {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-icon {
  background: var(--bg-tertiary);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.btn-icon:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 650px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.btn-close-modal {
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
}
.btn-close-modal:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* printer friendly lr layout */
.lr-print-receipt {
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  padding: 5px;
  line-height: 1.3;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

.lr-sticker {
  flex: 1;
  background: #fff;
  padding: 8px;
  border: 1px dashed #ccc;
  box-sizing: border-box;
  min-width: 170px;
  max-width: 49%;
}

.lr-sticker-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  column-gap: 5px;
  row-gap: 6px;
}

.lr-col-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}

.lr-bold-label {
  font-weight: 800;
  color: #000;
  font-size: 14px;
  text-transform: uppercase;
}

.lr-value {
  font-weight: 500;
  color: #111;
  font-size: 20px;
}

.lr-span-2 {
  grid-column: span 2;
}

.lr-sticker-disclaimer {
  grid-column: span 2;
  font-size: 10px;
  line-height: 1.1;
  border-top: 1px dashed #000;
  margin-top: 3px;
  padding-top: 2px;
  font-weight: 500;
  color: #333;
}

/* Hide print layout by default in the web app screen, except inside print preview */
@media print {
  body * {
    visibility: hidden;
  }
  .lr-print-receipt, .lr-print-receipt * {
    visibility: visible;
  }
  .lr-print-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    padding: 0;
    margin: 0;
  }
  .lr-sticker {
    border: none;
    max-width: 48%;
  }
}
