/* MAFHH Freight Forwarding & Customs Clearing Portal - Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens (CSS Variables) --- */
:root {
  --color-primary-navy: #0B1117;
  --color-primary-dark: #05080c;
  --color-primary-hover: #141f2a;
  --color-accent-blue: #c53025;
  --color-accent-light: #FF493B;
  
  --color-bg-main: #f4f6fa;
  --color-bg-card: #ffffff;
  
  --color-text-primary: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  
  --color-border: #e2e8f0;
  
  /* Status Colors */
  --color-status-booking-bg: #f1f5f9;
  --color-status-booking-text: #475569;
  --color-status-transit-bg: #e0f2fe;
  --color-status-transit-text: #0369a1;
  --color-status-arrived-bg: #faf5ff;
  --color-status-arrived-text: #6b21a8;
  --color-status-customs-bg: #fff7ed;
  --color-status-customs-text: #c2410c;
  --color-status-delivered-bg: #f0fdf4;
  --color-status-delivered-text: #15803d;
  --color-status-expired-bg: #fef2f2;
  --color-status-expired-text: #b91c1c;
  --color-status-warning-bg: #fffbeb;
  --color-status-warning-text: #b45309;

  --transition-speed: 0.25s;
  --border-radius-lg: 12px;
  --border-radius-md: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.025);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
}

/* --- Base Resets & Layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--color-bg-main);
  color: var(--color-text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--color-accent-light);
  text-decoration: none;
  transition: color var(--transition-speed);
}
a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* --- Page Shell Layout (Sidebar + Main Panel) --- */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  background-color: var(--color-primary-navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-speed) ease;
  position: relative;
  z-index: 10;
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent-blue);
  border-radius: 50%;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 0 10px rgba(255, 73, 59, 0.3);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.sidebar-brand-subtitle {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.sidebar-menu-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  padding: 24px 24px 8px 24px;
  font-weight: 600;
}

.sidebar-menu {
  list-style: none;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.sidebar-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #e2e8f0;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-speed);
}

.sidebar-item-link:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
  text-decoration: none;
}

.sidebar-item.active .sidebar-item-link {
  background-color: var(--color-accent-blue);
  color: #ffffff;
}

.sidebar-item-badge {
  margin-left: auto;
  background-color: var(--color-accent-light);
  color: #ffffff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Sidebar Admin User Info at bottom */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-username {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* --- Main Content Section --- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100vh;
}

/* Header */
.app-header {
  height: 70px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-toggle-btn {
  font-size: 20px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
}

.header-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-search {
  display: flex;
  align-items: center;
  background-color: var(--color-bg-main);
  padding: 8px 16px;
  border-radius: 20px;
  width: 250px;
}

.header-search input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  margin-left: 8px;
  color: var(--color-text-primary);
}

.header-search input::placeholder {
  color: var(--color-text-muted);
}

.icon-button {
  position: relative;
  font-size: 20px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed);
}

.icon-button:hover {
  color: var(--color-text-primary);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background-color: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text-primary);
  cursor: pointer;
}

.user-profile-menu select {
  border: none;
  background: none;
  outline: none;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
}

