/* ============================================================
   Whirlpool IMS — Custom Design System
   Bootstrap 5 + FontAwesome 6 override layer
   ============================================================ */

:root {
  --wp-blue:        #003087;
  --wp-blue-light:  #0047b3;
  --wp-blue-dark:   #001f5b;
  --wp-red:         #e31837;
  --wp-grey:        #f4f6f9;
  --wp-grey-dark:   #e9ecef;
  --wp-sidebar-w:   260px;
  --wp-topbar-h:    64px;
  --wp-radius:      10px;
  --wp-shadow:      0 2px 12px rgba(0,48,135,.08);
  --wp-shadow-md:   0 4px 24px rgba(0,48,135,.13);
  --wp-transition:  all .2s ease;
}

/* ── Typography ─────────────────────────────── */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--wp-grey);
  color: #1a1a2e;
  font-size: 14px;
}

/* ── Sidebar ────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--wp-sidebar-w);
  height: 100vh;
  background: var(--wp-blue-dark);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  transition: var(--wp-transition);
  overflow-y: auto;
  overflow-x: hidden;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-brand .brand-logo {
  width: 40px; height: 40px;
  background: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-logo svg { width: 28px; height: 28px; }

.sidebar-brand .brand-text .brand-name {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1.2;
}

.sidebar-brand .brand-text .brand-sub {
  color: rgba(255,255,255,.45);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* nav sections */
.nav-section-label {
  padding: 18px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 400;
  transition: var(--wp-transition);
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-nav .nav-link i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: .8;
  flex-shrink: 0;
}

.sidebar-nav .nav-link .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--wp-red);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 500;
}

.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

/* collapse sub-menu */
.sidebar-nav .collapse .nav-link {
  padding-left: 48px;
  font-size: 13px;
}

.nav-chevron {
  margin-left: auto;
  font-size: 11px;
  transition: transform .25s;
}

.nav-link[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }

/* sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

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

.sidebar-user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--wp-blue-light);
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}

.sidebar-user .user-info .user-name {
  color: #fff; font-size: 13px; font-weight: 500; line-height: 1.2;
}
.sidebar-user .user-info .user-role {
  color: rgba(255,255,255,.4); font-size: 11px;
}

/* ── Topbar ─────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0;
  left: var(--wp-sidebar-w);
  right: 0;
  height: var(--wp-topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8edf2;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 1040;
  transition: var(--wp-transition);
}

#sidebar-toggle {
  width: 36px; height: 36px;
  border: none;
  background: var(--wp-grey);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #555;
  transition: var(--wp-transition);
  flex-shrink: 0;
}

#sidebar-toggle:hover { background: var(--wp-grey-dark); color: var(--wp-blue); }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.topbar-breadcrumb .bc-item { color: #999; }
.topbar-breadcrumb .bc-sep { color: #ccc; font-size: 11px; }
.topbar-breadcrumb .bc-current { color: #1a1a2e; font-weight: 500; }

.topbar-spacer { flex: 1; }

/* search bar */
.topbar-search {
  position: relative;
  width: 260px;
}

.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid #e8edf2;
  border-radius: 8px;
  font-size: 13px;
  background: var(--wp-grey);
  outline: none;
  transition: var(--wp-transition);
  color: #1a1a2e;
}

.topbar-search input:focus {
  border-color: var(--wp-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,48,135,.07);
}

.topbar-search i {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  color: #aaa; font-size: 13px;
}

/* topbar icons */
.topbar-actions { display: flex; align-items: center; gap: 4px; }

.topbar-btn {
  width: 38px; height: 38px;
  border: none; background: transparent;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #666; font-size: 15px;
  cursor: pointer; position: relative;
  transition: var(--wp-transition);
  text-decoration: none;
}

.topbar-btn:hover { background: var(--wp-grey); color: var(--wp-blue); }

.topbar-btn .badge-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--wp-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--wp-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--wp-transition);
}

.topbar-avatar:hover { opacity: .85; }

/* ── Main Content ───────────────────────────── */
#main-content {
  margin-left: var(--wp-sidebar-w);
  padding-top: var(--wp-topbar-h);
  min-height: 100vh;
  transition: var(--wp-transition);
}

.content-body { padding: 28px 28px 40px; }

