/**
 * SEIM ERP - Modern Clean UI Theme
 * Built for Bootstrap 5.3.3
 */

:root {
  /* Brand colors */
  --seim-primary: #2563eb;
  --seim-primary-hover: #1d4ed8;
  --seim-primary-subtle: rgba(37, 99, 235, 0.08);
  --seim-primary-subtle-hover: rgba(37, 99, 235, 0.15);
  
  /* Sidebar */
  --seim-sidebar-bg: #0f172a;
  --seim-sidebar-border: rgba(255, 255, 255, 0.07);
  --seim-sidebar-text: #94a3b8;
  --seim-sidebar-text-hover: #f8fafc;
  --seim-sidebar-active-bg: #2563eb;
  --seim-sidebar-active-text: #ffffff;
  --seim-sidebar-width: 260px;
  --seim-sidebar-collapsed-width: 70px;
  
  /* Topbar */
  --seim-topbar-height: 64px;
  --seim-topbar-bg: #ffffff;
  --seim-topbar-border: #e2e8f0;
  
  /* Surface & Body */
  --seim-body-bg: #f8fafc;
  --seim-card-bg: #ffffff;
  --seim-card-border: #e2e8f0;
  --seim-card-radius: 0.625rem;
  
  /* Typography */
  --seim-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================================================== */
body {
  background-color: var(--seim-body-bg) !important;
  color: #1e293b;
  font-family: var(--seim-font-family);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  overflow-x: hidden;
}

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

.fs-11 { font-size: 0.6875rem !important; }
.fs-12 { font-size: 0.75rem !important; }
.fs-13 { font-size: 0.8125rem !important; }
.fs-14 { font-size: 0.875rem !important; }
.fs-15 { font-size: 0.9375rem !important; }
.fs-16 { font-size: 1rem !important; }
.fs-18 { font-size: 1.125rem !important; }
.fs-20 { font-size: 1.25rem !important; }
.fs-22 { font-size: 1.375rem !important; }

/* ==========================================================================
   MAIN APP LAYOUT
   ========================================================================== */
.wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* --------------------------------------------------------------------------
   SIDEBAR (SIDENAV)
   -------------------------------------------------------------------------- */
.sidenav-menu {
  width: var(--seim-sidebar-width);
  background-color: var(--seim-sidebar-bg) !important;
  border-right: 1px solid var(--seim-sidebar-border) !important;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, transform 0.2s ease;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
}

/* Brand header */
.sidenav-brand {
  height: var(--seim-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--seim-sidebar-border);
  background-color: #ffffff;
}

.sidenav-brand .brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

.sidenav-brand .brand-logo.logo-lg {
  max-height: 44px;
  max-width: 190px;
  object-fit: contain;
}

.sidenav-brand .brand-logo.logo-sm {
  max-height: 34px;
  max-width: 44px;
  object-fit: contain;
  display: none;
}

.button-close-offcanvas {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 0.375rem;
}
.button-close-offcanvas:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}



/* Sidenav scrollable area */
.sidenav-menu .scrollbar {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0 1.5rem;
}