/* Page Body Container */
.page-body {
  padding: 30px;
  flex-grow: 1;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-panel.active {
  display: block;
}

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

/* --- Layout Grids & Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--color-bg-card);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue { background-color: #eff6ff; color: var(--color-accent-light); }
.stat-icon.orange { background-color: #fff7ed; color: #f97316; }
.stat-icon.green { background-color: #f0fdf4; color: #22c55e; }
.stat-icon.red { background-color: #fef2f2; color: #ef4444; }
.stat-icon.purple { background-color: #faf5ff; color: #a855f7; }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 4px 0;
}

.stat-trend {
  font-size: 11px;
  font-weight: 600;
}
.stat-trend.positive { color: #16a34a; }
.stat-trend.negative { color: #dc2626; }

.stat-action {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent-light);
  margin-top: 4px;
  display: inline-block;
}
.stat-action:hover {
  text-decoration: underline;
}

/* Dashboard Grid Layouts */
.dashboard-layout-main {
  display: grid;
  grid-template-columns: 2.8fr 1.2fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-layout-sub {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.dashboard-card {
  background-color: var(--color-bg-card);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.dashboard-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-light);
}
.card-header-action:hover {
  text-decoration: underline;
}

/* --- Tables --- */
.table-container {
  overflow-x: auto;
  width: 100%;
}

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

.portal-table th {
  padding: 12px 16px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  font-weight: 600;
  border-bottom: 2px solid var(--color-border);
}

.portal-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.portal-table tbody tr:hover {
  background-color: rgba(244, 246, 250, 0.5);
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-booking { background-color: var(--color-status-booking-bg); color: var(--color-status-booking-text); }
.badge-transit { background-color: var(--color-status-transit-bg); color: var(--color-status-transit-text); }
.badge-arrived { background-color: var(--color-status-arrived-bg); color: var(--color-status-arrived-text); }
.badge-customs { background-color: var(--color-status-customs-bg); color: var(--color-status-customs-text); }
.badge-delivered { background-color: var(--color-status-delivered-bg); color: var(--color-status-delivered-text); }
.badge-expired { background-color: var(--color-status-expired-bg); color: var(--color-status-expired-text); }
.badge-valid { background-color: var(--color-status-delivered-bg); color: var(--color-status-delivered-text); }
.badge-warning { background-color: var(--color-status-warning-bg); color: var(--color-status-warning-text); }

/* --- Account Overview Section --- */
.account-overview-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.account-item {
  display: flex;
  flex-direction: column;
}

.account-item-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.account-item-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

.account-item-value.outstanding { color: #dc2626; }
.account-item-value.paid { color: #16a34a; }

.btn-outline {
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  transition: all var(--transition-speed);
  display: block;
}
.btn-outline:hover {
  background-color: var(--color-bg-main);
  border-color: var(--color-text-muted);
}

.btn-primary {
  background-color: var(--color-primary-navy);
  color: white;
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background var(--transition-speed);
  display: inline-block;
}
.btn-primary:hover {
  background-color: var(--color-accent-blue);
}

.btn-success {
  background-color: #10b981;
  color: white;
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background var(--transition-speed);
  display: inline-block;
}
.btn-success:hover {
  background-color: #059669;
}

/* --- Document Alerts List --- */
.doc-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doc-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background-color: var(--color-bg-main);
  border-radius: var(--border-radius-md);
}

.doc-alert-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-alert-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  background-color: white;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-alert-details {
  display: flex;
  flex-direction: column;
}

.doc-alert-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.doc-alert-expiry {
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* --- Notifications & Announcements --- */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}
.notification-item:last-child {
  border-bottom: none;
}
.notification-item.unread {
  background-color: #f0f7ff;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #eff6ff;
  color: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-body {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
}

.notif-title {
  font-weight: 600;
}

.notif-desc {
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.notif-date {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* --- Quick Actions Grid --- */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.action-btn {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-speed);
  box-shadow: var(--shadow-sm);
}

.action-btn:hover {
  border-color: var(--color-accent-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.action-btn-icon {
  font-size: 20px;
}
.action-btn-icon.blue { color: var(--color-accent-light); }
.action-btn-icon.green { color: #10b981; }
.action-btn-icon.purple { color: #8b5cf6; }
.action-btn-icon.orange { color: #f59e0b; }

/* --- Forms & Modals --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 17, 23, 0.6);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.modal-content {
  background-color: #ffffff;
  border-radius: var(--border-radius-lg);
  width: 550px;
  max-width: 90%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.3s ease;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  background-color: var(--color-primary-navy);
  color: white;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  color: #ffffff;
  opacity: 0.8;
  font-size: 20px;
}
.modal-close:hover {
  opacity: 1;
}

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

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text-primary);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  outline: none;
  transition: border-color var(--transition-speed);
}

.form-control:focus {
  border-color: var(--color-accent-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* --- Support Chat System --- */
.chat-container {
  display: flex;
  height: 480px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.chat-sidebar {
  width: 200px;
  border-right: 1px solid var(--color-border);
  background-color: var(--color-bg-main);
  display: flex;
  flex-direction: column;
}

.chat-ticket-list {
  list-style: none;
  overflow-y: auto;
}

.chat-ticket-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--transition-speed);
}

.chat-ticket-item:hover, .chat-ticket-item.active {
  background-color: #ffffff;
}

.chat-ticket-subject {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-ticket-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.chat-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
}

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

.chat-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  line-height: 1.4;
  position: relative;
}

.chat-bubble.customer {
  align-self: flex-end;
  background-color: var(--color-accent-blue);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-bubble.operations {
  align-self: flex-start;
  background-color: #e2e8f0;
  color: var(--color-text-primary);
  border-bottom-left-radius: 2px;
}

.chat-time {
  font-size: 9px;
  opacity: 0.75;
  margin-top: 4px;
  text-align: right;
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
}

.chat-input-area input {
  flex-grow: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  outline: none;
}

.chat-send-btn {
  background-color: var(--color-accent-blue);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* --- Tracking Timelines --- */
.tracking-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 40px 0;
  padding: 0 40px;
}

.tracking-timeline::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 60px;
  right: 60px;
  height: 4px;
  background-color: var(--color-border);
  z-index: 1;
}

.tracking-timeline-progress {
  position: absolute;
  top: 12px;
  left: 60px;
  height: 4px;
  background-color: #22c55e;
  z-index: 1;
  transition: width 0.5s ease;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 4px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.timeline-step.completed .timeline-dot {
  border-color: #22c55e;
  background-color: #22c55e;
  color: #ffffff;
  font-size: 12px;
}

.timeline-step.active .timeline-dot {
  border-color: var(--color-accent-light);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 73, 59, 0.25);
}

.timeline-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-top: 8px;
  text-align: center;
}

.timeline-step.active .timeline-label {
  color: var(--color-accent-light);
}

.timeline-step.completed .timeline-label {
  color: var(--color-text-primary);
}

/* --- Document Center Folders --- */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.folder-card {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-speed);
  box-shadow: var(--shadow-sm);
}

.folder-card:hover {
  border-color: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.folder-icon {
  font-size: 32px;
  color: #fbbf24;
}

.folder-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.folder-count {
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* --- Login Page Split View Layout --- */
.login-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

.login-left {
  flex: 1.2;
  background-image: linear-gradient(rgba(11, 17, 23, 0.55), rgba(11, 17, 23, 0.9)), url('https://images.unsplash.com/photo-1578575437130-527eed3abbec?auto=format&fit=crop&w=1200&q=80');
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 60px;
  color: white;
}

.login-right {
  flex: 0.8;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
}

.login-logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 64px;
  height: 64px;
  background-color: var(--color-primary-navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.login-logo-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary-navy);
  letter-spacing: 0.5px;
}

.login-logo-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.login-welcome-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 6px;
  text-align: center;
}

.login-welcome-desc {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 30px;
}

.login-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 13px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-secondary);
}

.login-btn {
  background-color: var(--color-primary-navy);
  color: white;
  width: 100%;
  padding: 12px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition-speed);
  margin-bottom: 20px;
}

.login-btn:hover {
  background-color: var(--color-accent-blue);
}

.login-footer {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Credentials Help Box */
.login-credentials-help {
  margin-top: 30px;
  background-color: var(--color-bg-main);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  font-size: 12px;
}

.login-credentials-title {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.login-credential-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background var(--transition-speed);
}
.login-credential-row:hover {
  background-color: #e2e8f0;
}

/* --- Vector Charts CSS (Admin Portal Mock Charts) --- */
.charts-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-container-inner {
  height: 250px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 20px;
}

.trend-chart-svg {
  width: 100%;
  height: 100%;
}

.donut-chart-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  height: 100%;
}

.donut-graphic {
  position: relative;
  width: 150px;
  height: 150px;
}

.donut-hole {
  position: absolute;
  top: 25px;
  left: 25px;
  width: 100px;
  height: 100px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.donut-hole-val {
  font-size: 20px;
  font-weight: 700;
}

.donut-hole-label {
  font-size: 10px;
  color: var(--color-text-secondary);
}

.chart-legends {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.legend-color.blue { background-color: var(--color-accent-light); }
.legend-color.green { background-color: #10b981; }
.legend-color.orange { background-color: #f97316; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-layout-main, .charts-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-layout-sub {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
  }
  .login-left {
    display: none;
  }
  .login-right {
    flex: 1;
  }
}

/* Custom file upload layout */
.file-upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.file-upload-zone:hover {
  border-color: var(--color-accent-light);
  background-color: var(--color-bg-main);
}
.file-upload-icon {
  font-size: 28px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.file-upload-text {
  font-size: 12px;
  color: var(--color-text-secondary);
}
.file-upload-text strong {
  color: var(--color-accent-light);
}

/* Printable statements */
@media print {
  body * {
    visibility: hidden;
  }
  #print-area, #print-area * {
    visibility: visible;
  }
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

/* --- Access Control & Permissions --- */
.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: .3s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #10b981;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* --- Access Denied Screen --- */
.access-denied-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  max-width: 600px;
  margin: 40px auto;
}
.access-denied-icon {
  font-size: 64px;
  color: #ef4444;
  margin-bottom: 20px;
}
.access-denied-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text-primary);
}
.access-denied-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* --- Premium Unified Chat Room Styles --- */
.chat-window {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 210px);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.chat-sidebar-left {
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background: var(--color-bg-main);
}
.chat-sidebar-search {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}
.chat-sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  outline: none;
  background: #ffffff;
}
.chat-rooms-list {
  list-style: none;
  overflow-y: auto;
  flex-grow: 1;
}
.chat-room-item {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition-speed);
}
.chat-room-item:hover {
  background: rgba(0, 0, 0, 0.02);
}
.chat-room-item.active {
  background: rgba(255, 73, 59, 0.08);
  border-left: 4px solid var(--color-accent-light);
}
.chat-room-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
}
.chat-room-avatar.group {
  background: var(--color-accent-light);
}
.chat-room-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid white;
}
.chat-room-status.online {
  background: #22c55e;
}
.chat-room-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-room-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.chat-room-last-msg {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-top: 2px;
}