/* ── Page Header ────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 20px; font-weight: 700; color: #1a1a2e; margin: 0; line-height: 1.2; }
.page-subtitle { font-size: 13px; color: #7c8db5; margin: 3px 0 0; }

/* ── Stat Cards ─────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: var(--wp-radius);
  padding: 20px 22px;
  box-shadow: var(--wp-shadow);
  border: 1px solid #f0f3f8;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--wp-transition);
}

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

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(0,48,135,.08);  color: var(--wp-blue); }
.stat-icon.green  { background: rgba(25,135,84,.08); color: #198754; }
.stat-icon.amber  { background: rgba(255,193,7,.12); color: #c68900; }
.stat-icon.red    { background: rgba(227,24,55,.08); color: var(--wp-red); }
.stat-icon.purple { background: rgba(108,66,193,.08); color: #6c42c1; }
.stat-icon.teal   { background: rgba(13,202,240,.08); color: #0a8fa8; }

.stat-info .stat-label { font-size: 12px; color: #8c9db5; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-info .stat-value { font-size: 24px; font-weight: 700; color: #1a1a2e; line-height: 1.2; margin: 2px 0; }
.stat-info .stat-change { font-size: 12px; }
.stat-info .stat-change.up   { color: #198754; }
.stat-info .stat-change.down { color: var(--wp-red); }

/* ── Cards ──────────────────────────────────── */
.wp-card {
  background: #fff;
  border-radius: var(--wp-radius);
  box-shadow: var(--wp-shadow);
  border: 1px solid #f0f3f8;
  overflow: hidden;
}

.wp-card .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f3f8;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wp-card .card-header .card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
  flex: 1;
}

