/* E-Shipping Request System - global styles */

:root {
  --eship-primary: #1FA1E2;
  --eship-primary-700: #147fb4;
  --eship-ink: #172033;
  --eship-muted: #647084;
  --eship-line: #d9e0ea;
  --eship-bg: #ffffff;
  --eship-success: #18734d;
  --eship-danger: #c92f43;
  --eship-warning: #b77900;
  --eship-info: #087990;
  --bs-primary: var(--eship-primary);
  --bs-primary-rgb: 31, 161, 226;
  --bs-border-radius: 6px;
  --bs-border-radius-sm: 5px;
}

body {
  color: var(--eship-ink);
  background: var(--eship-bg) !important;
  font-size: 14px;
  letter-spacing: 0;
}

.eship-shell {
  max-width: 1320px;
}

main.container-fluid {
  margin: 0 auto;
  padding-top: 1.25rem !important;
  padding-bottom: 2rem !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #111827;
  letter-spacing: 0;
}

.text-muted {
  color: var(--eship-muted) !important;
}

.eship-navbar {
  background: #10213f;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .18);
}

.eship-navbar .navbar-brand {
  font-size: 1rem;
  letter-spacing: 0;
}

.eship-navbar .nav-link {
  border-radius: 6px;
  color: rgba(255, 255, 255, .72);
  font-size: .9rem;
  padding: .45rem .65rem;
}

.eship-navbar .nav-link:hover,
.eship-navbar .nav-link.active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.eship-navbar .dropdown-toggle {
  border-radius: 6px;
  padding: .4rem .6rem;
}

.eship-menu-bar {
  background: #fff;
  border-bottom: 1px solid var(--eship-line);
}

.eship-menu {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: .55rem 0;
}

.eship-menu a {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  border-radius: 6px;
  color: #475467;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1;
  padding: .48rem .65rem;
  text-decoration: none;
}

.eship-menu a:hover {
  background: #eef2f7;
  color: #1f2937;
}

.eship-menu a.active {
  background: #e8eefc;
  color: var(--eship-primary-700);
}

.eship-menu i {
  font-size: .95rem;
}

.badge {
  border-radius: 5px;
  font-weight: 650;
  letter-spacing: 0;
}

.card {
  border: 1px solid var(--eship-line) !important;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05) !important;
}

.card-header {
  background: #fbfcfe !important;
  border-bottom: 1px solid var(--eship-line);
  color: #111827;
  padding: .7rem .9rem;
}

.card-body {
  padding: .95rem;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05) !important;
}

.btn {
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0;
}

.btn-sm {
  padding: .32rem .6rem;
}

.btn-primary {
  background: var(--eship-primary);
  border-color: var(--eship-primary);
}

.btn-primary:hover {
  background: var(--eship-primary-700);
  border-color: var(--eship-primary-700);
}

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

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

.btn-outline-secondary {
  color: #475467;
  border-color: #cbd5e1;
}

.btn-outline-secondary:hover {
  background: #eef2f7;
  border-color: #bac6d6;
  color: #1f2937;
}

.form-control,
.form-select,
.input-group-text {
  border-color: #cbd5e1;
  border-radius: 6px;
  color: var(--eship-ink);
}

.form-control:focus,
.form-select:focus {
  border-color: #7c9bf2;
  box-shadow: 0 0 0 .18rem rgba(37, 88, 216, .15);
}

.form-label {
  color: #344054;
  font-weight: 600;
}

.table {
  color: var(--eship-ink);
  --bs-table-hover-bg: #f8fafc;
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--eship-line);
  padding: .62rem .75rem;
}

.table-sm > :not(caption) > * > * {
  padding: .48rem .65rem;
}

.table thead th,
.table-light th {
  background: #f8fafc !important;
  color: #344054;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.table tbody td {
  vertical-align: middle;
}

.nav-pills {
  gap: .35rem;
}

.nav-pills .nav-link {
  border: 1px solid transparent;
  border-radius: 6px;
  color: #475467;
  font-weight: 600;
  padding: .42rem .7rem;
}