.chat-main-area {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-main-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}
.chat-main-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-main-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  background: #fafbfe;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-msg-bubble {
  max-width: 65%;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}
.chat-msg-bubble.outgoing {
  align-self: flex-end;
}
.chat-msg-bubble.incoming {
  align-self: flex-start;
}
.chat-msg-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  margin-left: 4px;
}
.chat-msg-bubble.outgoing .chat-msg-sender {
  text-align: right;
  margin-right: 4px;
  margin-left: 0;
}
.chat-msg-text-box {
  padding: 12px 16px;
  border-radius: var(--border-radius-lg);
  font-size: 13px;
  line-height: 1.5;
}
.chat-msg-bubble.outgoing .chat-msg-text-box {
  background: var(--color-primary-navy);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}
.chat-msg-bubble.incoming .chat-msg-text-box {
  background: #ffffff;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 2px;
}
.chat-msg-time {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
  align-self: flex-end;
}
.chat-msg-bubble.incoming .chat-msg-time {
  align-self: flex-start;
}

/* Chat attachments */
.chat-img-attachment {
  max-width: 250px;
  max-height: 180px;
  border-radius: var(--border-radius-md);
  margin-top: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.chat-file-attachment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--border-radius-md);
  margin-top: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: inherit;
  text-decoration: none;
}
.chat-msg-bubble.outgoing .chat-file-attachment-card {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
.chat-file-info {
  flex-grow: 1;
  min-width: 0;
}
.chat-file-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-file-size {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 2px;
}
.chat-file-download-btn {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  background: #ffffff;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.chat-msg-bubble.outgoing .chat-file-download-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.chat-input-bar-container {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-input-field-wrap {
  flex-grow: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.chat-input-field-wrap input {
  width: 100%;
  padding: 12px 48px 12px 18px;
  border-radius: 30px;
  border: 1px solid var(--color-border);
  outline: none;
  background: var(--color-bg-main);
  transition: all var(--transition-speed);
}
.chat-input-field-wrap input:focus {
  background: #ffffff;
  border-color: var(--color-accent-light);
  box-shadow: 0 0 0 3px rgba(255, 73, 59, 0.15);
}
.chat-attach-btn {
  position: absolute;
  right: 14px;
  font-size: 18px;
  color: var(--color-text-secondary);
  transition: color var(--transition-speed);
}
.chat-attach-btn:hover {
  color: var(--color-accent-light);
}

/* --- Q-Cargo Styled Contact Us Layout --- */
.contact-layout-split {
  display: grid;
  grid-template-columns: 1.3fr 1.7fr;
  gap: 30px;
  margin-bottom: 24px;
}
.contact-form-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.contact-branch-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.branch-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.branch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-light);
}
.branch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 12px;
}
.branch-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  background: rgba(255, 73, 59, 0.08);
  color: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.branch-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary-navy);
}
.branch-detail-row {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.branch-detail-row i {
  color: var(--color-accent-light);
  margin-top: 3px;
  font-size: 14px;
  width: 16px;
  text-align: center;
}
.branch-detail-row a:hover {
  text-decoration: underline;
}

/* WhatsApp float consulting badge */
.whatsapp-widget {
  background: #25d366;
  color: white;
  border-radius: var(--border-radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}
.whatsapp-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.whatsapp-icon {
  font-size: 32px;
}
.whatsapp-text {
  display: flex;
  flex-direction: column;
}
.whatsapp-title {
  font-size: 16px;
  font-weight: 700;
}
.whatsapp-desc {
  font-size: 12.5px;
  opacity: 0.9;
  margin-top: 2px;
}
.whatsapp-btn {
  background: white;
  color: #25d366;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 700;
  font-size: 13px;
  transition: transform var(--transition-speed);
}
.whatsapp-btn:hover {
  transform: scale(1.05);
}
