/**
 * BarkodPOS Admin — Profesyonel tema (Sneat-inspired)
 * Logo: https://barkodsatis.com/
 */
:root {
  --bpos-primary: #405189;
  --bpos-primary-rgb: 64, 81, 137;
  --bpos-primary-dark: #364574;
  --bpos-primary-light: #5a6ba8;
  --bpos-secondary: #8592a3;
  --bpos-success: #28a745;
  --bpos-info: #0dcaf0;
  --bpos-warning: #ffc107;
  --bpos-danger: #dc3545;
  --bpos-dark: #2b2c40;
  --bpos-body-bg: #f4f5fa;
  --bpos-menu-bg: #2b2c40;
  --bpos-menu-text: rgba(255, 255, 255, 0.78);
  --bpos-menu-text-active: #fff;
  --bpos-menu-hover: rgba(255, 255, 255, 0.06);
  --bpos-menu-active-bg: rgba(var(--bpos-primary-rgb), 0.16);
  --bpos-navbar-bg: #fff;
  --bpos-card-shadow: 0 2px 6px 0 rgba(67, 89, 113, 0.08);
  --bpos-card-shadow-hover: 0 4px 18px 0 rgba(67, 89, 113, 0.12);
  --bpos-radius: 0.5rem;
  --bpos-radius-lg: 0.75rem;
  --bpos-font: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bpos-sidebar-width: 260px;
  --bpos-transition: 0.2s ease;
}

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

body {
  font-family: var(--bpos-font);
  background: var(--bpos-body-bg);
  color: #566a7f;
  font-size: 0.9375rem;
  line-height: 1.53;
  -webkit-font-smoothing: antialiased;
}

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

/* Layout */
.layout-wrapper { min-height: 100vh; }
.layout-container { display: flex; width: 100%; }

.layout-menu {
  width: var(--bpos-sidebar-width);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1040;
  background: var(--bpos-menu-bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.layout-page {
  margin-left: var(--bpos-sidebar-width);
  width: calc(100% - var(--bpos-sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper { flex: 1; display: flex; flex-direction: column; }

/* Brand */
.app-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.app-brand-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}

.app-brand-logo img {
  height: 32px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.app-brand-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.menu-inner-shadow { display: none; }

/* Menu */
.menu-inner {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.menu-header {
  padding: 0.625rem 1.5rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.menu-item { position: relative; }

.menu-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  color: var(--bpos-menu-text);
  text-decoration: none;
  transition: background var(--bpos-transition), color var(--bpos-transition);
  border-radius: 0;
  font-size: 0.9375rem;
}

.menu-link:hover {
  color: var(--bpos-menu-text-active);
  background: var(--bpos-menu-hover);
}

.menu-item.active > .menu-link,
.menu-item.open > .menu-link {
  color: var(--bpos-menu-text-active);
  background: var(--bpos-menu-active-bg);
}

.menu-icon {
  font-size: 1.25rem;
  margin-right: 0.75rem;
  width: 1.375rem;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.menu-sub {
  list-style: none;
  padding: 0.25rem 0 0.5rem;
  margin: 0;
  display: none;
  background: rgba(0, 0, 0, 0.15);
}

.menu-item.open > .menu-sub { display: block; }

.menu-sub .menu-link {
  padding: 0.5rem 1.25rem 0.5rem 3.25rem;
  font-size: 0.875rem;
}

.menu-sub .menu-item.active > .menu-link {
  color: #fff;
  font-weight: 500;
}

.menu-toggle::after {
  content: '\ea4a';
  font-family: boxicons !important;
  margin-left: auto;
  font-size: 1rem;
  transition: transform 0.2s;
  opacity: 0.6;
}

.menu-item.open > .menu-toggle::after { transform: rotate(90deg); }

/* Navbar */
.layout-navbar {
  background: var(--bpos-navbar-bg) !important;
  box-shadow: var(--bpos-card-shadow);
  border-radius: var(--bpos-radius);
  margin: 1rem 1.5rem 0;
  padding: 0.5rem 1rem;
  min-height: 56px;
}

.layout-navbar .breadcrumb {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.layout-navbar .breadcrumb-item a {
  color: var(--bpos-secondary);
}

.layout-navbar .breadcrumb-item.active {
  color: var(--bpos-dark);
  font-weight: 500;
}

.layout-navbar .nav-link {
  color: #566a7f;
  padding: 0.375rem 0.5rem;
}

.navbar-search-wrap {
  max-width: 280px;
}

.navbar-search-wrap .form-control {
  border-radius: 2rem;
  padding-left: 2.25rem;
  font-size: 0.875rem;
  background: var(--bpos-body-bg);
  border-color: transparent;
}

.navbar-search-wrap .search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bpos-secondary);
  pointer-events: none;
}

.sube-select-wrap .form-select {
  border-radius: var(--bpos-radius);
  font-size: 0.8125rem;
  border-color: rgba(67, 89, 113, 0.15);
  min-width: 170px;
}

/* Avatar */
.avatar { width: 38px; height: 38px; flex-shrink: 0; }

.avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 600;
  font-size: 0.875rem;
  color: #fff;
  background: var(--bpos-primary) !important;
}

.badge-notifications {
  position: absolute;
  top: 2px;
  right: -2px;
  font-size: 0.6rem;
  padding: 0.15rem 0.35rem;
  min-width: 1.1rem;
}

/* Cards */
.card {
  border: none;
  box-shadow: var(--bpos-card-shadow);
  border-radius: var(--bpos-radius-lg);
  background: #fff;
  transition: box-shadow var(--bpos-transition);
}

.card:hover { box-shadow: var(--bpos-card-shadow-hover); }

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(67, 89, 113, 0.08);
  padding: 1rem 1.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bpos-dark);
}

.card-body { padding: 1.25rem; }

/* Stat cards */
.stat-card {
  border-left: 3px solid transparent;
  transition: transform var(--bpos-transition), box-shadow var(--bpos-transition);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card.stat-primary { border-left-color: var(--bpos-primary); }
.stat-card.stat-success { border-left-color: var(--bpos-success); }
.stat-card.stat-info { border-left-color: var(--bpos-info); }
.stat-card.stat-warning { border-left-color: var(--bpos-warning); }
.stat-card.stat-danger { border-left-color: var(--bpos-danger); }

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

.stat-card .stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--bpos-dark);
  line-height: 1.2;
}

.stat-card .stat-label {
  color: var(--bpos-secondary);
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}

.stat-card .stat-trend {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Labels */
.bg-label-primary { background: rgba(var(--bpos-primary-rgb), 0.12) !important; color: var(--bpos-primary) !important; }
.bg-label-success { background: rgba(40, 167, 69, 0.12) !important; color: #1e7e34 !important; }
.bg-label-warning { background: rgba(255, 193, 7, 0.16) !important; color: #b8860b !important; }
.bg-label-danger  { background: rgba(220, 53, 69, 0.12) !important; color: var(--bpos-danger) !important; }
.bg-label-info    { background: rgba(13, 202, 240, 0.12) !important; color: #0aa2c0 !important; }

/* Page header */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--bpos-dark);
  margin-bottom: 0.25rem;
}

.page-header-subtitle {
  color: var(--bpos-secondary);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.page-header-actions .btn { white-space: nowrap; }

/* Forms */
.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--bpos-dark);
  margin-bottom: 0.375rem;
}

.form-control, .form-select {
  border-color: rgba(67, 89, 113, 0.2);
  border-radius: var(--bpos-radius);
  font-size: 0.9375rem;
  padding: 0.5rem 0.875rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--bpos-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bpos-primary-rgb), 0.15);
}

.input-group-text {
  background: var(--bpos-body-bg);
  border-color: rgba(67, 89, 113, 0.2);
  color: var(--bpos-secondary);
}

.form-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--bpos-dark);
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(67, 89, 113, 0.1);
}