.nav-pills .nav-link:hover {
  background: #eef2f7;
  border-color: #d9e0ea;
}

.nav-pills .nav-link.active {
  background: #e8eefc;
  border-color: #b9c8f7;
  color: var(--eship-primary-700);
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(37, 88, 216, .22), transparent 34rem),
    linear-gradient(135deg, #101828 0%, #172033 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28) !important;
}

/* Dashboard menu cards */
.menu-card {
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  height: 100%;
}

.menu-card:hover {
  border-color: #b9c8f7 !important;
  box-shadow: 0 8px 18px rgba(16, 24, 40, .08) !important;
  transform: translateY(-1px);
}

.menu-card .card-body {
  min-height: 86px;
  padding: .9rem 1rem;
}

.menu-card .menu-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.menu-card .fw-semibold {
  font-size: .95rem;
}

.menu-card .small {
  line-height: 1.35;
}

.menu-icon.bg-primary,
.menu-icon.bg-danger,
.menu-icon.bg-warning,
.menu-icon.bg-success,
.menu-icon.bg-info,
.menu-icon.bg-dark,
.menu-icon.bg-secondary {
  background: #eef2f7 !important;
  color: #344054 !important;
}

.menu-icon.bg-primary { color: var(--eship-primary) !important; }
.menu-icon.bg-danger { color: var(--eship-danger) !important; }
.menu-icon.bg-warning { color: var(--eship-warning) !important; }
.menu-icon.bg-success { color: var(--eship-success) !important; }
.menu-icon.bg-info { color: var(--eship-info) !important; }

.page-toolbar {
  background: #fff;
  border: 1px solid var(--eship-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  padding: 1rem;
}

.dashboard-stats {
  background: #f8fafc;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  padding: .65rem .85rem;
}

.dashboard-stats > div {
  min-width: 58px;
}

.dashboard-stats .fs-4 {
  font-size: 1.25rem !important;
  line-height: 1.1;
}

/* Status timeline */
.status-timeline {
  list-style: none;
  padding-left: 0;
}

.status-timeline li {
  position: relative;
  padding-left: 1.75rem;
  padding-bottom: 1rem;
  border-left: 1px solid var(--eship-line);
  margin-left: .55rem;
}

.status-timeline li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.status-timeline .dot {
  position: absolute;
  left: -0.44rem;
  top: .1rem;
  width: .78rem;
  height: .78rem;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #fff;
}

.status-timeline .done .dot { background: var(--eship-success); }
.status-timeline .active .dot { background: #f5b300; }
.status-timeline .rejected .dot { background: var(--eship-danger); }

/* Line-items table */
#itemsTable input,
#itemsTable select {
  min-width: 78px;
}

#itemsTable .item-total {
  text-align: right;
}

footer {
  color: #667085 !important;
}

@media (max-width: 991.98px) {
  .eship-shell {
    max-width: 100%;
  }
}

/* Reference dashboard shell */
.app-body {
  background: #fff !important;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: #fff;
}

.app-sidebar {
  width: 240px;
  min-width: 240px;
  border-right: 1px solid #e5eaf0;
  background: #fff;
  padding: .85rem .6rem;
}

.sidebar-brand {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  color: #111827;
  margin: 0 .55rem 1.15rem;
  min-width: 0;
  padding-top: .2rem;
  text-decoration: none;
}

.sidebar-brand i {
  color: #111827;
  font-size: 1.8rem;
  line-height: 1;
}