.sidenav-menu .scrollbar::-webkit-scrollbar {
  width: 4px;
}
.sidenav-menu .scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Sidenav navigation list */
.side-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-nav-title {
  padding: 0.85rem 1.25rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.side-nav-item {
  position: relative;
  list-style: none;
}

.side-nav-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  margin: 0.15rem 0.65rem;
  color: var(--seim-sidebar-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.84rem;
  border-radius: 0.45rem;
  transition: all 0.15s ease-in-out;
  border-left: none !important;
}

.side-nav-link .menu-icon {
  min-width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.side-nav-link .menu-icon svg,
.side-nav-link .menu-icon i {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.side-nav-link .menu-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.side-nav-link .menu-text {
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.side-nav-link .menu-caption {
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.2;
  margin-top: 1px;
}

.side-nav-link .menu-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.side-nav-link .menu-arrow::before {
  content: "\ea5f";
  font-family: "tabler-icons" !important;
}

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

.side-nav-link:hover {
  color: var(--seim-sidebar-text-hover);
  background-color: rgba(255, 255, 255, 0.06);
}
.side-nav-link:hover .menu-icon {
  color: #f8fafc;
}

/* Active Top Level item */
.side-nav > .side-nav-item > .side-nav-link.active,
.side-nav > .side-nav-item.active > .side-nav-link {
  background-color: var(--seim-sidebar-active-bg) !important;
  color: var(--seim-sidebar-active-text) !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
}
.side-nav > .side-nav-item > .side-nav-link.active .menu-icon,
.side-nav > .side-nav-item.active > .side-nav-link .menu-icon {
  color: #ffffff !important;
}
.side-nav > .side-nav-item > .side-nav-link.active .menu-caption {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Submenu Accordion */
.sub-menu {
  list-style: none;
  padding: 0.25rem 0 0.25rem 0.85rem;
  margin: 0.15rem 0.65rem 0.35rem 1.35rem;
  border-left: 1.5px solid rgba(255, 255, 255, 0.12);
}

.sub-menu .menu-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.5rem 0.15rem;
}

.sub-menu .side-nav-item {
  margin: 1px 0;
}

.sub-menu .side-nav-link {
  padding: 0.4rem 0.65rem;
  margin: 0.1rem 0;
  font-size: 0.8125rem;
  color: #94a3b8;
  border-radius: 0.375rem;
}

.sub-menu .side-nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

.sub-menu .side-nav-item.active > .side-nav-link,
.sub-menu .side-nav-link.active {
  color: #38bdf8 !important;
  background-color: rgba(56, 189, 248, 0.1) !important;
  font-weight: 600;
  box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   TOPBAR
   -------------------------------------------------------------------------- */
.app-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--seim-sidebar-width);
  height: var(--seim-topbar-height);
  background-color: var(--seim-topbar-bg) !important;
  border-bottom: 1px solid var(--seim-topbar-border) !important;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  transition: left 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.button-toggle-menu {
  width: 36px;
  height: 36px;
  border-radius: 0.45rem;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.button-toggle-menu:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Topbar search */
.topbar-search {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 9999px !important;
  padding-left: 2.2rem !important;
  padding-right: 0.85rem !important;
  font-size: 0.8125rem !important;
  height: 36px;
  width: 220px;
  color: #1e293b !important;
  transition: width 0.2s ease, border-color 0.2s ease;
}
.topbar-search:focus {
  width: 280px;
  background-color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
  outline: none;
}
.topbar-search::placeholder {
  color: #94a3b8 !important;
}

.app-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

/* Notification button */
.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 0.45rem;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.topbar-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}
.topbar-btn .topbar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.15em 0.4em;
  border-radius: 9999px;
  background-color: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  line-height: 1;
}

/* User header trigger */
.user-dropdown-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.user-dropdown-btn:hover {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}
.avatar-user-sm {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-header-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}
.user-header-sub {
  font-size: 0.6875rem;
  color: #64748b;
  max-width: 140px;
}

/* --------------------------------------------------------------------------
   CONTENT PAGE
   -------------------------------------------------------------------------- */
.content-page {
  flex: 1;
  min-width: 0;
  margin-left: var(--seim-sidebar-width);
  margin-top: var(--seim-topbar-height);
  padding: 1.25rem 1.5rem;
  min-height: calc(100vh - var(--seim-topbar-height));
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
  background-color: var(--seim-body-bg);
}

.content-page > .container-fluid {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
}

/* Page Title Header */
.page-title-box {
  margin-bottom: 1.25rem;
}
.page-title-box h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.page-title-box .breadcrumb {
  font-size: 0.78rem;
  margin: 0;
}
.page-title-box .breadcrumb a {
  color: #64748b;
}

/* Footer */
footer.footer {
  margin-top: auto;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #64748b;
}

/* ==========================================================================
   CARDS, TABLES, FORMS, UI COMPONENTS
   ========================================================================== */
.card {
  background-color: var(--seim-card-bg);
  border: 1px solid var(--seim-card-border);
  border-radius: var(--seim-card-radius);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
  margin-bottom: 1.25rem;
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.card-body {
  padding: 1.25rem;
}

/* Tables */
.table {
  color: #334155;
  font-size: 0.8125rem;
  vertical-align: middle;
  margin-bottom: 0;
  width: 100%;
}

.table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: #64748b;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
}

.table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8125rem;
}

.table-sm th {
  padding: 0.4rem 0.55rem;
  font-size: 0.6875rem;
}

.table-sm td {
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: inherit;
}

.table td.nowrap,
.table th.nowrap {
  white-space: nowrap;
}

/* Forms */
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  padding: 0.45rem 0.75rem;
  color: #1e293b;
}

.form-control:focus,
.form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Buttons */
.btn {
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 0.45rem;
  padding: 0.45rem 0.95rem;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--seim-primary);
  border-color: var(--seim-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--seim-primary-hover);
  border-color: var(--seim-primary-hover);
}