.form-section-title:first-child { margin-top: 0; }

/* Footer */
.content-footer {
  background: transparent !important;
  margin-top: auto;
}

.content-footer .footer-container {
  border-top: 1px solid rgba(67, 89, 113, 0.08);
}

/* Overlay */
.layout-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 44, 64, 0.5);
  z-index: 1035;
  backdrop-filter: blur(2px);
}

.layout-menu-expanded .layout-overlay { display: block; }

/* Login */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #2b2c40 0%, #405189 45%, #5a6ba8 100%);
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-brand {
  color: #fff;
  position: relative;
  z-index: 1;
}

.auth-brand .auth-logo {
  height: 44px;
  width: auto;
  max-width: 200px;
  margin-bottom: 2rem;
  filter: brightness(0) invert(1);
}

.auth-brand h1 {
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.25;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-feature i {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-top: 0.125rem;
}

.auth-card {
  border: none;
  border-radius: var(--bpos-radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.auth-card .auth-logo-sm {
  height: 36px;
  width: auto;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bpos-secondary);
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.4;
  display: block;
  margin-bottom: 0.75rem;
}

/* DataTables */
.dataTables_wrapper .dt-buttons { margin-bottom: 0.75rem; }
.dataTables_wrapper .dt-buttons .btn { font-size: 0.8125rem; }

table.dataTable thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bpos-secondary);
  border-bottom-width: 1px !important;
}

/* Print */
@media print {
  .layout-menu, .layout-navbar, .content-footer, .btn, .breadcrumb,
  .card-header .btn, .page-header-actions, .dataTables_wrapper .dt-buttons,
  .no-print { display: none !important; }
  .layout-page { margin-left: 0 !important; width: 100% !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* Responsive */
@media (max-width: 1199.98px) {
  .layout-menu {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }
  .layout-menu-expanded .layout-menu { transform: translateX(0); }
  .layout-page { margin-left: 0; width: 100%; }
  .layout-navbar { margin: 0.75rem 1rem 0; }
}

@media (max-width: 575.98px) {
  .page-header-actions { width: 100%; margin-top: 0.75rem; }
  .page-header-actions .btn { width: 100%; }
}
