/* ==========================================================================
   CONVEYOR UNIEXPRESS - WHITE & LIGHT BLUE ADMIN PORTAL THEME (ADMIN.CSS)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --admin-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --admin-mono: 'JetBrains Mono', monospace;

  --sidebar-width: 260px;
  --topbar-height: 70px;

  /* White & Light Blue Palette */
  --bg-main: #f0f7ff; /* Very Soft Ice Blue Background */
  --bg-card: #ffffff; /* Crisp Pure White Card */
  --bg-sidebar: #ffffff; /* White Sidebar */
  --bg-sidebar-hover: #f0f9ff;
  --bg-sidebar-active: #0284c7;

  --color-primary: #0284c7; /* Sky / Ocean Blue */
  --color-primary-hover: #0369a1;
  --color-primary-light: #e0f2fe; /* Light Blue Tint */
  --color-primary-soft: #f0f9ff;

  --color-accent: #0ea5e9;
  --color-accent-light: #e0f2fe;

  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;
  --border-blue: #bae6fd;

  --text-main: #0f172a; /* Deep Slate Navy for High Contrast Readability */
  --text-muted: #64748b;
  --text-dark: #1e293b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-dropdown: 0 10px 15px -3px rgba(2, 132, 199, 0.08), 0 4px 6px -4px rgba(2, 132, 199, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--admin-font);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Admin Wrapper */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-main);
}

/* Sidebar (Clean White & Soft Blue) */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid #e0f2fe;
  box-shadow: 2px 0 8px rgba(2, 132, 199, 0.03);
}

.sidebar-brand {
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.sidebar-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.sidebar-brand-badge {
  font-size: 0.65rem;
  background: #e0f2fe;
  color: #0284c7;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  font-weight: 800;
  padding: 0.85rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.25rem;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: #f0f9ff;
  color: #0284c7;
}

.sidebar-link.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.user-info {
  flex-grow: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 0.725rem;
  color: #64748b;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-main);
}

/* Topbar (Clean White & Light Blue Accent) */
.admin-topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid #e0f2fe;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.04);
}

.topbar-title-section h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Admin Content Container */
.admin-content {
  padding: 2rem;
  flex: 1;
}

/* Stat Cards (White & Light Blue) */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: #bae6fd;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(2, 132, 199, 0.08);
}

.stat-card-label {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.stat-card-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.stat-card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon-blue { background: #e0f2fe; color: #0284c7; }
.stat-icon-amber { background: #fef3c7; color: #d97706; }
.stat-icon-green { background: #d1fae5; color: #059669; }
.stat-icon-purple { background: #ede9fe; color: #7c3aed; }

/* Admin Panels / Cards (Pure White) */
.admin-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.card-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.card-body {
  padding: 1.5rem;
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
}

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

.data-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f0f9ff;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.badge-primary { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-outline {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-outline:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0284c7;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.15s ease;
}

.form-control:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px #e0f2fe;
}

/* Alerts */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* Air Waybill Document & Print Styling */
.awb-container {
  max-width: 850px;
  margin: 2rem auto;
  background: #ffffff;
  border: 2px solid #0f172a;
  padding: 2rem;
  font-family: var(--admin-font);
  color: #000000;
}

.awb-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.awb-barcode-box {
  text-align: right;
  font-family: var(--admin-mono);
}

.barcode-stripes {
  height: 45px;
  background: repeating-linear-gradient(
    90deg,
    #000 0px,
    #000 3px,
    #fff 3px,
    #fff 6px,
    #000 6px,
    #000 10px,
    #fff 10px,
    #fff 12px
  );
  width: 220px;
  margin-left: auto;
  margin-bottom: 4px;
}

.awb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #0f172a;
  margin-bottom: 1rem;
}

.awb-cell {
  padding: 0.75rem;
  border-right: 1px solid #0f172a;
  border-bottom: 1px solid #0f172a;
}

.awb-cell:last-child {
  border-right: none;
}

.awb-cell-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: bold;
  color: #475569;
  margin-bottom: 0.25rem;
}

.awb-cell-content {
  font-size: 0.9rem;
  font-weight: 600;
}

@media print {
  body {
    background: #ffffff !important;
  }
  .admin-sidebar, .admin-topbar, .btn-print-hide {
    display: none !important;
  }
  .admin-main {
    margin-left: 0 !important;
    background: #ffffff !important;
  }
  .awb-container {
    border: 2px solid #000000 !important;
    margin: 0 !important;
    max-width: 100% !important;
    box-shadow: none !important;
  }
}