/* Soft Badges & Light Badges */
.badge.bg-light {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bg-primary-subtle, .badge-soft-primary { background-color: rgba(37, 99, 235, 0.1) !important; color: #2563eb !important; }
.bg-success-subtle, .badge-soft-success { background-color: rgba(16, 185, 129, 0.1) !important; color: #059669 !important; }
.bg-danger-subtle, .badge-soft-danger { background-color: rgba(239, 68, 68, 0.1) !important; color: #dc2626 !important; }
.bg-warning-subtle, .badge-soft-warning { background-color: rgba(245, 158, 11, 0.12) !important; color: #d97706 !important; }
.bg-info-subtle, .badge-soft-info { background-color: rgba(6, 182, 212, 0.1) !important; color: #0891b2 !important; }

/* Soft Buttons */
.btn-soft-primary {
  color: #2563eb;
  background-color: rgba(37, 99, 235, 0.09);
  border-color: transparent;
}
.btn-soft-primary:hover, .btn-soft-primary:focus {
  color: #ffffff;
  background-color: #2563eb;
  border-color: #2563eb;
}

.btn-soft-success {
  color: #059669;
  background-color: rgba(16, 185, 129, 0.09);
  border-color: transparent;
}
.btn-soft-success:hover, .btn-soft-success:focus {
  color: #ffffff;
  background-color: #059669;
  border-color: #059669;
}

.btn-soft-danger {
  color: #dc2626;
  background-color: rgba(239, 68, 68, 0.09);
  border-color: transparent;
}
.btn-soft-danger:hover, .btn-soft-danger:focus {
  color: #ffffff;
  background-color: #dc2626;
  border-color: #dc2626;
}

.btn-soft-secondary {
  color: #475569;
  background-color: rgba(100, 116, 139, 0.09);
  border-color: transparent;
}
.btn-soft-secondary:hover, .btn-soft-secondary:focus {
  color: #ffffff;
  background-color: #475569;
  border-color: #475569;
}

/* Dropdown styling */
.dropdown-menu {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  font-size: 0.84rem;
  padding: 0.35rem;
}
.dropdown-item {
  border-radius: 0.35rem;
  padding: 0.45rem 0.75rem;
  color: #334155;
}
.dropdown-item:hover, .dropdown-item:focus {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* ==========================================================================
   SIDEBAR COLLAPSED & RESPONSIVE
   ========================================================================== */
body.sidebar-collapsed .sidenav-menu {
  width: var(--seim-sidebar-collapsed-width);
}

body.sidebar-collapsed .sidenav-brand .logo-lg,
body.sidebar-collapsed .sidenav-brand .brand-text,
body.sidebar-collapsed .sidenav-user-card,
body.sidebar-collapsed .side-nav-title,
body.sidebar-collapsed .side-nav-link .menu-text,
body.sidebar-collapsed .side-nav-link .menu-caption,
body.sidebar-collapsed .side-nav-link .menu-arrow,
body.sidebar-collapsed .sub-menu {
  display: none !important;
}

body.sidebar-collapsed .sidenav-brand .logo-sm {
  display: block;
}

body.sidebar-collapsed .side-nav-link {
  justify-content: center;
  padding: 0.65rem 0;
  margin: 0.15rem 0.35rem;
}

body.sidebar-collapsed .side-nav-link .menu-icon {
  margin-right: 0;
}

body.sidebar-collapsed .app-topbar {
  left: var(--seim-sidebar-collapsed-width);
}

body.sidebar-collapsed .content-page {
  margin-left: var(--seim-sidebar-collapsed-width);
}

.fs-10 { font-size: 0.625rem !important; }
.tracking-wide { letter-spacing: 0.04em; }

/* Mobile viewport */
@media (max-width: 991.98px) {
  .sidenav-menu {
    transform: translateX(-100%);
  }
  
  .app-topbar {
    left: 0 !important;
  }
  
  .content-page {
    margin-left: 0 !important;
    padding: 1rem;
  }
  
  body.sidebar-enable .sidenav-menu {
    transform: translateX(0);
  }
  
  body.sidebar-enable::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
  }
}

@media (max-width: 575.98px) {
  .content-page {
    padding: 0.75rem;
  }
  .card-body {
    padding: 1rem;
  }
  .table td, .table th {
    padding: 0.45rem 0.5rem;
  }
}

