:root {
  --brand-primary: #2563eb;
  --sidebar-width: 240px;
  --border-color: #e9ecef;
  --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background-color: #f4f6f8;
  color: #1f2937;
  font-family: "Cairo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
  color: var(--brand-primary);
}

/* ---------- App shell / sidebar layout ---------- */

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

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: #ffffff;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
  z-index: 1030;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  max-height: 60px;
  width: auto;
}

.sidebar-nav {
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow-y: auto;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  color: #4b5563;
  font-weight: 500;
  font-size: 0.925rem;
}

.sidebar-nav .nav-link i {
  font-size: 1.05rem;
  width: 1.1rem;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  background-color: #f1f5f9;
  color: #111827;
}

.sidebar-nav .nav-link.active {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.main-wrapper {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  color: #111827;
}

.sidebar-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: #4b5563;
  line-height: 1;
}

.content {
  padding: 1.5rem;
  flex: 1;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-right: 0;
  }

  .sidebar-toggle {
    display: inline-block;
  }
}

/* ---------- ERP surface styling ---------- */

.card {
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
}

.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.btn {
  border-radius: 0.5rem;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: color-mix(in srgb, var(--brand-primary) 85%, black);
  border-color: color-mix(in srgb, var(--brand-primary) 85%, black);
}

.form-control,
.form-select {
  border-radius: 0.5rem;
}

.form-control:focus,
.form-select:focus,
.btn:focus {
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand-primary) 25%, transparent);
  border-color: var(--brand-primary);
}

.table {
  background-color: #ffffff;
}

.badge {
  font-weight: 500;
}

.validation-summary-valid {
  display: none;
}

/* ---------- Login page ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: #f4f6f8;
  position: relative;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
}

.login-page::before {
  width: 320px;
  height: 320px;
  top: -100px;
  right: -100px;
  background: rgba(37, 99, 235, 0.16);
}

.login-page::after {
  width: 280px;
  height: 280px;
  bottom: -80px;
  left: -80px;
  background: rgba(245, 158, 11, 0.18);
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.login-card {
  border: none;
  border-radius: 1.5rem;
  box-shadow: 0 20px 45px -14px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.login-card .card-body {
  padding: 2.5rem 2.25rem;
}

.login-logo {
  height: 76px;
  width: auto;
  filter: drop-shadow(0 8px 16px rgba(245, 158, 11, 0.35));
  animation: login-logo-slide 3.5s ease-in-out infinite;
}

@keyframes login-logo-slide {
  0%, 100% {
    transform: translateX(-12px);
  }
  50% {
    transform: translateX(12px);
  }
}

.login-input-group .input-group-text {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: var(--brand-primary);
}

.login-input-group .form-control {
  border-color: #e2e8f0;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.login-input-group .form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.login-input-group:focus-within .input-group-text {
  border-color: var(--brand-primary);
}

.login-submit {
  padding: 0.65rem 1rem;
  font-weight: 600;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -8px rgba(37, 99, 235, 0.5);
}

/* ---------- Topbar user menu ---------- */

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-inline-start: auto;
}

.topbar-user-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.9rem;
}

/* ---------- Dashboard stat cards ---------- */

.stat-card .card-body {
  text-align: center;
  padding: 1.5rem 1rem;
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

.stat-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* ---------- Receipt form (mimics the paper receipt layout) ---------- */

.receipt-form-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px dashed var(--border-color);
}

.receipt-badge {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.receipt-badge-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.receipt-badge-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-primary);
  font-family: "Courier New", monospace;
}

.receipt-section {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  height: 100%;
}

.receipt-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