.sidebar-brand strong {
  display: block;
  font-size: .96rem;
  line-height: 1.15;
  max-width: 165px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sidebar-brand small {
  display: block;
  color: var(--eship-muted);
  font-size: .72rem;
  line-height: 1.1;
  white-space: nowrap;
}

.sidebar-nav {
  display: grid;
  gap: .25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #111827;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  padding: .62rem .65rem;
  text-decoration: none;
}

.sidebar-nav a i {
  color: #3b4858;
  font-size: 1rem;
}

.sidebar-nav a:hover {
  background: #f3f7fa;
}

.sidebar-nav a.active {
  background: rgba(31, 161, 226, .12);
  color: #0e6f9f;
}

.sidebar-nav a.active i {
  color: var(--eship-primary);
}

.app-main {
  min-width: 0;
  flex: 1;
  background: #fff;
}

.app-topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e5eaf0;
  background: #fff;
  padding: 0 1.55rem;
}

.topbar-title {
  color: #111827;
  font-size: 1rem;
  font-weight: 700;
}

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

.topbar-search {
  width: 255px;
  display: flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid #d5dde8;
  border-radius: 7px;
  background: #fff;
  padding: .35rem .55rem;
}

.topbar-search i {
  color: #667085;
}

.topbar-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  font-size: .85rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  color: #111827;
  background: #f3f5f8;
  border: 1px solid #e3e8ef;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 600;
  padding: .35rem .55rem;
  text-decoration: none;
}

.user-chip strong {
  font-size: .68rem;
  text-transform: uppercase;
}

.app-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1.55rem 1.8rem;
}

.app-footer {
  max-width: 1440px;
  margin: 0 auto;
}

.dashboard-hero {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: .55rem 0 .85rem;
}

.dashboard-hero h1 {
  font-size: 1.55rem;
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: var(--eship-primary);
  margin-left: .35rem;
  vertical-align: middle;
}

.dashboard-stats {
  background: transparent;
  border: 0;
  gap: .5rem !important;
  padding: 0;
}

.dashboard-stats > div {
  min-width: 70px;
  border: 1px solid #d7dee8;
  border-top: 3px solid var(--eship-primary);
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .08);
  padding: .55rem .55rem .45rem;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
  align-items: stretch;
}

.dashboard-actions .menu-card .card-body {
  min-height: 78px;
}

.dashboard-actions .menu-card:hover,
.dashboard-actions .menu-card:focus-within {
  border-color: var(--eship-primary) !important;
}

.dashboard-actions .menu-icon {
  background: rgba(31, 161, 226, .1) !important;
  color: var(--eship-primary) !important;
}

.dashboard-actions > div:first-child .menu-card {
  border-color: var(--eship-primary) !important;
}

@media (max-width: 1280px) {
  .dashboard-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dashboard-actions {
    grid-template-columns: 1fr;
  }
}

.dashboard-panel .card-header {
  font-size: 1rem;
}

.dashboard-panel .card-body {
  padding: .85rem;
}

.panel-title {
  color: #111827;
  font-weight: 700;
  margin-bottom: .55rem;
}

.timeline-list {
  display: grid;
  gap: .3rem;
}

.timeline-list a {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #111827;
  min-height: 28px;
  text-decoration: none;
}

.timeline-list small {
  display: block;
  color: var(--eship-muted);
  font-size: .72rem;
}

.timeline-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--eship-primary);
  box-shadow: 0 0 0 3px rgba(31, 161, 226, .12);
}

.mini-chart {
  border-left: 1px solid #e5eaf0;
  border-right: 1px solid #e5eaf0;
  padding: 0 .85rem;
}

.mini-chart svg {
  width: 100%;
  height: 130px;
}

.mini-chart line {
  stroke: #e5eaf0;
  stroke-width: 1;
}

.mini-chart polyline {
  fill: none;
  stroke: var(--eship-primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-days {
  display: flex;
  justify-content: space-between;
  color: #475467;
  font-size: .72rem;
}

@media (max-width: 1100px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid #e5eaf0;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-nav a {
    white-space: nowrap;
  }

  .app-topbar {
    height: auto;
    flex-wrap: wrap;
    padding: .8rem 1rem;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-search {
    flex: 1;
    min-width: 220px;
  }
}

/* Print: FM-SC-06 handled by its own stylesheet */
@media print {
  .eship-navbar, footer, .no-print { display: none !important; }
}