.wp-card .card-body { padding: 20px; }
.wp-card .card-footer { padding: 12px 20px; background: var(--wp-grey); border-top: 1px solid #f0f3f8; }

/* ── Tables ─────────────────────────────────── */
.wp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.wp-table thead th {
  padding: 11px 16px;
  background: #f8fafd;
  color: #7c8db5;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid #edf0f7;
  white-space: nowrap;
}

.wp-table tbody tr {
  transition: background .12s;
  border-bottom: 1px solid #f4f6fb;
}

.wp-table tbody tr:hover { background: #f8fafd; }
.wp-table tbody tr:last-child { border-bottom: none; }

.wp-table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  color: #2d3748;
}

.wp-table .product-thumb {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--wp-grey);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* ── Badges / Status Pills ──────────────────── */
.wp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.wp-badge.pending   { background: #fff3cd; color: #856404; }
.wp-badge.approved  { background: #d1e7dd; color: #0a5740; }
.wp-badge.rejected  { background: #f8d7da; color: #842029; }
.wp-badge.dispatched{ background: #cff4fc; color: #055160; }
.wp-badge.delivered { background: #d1e7dd; color: #0a5740; }
.wp-badge.in-transit{ background: #e2d9f3; color: #432874; }
.wp-badge.in-stock  { background: #d1e7dd; color: #0a5740; }
.wp-badge.low-stock { background: #fff3cd; color: #856404; }
.wp-badge.out-stock { background: #f8d7da; color: #842029; }
.wp-badge.info      { background: rgba(0,48,135,.08); color: var(--wp-blue); }

.wp-badge i { font-size: 9px; }

/* ── Buttons ────────────────────────────────── */
.btn-wp {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: var(--wp-transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-wp-primary {
  background: var(--wp-blue);
  color: #fff;
}
.btn-wp-primary:hover { background: var(--wp-blue-light); color: #fff; }

.btn-wp-outline {
  background: transparent;
  color: var(--wp-blue);
  border: 1px solid var(--wp-blue);
}
.btn-wp-outline:hover { background: var(--wp-blue); color: #fff; }

.btn-wp-ghost {
  background: var(--wp-grey);
  color: #5a6474;
}
.btn-wp-ghost:hover { background: var(--wp-grey-dark); color: #1a1a2e; }

.btn-wp-danger {
  background: var(--wp-red);
  color: #fff;
}
.btn-wp-danger:hover { background: #c01030; color: #fff; }

.btn-wp-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-wp-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* Action button group in tables */
.action-group { display: flex; align-items: center; gap: 4px; }

.action-btn {
  width: 30px; height: 30px;
  border: none; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer;
  transition: var(--wp-transition);
  text-decoration: none;
}

.action-btn.view    { background: rgba(0,48,135,.07); color: var(--wp-blue); }
.action-btn.edit    { background: rgba(255,193,7,.1); color: #c68900; }
.action-btn.delete  { background: rgba(227,24,55,.07); color: var(--wp-red); }
.action-btn.approve { background: rgba(25,135,84,.08); color: #198754; }
.action-btn.ship    { background: rgba(108,66,193,.08); color: #6c42c1; }

.action-btn:hover { filter: brightness(.9); transform: scale(1.07); }

/* ── Form Styles ────────────────────────────── */
.wp-form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #4a5568;
  margin-bottom: 5px;
  display: block;
}

.wp-form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid #dde3ed;
  border-radius: 8px;
  font-size: 13.5px;
  color: #1a1a2e;
  background: #fff;
  outline: none;
  transition: var(--wp-transition);
}

.wp-form-control:focus {
  border-color: var(--wp-blue);
  box-shadow: 0 0 0 3px rgba(0,48,135,.07);
}

.wp-form-control.is-invalid { border-color: var(--wp-red); }
.wp-input-group { position: relative; }
.wp-input-group .input-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: #aab4c8; font-size: 13px; pointer-events: none;
}
.wp-input-group .wp-form-control { padding-left: 36px; }

/* ── Modal ──────────────────────────────────── */
.wp-modal .modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,.15);
}

.wp-modal .modal-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #f0f3f8;
  border-radius: 14px 14px 0 0;
}

.wp-modal .modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 9px;
}

.wp-modal .modal-title i { color: var(--wp-blue); font-size: 15px; }
.wp-modal .modal-body { padding: 20px 24px; }
.wp-modal .modal-footer { padding: 14px 24px; border-top: 1px solid #f0f3f8; }

/* ── Sidebar Collapsed ──────────────────────── */
body.sidebar-collapsed #sidebar { width: 68px; }
body.sidebar-collapsed #topbar,
body.sidebar-collapsed #main-content { left: 68px; margin-left: 68px; }
body.sidebar-collapsed .sidebar-brand .brand-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .sidebar-nav .nav-link span,
body.sidebar-collapsed .nav-chevron,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .sidebar-footer .user-info { display: none; }
body.sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding: 12px; }
body.sidebar-collapsed .sidebar-nav .nav-link i { width: auto; margin: 0; }
body.sidebar-collapsed .sidebar-brand { padding: 18px 14px; }
body.sidebar-collapsed .sidebar-user { justify-content: center; }
body.sidebar-collapsed .sidebar-user .avatar { margin: 0; }
body.sidebar-collapsed .sidebar-nav .collapse { display: none !important; }

/* ── Progress / Timeline ────────────────────── */
.order-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 0;
}

.tl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.tl-step .tl-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #dde3ed;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  z-index: 1;
  color: #aaa;
}

.tl-step.done .tl-dot {
  background: #198754; border-color: #198754; color: #fff;
}

.tl-step.active .tl-dot {
  background: var(--wp-blue); border-color: var(--wp-blue); color: #fff;
  box-shadow: 0 0 0 4px rgba(0,48,135,.12);
}

.tl-step .tl-label {
  font-size: 10.5px; color: #8c9db5;
  margin-top: 5px; text-align: center; white-space: nowrap;
}

.tl-step.done  .tl-label,
.tl-step.active .tl-label { color: #1a1a2e; font-weight: 500; }

.tl-line {
  flex: 1;
  height: 2px;
  background: #dde3ed;
  margin-top: -14px;
}

.tl-line.done { background: #198754; }

/* ── Charts placeholder ─────────────────────── */
.chart-container { position: relative; }

/* ── Empty states ───────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #8c9db5;
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: .35;
}

.empty-state p { margin: 0; font-size: 13.5px; }

/* ── Alerts ─────────────────────────────────── */
.wp-alert {
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.wp-alert.success { background: #d1e7dd; border-color: #a3cfbb; color: #0a5740; }
.wp-alert.danger  { background: #f8d7da; border-color: #f1aeb5; color: #842029; }
.wp-alert.warning { background: #fff3cd; border-color: #ffe69c; color: #664d03; }
.wp-alert.info    { background: rgba(0,48,135,.06); border-color: rgba(0,48,135,.12); color: var(--wp-blue); }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 992px) {
  #sidebar { left: calc(-1 * var(--wp-sidebar-w)); }
  #sidebar.mobile-open { left: 0; }
  #topbar, #main-content { margin-left: 0; left: 0; }
  .content-body { padding: 20px 16px 32px; }
}

/* ── Login Page ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--wp-blue-dark) 0%, var(--wp-blue) 50%, #0063cc 100%);
}

.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: #fff;
}

.login-right {
  width: 460px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 52px;
}

.login-form-wrap { width: 100%; max-width: 360px; }
.login-logo-wrap { margin-bottom: 28px; }

.login-logo {
  width: 52px; height: 52px;
  background: var(--wp-blue);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

.login-heading {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.login-sub { font-size: 13.5px; color: #7c8db5; margin-bottom: 28px; }

.wp-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #aab4c8; margin: 20px 0;
}

.wp-divider::before, .wp-divider::after {
  content: ''; flex: 1; height: 1px; background: #e8edf2;
}

@media (max-width: 768px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 28px; }
}

/* ── Utilities ──────────────────────────────── */
.text-wp-blue  { color: var(--wp-blue) !important; }
.bg-wp-blue    { background: var(--wp-blue) !important; }
.border-wp     { border: 1px solid #edf0f7 !important; }
.rounded-wp    { border-radius: var(--wp-radius) !important; }
.shadow-wp     { box-shadow: var(--wp-shadow) !important; }
.fw-600        { font-weight: 600; }
.cursor-pointer { cursor: pointer; }
.fs-12         { font-size: 12px; }
.fs-13         { font-size: 13px; }
