:root {
  --font-sans:
    "IBM Plex Sans Arabic", "Changa", "Tajawal", "DIN Next LT Arabic",
    "Segoe UI", Tahoma, sans-serif;
  --font-display: "Changa", "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  --basar-pattern: url("images/battren.jpeg");
  --basar-pattern-size: 640px;
  --basar-pattern-opacity: 0.12;
  --app-gradient:
    radial-gradient(
      120% 120% at 100% 0%,
      color-mix(in oklab, var(--color-primary) 24%, transparent) 0%,
      transparent 55%
    ),
    radial-gradient(
      120% 120% at 0% 100%,
      color-mix(in oklab, var(--color-accent) 20%, transparent) 0%,
      transparent 55%
    ),
    linear-gradient(
      135deg,
      color-mix(in oklab, var(--color-background) 70%, var(--color-surface) 30%)
        0%,
      var(--color-background) 60%,
      color-mix(in oklab, var(--color-primary) 8%, var(--color-background) 92%)
        100%
    );
}

* {
  font-family: var(--font-sans);
}
input,
button,
select,
textarea,
optgroup,
option {
  font-family: var(--font-sans);
}

body {
  font-family: var(--font-sans);
  background: var(--app-gradient);
  color: var(--color-text-base);
  min-height: 100vh;
  line-height: 1.6;
}

h1,h2,h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 800;
}

h1,
h2,
h3,
.font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

::selection {
  background: color-mix(in oklab, var(--color-primary) 20%, transparent);
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--app-gradient);
  background-image:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.08)
    ),
    var(--app-gradient);
  background-size: 140%, cover;
  background-position: center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed;
  background-blend-mode: screen, normal;
  overflow: hidden;
}

.app-bg::before,
.app-bg::after {
  content: "";
  position: absolute;
  width: 56vmax;
  height: 56vmax;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.35;
  animation: appFloat 18s ease-in-out infinite;
}

.app-bg::before {
  background:
    radial-gradient(
      circle at 20% 15%,
      color-mix(in oklab, var(--color-accent) 45%, transparent),
      transparent 60%
    ),
    radial-gradient(
      circle at 80% 85%,
      color-mix(in oklab, var(--color-primary) 40%, transparent),
      transparent 65%
    );
  top: -18vmax;
  right: -12vmax;
}

.app-bg::after {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background-image: var(--basar-pattern);
  background-size: var(--basar-pattern-size);
  background-repeat: repeat;
  background-position: center;
  background-attachment: fixed;
  mix-blend-mode: soft-light;
  opacity: var(--basar-pattern-opacity);
  animation: none;
  pointer-events: none;
}

@keyframes appFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -3%, 0) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-bg::before,
  .app-bg::after {
    animation: none;
  }
}

[data-theme="dark"] {
  --basar-pattern-opacity: 0.18;
}

[data-theme="dark"] .app-bg {
  background-image:
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6)),
    var(--app-gradient);
  background-blend-mode: multiply, normal;
  background-size: 140%, cover;
}

:where(a, button, input, select, textarea, .btn):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px
    color-mix(in oklab, var(--color-primary) 25%, transparent);
}

/* Global premium UI */
.page-shell {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(237, 26, 59, 0.08),
      transparent 45%
    ),
    radial-gradient(circle at 80% 25%, rgba(14, 165, 233, 0.1), transparent 50%);
  pointer-events: none;
}

.page-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  padding: 1.2rem;
}

#documents-controls {
  display: grid;
  grid-template-columns: 1fr minmax(340px, 520px);
  grid-template-areas:
    "types search"
    "actions search";
  align-items: start;
  gap: 1rem;
}

#documents-controls .docs-controls-right {
  display: contents;
}

#documents-controls .docs-controls-types {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  grid-area: types;
}

#documents-controls .docs-controls-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

#documents-controls .docs-controls-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-end;
  min-width: 0;
  grid-area: search;
  align-self: start;
  flex-wrap: nowrap;
}

#documents-controls .docs-controls-search label {
  white-space: nowrap;
}

#documents-controls .docs-controls-search .relative {
  flex: 1 1 420px;
  min-width: 220px;
}

#documents-controls #do-search-input {
  height: 40px;
}

#documents-controls .doc-type-btn {
  height: 40px;
  padding-block: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

#documents-controls .action-btn {
  min-height: 40px;
  white-space: nowrap;
}

#documents-controls .btn {
  padding: 0.45rem 0.9rem;
  border-radius: 12px;
}

#documents-controls .action-btn:hover {
  transform: scale(1.03);
}

/* Save success pulse animation */
@keyframes saveSuccessPulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50%  { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.save-success {
  animation: saveSuccessPulse 0.6s ease-out;
}

/* Responsive Document Controls */
#documents-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0.75rem;
  z-index: 40;
}

/* Child Containers */
#documents-controls .docs-controls-right,
#documents-controls .docs-controls-actions,
#documents-controls .docs-controls-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Type Selector (Right in RTL) */
#documents-controls .docs-controls-right {
  flex: 0 0 auto;
}

/* Actions Group (Center) */
#documents-controls .docs-controls-actions {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 300px; /* Ensure buttons don't crush */
}

/* Search Bar (Left in RTL) */
#documents-controls .docs-controls-search {
  flex: 0 1 350px; /* Allow shrinking but prefer 350px */
  min-width: 250px;
}

/* Search Input */
#documents-controls .docs-controls-search input {
  width: 100%;
  transition: all 0.2s;
}

#documents-controls .docs-controls-search input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}

/* Breakpoint for intermediate screens (e.g. Tablets or Desktop with Sidebar Open) */
@media (max-width: 1200px) {
  #documents-controls {
    justify-content: center;
    gap: 1.25rem;
  }

  /* Move Search to top for easier access */
  #documents-controls .docs-controls-search {
    order: -1;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  #documents-controls .docs-controls-search input {
    max-width: 100%;
  }

  #documents-controls .docs-controls-right {
    order: 1;
    justify-content: center;
  }

  #documents-controls .docs-controls-actions {
    order: 2;
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* Small mobile adjustments */
@media (max-width: 640px) {
  #documents-controls {
    padding: 0.75rem;
  }

  #documents-controls .docs-controls-right,
  #documents-controls .docs-controls-actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  #documents-controls .docs-controls-right .flex.rounded-md {
    width: 100%;
    display: flex;
  }

  #documents-controls .doc-type-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  #documents-controls .action-btn {
    width: 100%;
    justify-content: center;
  }

  #documents-controls .docs-controls-actions > div {
    width: 100%;
    justify-content: center;
  }
}

#documents-controls .docs-overview-btn {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.04),
    rgba(59, 130, 246, 0.08)
  );
  border-color: rgba(59, 130, 246, 0.24);
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  white-space: nowrap;
}

#documents-controls .docs-overview-btn i {
  color: #2563eb;
}

#documents-controls .docs-overview-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.16);
}

#documents-controls .docs-overview-btn:active {
  transform: translateY(0);
}

#documents-controls .h-8.w-px {
  align-self: stretch;
}

#documents-controls #financial-only-control,
#documents-controls #po-alt-print-control {
  flex: 0 1 auto;
  max-width: 100%;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.page-search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: color-mix(
    in oklab,
    var(--color-surface) 75%,
    var(--color-background)
  );
  min-width: min(400px, 100%);
  flex: 1 1 240px;
}

.page-search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--color-text-base);
}

.page-search i {
  color: #94a3b8;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.data-table th {
  background: color-mix(
    in oklab,
    var(--color-surface) 70%,
    var(--color-background)
  );
  font-weight: 800;
  color: var(--color-text-base);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr:hover td {
  background: color-mix(
    in oklab,
    var(--color-primary) 7%,
    var(--color-surface)
  );
  transform: translateY(-1px);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.card :where(h1, h2, h3, h4) {
  color: var(--color-text-base);
}

.card :where(p, span, label, small, a) {
  color: inherit;
}

.table-shell {
  width: 100%;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  -webkit-overflow-scrolling: touch;
}

.table-shell::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-shell::-webkit-scrollbar-thumb {
  background: color-mix(
    in oklab,
    var(--color-border) 75%,
    var(--color-text-subtle)
  );
  border-radius: 999px;
}

.table-shell::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 640px) {
  .data-table th,
  .data-table td {
    padding: 0.7rem 0.8rem;
    font-size: 0.9rem;
  }
}

#monthly-reports-section
  :where(
    select,
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    textarea
  ) {
  background: var(--color-surface);
  color: var(--color-text-base);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
}

#monthly-reports-section :where(select, input, textarea)::placeholder {
  color: color-mix(in oklab, var(--color-text-subtle) 70%, transparent);
}

[data-theme="dark"]
  #monthly-reports-section
  :where(
    select,
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    textarea
  ) {
  background: color-mix(in oklab, var(--color-surface) 80%, #000);
}

[data-theme="dark"] .page-hero,
[data-theme="dark"] .page-card {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .page-search {
  background: #0b1320;
  border-color: #1f2937;
}

[data-theme="dark"] .page-search input {
  color: #e5e7eb;
}

[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td {
  border-color: #1f2937;
  color: #e5e7eb;
}

[data-theme="dark"] .data-table th {
  background: #0b1320;
}

[data-theme="dark"] .data-table tr:hover td {
  background: rgba(237, 26, 59, 0.14);
}

#clock-container {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  width: min(96vw, 1200px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.05rem 1.6rem;
  background: transparent;
  border-radius: 20px;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-align: right;
  color: var(--color-text-base);
  z-index: 5;
  overflow: hidden;
}

#clock-container::before {
  content: none;
}

[data-theme="dark"] #clock-container {
  background: transparent;
  border: none;
  box-shadow: none;
}

.clock-core {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}

#clock-time {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#clock-date {
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  font-weight: 600;
  color: var(--color-text-subtle);
}

.clock-divider {
  width: 1px;
  height: 48px;
  background: color-mix(in oklab, var(--color-border) 65%, transparent);
  opacity: 0.8;
}

.weather-widget {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem 0.45rem 0.7rem;
  min-width: 136px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  direction: rtl;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

[data-theme="dark"] .weather-widget {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.48)),
    radial-gradient(circle at 18% 20%, rgba(237, 26, 59, 0.14), transparent 48%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.weather-widget::before {
  content: none;
}

.weather-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow:
    0 6px 16px rgba(251, 191, 36, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: weatherFloat 6.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .weather-icon {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.04) 55%),
    linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(237, 26, 59, 0.14));
  border: 1px solid rgba(251, 191, 36, 0.18);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.weather-icon svg {
  width: 23px;
  height: 23px;
  display: block;
  filter: drop-shadow(0 6px 11px rgba(15, 23, 42, 0.1));
}

.weather-icon .sun-core {
  animation: weatherGlow 2.8s ease-in-out infinite;
  transform-origin: center;
}

.weather-icon .ray {
  animation: weatherRay 3.4s ease-in-out infinite;
  transform-origin: center;
  opacity: 0.9;
}

.weather-icon .drop {
  animation: weatherRain 1.2s ease-in-out infinite;
  transform-origin: center;
}

.weather-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  min-width: 0;
  text-align: right;
  position: relative;
  z-index: 1;
}

.weather-label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #111827;
  line-height: 1.25;
}

[data-theme="dark"] .weather-label {
  color: var(--color-text-base);
}

.weather-temp {
  font-size: 1rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.68);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .weather-temp {
  color: color-mix(in oklab, var(--color-text-base) 78%, transparent);
}

@keyframes weatherSheen {
  0%,
  68% {
    transform: translateX(-100%);
    opacity: 0;
  }
  78% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes weatherFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes weatherGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(237, 26, 59, 0));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(237, 26, 59, 0.28));
  }
}

@keyframes weatherRay {
  0%,
  100% {
    transform: rotate(0deg);
    opacity: 0.75;
  }
  50% {
    transform: rotate(8deg);
    opacity: 1;
  }
}

@keyframes weatherRain {
  0% {
    transform: translateY(-2px);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: translateY(7px);
    opacity: 0;
  }
}

.login-card {
  position: relative;
  z-index: 3;
}

@media (max-width: 1200px) {
  #clock-container {
    top: 1rem;
    width: min(96vw, 980px);
  }
}

@media (max-width: 720px) {
  #clock-container {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.2rem;
    text-align: center;
  }

  .clock-core {
    align-items: center;
  }

  .clock-divider {
    width: 100%;
    height: 1px;
  }

  .weather-widget {
    justify-content: center;
  }

  .weather-meta {
    align-items: center;
    text-align: center;
  }
}

.password-container {
  /* Ù†Ø¬Ø¹Ù„ Ø§Ù„Ù…ÙˆØ¶Ø¹ Ù†Ø³Ø¨ÙŠÙ‹Ø§ Ø­ØªÙ‰ Ù†ØªÙ…ÙƒÙ† Ù…Ù† ÙˆØ¶Ø¹ Ø§Ù„Ø£ÙŠÙ‚ÙˆÙ†Ø© Ø¨Ø¯Ø§Ø®Ù„Ù‡ */
  position: relative;
  width: fit-content;
  /* Ø£Ùˆ Ø­Ø¯Ø¯ Ø¹Ø±Ø¶Ù‹Ø§ Ø«Ø§Ø¨ØªÙ‹Ø§ Ù…Ø«Ù„ 300px */
}

.password-container input {
  /* Ø£Ø¶Ù Ø§Ù„ØªÙ†Ø³ÙŠÙ‚ Ø§Ù„Ø°ÙŠ ØªØ±ÙŠØ¯Ù‡ Ù„Ø­Ù‚Ù„ Ø§Ù„Ø¥Ø¯Ø®Ø§Ù„ */
  padding-left: 30px;
  /* Ù„Ø¥Ø¹Ø·Ø§Ø¡ Ù…Ø³Ø§Ø­Ø© Ù„Ù„Ø£ÙŠÙ‚ÙˆÙ†Ø© Ø¹Ù„Ù‰ Ø§Ù„ÙŠØ³Ø§Ø± */
  width: 250px;
  height: 40px;
  /* ... Ø£ÙŠ ØªÙ†Ø³ÙŠÙ‚Ø§Øª Ø£Ø®Ø±Ù‰ ... */
}

.password-container i {
  /* Ù†Ø¬Ø¹Ù„ Ù…ÙˆØ¶Ø¹ Ø§Ù„Ø£ÙŠÙ‚ÙˆÙ†Ø© Ù…Ø·Ù„Ù‚Ù‹Ø§ Ø¨Ø§Ù„Ù†Ø³Ø¨Ø© Ù„Ù„Ø­Ø§ÙˆÙŠØ© */
  position: absolute;
  top: 50%;
  left: 10px;
  /* ØªØ¨Ø¹Ø¯ 10 Ø¨ÙƒØ³Ù„ Ø¹Ù† Ø§Ù„Ø­Ø§ÙØ© Ø§Ù„ÙŠØ³Ø±Ù‰ */
  transform: translateY(-50%);
  /* Ù„ØªÙˆØ³ÙŠØ· Ø§Ù„Ø£ÙŠÙ‚ÙˆÙ†Ø© Ø¹Ù…ÙˆØ¯ÙŠÙ‹Ø§ */
  cursor: pointer;
  /* ØªØºÙŠÙŠØ± Ø´ÙƒÙ„ Ø§Ù„Ù…Ø¤Ø´Ø± Ù„Ù„Ø¥Ø´Ø§Ø±Ø© Ø¥Ù„Ù‰ Ø£Ù†Ù‡Ø§ Ù‚Ø§Ø¨Ù„Ø© Ù„Ù„Ù†Ù‚Ø± */
  color: #888;
  /* Ù„ÙˆÙ† Ø§Ù„Ø£ÙŠÙ‚ÙˆÙ†Ø© */
}

/* Inactivity Warning Overlay */
body.inactivity-warning::after {
  content: "Ø³ÙŠØªÙ… ØªØ³Ø¬ÙŠÙ„ Ø§Ù„Ø®Ø±ÙˆØ¬ Ø¨Ø¹Ø¯ 30 Ø«Ø§Ù†ÙŠØ© Ø¨Ø³Ø¨Ø¨ Ø¹Ø¯Ù… Ø§Ù„Ù†Ø´Ø§Ø·";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f08f8f;
  opacity: 0.9;
  /* Semi-transparent red */
  z-index: 9998;
  /* Below modals but above everything else */

  /* Centering the text */
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  padding: 2rem;
  text-align: center;
}

.alert-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  /* Hidden by default */
  align-items: center;
  justify-content: center;
}

.alert-modal-backdrop.visible {
  display: flex;
  /* Shown when 'visible' class is added */
}

.alert-modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.alert-modal-content h3 {
  font-size: 1.25rem;
  font-weight: bold;
  color: #334155;
  /* slate-700 */
  margin-bottom: 0.5rem;
}

.alert-modal-content p {
  color: #64748b;
  /* slate-500 */
  margin-bottom: 1.5rem;
}

.alert-modal-content button {
  background-color: #ef4444;
  /* red-500 */
  color: white;
  font-weight: bold;
  padding: 0.5rem 2rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.alert-modal-content button:hover {
  background-color: #dc2626;
  /* red-600 */
}

.wo-attachments-card {
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.96),
    rgba(255, 255, 255, 0.95)
  );
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.wo-attachments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wo-attachments-title {
  font-weight: 800;
  color: #0f172a;
  font-size: 1rem;
}

.wo-attachments-sub {
  font-size: 0.85rem;
  color: #64748b;
}

.wo-attachments-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .wo-attachments-grid {
    grid-template-columns: 1fr;
  }
}

.wo-attachment-block {
  border: 1px dashed #d8dee9;
  border-radius: 14px;
  padding: 0.9rem;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
}

.wo-attachment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.wo-attachment-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.wo-attachment-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

.wo-attachment-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.wo-attachment-preview {
  margin-top: 0.75rem;
  min-height: 140px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.8),
    rgba(255, 255, 255, 0.95)
  );
  border: 1px dashed #d8dee9;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  overflow: hidden;
}

.wo-attachment-preview img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
}

.wo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.wo-gallery-item {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wo-gallery-remove {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.wo-gallery-empty {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}
/* Ø§Ù„Ø«ÙŠÙ… Ø§Ù„ÙØ§ØªØ­ (Ø§Ù„Ø§ÙØªØ±Ø§Ø¶ÙŠ) */
/* :root {
            --bg-color: #ffffff;
          
            --text-color: #1e293b;
         
            --primary-color: #dc2626;
          
            --card-bg: #f8fafc;
            
        } */

/* Ø§Ù„Ø«ÙŠÙ… Ø§Ù„Ø¯Ø§ÙƒÙ† */

#app-container,
#auth-container,
#admin-container {
  display: none;
  /* Hide all views initially */
}

/* Override helper to force admin panel visible when requested */
#admin-container.admin-visible:not(.hidden) {
  display: block !important;
}

.watermark-container {
  position: relative;
  overflow: hidden;
}

.watermark-container::after {
  content: "Ø¹Ø±Ø¶ Ø³Ø¹Ø±";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 6rem;
  font-weight: 900;
  color: rgba(220, 38, 38, 0.03);
  z-index: 0;
  pointer-events: none;
  display: none;
  font-family: "DIN Next LT Arabic", "Tajawal", "Cairo", sans-serif;
}

.quotation-watermark::after {
  display: block;
}

#print-container {
  display: none;
}

.doc-type-btn.active,
.doc-type-btn-admin.active {
  background-color: #dc2626;
  color: white;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.invalid-input {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
}

.action-btn {
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1-px rgba(0, 0, 0, 0.06);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: right;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 90%;
  max-width: 450px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* User management modals - landscape, wide layout */
.user-management-modal .modal-content {
  width: min(95vw, 900px);
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}

.user-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .user-modal-grid {
    grid-template-columns: 1fr;
  }
}

.user-modal-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 0.875rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.user-modal-header h3 {
  text-align: center;
}

.user-modal-footer {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Item translate controls */
.item-translate-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.item-translate-btn,
.item-translate-undo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-weight: 700;
  font-size: 0.9rem;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.item-translate-btn {
  background: linear-gradient(135deg, #ed1a3b, #f872a0);
  color: #fff;
  box-shadow: 0 10px 26px rgba(237, 26, 59, 0.25);
}

.item-translate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(237, 26, 59, 0.28);
}

.item-translate-btn:active {
  transform: translateY(0);
}

.item-translate-undo {
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.item-translate-undo:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
}

.item-translate-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
/* Dashboard refresh */
.dashboard-shell {
  --dashboard-accent: #ed1a3b;
  --dashboard-accent-soft: rgba(237, 26, 59, 0.12);
  --dashboard-border: var(--color-border);
  --dashboard-surface: var(--color-surface);
  --dashboard-surface-muted: rgba(15, 23, 42, 0.04);
  --dashboard-text: var(--color-text-base);
  --dashboard-text-muted: var(--color-text-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

[data-theme="dark"] .dashboard-shell {
  --dashboard-accent-soft: rgba(237, 26, 59, 0.2);
  --dashboard-border: rgba(148, 163, 184, 0.18);
  --dashboard-surface-muted: rgba(148, 163, 184, 0.08);
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(248, 250, 252, 0.92)
  );
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  flex-direction: row-reverse;
  position: relative;
  overflow: hidden;
}

.dashboard-topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 25%,
      rgba(237, 26, 59, 0.08),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 10%,
      rgba(14, 165, 233, 0.08),
      transparent 50%
    );
  pointer-events: none;
}

.dashboard-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dashboard-text-muted);
  font-weight: 700;
}

.dashboard-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-title {
  font-size: clamp(1.45rem, 1.15rem + 1vw, 1.95rem);
  font-weight: 800;
  color: #0f172a;
}

.dashboard-title-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(237, 26, 59, 0.1);
  color: #ed1a3b;
  font-size: 0.7rem;
  font-weight: 700;
}

.dashboard-subtitle {
  color: #6b7280;
  font-size: 0.9rem;
}

.dashboard-topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex-direction: row-reverse;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.95)
  );
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.dashboard-chip-muted {
  background: rgba(15, 23, 42, 0.04);
  color: var(--dashboard-text-muted);
}

/* Shared page layout */
.page-shell {
  width: min(100% - 2rem, 1440px);
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}

.page-hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.page-hero-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  font-weight: 700;
}

.page-hero-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-subtle);
}

.page-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 1.25rem;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.page-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  min-width: 220px;
}

.page-search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--color-text-base);
}

.page-search i {
  color: var(--color-text-subtle);
}

.documents-overview-hero {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--color-primary) 90%, white 10%),
    color-mix(in oklab, var(--color-secondary) 78%, var(--color-primary) 22%)
  ) !important;
  border: 1px solid
    color-mix(in oklab, var(--color-primary) 32%, var(--color-border) 68%) !important;
  box-shadow: var(--shadow-md) !important;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.documents-overview-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.22),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 30%,
      rgba(255, 255, 255, 0.14),
      transparent 55%
    ),
    linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 45%);
  pointer-events: none;
  mix-blend-mode: screen;
}

.documents-overview-filters {
  background: var(--surface-glass) !important;
  border: 1px solid var(--surface-glass-border) !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: blur(10px) !important;
}

.docs-ov-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.docs-ov-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #fff;
  margin-top: 0.25rem;
}

.docs-ov-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 0.35rem;
  max-width: 56ch;
}

.docs-ov-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.docs-ov-hero-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.docs-ov-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  font-size: 0.82rem;
  backdrop-filter: blur(6px);
}

.docs-ov-chip i {
  color: #fff;
}

.docs-ov-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-text-base);
  margin-bottom: 0.35rem;
}

.docs-ov-label i {
  color: var(--color-primary);
}

.docs-ov-input {
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 0.55rem 0.85rem;
  color: var(--color-text-base);
  outline: none;
  box-shadow: var(--shadow-xs);
}

.docs-ov-input:focus {
  border-color: color-mix(
    in oklab,
    var(--color-primary) 45%,
    var(--color-border) 55%
  );
  box-shadow: 0 0 0 3px
    color-mix(in oklab, var(--color-primary) 20%, transparent);
}

.docs-ov-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 0.9rem;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.docs-ov-btn-primary {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--color-primary) 86%, #ff5a72 14%),
    var(--color-primary)
  );
  color: #fff;
  border-color: color-mix(
    in oklab,
    var(--color-primary) 40%,
    rgba(255, 255, 255, 0.1) 60%
  );
  box-shadow: 0 14px 32px rgba(237, 26, 59, 0.22);
}

.docs-ov-btn-ghost {
  background: color-mix(
    in oklab,
    var(--color-surface) 80%,
    var(--color-primary) 6%
  );
  color: var(--color-text-base);
  border-color: color-mix(
    in oklab,
    var(--color-primary) 18%,
    var(--color-border) 82%
  );
  box-shadow: var(--shadow-xs);
}

.docs-ov-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.docs-ov-btn:active {
  transform: translateY(0);
}

.docs-ov-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid
    color-mix(in oklab, var(--color-primary) 18%, var(--color-border) 82%);
  background: color-mix(
    in oklab,
    var(--color-surface) 86%,
    var(--color-primary) 6%
  );
  color: var(--color-text-base);
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: var(--shadow-xs);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.docs-ov-pill i {
  color: var(--color-primary);
}

.docs-ov-pill.active {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--color-primary) 86%, #ff5a72 14%),
    var(--color-primary)
  );
  color: #fff;
  border-color: color-mix(
    in oklab,
    var(--color-primary) 55%,
    rgba(255, 255, 255, 0.12) 45%
  );
  box-shadow: 0 14px 30px rgba(237, 26, 59, 0.22);
}

.docs-ov-pill.active i {
  color: #fff;
}

.docs-ov-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  filter: brightness(1.02);
}

.docs-ov-pill-ghost {
  background: transparent;
  border-color: color-mix(in oklab, var(--color-border) 75%, transparent 25%);
}

.docs-ov-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid
    color-mix(in oklab, var(--color-border) 75%, transparent 25%);
  background: var(--color-surface);
  color: var(--color-text-base);
  font-weight: 900;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xs);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.docs-ov-type-btn i {
  color: var(--color-primary);
}

.docs-ov-type-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  filter: brightness(1.02);
}

.docs-ov-progress-bar {
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--color-primary) 90%, #ff5a72 10%),
    var(--color-primary)
  );
}

.docs-ov-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.docs-ov-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 18px;
  border: 1px solid
    color-mix(
      in oklab,
      var(--color-border) 70%,
      var(--color-primary) 12%,
      transparent 18%
    );
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-surface) 92%, var(--color-background) 8%),
    var(--color-surface)
  );
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.docs-ov-row-actions-secondary {
  padding-top: 0.45rem;
  border-top: 1px dashed
    color-mix(in oklab, var(--color-border) 70%, transparent 30%);
}

#welcomeModal .welcome-modal {
  max-width: min(720px, 92vw);
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    color-mix(in oklab, var(--color-surface) 94%, white 6%),
    color-mix(in oklab, var(--color-surface) 86%, var(--color-background) 14%)
  );
  border: 1px solid
    color-mix(
      in oklab,
      var(--color-border) 70%,
      var(--color-primary) 10%,
      transparent 20%
    );
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: 1.25rem 1.25rem 1.1rem;
}

#welcomeModal .welcome-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#welcomeModal .welcome-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

#welcomeModal .welcome-title {
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--color-text-base);
}

#welcomeModal .welcome-subtitle {
  font-size: 0.92rem;
  color: color-mix(in oklab, var(--color-text-base) 70%, transparent);
  margin-top: 0.2rem;
}

#welcomeModal .welcome-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid
    color-mix(in oklab, var(--color-border) 70%, transparent 30%);
  background: color-mix(
    in oklab,
    var(--color-surface) 92%,
    var(--color-background) 8%
  );
  color: color-mix(in oklab, var(--color-text-base) 72%, transparent);
  box-shadow: var(--shadow-xs);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

#welcomeModal .welcome-close:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  filter: brightness(1.02);
}

#welcomeModal .welcome-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}

#welcomeModal .welcome-card {
  border-radius: 16px;
  border: 1px solid
    color-mix(in oklab, var(--color-border) 70%, transparent 30%);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  padding: 0.95rem;
}

[data-theme="dark"] #welcomeModal .welcome-card {
  background: rgba(15, 23, 42, 0.55);
}

#welcomeModal .welcome-card-title {
  font-weight: 900;
  color: var(--color-text-base);
  margin-bottom: 0.6rem;
}

#welcomeModal .welcome-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#welcomeModal .welcome-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 700;
  color: color-mix(in oklab, var(--color-text-base) 78%, transparent);
  line-height: 1.55;
}

#welcomeModal .welcome-list i {
  margin-top: 0.1rem;
  color: var(--color-primary);
}

#welcomeModal .welcome-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

#welcomeModal .welcome-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 44px;
  padding: 0 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid
    color-mix(in oklab, var(--color-primary) 65%, rgba(255, 255, 255, 0.14) 35%);
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--color-primary) 86%, #ff5a72 14%),
    var(--color-primary)
  );
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(237, 26, 59, 0.24);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

#welcomeModal .welcome-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 48px rgba(237, 26, 59, 0.28);
  filter: brightness(1.02);
}

#welcomeModal .welcome-primary:active {
  transform: translateY(0);
}

@media (max-width: 820px) {
  #welcomeModal .welcome-body {
    grid-template-columns: 1fr;
  }
}

#documents-overview-section .docs-ov-row-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid
    color-mix(
      in oklab,
      var(--color-border) 72%,
      var(--color-primary) 10%,
      transparent 18%
    );
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-surface) 92%, white 8%),
    var(--color-surface)
  );
  color: var(--color-text-base);
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow:
    0 12px 26px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

#documents-overview-section .docs-ov-row-btn i {
  color: var(--color-primary);
  font-size: 0.95rem;
  line-height: 1;
}

#documents-overview-section .docs-ov-row-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  filter: brightness(1.02);
}

#documents-overview-section .docs-ov-row-btn:active {
  transform: translateY(0);
  box-shadow:
    0 12px 26px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#documents-overview-section .docs-ov-row-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--color-primary) 22%, transparent),
    0 16px 34px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#documents-overview-section .docs-ov-row-btn:disabled,
#documents-overview-section .docs-ov-row-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#documents-overview-section .docs-ov-row-btn-primary {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--color-primary) 86%, #ff5a72 14%),
    var(--color-primary)
  );
  border-color: color-mix(
    in oklab,
    var(--color-primary) 65%,
    rgba(255, 255, 255, 0.14) 35%
  );
  color: #fff;
  box-shadow:
    0 16px 36px rgba(237, 26, 59, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#documents-overview-section .docs-ov-row-btn-primary i {
  color: #fff;
}

#documents-overview-section .docs-ov-row-btn-soft {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-primary) 10%, var(--color-surface) 90%),
    var(--color-surface)
  );
  border-color: color-mix(
    in oklab,
    var(--color-primary) 28%,
    var(--color-border) 72%
  );
}

#documents-overview-section .docs-ov-row-btn-outline {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-surface) 88%, var(--color-primary) 3%),
    transparent
  );
  border-color: color-mix(
    in oklab,
    var(--color-primary) 45%,
    var(--color-border) 55%
  );
  color: var(--color-primary);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

#documents-overview-section .docs-ov-row-btn-outline i {
  color: var(--color-primary);
}

#documents-overview-section .docs-ov-row-btn-danger {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--color-primary-strong) 72%, #7f1d1d 28%),
    var(--color-primary-strong)
  );
  border-color: color-mix(
    in oklab,
    var(--color-primary-strong) 62%,
    rgba(255, 255, 255, 0.14) 38%
  );
  color: #fff;
  box-shadow:
    0 16px 36px rgba(127, 29, 29, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#documents-overview-section .docs-ov-row-btn-danger i {
  color: #fff;
}

#documents-overview-section .docs-ov-row-btn-ghost {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-surface) 90%, var(--color-background) 10%),
    var(--color-surface)
  );
  border-color: color-mix(in oklab, var(--color-border) 82%, transparent 18%);
}

.documents-overview-toolbar .doc-type-btn-admin.active {
  background: color-mix(
    in oklab,
    var(--color-primary) 12%,
    var(--color-surface) 88%
  );
  border-color: color-mix(
    in oklab,
    var(--color-primary) 35%,
    var(--color-border) 65%
  );
  color: var(--color-primary);
  box-shadow: none;
}

/* --- Nav Guide (Sections Guide) Sidebar --- */
.nav-guide {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  width: 320px;
  height: 100vh !important;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  z-index: 9999 !important;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode support */
[data-theme="dark"] .nav-guide {
  background-color: rgba(15, 23, 42, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.nav-guide.hidden {
  display: none !important;
}

.nav-guide-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .nav-guide-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-guide-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-base);
  margin-bottom: 0.25rem;
}

.nav-guide-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-subtle);
  line-height: 1.5;
}

.nav-guide-close {
  background: transparent;
  border: none;
  color: var(--color-text-subtle);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-guide-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--color-primary);
}

[data-theme="dark"] .nav-guide-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-guide-group {
  margin-bottom: 2rem;
}

.nav-guide-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.nav-guide-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-guide-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem;
  border-radius: 12px;
  background-color: var(--color-surface-muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-guide-card:hover {
  background-color: var(--color-surface);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

[data-theme="dark"] .nav-guide-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Card hover glow effect */
.nav-guide-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, color-mix(in oklab, var(--accent) 10%, transparent) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.nav-guide-card:hover::after {
  opacity: 1;
}

.nav-guide-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px color-mix(in oklab, var(--accent) 40%, transparent);
}

.nav-guide-label {
  font-weight: 700;
  color: var(--color-text-base);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.nav-guide-desc {
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  line-height: 1.4;
}

.nav-guide-footer {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  opacity: 0.7;
}

[data-theme="dark"] .nav-guide-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
  .docs-ov-title {
    font-size: 1.25rem;
  }

  .docs-ov-input {
    height: 42px;
  }
}

.dashboard-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dashboard-text);
  cursor: pointer;
}

.dashboard-icon-btn:hover {
  background: var(--dashboard-surface-muted);
}

.dashboard-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.dashboard-sidebar {
  width: 260px;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 1.5rem;
}

.dashboard-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-sidebar-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--dashboard-accent);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dashboard-sidebar-title {
  font-weight: 700;
  color: var(--dashboard-text);
}

.dashboard-sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--dashboard-text-muted);
}

.dashboard-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-sidebar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dashboard-text-muted);
  font-weight: 700;
}

.dashboard-sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dashboard-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--dashboard-text);
  font-weight: 600;
  background: transparent;
}

.dashboard-sidebar-link i {
  color: var(--dashboard-text-muted);
}

.dashboard-sidebar-link.is-active {
  background: var(--dashboard-accent-soft);
  border-color: rgba(237, 26, 59, 0.3);
  color: var(--dashboard-accent);
}

.dashboard-sidebar-link.is-active i {
  color: var(--dashboard-accent);
}

.dashboard-sidebar-link-text {
  font-size: 0.9rem;
}

.dashboard-sidebar-card {
  border: 1px solid var(--dashboard-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--dashboard-surface-muted);
}

.dashboard-sidebar-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dashboard-text);
}

.dashboard-sidebar-card-value {
  color: var(--dashboard-accent);
  font-weight: 700;
}

.dashboard-sidebar-card-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--dashboard-text-muted);
  line-height: 1.5;
}

.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center; /* Center items vertically */
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  border-radius: 24px; /* More rounded */
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7),
    rgba(241, 245, 249, 0.8)
  );
  backdrop-filter: blur(12px); /* Glass effect */
  box-shadow:
    0 20px 40px -10px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  /* flex-direction: row-reverse; Removed to align items to the right in RTL */
  position: relative;
  overflow: visible; /* Allow shadows to spill */
  margin-bottom: 2rem;
}

.dashboard-filters::before {
  display: none; /* Remove old effect */
}

.dashboard-filters-title {
  display: flex;
  flex-direction: column; /* Stack icon and text slightly or keep side-by-side */
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: auto;
  padding-left: 1rem;
  border-left: 1px solid rgba(203, 213, 225, 0.4); /* Separator */
  margin-left: 0.5rem;
}

.dashboard-filter-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    var(--color-primary),
    #be123c
  ); /* Gradient icon bg */
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(237, 26, 59, 0.25);
  font-size: 1.1rem;
}

.dashboard-filters-heading {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--dashboard-text);
  letter-spacing: -0.02em;
}

.dashboard-filters-sub {
  font-size: 0.7rem;
  color: var(--dashboard-text-muted);
  font-weight: 500;
}

.dashboard-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 160px;
  text-align: right;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.dashboard-filter-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
  margin-right: 0.25rem;
  opacity: 0.9;
}

.dashboard-filter-select {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: #fff;
  color: var(--color-text-base);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.04),
    0 2px 4px -1px rgba(15, 23, 42, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  background-size: 1rem;
  padding-left: 2.5rem; /* Space for arrow */
}

.dashboard-filter-select:hover,
.dashboard-filter-input:hover {
  border-color: rgba(237, 26, 59, 0.3);
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.dashboard-filter-select:focus,
.dashboard-filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(237, 26, 59, 0.15);
}

.dashboard-filter-range {
  min-width: 340px;
  flex: 1.5; /* Give slightly more space to the range inputs */
}

.dashboard-filter-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  padding: 0.35rem;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.04);
}

.dashboard-filter-input {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  border: none; /* Removed border for seamless look inside group */
  background: transparent;
  color: var(--color-text-base);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: none;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
  font-family: inherit;
  min-width: 0; /* Allow shrinking */
}

.dashboard-filter-input:hover {
  background: #f8fafc;
  transform: none; /* Disable transform for inner inputs */
  box-shadow: none;
}

.dashboard-filter-input:focus {
  background: #f1f5f9;
  box-shadow: none;
  border-color: transparent;
}

.dashboard-filter-divider {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 0.25rem;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .dashboard-filters {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.8),
    rgba(15, 23, 42, 0.9)
  );
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dashboard-filters-title {
  border-left-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dashboard-filter-select {
  background-color: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

[data-theme="dark"] .dashboard-filter-range-inputs {
  background-color: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dashboard-filter-input {
  color: #e2e8f0;
}

[data-theme="dark"] .dashboard-filter-input:hover,
[data-theme="dark"] .dashboard-filter-input:focus {
  background-color: #0f172a;
}
[data-theme="dark"] .dashboard-filter-select:focus-visible,
[data-theme="dark"] .dashboard-filter-input:focus-visible,
.dashboard-filter-select:focus-visible,
.dashboard-filter-input:focus-visible {
  border-color: color-mix(in oklab, var(--dashboard-accent) 60%, #e2e8f0 40%);
  box-shadow: 0 0 0 3px rgba(237, 26, 59, 0.12);
  transform: translateY(-1px);
}

[data-theme="dark"] .dashboard-filter-input::placeholder {
  color: #cbd5e1;
}

.dashboard-filter-divider {
  color: var(--dashboard-text-muted);
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.15rem;
}

.dashboard-span-3 {
  grid-column: span 3;
}

.dashboard-span-4 {
  grid-column: span 4;
}

.dashboard-span-8 {
  grid-column: span 8;
}

.dashboard-span-12 {
  grid-column: span 12;
}

.dashboard-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.94)
  );
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.dashboard-kpi:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.16);
  border-color: rgba(237, 26, 59, 0.18);
}

.dashboard-kpi-label {
  font-size: 0.75rem;
  color: var(--dashboard-text-muted);
  font-weight: 600;
}

.dashboard-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dashboard-text);
  animation: kpiCountUp 0.45s ease both;
}

.dashboard-kpi-meta {
  margin-top: 0.35rem;
}

.dashboard-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.dashboard-kpi-trend--up {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.14);
}

.dashboard-kpi-trend--down {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.14);
}

.dashboard-kpi-icon {
  --kpi-color: var(--dashboard-accent);
  --kpi-soft: var(--dashboard-accent-soft);
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(
    145deg,
    rgba(237, 26, 59, 0.14),
    rgba(237, 26, 59, 0.04)
  );
  color: var(--kpi-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.dashboard-kpi-icon--green {
  --kpi-color: #16a34a;
  --kpi-soft: rgba(22, 163, 74, 0.16);
}

.dashboard-kpi-icon--blue {
  --kpi-color: #2563eb;
  --kpi-soft: rgba(37, 99, 235, 0.16);
}

.dashboard-kpi-icon--amber {
  --kpi-color: #f59e0b;
  --kpi-soft: rgba(245, 158, 11, 0.18);
}

.dashboard-panel {
  padding: 1.35rem;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.95)
  );
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.dashboard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dashboard-text);
}

.dashboard-panel-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dashboard-text-muted);
  background: var(--dashboard-surface-muted);
  border: 1px solid var(--dashboard-border);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.dashboard-chart {
  min-height: 260px;
}

.dashboard-chart canvas {
  width: 100% !important;
}

.dashboard-table {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(248, 250, 252, 0.95)
  );
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
}

.dashboard-table-head {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: linear-gradient(
    120deg,
    rgba(15, 23, 42, 0.04),
    rgba(237, 26, 59, 0.06)
  );
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dashboard-table-body {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

#top-clients-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.85rem 1rem !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92) !important;
  border-radius: 0 !important;
}

#top-clients-list li:last-child {
  border-bottom: none;
}

#top-clients-list .font-bold {
  color: #16a34a !important;
}

.dashboard-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-activity-list > div {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.92)
  );
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.dashboard-activity-list .text-slate-500 {
  color: var(--dashboard-text-muted) !important;
}

.dashboard-sidebar-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#dashboard-sidebar-toggle:checked ~ .dashboard-layout .dashboard-sidebar {
  width: 90px;
  padding: 1rem 0.75rem;
}

#dashboard-sidebar-toggle:checked
  ~ .dashboard-layout
  .dashboard-sidebar
  .dashboard-sidebar-info,
#dashboard-sidebar-toggle:checked
  ~ .dashboard-layout
  .dashboard-sidebar
  .dashboard-sidebar-label,
#dashboard-sidebar-toggle:checked
  ~ .dashboard-layout
  .dashboard-sidebar
  .dashboard-sidebar-link-text,
#dashboard-sidebar-toggle:checked
  ~ .dashboard-layout
  .dashboard-sidebar
  .dashboard-sidebar-card {
  display: none;
}

#dashboard-sidebar-toggle:checked
  ~ .dashboard-layout
  .dashboard-sidebar
  .dashboard-sidebar-link {
  justify-content: center;
}

@media (max-width: 1200px) {
  .dashboard-span-3,
  .dashboard-span-4 {
    grid-column: span 6;
  }

  .dashboard-span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 1024px) {
  .enterprise-nav {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .enterprise-nav .header-left,
  .enterprise-nav .header-right,
  .enterprise-nav .header-center {
    justify-self: stretch;
  }

  .enterprise-nav .header-center {
    flex-direction: column;
  }

  .app-shell {
    width: min(100% - 1.5rem, 1440px);
    flex-direction: column;
  }
}

#documents-overview-section .documents-overview-hero {
  align-items: flex-start;
}

#documents-overview-section .documents-overview-hero .inline-flex {
  flex-wrap: wrap;
}

#documents-overview-section .documents-overview-filter-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

#documents-overview-section .documents-overview-filter-row {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  #documents-overview-section .documents-overview-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #documents-overview-section .documents-overview-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* App shell + right sidebar */
.app-shell {
  width: min(100% - 2rem, 1440px);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#main-nav.app-sidebar {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem;
  border-radius: 20px;
  background:
    radial-gradient(120% 100% at 50% 0%,
      rgba(180, 40, 55, 0.25) 0%,
      rgba(40, 10, 18, 0.85) 40%,
      rgba(15, 5, 10, 0.98) 100%),
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.04),
      rgba(0, 0, 0, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 5.5rem;
  min-height: calc(100vh - 7rem);
}

#main-nav.app-sidebar .nav-btn {
  display: flex;
  align-items: center;
  flex-direction: row;
  width: 100%;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg,
    rgba(120, 20, 30, 0.35),
    rgba(60, 10, 18, 0.2));
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.88);
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
  backdrop-filter: blur(4px);
}

#main-nav.app-sidebar .nav-btn::after {
  display: none;
}

#main-nav.app-sidebar .nav-btn svg,
#main-nav.app-sidebar .nav-btn i {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.65);
  order: 2;
  margin-right: 0;
  margin-left: auto;
  transition: color 0.25s ease;
}

#main-nav.app-sidebar .nav-btn:hover {
  background: linear-gradient(135deg,
    rgba(160, 30, 45, 0.5),
    rgba(80, 15, 25, 0.35));
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

#main-nav.app-sidebar .nav-btn:hover svg,
#main-nav.app-sidebar .nav-btn:hover i {
  color: rgba(255, 255, 255, 0.9);
}

#main-nav.app-sidebar .nav-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px
    color-mix(in oklab, var(--color-primary) 40%, transparent);
}

#main-nav.app-sidebar .nav-btn.active {
  background: linear-gradient(135deg,
    rgba(200, 40, 55, 0.6),
    rgba(100, 20, 30, 0.45));
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#main-nav.app-sidebar .nav-btn.active svg,
#main-nav.app-sidebar .nav-btn.active i {
  color: #ffffff;
}

#main-nav.app-sidebar .nav-secondary {
  background: transparent;
}

@media (min-width: 768px) {
  #main-nav.app-sidebar.hidden {
    display: flex !important;
  }
}

@media (min-width: 1024px) {
  #main-nav.app-sidebar {
    max-height: calc(100vh - 6.5rem);
  }
}

@media (max-width: 1024px) {
  .brand-title {
    display: none;
  }
}

@media (max-width: 767px) {
  .app-header {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  #header-start {
    width: 100%;
    justify-content: space-between;
  }

  #user-menu-button {
    padding: 0.35rem 0.65rem;
  }

  #user-menu-button .text-sm span[data-lang="welcome"],
  #user-menu-button .permission-badge-label {
    display: none;
  }

  #user-name-display {
    max-width: 96px;
  }

  #main-nav .nav-btn {
    width: 100%;
    justify-content: flex-start;
  }

  #main-nav.app-sidebar {
    position: fixed;
    top: 5.5rem;
    inset-inline-end: 1rem;
    width: min(82vw, 320px);
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    transform: translateX(120%);
    transition: transform 0.2s ease;
    z-index: 80;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
  }

  #main-nav.app-sidebar.is-open {
    transform: translateX(0);
  }

  #header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
  }

  #header-actions .btn {
    justify-content: center;
  }

  #header-actions .btn,
  #header-actions #admin-panel-button,
  #header-actions .theme-dropdown {
    width: 100%;
  }

  #header-actions .theme-dropdown {
    display: flex;
  }

  #header-actions .theme-dropdown > .btn {
    flex: 1 1 auto;
  }

  .header-divider {
    display: none;
  }

  .nav-guide {
    padding: 0.95rem;
  }

  .nav-guide-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-guide-close {
    align-self: flex-end;
  }

  .nav-guide-grid {
    grid-template-columns: 1fr;
  }
}

.invalid-input {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 800;
  border-radius: 14px;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, #ed1a3b, #f43f5e);
  border-color: #fca5a5;
  color: #fff;
  box-shadow: 0 14px 32px rgba(237, 26, 59, 0.22);
}

.btn-secondary {
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  color: #0f172a;
  border-color: #dbeafe;
  box-shadow: 0 12px 26px rgba(59, 130, 246, 0.16);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-base);
  box-shadow: none;
}

.btn-ghost:hover {
  background: color-mix(
    in oklab,
    var(--color-primary) 6%,
    var(--color-surface)
  );
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: color-mix(in oklab, #ef4444 55%, #ffffff);
  color: #fff;
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.18);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(0);
}

[data-theme="dark"] .btn-primary {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  border-color: rgba(248, 113, 113, 0.4);
}

[data-theme="dark"] .btn-secondary {
  background: linear-gradient(135deg, #0f172a, #111827);
  border-color: #1f2937;
  color: #e5e7eb;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .btn-danger {
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.action-btn {
  transform: translateY(0);
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.08);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  /* New blur effect */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: rgba(255, 255, 255, 0.95);
  /* Slightly transparent */
  padding: 2rem;
  border-radius: 0.75rem;
  /* Larger radius */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  text-align: right;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  width: 90%;
  max-width: 450px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#adminDocViewModal .modal-content {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

/* --- Documents Overview Modal --- */
.documents-overview-modal {
  width: calc(100vw - 3rem);
  height: calc(100vh - 3rem);
  max-width: none;
  max-height: none;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, #fff7f8, #fdf1f4 40%, #ffffff);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(237, 26, 59, 0.08);
}

.documents-overview-modal .documents-overview-modal-body {
  flex: 1;
  overflow: auto;
  padding-right: 0.75rem;
  padding-bottom: 1rem;
  max-height: none;
}

.documents-overview-modal .documents-overview-modal-body > * {
  width: 100%;
}

/* Brand styling for documents overview */
.documents-overview-modal {
  --brand: #ed1a3b;
  --brand-soft: rgba(237, 26, 59, 0.1);
  --brand-strong: #c31230;
}

.translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, #ed1a3b, #f872a0);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(237, 26, 59, 0.25);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.translate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(237, 26, 59, 0.28);
}

.translate-btn:active {
  transform: translateY(0);
}

.translate-undo {
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #1f2937;
  font-weight: 700;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.translate-undo:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
}

.translate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
}

.translate-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.item-translate-btn.opacity-70 {
  opacity: 0.7;
  cursor: not-allowed;
}

.modal-backdrop.visible .modal-content {
  transform: scale(1);
}

#main-form input,
#main-form textarea,
#main-form select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

#main-form input:focus,
#main-form textarea:focus,
#main-form select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 2px #fca5a5;
}

/* --- Professional Print Styles --- */
/* === OPTIMIZED PRINT STYLES FOR DENSITY === */
@media print {
  body > *:not(#print-container):not(#print-report-container) {
    display: none !important;
  }

  #print-container,
  #print-report-container {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  .no-print {
    display: none !important;
  }

  /* Reduced padding for more space */
  .print-area {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0.5cm !important; /* Reduced from 1cm */
    width: 100%;
    box-sizing: border-box;
    background: white !important;
    font-family:
      "Tajawal", "DIN Next LT Arabic", "Cairo", "Segoe UI", Tahoma, sans-serif !important;
    direction: rtl;
    font-size: 9pt; /* Reduced from 11pt */
    line-height: 1.25; /* Tighter line height */
  }

  .watermark-container::after {
    display: none !important;
  }

  /* Smaller title */
  .print-area h2 {
    font-size: 18pt !important; /* Reduced from 22pt */
    color: #dc2626 !important;
    margin-bottom: 0.3rem !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Compact table */
  .print-area table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 0.5rem 0 !important; /* Reduced from 1rem */
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

  .print-area table thead {
    background-color: #dc2626 !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Smaller table cells */
  .print-area table th,
  .print-area table td {
    border: 1px solid #ddd !important;
    padding: 4px 6px !important; /* Reduced from 8px */
    text-align: right !important;
    font-size: 8pt !important; /* Reduced from 10pt */
    line-height: 1.2 !important;
  }

  .print-area table td:first-child,
  .print-area table td:nth-child(3),
  .print-area table td:nth-child(4),
  .print-area table td:nth-child(5) {
    text-align: center !important;
  }

  /* Compact footer */
  .print-footer {
    display: block !important;
    text-align: center;
    font-size: 7pt; /* Reduced from 9pt */
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 0.25rem;
    margin-top: 0.5rem; /* Reduced from 2rem */
    page-break-inside: avoid;
  }

  /* Compact signature section */
  .signature-section {
    page-break-inside: avoid;
    margin-top: 0.5rem !important; /* Reduced from 2rem */
  }

  /* Compact terms section */
  .terms-section,
  .print-terms,
  [class*="terms"] {
    font-size: 7pt !important;
    line-height: 1.15 !important;
    margin-top: 0.3rem !important;
    padding: 0.2rem !important;
  }

  /* Stamp and signature images smaller */
  .stamp-image,
  .signature-image,
  [class*="stamp"],
  [class*="signature"] img {
    max-height: 50px !important;
    max-width: 80px !important;
  }

  table {
    page-break-inside: auto;
  }

  tr,
  td,
  th {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Tighter page margins */
  @page {
    size: A4;
    margin: 5mm; /* Reduced from 10mm */
  }
}

/* #auth-container {
            background-color: #7f1d1d;
            background-image:
                radial-gradient(at 47% 33%, hsl(20.00, 75%, 40%) 0, transparent 59%),
                radial-gradient(at 82% 65%, hsl(212.00, 75%, 35%) 0, transparent 55%);
        } */

#auth-container {
  position: relative;
  overflow: hidden;
}

#auth-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 255, 255, 0.32),
      transparent 45%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

#auth-container > *:not(.login-backdrop) {
  position: relative;
  z-index: 1;
}

.login-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  width: min(28rem, 100%);
  margin-inline: auto;
}

#login-footer {
  position: static;
  margin-top: 1.25rem;
  text-align: center;
  width: 100%;
  display: block;
  padding: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

#login-footer > span {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 100%;
  color: rgba(15, 23, 42, 0.75);
  letter-spacing: 0.2px;
  line-height: 1.25;
}

#login-footer #org-name {
  font-weight: 800;
  color: #0f172a;
}

#login-footer #current-year {
  font-weight: 700;
  color: rgba(237, 26, 59, 0.95);
}

[data-theme="dark"] #login-footer > span {
  color: rgba(229, 231, 235, 0.78);
}

[data-theme="dark"] #login-footer #org-name {
  color: rgba(229, 231, 235, 0.95);
}

[data-theme="dark"] #login-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.theme-dropdown {
  position: relative;
}

.theme-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.25rem;
  z-index: 60;
}

.theme-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--color-text-base);
}

.theme-menu-item:hover {
  background: var(--color-background);
}

.theme-swatch {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.35rem;
  border: 2px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.default-badge {
  margin-inline-start: auto;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

.dropdown-item:hover {
  background-color: var(--color-background);
}

.nav-btn-mobile.active {
  color: #dc2626;
  /* red-600 */
  background-color: #fee2e2;
  /* red-100 */
}

/* ---- Login Page Enhancements ---- */
/* Subtle background movement */
@keyframes bgFloat {
  0% {
    background-position:
      0% 0%,
      100% 100%;
  }
  100% {
    background-position:
      6% 8%,
      94% 92%;
  }
}

@keyframes loginPatternDrift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1.02);
  }
  50% {
    transform: translate3d(2%, 1.5%, 0) scale(1.05);
  }
  100% {
    transform: translate3d(-2%, -1%, 0) scale(1.02);
  }
}

@keyframes loginBrandPatternDrift {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1.02);
  }
  50% {
    transform: translate3d(1.5%, 1%, 0) scale(1.045);
  }
  100% {
    transform: translate3d(-1.5%, -1%, 0) scale(1.02);
  }
}

@keyframes loginPatternFloat {
  0%,
  100% {
    transform: translate3d(-1.5%, -1%, 0) scale(1.02);
  }
  50% {
    transform: translate3d(1.5%, 1%, 0) scale(1.055);
  }
}

/* Vision 2030 logo styling */
.vision-logo {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
  opacity: 0.95;
}

#auth-container .vision-logo {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  right: auto;
  bottom: auto;
  z-index: 5;
}

@keyframes orbFloatA {
  0% {
    transform: translate3d(-8%, -10%, 0) scale(1);
  }
  23% {
    transform: translate3d(6%, -2%, 0) scale(1.02);
  }
  49% {
    transform: translate3d(-2%, 8%, 0) scale(0.98);
  }
  73% {
    transform: translate3d(10%, 2%, 0) scale(1.03);
  }
  100% {
    transform: translate3d(-8%, -10%, 0) scale(1);
  }
}

@keyframes orbFloatB {
  0% {
    transform: translate3d(10%, 8%, 0) scale(1);
  }
  28% {
    transform: translate3d(-4%, 2%, 0) scale(1.04);
  }
  56% {
    transform: translate3d(2%, -10%, 0) scale(0.97);
  }
  81% {
    transform: translate3d(-10%, -2%, 0) scale(1.02);
  }
  100% {
    transform: translate3d(10%, 8%, 0) scale(1);
  }
}

@keyframes orbFloatC {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  18% {
    transform: translate3d(-7%, 4%, 0) scale(1.02);
  }
  44% {
    transform: translate3d(4%, 10%, 0) scale(0.98);
  }
  68% {
    transform: translate3d(9%, -5%, 0) scale(1.03);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes orbSheen {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 0.95;
  }
}

.login-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  width: var(--orb-size);
  height: var(--orb-size);
  opacity: var(--orb-opacity, 0.28);
  filter: drop-shadow(0 18px 36px rgba(15, 23, 42, 0.1));
  transform: translate3d(0, 0, 0);
  will-change: transform;
  background:
    radial-gradient(
      circle at 28% 26%,
      rgba(255, 255, 255, 0.95),
      rgba(255, 255, 255, 0.22) 16%,
      rgba(255, 255, 255, 0.08) 34%,
      rgba(0, 0, 0, 0.1) 70%,
      rgba(0, 0, 0, 0.22) 100%
    ),
    radial-gradient(
      circle at 60% 62%,
      color-mix(in oklab, var(--orb-color) 92%, #ffffff 8%),
      color-mix(in oklab, var(--orb-color) 72%, transparent) 55%,
      transparent 75%
    );
  background-blend-mode: screen, normal;
}

.orb::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 999px;
  background: radial-gradient(
    circle at 26% 24%,
    rgba(255, 255, 255, 0.85),
    rgba(255, 255, 255, 0.15) 22%,
    transparent 58%
  );
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: orbSheen 6.5s ease-in-out infinite;
}

[data-theme="dark"] .orb {
  opacity: var(--orb-opacity-dark, 0.26);
  filter: drop-shadow(0 22px 44px rgba(0, 0, 0, 0.55));
  background:
    radial-gradient(
      circle at 28% 26%,
      rgba(255, 255, 255, 0.65),
      rgba(255, 255, 255, 0.12) 16%,
      rgba(255, 255, 255, 0.06) 34%,
      rgba(0, 0, 0, 0.2) 74%,
      rgba(0, 0, 0, 0.4) 100%
    ),
    radial-gradient(
      circle at 60% 62%,
      color-mix(in oklab, var(--orb-color) 80%, #0b1320 20%),
      color-mix(in oklab, var(--orb-color) 55%, transparent) 55%,
      transparent 75%
    );
}

[data-theme="dark"] .orb::after {
  opacity: 0.75;
}

.orb-1 {
  --orb-size: clamp(220px, 26vmin, 360px);
  --orb-color: rgba(148, 163, 184, 0.55);
  --orb-opacity: 0.21;
  --orb-opacity-dark: 0.2;
  top: -10%;
  left: -8%;
  animation: orbFloatA 28s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.orb-2 {
  --orb-size: clamp(180px, 22vmin, 320px);
  --orb-color: rgba(59, 130, 246, 0.35);
  --orb-opacity: 0.17;
  --orb-opacity-dark: 0.18;
  top: 12%;
  right: -10%;
  animation: orbFloatB 34s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: -6s;
}

.orb-3 {
  --orb-size: clamp(160px, 18vmin, 280px);
  --orb-color: rgba(100, 116, 139, 0.4);
  --orb-opacity: 0.12;
  --orb-opacity-dark: 0.17;
  bottom: -12%;
  left: 14%;
  animation: orbFloatC 31s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: -10s;
}

.orb-4 {
  --orb-size: clamp(140px, 16vmin, 240px);
  --orb-color: rgba(203, 213, 225, 0.35);
  --orb-opacity: 0.1;
  --orb-opacity-dark: 0.14;
  bottom: 10%;
  right: 12%;
  animation: orbFloatA 37s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: -18s;
}

.orb-5 {
  --orb-size: clamp(120px, 14vmin, 200px);
  --orb-color: rgba(71, 85, 105, 0.3);
  --orb-opacity: 0.06;
  --orb-opacity-dark: 0.11;
  top: 46%;
  left: 52%;
  animation: orbFloatB 42s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: -22s;
}

/* Login card dynamic shadow effects */
.login-card {
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.login-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card { animation: loginCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes loginShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
.login-card.shake { animation: loginShake 0.4s ease; }

.auth-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.4;
}
.auth-alert.hidden { display: none; }
.auth-alert.auth-error  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.auth-alert.auth-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

.login-bg-switch {
  position: fixed;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  direction: rtl;
  z-index: 7;
}

.login-bg-switch-label {
  padding: 0.2rem 0;
  color: rgba(15, 23, 42, 0.64);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.login-bg-option {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.login-bg-option:hover {
  transform: translateY(-1px);
  border-color: rgba(237, 26, 59, 0.55);
}

.login-bg-option[aria-pressed="true"] {
  border-color: rgba(237, 26, 59, 0.95);
  box-shadow: 0 0 0 3px rgba(237, 26, 59, 0.16);
}

.login-bg-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.login-bg-swatch-white {
  background: #ffffff;
}

.login-bg-swatch-brand {
  background: linear-gradient(135deg, #ed1a3b, #fff5f7 72%);
}

@media (max-width: 720px) {
  #auth-container > .login-bg-switch {
    top: auto;
    bottom: 1rem;
    left: 1rem;
    right: auto;
    transform: none;
    flex-direction: row;
  }
}

.login-backdrop {
  background-color: #f8fafc;
  background-image:
    radial-gradient(900px 520px at 18% 18%, rgba(237, 26, 59, 0.06), transparent 60%),
    radial-gradient(820px 520px at 86% 78%, rgba(15, 23, 42, 0.04), transparent 62%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.92));
  background-size:
    100% 100%,
    100% 100%,
    100% 100%;
  background-repeat: no-repeat;
  background-position:
    center,
    center,
    center;
  background-attachment: scroll;
  background-blend-mode: normal;
  filter: saturate(1.02);
  animation: none;
  z-index: 0;
}

[data-theme="dark"] #auth-container > *:not(.login-backdrop),
#auth-container > *:not(.login-backdrop) {
  position: relative;
  z-index: 1;
}

#auth-container > .login-bg-switch {
  position: fixed;
  top: 50%;
  left: 1.5rem;
  right: auto;
  transform: translateY(-50%);
  z-index: 7;
}

[data-theme="dark"] .login-backdrop {
  background-color: #0b1320;
  background-image:
    radial-gradient(
      1200px 700px at 12% 12%,
      rgba(237, 26, 59, 0.18),
      transparent 60%
    ),
    radial-gradient(
      1000px 600px at 88% 22%,
      rgba(56, 189, 248, 0.1),
      transparent 55%
    ),
    radial-gradient(
      900px 520px at 70% 92%,
      rgba(148, 163, 184, 0.14),
      transparent 60%
    ),
    linear-gradient(0deg, rgba(15, 23, 42, 0.68), rgba(15, 23, 42, 0.68)),
    var(--basar-pattern);
  background-size:
    140% 140%,
    140% 140%,
    140% 140%,
    100% 100%,
    var(--basar-pattern-size);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-position:
    12% 12%,
    88% 22%,
    70% 92%,
    center,
    center;
  background-attachment: scroll, scroll, scroll, fixed, fixed;
  background-blend-mode: screen, screen, normal, normal, soft-light;
  filter: saturate(1.05);
  animation: bgFloat 22s ease-in-out infinite;
  opacity: 1;
}

#auth-container[data-login-bg="brand"] .login-backdrop {
  background-color: #f1f5f9;
  background-image:
    radial-gradient(900px 520px at 18% 20%, rgba(237, 26, 59, 0.08), transparent 58%),
    radial-gradient(780px 480px at 82% 18%, rgba(15, 23, 42, 0.06), transparent 56%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.88));
  background-size:
    100% 100%,
    100% 100%,
    100% 100%;
  background-repeat: no-repeat;
  background-position:
    center,
    center,
    center;
  background-attachment: scroll;
  background-blend-mode: normal;
  animation: none;
}

#auth-container[data-login-bg="white"] {
  background: #ffffff !important;
}

#auth-container[data-login-bg="white"] .login-backdrop {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  background-size: auto;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: scroll;
  background-blend-mode: normal;
  filter: none;
  animation: none;
}

#auth-container[data-login-bg="white"]::before {
  background: none;
}

#auth-container[data-login-bg="white"] .login-backdrop::before {
  display: block;
  background:
    var(--basar-pattern);
  background-size:
    420px auto;
  background-repeat: repeat;
  background-position:
    center;
  filter: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  animation: loginPatternDrift 30s ease-in-out infinite;
  -webkit-mask-image:
    radial-gradient(ellipse at 84% 48%, #000 0%, rgba(0, 0, 0, 0.72) 30%, transparent 66%);
  mask-image:
    radial-gradient(ellipse at 84% 48%, #000 0%, rgba(0, 0, 0, 0.72) 30%, transparent 66%);
}

#auth-container[data-login-bg="white"] .login-backdrop::after {
  display: none;
  background: none;
  filter: none;
  opacity: 0;
  animation: none;
}

#auth-container[data-login-bg="white"] .orb {
  display: none;
}

#auth-container[data-login-bg="white"] .orb-1 {
  --orb-white-opacity: 0.22;
}

#auth-container[data-login-bg="white"] .orb-2 {
  --orb-white-opacity: 0.14;
}

#auth-container[data-login-bg="white"] .orb-3 {
  --orb-white-opacity: 0.18;
}

#auth-container[data-login-bg="white"] .orb-4 {
  --orb-white-opacity: 0.1;
}

#auth-container[data-login-bg="white"] .orb-5 {
  --orb-white-opacity: 0.08;
}

#auth-container[data-login-bg="white"] .login-pattern-panel {
  display: none;
}

.login-backdrop::before,
.login-backdrop::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
}

.login-backdrop::before {
  background:
    var(--basar-pattern);
  background-size:
    390px auto;
  background-repeat: repeat;
  background-position:
    center;
  filter: none;
  opacity: 0.105;
  mix-blend-mode: multiply;
  animation: loginBrandPatternDrift 28s ease-in-out infinite;
  -webkit-mask-image:
    radial-gradient(ellipse at 82% 45%, #000 0%, rgba(0, 0, 0, 0.8) 34%, transparent 68%);
  mask-image:
    radial-gradient(ellipse at 82% 45%, #000 0%, rgba(0, 0, 0, 0.8) 34%, transparent 68%);
}

.login-backdrop::after {
  inset: -30%;
  background:
    radial-gradient(
      circle at 30% 65%,
      rgba(255, 255, 255, 0.22),
      transparent 60%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(255, 255, 255, 0.16),
      transparent 62%
    );
  filter: blur(34px);
  opacity: 0.65;
  animation: loginAurora2 34s ease-in-out infinite;
  mix-blend-mode: overlay;
}

@keyframes loginAurora {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(4%, -3%, 0) rotate(8deg);
  }
}

@keyframes loginAurora2 {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-3%, 4%, 0) rotate(-6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .orb::after,
  .login-backdrop,
  .login-backdrop::before,
  .login-backdrop::after,
  .weather-widget::before,
  .weather-icon,
  .weather-icon .sun-core,
  .weather-icon .ray,
  .weather-icon .drop {
    animation: none;
  }
}

.login-pattern-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(260px, 24vw, 420px);
  background-image:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.72),
      rgba(255, 255, 255, 0.4)
    ),
    var(--basar-pattern);
  background-size: 100%, var(--basar-pattern-size);
  background-repeat: no-repeat, repeat;
  background-position: center;
  background-attachment: fixed;
  background-blend-mode: normal, soft-light;
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 1024px) {
  .login-pattern-panel {
    display: none;
  }
}

.products-shell {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.products-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(237, 26, 59, 0.9),
    rgba(244, 63, 94, 0.75)
  );
  color: #fff;
  box-shadow: 0 18px 45px rgba(237, 26, 59, 0.18);
  position: relative;
  overflow: hidden;
}

.products-hero-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.products-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  font-weight: 700;
}

.products-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0.1rem 0;
}

.products-sub {
  opacity: 0.9;
  font-size: 0.95rem;
}

.products-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.products-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(255, 255, 255, 0.15),
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 30%,
      rgba(255, 255, 255, 0.1),
      transparent 45%
    );
  mix-blend-mode: screen;
  pointer-events: none;
}

.products-hero .add-product-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: #ffffff;
  color: #c1122f;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  font-size: 1rem;
}

.products-hero .add-product-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.15);
  filter: brightness(1.02);
}

.products-hero .add-product-btn:active {
  transform: translateY(0);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.products-hero .add-product-btn i {
  color: #c1122f;
  font-size: 1.05rem;
}

.products-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.products-search {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  min-width: min(420px, 100%);
  flex: 1 1 260px;
}

.products-search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--color-text-base);
}

.products-search i {
  color: #94a3b8;
}

.products-table-area {
  margin-top: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: auto;
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  -webkit-overflow-scrolling: touch;
}

#products-table-container table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

#products-table-container th,
#products-table-container td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

#products-table-container th {
  background: color-mix(
    in oklab,
    var(--color-surface) 70%,
    var(--color-background)
  );
  font-weight: 800;
  color: var(--color-text-base);
  position: sticky;
  top: 0;
  z-index: 1;
}

#products-table-container tr:hover td {
  background: color-mix(
    in oklab,
    var(--color-primary) 7%,
    var(--color-surface)
  );
  transform: translateY(-1px);
}

.products-pagination {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.products-page-info {
  color: #475569;
  font-weight: 800;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .products-page-info {
  background: #0b1320;
  border-color: #1f2937;
  color: #e5e7eb;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.products-pagination .btn {
  min-width: 110px;
  justify-content: center;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.products-pagination .btn.btn-secondary {
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  color: #0f172a;
  border-color: #dbeafe;
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.15);
}

.products-pagination .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.products-pagination .btn:active {
  transform: translateY(0);
}

[data-theme="dark"] .products-pagination .btn.btn-secondary {
  background: linear-gradient(135deg, #0f172a, #111827);
  color: #e5e7eb;
  border-color: #1f2937;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}
.products-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.products-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.25);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.products-action-btn i {
  font-size: 0.95rem;
}

.products-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.28);
}

.products-action-btn:active {
  transform: translateY(0);
}

.products-action-delete {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .products-action-btn {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .products-action-delete {
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.32);
}

[data-theme="dark"] .products-hero {
  background: linear-gradient(
    135deg,
    rgba(237, 26, 59, 0.75),
    rgba(15, 23, 42, 0.85)
  );
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .products-card {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .products-search {
  background: #0b1320;
  border-color: #1f2937;
}

[data-theme="dark"] .products-search input {
  color: #e5e7eb;
}

[data-theme="dark"] #products-table-container th,
[data-theme="dark"] #products-table-container td {
  border-color: #1f2937;
  color: #e5e7eb;
}

[data-theme="dark"] #products-table-container th {
  background: #0b1320;
  color: #e5e7eb;
}

[data-theme="dark"] #products-table-container tr:hover td {
  background: rgba(237, 26, 59, 0.14);
}

/* ══════════════════════════════════════════
   PRODUCTS PAGE  — enhanced UI components
══════════════════════════════════════════ */

/* ── Hero action buttons ── */
.ph-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1.5px solid transparent;
  transition: transform 0.15s, box-shadow 0.18s, filter 0.18s;
  cursor: pointer;
  white-space: nowrap;
}
.ph-btn:hover { transform: translateY(-2px); }
.ph-btn:active { transform: translateY(0); }

.ph-btn-primary {
  background: #ffffff;
  color: #c1122f;
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.ph-btn-primary:hover { box-shadow: 0 14px 32px rgba(0,0,0,0.16); filter: brightness(1.02); }

.ph-btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.22);
  backdrop-filter: blur(4px);
}
.ph-btn-ghost:hover { background: rgba(255,255,255,0.2); }

/* ── Count badge in toolbar ── */
.prod-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
[data-theme="dark"] .prod-count-badge {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

/* ── New table styles ── */
.prod-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.prod-th {
  padding: 0.85rem 1rem;
  text-align: right;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.prod-th-num   { width: 52px; text-align: center; }
.prod-th-price { width: 130px; }
.prod-th-actions { width: 160px; text-align: center; }

.prod-td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 0.92rem;
  color: var(--color-text-base);
  transition: background 0.15s;
}
.prod-td-num {
  text-align: center;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
}

.prod-row:hover .prod-td { background: #fef2f4; }
.prod-row:last-child .prod-td { border-bottom: none; }

/* ── Product name cell ── */
.prod-name-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.prod-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
}
.prod-name-text {
  font-weight: 700;
  color: #0f172a;
}

/* ── Description ── */
.prod-desc { color: #64748b; font-size: 0.88rem; }
.prod-no-desc { color: #cbd5e1; }

/* ── Price badge ── */
.prod-price-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
}
.prod-price-positive {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.prod-price-zero {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}
.prod-currency {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.75;
}

/* ── Row action buttons ── */
.prod-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.prod-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
}
.prod-action-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.prod-action-btn:active { transform: translateY(0); }

.prod-action-edit {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}
.prod-action-edit:hover { box-shadow: 0 6px 16px rgba(59,130,246,0.2); }

.prod-action-delete {
  background: #fff1f2;
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 2px 8px rgba(239,68,68,0.1);
}
.prod-action-delete:hover { box-shadow: 0 6px 16px rgba(239,68,68,0.2); }

/* ── Empty state ── */
.prod-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 0.75rem;
  text-align: center;
}
.prod-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #ed1a3b;
  margin-bottom: 0.5rem;
}
.prod-empty-title { font-weight: 800; font-size: 1.05rem; color: #0f172a; }
.prod-empty-sub   { font-size: 0.88rem; color: #94a3b8; }

/* ── Dark theme overrides for new elements ── */
[data-theme="dark"] .prod-th {
  background: #0b1320;
  color: #64748b;
  border-color: #1f2937;
}
[data-theme="dark"] .prod-td { border-color: #1e293b; }
[data-theme="dark"] .prod-row:hover .prod-td { background: rgba(237,26,59,0.08); }
[data-theme="dark"] .prod-name-text { color: #e2e8f0; }
[data-theme="dark"] .prod-price-positive {
  background: rgba(21,128,61,0.12);
  border-color: rgba(21,128,61,0.2);
  color: #4ade80;
}
[data-theme="dark"] .prod-price-zero {
  background: #1e293b;
  border-color: #334155;
  color: #64748b;
}
[data-theme="dark"] .prod-action-edit {
  background: rgba(29,78,216,0.12);
  border-color: rgba(59,130,246,0.2);
  color: #60a5fa;
}
[data-theme="dark"] .prod-action-delete {
  background: rgba(220,38,38,0.12);
  border-color: rgba(239,68,68,0.2);
  color: #f87171;
}
[data-theme="dark"] .prod-empty-icon {
  background: rgba(237,26,59,0.1);
  border-color: rgba(237,26,59,0.2);
}
[data-theme="dark"] .prod-empty-title { color: #e2e8f0; }
[data-theme="dark"] .ph-btn-primary { background: #1e293b; color: #f87171; border-color: #334155; }

.login-pattern-panel {
  display: none;
}

[data-theme="dark"] .products-hero .add-product-btn {
  background: #0f172a;
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .products-hero .add-product-btn i {
  color: #f87171;
}

[data-theme="dark"] #products-table-container tr:hover td {
  background: rgba(237, 26, 59, 0.14);
}

/* Products catalog polish */
.products-shell {
  width: min(1240px, 100% - 2rem);
  gap: 1rem;
}

.products-hero {
  align-items: stretch;
  min-height: 132px;
  padding: 1.35rem 1.6rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #e11d48 0%, #f43f5e 58%, #fb7185 100%);
  box-shadow: 0 18px 44px rgba(225, 29, 72, 0.18);
}

.products-hero::after {
  display: none;
}

.products-hero-text {
  justify-content: center;
  max-width: 520px;
}

.products-kicker {
  margin: 0;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.78);
}

.products-title {
  margin: 0.1rem 0 0;
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
  line-height: 1.15;
  color: #fff;
  letter-spacing: 0;
}

.products-sub {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.products-hero-actions {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 520px;
}

.ph-btn {
  min-height: 44px;
  border-radius: 12px;
  border-width: 1px;
  font-weight: 800;
  box-shadow: none;
}

.ph-btn-primary {
  background: #fff;
  color: #be123c;
  border-color: rgba(255, 255, 255, 0.6);
}

.ph-btn-blue {
  background: #2563eb;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.ph-btn-green {
  background: #16a34a;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.ph-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.products-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.products-metric {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.products-metric-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff1f2;
  color: #e11d48;
}

.products-metric-green {
  background: #ecfdf5;
  color: #16a34a;
}

.products-metric-slate {
  background: #f1f5f9;
  color: #64748b;
}

.products-metric-label {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.products-metric strong {
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.products-card {
  border-radius: 16px;
  padding: 1rem;
  border-color: rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.94);
}

.products-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
}

.products-search {
  min-height: 52px;
  border-radius: 14px;
  background: #f8fafc;
}

.products-search input {
  font-weight: 700;
  font-size: 0.96rem;
}

.prod-count-badge {
  min-height: 38px;
  justify-content: center;
}

.products-table-area {
  border-radius: 14px;
  box-shadow: none;
}

.prod-table {
  min-width: 760px;
}

.prod-th {
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  color: #0f172a;
}

.prod-th-price {
  width: 170px;
}

.prod-th-actions {
  width: 188px;
}

.prod-td {
  padding: 0.95rem 1rem;
}

.prod-name-text {
  font-size: 0.96rem;
}

.prod-desc {
  color: #475569;
  max-width: 420px;
}

.prod-price-badge {
  border-radius: 10px;
}

.prod-actions-cell {
  min-width: 188px;
}

.prod-action-btn {
  min-height: 38px;
  border-radius: 10px;
}

[data-theme="dark"] .products-metric,
[data-theme="dark"] .products-card {
  background: rgba(15, 23, 42, 0.94);
  border-color: #1f2937;
}

[data-theme="dark"] .products-metric strong,
[data-theme="dark"] .prod-th {
  color: #e5e7eb;
}

[data-theme="dark"] .products-metric-label {
  color: #94a3b8;
}

@media (max-width: 920px) {
  .products-hero {
    flex-direction: column;
  }

  .products-hero-actions {
    justify-content: stretch;
    max-width: none;
  }

  .products-hero-actions .ph-btn {
    flex: 1 1 150px;
    justify-content: center;
  }

  .products-metrics,
  .products-toolbar {
    grid-template-columns: 1fr;
  }

  .prod-count-badge {
    justify-self: stretch;
  }
}

@media (max-width: 640px) {
  .products-shell {
    width: min(100%, 100% - 1rem);
  }

  .products-hero,
  .products-card {
    border-radius: 14px;
  }

  .products-hero {
    padding: 1.1rem;
  }

  .products-title {
    font-size: 1.55rem;
  }

  .products-metric {
    grid-template-columns: auto 1fr;
  }

  .products-metric strong {
    grid-column: 2;
    justify-self: start;
  }

  .products-table-area {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .prod-table,
  .prod-table thead,
  .prod-table tbody,
  .prod-table tr,
  .prod-table th,
  .prod-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .prod-table thead {
    display: none;
  }

  .prod-row {
    display: grid;
    gap: 0.7rem;
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  }

  .prod-td {
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .prod-td-num {
    display: none;
  }

  .prod-desc {
    max-width: none;
  }

  .prod-actions-cell {
    min-width: 0;
    justify-content: stretch;
  }

  .prod-action-btn {
    flex: 1 1 0;
    justify-content: center;
  }

  [data-theme="dark"] .prod-row {
    background: #0f172a;
    border-color: #1f2937;
  }
}


/* Login card entrance animation */
@keyframes loginCardEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  animation: loginCardEnter 0.5s ease-out both;
}

/* Login form stagger */
#login-form > * {
  animation: loginCardEnter 0.4s ease-out both;
}

#login-form > :nth-child(1) { animation-delay: 0.05s; }
#login-form > :nth-child(2) { animation-delay: 0.1s; }
#login-form > :nth-child(3) { animation-delay: 0.15s; }
#login-form > :nth-child(4) { animation-delay: 0.2s; }

.login-input {
  height: 52px;
  padding: 0 1rem;
  background: #ffffff;
  border: 1px solid #d3dce8;
  border-radius: 8px;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

#login-username {
  cursor: pointer;
  padding-right: 2.5rem;
}

#login-username option:first-child {
  color: #94a3b8;
}

#login-username option {
  font-weight: 600;
  padding: 0.5rem;
}

.login-input:focus {
  background: #ffffff;
  border-color: rgba(237, 26, 59, 0.58);
  box-shadow: 0 0 0 3px rgba(237, 26, 59, 0.12);
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a;
  box-shadow:
    inset 0 0 0 1000px #ffffff,
    0 0 0 3px rgba(237, 26, 59, 0.08);
  transition: background-color 5000s ease-in-out 0s;
}

.login-card h2 {
  letter-spacing: -0.01em;
  color: #0f172a;
  font-size: clamp(1.65rem, 2vw, 2rem);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

#login-form .btn-primary {
  background:
    linear-gradient(135deg, #ff3154 0%, #ed1a3b 48%, #c9102c 100%);
  border: 1px solid rgba(237, 26, 59, 0.84);
  box-shadow:
    0 12px 24px rgba(237, 26, 59, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

#login-form .btn {
  height: 58px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

#login-form .btn-primary:hover {
  filter: saturate(1.04);
  transform: translateY(-1px);
  box-shadow:
    0 16px 32px rgba(237, 26, 59, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#login-form .btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 8px 16px rgba(237, 26, 59, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#auth-container .login-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)) !important;
  border: 1px solid rgba(210, 219, 232, 0.86);
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.11),
    0 6px 18px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

#auth-container .login-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(237, 26, 59, 0.85) 24%, rgba(255, 73, 103, 0.82) 50%, rgba(237, 26, 59, 0.85) 76%, transparent);
}

#auth-container .login-card::after {
  content: "";
  position: absolute;
  top: -108px;
  right: -120px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(237, 26, 59, 0.08), rgba(237, 26, 59, 0.03) 44%, transparent 68%);
  pointer-events: none;
}

#auth-container .login-card .company-logo {
  height: 92px;
  margin-bottom: 1.15rem;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.08));
}

#auth-form-container {
  position: relative;
  z-index: 1;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

#login-form > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0 !important;
}

#login-form label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.55rem !important;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 900;
}

#login-password {
  padding-left: 1rem;
  padding-right: 3rem;
}

#toggle-password {
  left: auto !important;
  right: 0.85rem !important;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #64748b !important;
  background: rgba(241, 245, 249, 0.88);
  border: 1px solid rgba(203, 213, 225, 0.72);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

#toggle-password:hover {
  color: #ed1a3b !important;
  background: #ffffff;
  border-color: rgba(237, 26, 59, 0.22);
}

#auth-message {
  position: relative;
  z-index: 1;
  min-height: 1.25rem;
}

#auth-container #login-footer {
  position: relative;
  z-index: 1;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.portal-shell {
  display: flex;
  min-height: 100vh;
  gap: 1.5rem;
  padding: 1.5rem;
}

.portal-sidebar {
  width: 260px;
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.portal-header {
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.portal-header.app-header.enterprise-nav {
  width: 100%;
  margin: 0;
  padding: 0.85rem 1.1rem;
}

.portal-header.app-header.enterprise-nav .header-center {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.portal-header-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: right;
}

.portal-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  min-width: 220px;
  max-width: 360px;
  width: 100%;
  flex: 0 0 auto;
}

/* Login layout anchors — new split layout overrides */
@media (min-width: 769px) {
  body #auth-container .auth-brand-foot #clock-container {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    z-index: 1 !important;
  }

  body #auth-container .auth-form-foot .vision-logo {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 1 !important;
  }
}

@media (max-width: 768px) {
  body #auth-container .auth-brand-foot #clock-container {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
  }

  body #auth-container #login-footer {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   AUTH — LUXURY SPLIT LAYOUT  v2
═══════════════════════════════════════════════════════════ */

#auth-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  position: fixed !important;
  inset: 0 !important;
  overflow: hidden !important;
  z-index: 9999 !important;
}

/* JS uses safeHide() → adds .hidden — must win over display:flex !important above */
#auth-container.hidden {
  display: none !important;
}

.login-backdrop { display: none !important; }
#auth-container::before { display: none !important; }
#auth-container .login-bg-switch { display: none !important; }

/* ═══════════════════════════
   BRAND PANEL (dark side)
═══════════════════════════ */
.auth-brand-panel {
  flex: 1;
  min-height: 0;
  background: #0b111e;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  order: 2;
}

/* Multi-layer rich background */
.auth-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 0%,   rgba(237,26,59,0.18)  0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 10% 100%,  rgba(237,26,59,0.10)  0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 50%,  rgba(15,23,42,0.5)    0%, transparent 100%);
  z-index: 0;
  pointer-events: none;
}

/* Diagonal grid lines */
.auth-brand-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  z-index: 0;
  pointer-events: none;
}

/* Pulsing red orb — top right */
.auth-brand-glow {
  position: absolute;
  top: -160px;
  right: -100px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237,26,59,0.25) 0%, rgba(237,26,59,0.06) 45%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  animation: glowPulse 7s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1; }
}

/* Top badge */
.auth-brand-top {
  position: relative;
  z-index: 1;
  padding: 2rem 2.5rem 0;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(4px);
}

/* Center logo + tagline */
.auth-brand-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  position: relative;
  z-index: 1;
  padding: 2rem 2.5rem;
  text-align: center;
}

.auth-brand-logo {
  height: 120px;
  object-fit: contain;
  filter:
    brightness(0) invert(1)
    drop-shadow(0 4px 32px rgba(237,26,59,0.5));
  animation: logoFloat 5s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.auth-brand-rule {
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ed1a3b 30%, #ff6b84 55%, #ed1a3b 75%, transparent);
  opacity: 0.85;
}

.auth-brand-tagline {
  color: rgba(255,255,255,0.52);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

/* Three animated dots */
.auth-brand-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.auth-brand-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(237,26,59,0.45);
  animation: dotPop 2.4s ease-in-out infinite;
}
.auth-brand-dots span:nth-child(2) { animation-delay: 0.4s; width: 8px; height: 8px; background: #ed1a3b; }
.auth-brand-dots span:nth-child(3) { animation-delay: 0.8s; }

@keyframes dotPop {
  0%,100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.4); opacity: 1; }
}

/* Bottom: clock + weather */
.auth-brand-foot {
  position: relative;
  z-index: 1;
  padding: 1.5rem 2.5rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.18);
}

.auth-brand-foot #clock-container {
  position: static !important;
  transform: none !important;
  width: 100% !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 1 !important;
}

.auth-brand-foot #clock-time   { color: #fff !important; font-size: clamp(1.3rem, 1.8vw, 1.9rem) !important; letter-spacing: 0.06em !important; }
.auth-brand-foot #clock-date   { color: rgba(255,255,255,0.38) !important; font-size: 0.72rem !important; letter-spacing: 0.04em !important; }
.auth-brand-foot .weather-label { color: rgba(255,255,255,0.4) !important; font-size: 0.68rem !important; }
.auth-brand-foot .weather-temp  { color: rgba(255,255,255,0.8) !important; font-size: 0.95rem !important; font-weight: 700 !important; }
.auth-brand-foot .weather-icon  { color: rgba(255,255,255,0.6) !important; font-size: 1.6rem !important; }
.auth-brand-foot .clock-divider { background: rgba(255,255,255,0.1) !important; }
.auth-brand-foot .weather-widget {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.auth-brand-foot .weather-icon {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.1) !important;
  box-shadow: none !important;
}

/* ═══════════════════════════
   FORM PANEL (light side)
═══════════════════════════ */
.auth-form-panel {
  width: 460px;
  min-width: 340px;
  min-height: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  position: relative;
  z-index: 2;
  order: 1;
  box-shadow: -16px 0 60px rgba(0,0,0,0.22);
}

/* 3px red gradient bar at very top */
.auth-form-accent {
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #ed1a3b 30%, #ff6b84 60%, #ed1a3b 80%, transparent 100%);
  flex-shrink: 0;
}

/* Middle scroll area */
.auth-form-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.75rem 2rem;
  overflow-y: auto;
  scrollbar-width: none;
}
.auth-form-inner::-webkit-scrollbar { display: none; }

.auth-form-inner .login-stack {
  width: 100%;
  max-width: 340px;
}

/* Bottom strip */
.auth-form-foot {
  padding: 1.25rem 2.75rem 1.75rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.auth-vision-logo {
  position: static !important;
  height: 1.9rem !important;
  width: auto !important;
  object-fit: contain !important;
  opacity: 0.8 !important;
}

#auth-container #login-footer {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  text-align: left !important;
}

/* ── Login Card (transparent — lives in white panel) ── */
#auth-container .login-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  animation: loginCardIn 0.5s cubic-bezier(0.16,1,0.3,1) both !important;
}
#auth-container .login-card::before,
#auth-container .login-card::after { display: none !important; }

/* ── Card Header ── */
.lc-head { margin-bottom: 2.25rem; }

.lc-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1px solid rgba(237,26,59,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.35rem;
  color: #ed1a3b;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(237,26,59,0.1);
}

.lc-head h2 {
  font-size: 2rem !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  letter-spacing: -0.03em !important;
  line-height: 1.15 !important;
  margin-bottom: 0.4rem !important;
}

.lc-sub {
  color: #94a3b8;
  font-size: 0.87rem;
  line-height: 1.55;
  font-weight: 400;
}

/* ── Form Elements ── */
#auth-container #login-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.2rem !important;
}

.lf-group { display: flex; flex-direction: column; }

.lf-label {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  margin-bottom: 0.45rem !important;
  display: block !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
}

.lf-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lf-ico {
  position: absolute;
  right: 1rem;
  color: #d1d5db;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s;
}

.lf-select-arrow {
  position: absolute;
  left: 1rem;
  color: #94a3b8;
  font-size: 0.7rem;
  pointer-events: none;
  z-index: 2;
}
}
.lf-wrap:focus-within .lf-ico { color: #ed1a3b; }

#auth-container .login-input {
  height: 52px !important;
  padding-right: 2.65rem !important;
  padding-left: 1rem !important;
  border-radius: 12px !important;
  border: 1.5px solid #edf0f5 !important;
  background: #f8fafc !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  font-size: 0.93rem !important;
  width: 100% !important;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s !important;
}
#auth-container .login-input:focus {
  background: #fff !important;
  border-color: rgba(237,26,59,0.5) !important;
  box-shadow: 0 0 0 3.5px rgba(237,26,59,0.09) !important;
  outline: none !important;
}
#auth-container .login-input::placeholder { color: #c8cdd8 !important; font-weight: 400 !important; }

.lf-pw { padding-left: 2.75rem !important; }

#auth-container #toggle-password {
  position: absolute !important;
  left: 0.7rem !important;
  right: auto !important;
  width: 2.1rem !important;
  height: 2.1rem !important;
  border-radius: 8px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #94a3b8 !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  font-size: 0.8rem !important;
  transition: all 0.18s !important;
}
#auth-container #toggle-password:hover {
  background: #fff !important;
  color: #ed1a3b !important;
  border-color: rgba(237,26,59,0.25) !important;
}

.lf-forgot-row {
  margin-top: 0.45rem;
  text-align: left;
}
.lf-forgot-row button {
  font-size: 0.76rem;
  color: #b0bec5;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.18s;
}
.lf-forgot-row button:hover { color: #ed1a3b; text-decoration: underline; }

/* Submit */
.lf-btn {
  width: 100%;
  height: 54px;
  margin-top: 0.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff3154 0%, #ed1a3b 48%, #c9102c 100%);
  color: #fff;
  border: none;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  box-shadow: 0 8px 24px rgba(237,26,59,0.32), inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  position: relative;
  overflow: hidden;
}
.lf-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}
.lf-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(237,26,59,0.4), inset 0 1px 0 rgba(255,255,255,0.26);
  filter: brightness(1.04);
}
.lf-btn:active { transform: translateY(0); }
.lf-btn-ico { font-size: 0.85rem; }

/* ── Responsive ── */
@media (max-width: 820px) {
  #auth-container { flex-direction: column !important; }

  .auth-brand-panel {
    min-height: auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.75rem 1.5rem !important;
  }

  .auth-brand-top,
  .auth-brand-foot,
  .auth-brand-dots { display: none !important; }

  .auth-brand-content {
    flex-direction: row !important;
    gap: 1.25rem !important;
    padding: 0 !important;
  }

  .auth-brand-rule { display: none !important; }
  .auth-brand-logo { height: 56px !important; animation: none !important; }
  .auth-brand-tagline { font-size: 0.8rem !important; text-align: right !important; }

  .auth-form-panel {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
  }

  .auth-form-inner { padding: 2rem 1.5rem 1.5rem !important; }

  .auth-form-foot { padding: 1rem 1.5rem !important; }
}

/* ═══════════════════════════════════════════════
   WHITE THEME  [data-login-bg="white"]
   Brand panel goes light — all colors flip dark
═══════════════════════════════════════════════ */

[data-login-bg="white"] .auth-brand-panel {
  background: #f8fafc;
}

[data-login-bg="white"] .auth-brand-panel::before {
  background:
    radial-gradient(ellipse 80% 60% at 60% 0%,  rgba(237,26,59,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(237,26,59,0.04) 0%, transparent 60%);
}

[data-login-bg="white"] .auth-brand-lines {
  background-image:
    linear-gradient(rgba(15,23,42,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.035) 1px, transparent 1px);
}

[data-login-bg="white"] .auth-brand-glow {
  background: radial-gradient(circle, rgba(237,26,59,0.1) 0%, rgba(237,26,59,0.025) 45%, transparent 70%);
}

[data-login-bg="white"] .auth-brand-badge {
  color: #ed1a3b;
  border-color: rgba(237,26,59,0.22);
  background: rgba(237,26,59,0.05);
}

[data-login-bg="white"] .auth-brand-badge i {
  color: #ed1a3b !important;
}

/* Logo: show original colors (no white invert) */
[data-login-bg="white"] .auth-brand-logo {
  filter: drop-shadow(0 4px 20px rgba(237,26,59,0.18));
}

[data-login-bg="white"] .auth-brand-tagline {
  color: #475569;
}

[data-login-bg="white"] .auth-brand-dots span {
  background: rgba(237,26,59,0.35);
}
[data-login-bg="white"] .auth-brand-dots span:nth-child(2) {
  background: #ed1a3b;
}

[data-login-bg="white"] .auth-brand-foot {
  border-top-color: rgba(0,0,0,0.07);
  background: rgba(0,0,0,0.025);
}

/* Clock/weather: dark text on light background */
[data-login-bg="white"] .auth-brand-foot #clock-time   { color: #0f172a !important; }
[data-login-bg="white"] .auth-brand-foot #clock-date   { color: #64748b !important; }
[data-login-bg="white"] .auth-brand-foot .weather-label { color: #64748b !important; }
[data-login-bg="white"] .auth-brand-foot .weather-temp  { color: #0f172a !important; }
[data-login-bg="white"] .auth-brand-foot .weather-icon  { color: #ed1a3b !important; }
[data-login-bg="white"] .auth-brand-foot .clock-divider { background: rgba(0,0,0,0.1) !important; }
[data-login-bg="white"] .auth-brand-foot .weather-widget {
  background: transparent !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
[data-login-bg="white"] .auth-brand-foot .weather-icon {
  background: rgba(237,26,59,0.06) !important;
  border-color: rgba(237,26,59,0.12) !important;
  box-shadow: none !important;
}

/* Form panel: subtler shadow in white theme */
[data-login-bg="white"] .auth-form-panel {
  border-right: 1px solid #e2e8f0;
  box-shadow: -8px 0 40px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════
   BUILDING THEME  [data-login-bg="building"]
   3-image auto-crossfade slideshow
═══════════════════════════════════════════════ */

/* Slides container — hidden by default */
.auth-brand-slides {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Dark overlay on top of all slides */
.auth-brand-slides::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(6,10,20,0.74) 0%,
    rgba(6,10,20,0.48) 60%,
    rgba(140,8,24,0.22) 100%);
  z-index: 2;
  pointer-events: none;
}

.auth-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  z-index: 1;
  animation-fill-mode: backwards;
}

/* fade in → hold → fade out → wait for next cycle */
@keyframes slideFade {
  0%     { opacity: 0; }
  8.33%  { opacity: 1; }
  33.33% { opacity: 1; }
  41.67% { opacity: 0; }
  100%   { opacity: 0; }
}

/* 24s total, 8s per image, staggered evenly */
.auth-slide:nth-child(1) { animation: slideFade 24s ease-in-out infinite 0s;  }
.auth-slide:nth-child(2) { animation: slideFade 24s ease-in-out infinite 8s;  }
.auth-slide:nth-child(3) { animation: slideFade 24s ease-in-out infinite 16s; }

[data-login-bg="building"] .auth-brand-slides { display: block; }

[data-login-bg="building"] .auth-brand-panel {
  background: #080c14;
}

[data-login-bg="building"] .auth-brand-panel::before { display: none; }
[data-login-bg="building"] .auth-brand-lines { opacity: 0.012; }
[data-login-bg="building"] .auth-brand-glow  { opacity: 0.25; }

[data-login-bg="building"] .auth-brand-badge {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.6);
}

[data-login-bg="building"] .auth-brand-logo {
  filter: brightness(0) invert(1) drop-shadow(0 4px 24px rgba(237,26,59,0.6));
}

[data-login-bg="building"] .auth-brand-tagline { color: rgba(255,255,255,0.78); }

[data-login-bg="building"] .auth-brand-foot {
  border-top-color: rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.42);
}

[data-login-bg="building"] .auth-form-panel {
  box-shadow: -20px 0 80px rgba(0,0,0,0.42);
}

/* ── Theme Toggle Pill ── */
.auth-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 100px;
  padding: 0.2rem;
}

.auth-theme-toggle button {
  width: 28px;
  height: 28px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.auth-theme-toggle button[aria-pressed="true"],
.auth-theme-toggle button.is-active {
  background: #ffffff;
  color: #ed1a3b;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.portal-search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.portal-sidebar .sidebar-item {
  border-radius: var(--radius-sm);
  margin: 0 0.75rem;
}

.portal-sidebar .sidebar-item.active {
  background: color-mix(
    in oklab,
    var(--color-primary) 12%,
    var(--color-surface) 88%
  );
  color: var(--color-primary);
  border-right: none;
  box-shadow: var(--shadow-xs);
}

.portal-content {
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  min-height: 520px;
}

@media (max-width: 1024px) {
  .portal-shell {
    flex-direction: column;
  }

  .portal-sidebar {
    width: 100%;
    position: relative;
  }

  .portal-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.cms-shell {
  display: grid;
  gap: 1.5rem;
}

.cms-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
}

.cms-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.cms-title {
  font-size: 1.6rem;
  margin: 0.25rem 0 0.5rem;
}

.cms-subtitle {
  color: var(--color-text-subtle);
  max-width: 520px;
}

.cms-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.cms-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.75rem;
  min-width: 220px;
  flex: 1;
}

.cms-search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
}

.cms-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cms-provider {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  background: var(--color-surface-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
}

.cms-table {
  padding: 0;
  overflow: hidden;
}

.cms-table-head {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(140px, 1fr) 140px;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-surface-muted);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.cms-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(140px, 1fr) 140px;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  align-items: center;
}

.cms-row-title {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cms-row-meta {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

.cms-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.cms-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
}

.cms-status--published {
  background: rgba(16, 185, 129, 0.15);
  color: #0f766e;
}

.cms-status--draft {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.cms-status--archived {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.cms-empty {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-subtle);
}

.cms-drawer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 80;
}

.cms-drawer-panel {
  width: min(560px, 100%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.cms-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.cms-form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.cms-field label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: inline-block;
}

.cms-field input,
.cms-field textarea,
.cms-field select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  background: #ffffff;
}

.cms-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .cms-table-head {
    display: none;
  }

  .cms-row {
    grid-template-columns: 1fr;
  }

  .cms-actions {
    justify-content: flex-start;
  }
}

/* Enterprise navbar overrides */
.app-header.enterprise-nav {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  padding: 0.65rem 1rem;
  margin: 0.75rem auto 1.25rem;
  width: min(100% - 2rem, 1440px);
  border-radius: 16px;
}

.enterprise-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  overflow: visible;
}

.enterprise-nav .header-left,
.enterprise-nav .header-center,
.enterprise-nav .header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.enterprise-nav .header-center {
  flex: 1 1 480px;
  justify-content: center;
  min-width: 0;
  gap: 0.75rem;
}

.enterprise-nav .app-brand {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  gap: 0.5rem;
}

.enterprise-nav .brand-mark {
  width: clamp(38px, 4vw, 48px);
  height: clamp(38px, 4vw, 48px);
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  object-fit: contain;
  display: block;
}

.enterprise-nav .brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
}

.enterprise-nav .app-brand.only-mark {
  gap: 0;
}

.enterprise-nav #main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  min-width: 0;
}

.enterprise-nav #main-nav.is-open {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  padding: 0.6rem;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.enterprise-nav .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #6b7280;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.enterprise-nav .nav-btn i,
.enterprise-nav .nav-btn svg {
  width: 1rem;
  height: 1rem;
  color: #9ca3af;
}

.enterprise-nav .nav-btn:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}

.enterprise-nav .nav-btn.active {
  background: #ed1a3b;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(237, 26, 59, 0.2);
}

.enterprise-nav #main-nav .nav-btn.active {
  background: #ed1a3b;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(237, 26, 59, 0.2);
}

.enterprise-nav .nav-btn.active svg,
.enterprise-nav .nav-btn.active i {
  color: #ffffff;
}

.enterprise-nav #main-nav .nav-btn.active svg,
.enterprise-nav #main-nav .nav-btn.active i {
  color: #ffffff;
}

.enterprise-nav .nav-secondary {
  color: #334155;
  border-color: #e2e8f0;
  background: #ffffff;
}

.enterprise-nav .nav-dropdown {
  position: relative;
}

.enterprise-nav .nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  inset-inline-end: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
  padding: 0.4rem;
  z-index: 60;
}

.enterprise-nav .nav-dropdown-item {
  width: 100%;
  justify-content: flex-start;
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
  font-weight: 500;
  color: #0f172a;
}

.enterprise-nav .nav-dropdown-item:hover {
  background: #f1f5f9;
  border-color: transparent;
}

.enterprise-nav .nav-dropdown-item i,
.enterprise-nav .nav-dropdown-item svg {
  color: #475569;
}

.enterprise-nav #nav-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.enterprise-nav #nav-toggle-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.enterprise-nav #nav-toggle-btn[aria-expanded="true"] {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.35);
}

.enterprise-nav #user-menu-button {
  background: rgba(237, 26, 59, 0.08);
  border: 1px solid rgba(237, 26, 59, 0.2);
  color: #111827;
  box-shadow: none;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.enterprise-nav #user-menu-button:hover {
  background: rgba(237, 26, 59, 0.12);
  box-shadow: none;
}

.enterprise-nav #user-menu-button svg {
  color: #6b7280;
}

.enterprise-nav .user-menu-dropdown {
  width: 240px;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
  top: calc(100% + 0.5rem);
  margin-top: 0;
  inset-inline-end: 0;
  inset-inline-start: auto;
  right: auto;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  z-index: 80;
}

.enterprise-nav .luxury-user-menu {
  padding: 0;
  border-radius: 14px;
  background: transparent;
}

.enterprise-nav .luxury-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  padding: 4px;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

#settings-menu-dropdown {
  direction: rtl;
  text-align: right;
  min-width: 240px;
  padding: 0.35rem 0.25rem;
  inset-inline-end: 0;
  inset-inline-start: auto;
  left: auto;
  right: auto;
}

#settings-menu-dropdown .menu-item {
  width: 100%;
  justify-content: space-between;
}

#settings-menu-dropdown .theme-dropdown {
  display: none;
}

#settings-menu-dropdown #theme-menu {
  display: none;
}

.enterprise-nav .menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: #0f172a;
  border-radius: 0.65rem;
  border: 0;
  background: transparent;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.enterprise-nav .menu-item i {
  width: 1rem;
  color: #64748b;
}

.enterprise-nav .menu-item:hover {
  background: #f1f5f9;
}

.enterprise-nav .user-menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem;
}

.enterprise-nav .user-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.35rem 0;
}

.enterprise-nav .theme-dropdown {
  width: 100%;
}

.enterprise-nav .theme-dropdown .theme-menu {
  inset-inline-end: 0;
  min-width: 220px;
}

/* Basar Pro header + sidebar layout */
.enterprise-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.app-header.enterprise-nav {
  top: 0;
  margin-top: 0;
  border-radius: 16px;
}

.enterprise-nav .header-left {
  justify-self: end;
  flex-wrap: wrap;
}

.enterprise-nav .header-center {
  justify-self: stretch;
  justify-content: center;
}

.enterprise-nav .header-right {
  justify-self: start;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
}

.header-actions-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 3px;
  flex-shrink: 0;
}

#ops-notif-wrapper {
  display: flex;
  align-items: center;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-icon-btn:hover {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.header-icon-btn--lang {
  width: auto;
  padding: 0 10px;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.header-icon-btn.notif-error {
  border-color: color-mix(in oklab, var(--color-primary) 55%, #e5e7eb 45%);
  background: color-mix(in oklab, var(--color-primary) 8%, #ffffff 92%);
  color: var(--color-primary);
}

.header-icon-btn.notif-ok {
  border-color: color-mix(in oklab, var(--color-primary) 18%, #e5e7eb 82%);
}

.notification-badge {
  position: absolute;
  inset-block-start: -6px;
  inset-inline-end: -6px;
  min-width: 20px;
  height: 20px;
  padding-inline: 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.62rem, 0.5rem + 0.5vw, 0.85rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--notif-badge-text);
  background: var(--notif-badge-bg);
  border: 2px solid var(--notif-badge-ring);
  box-shadow: 0 10px 18px var(--notif-badge-shadow);
  transform: scale(1);
  will-change: transform;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.25s ease,
    color 0.25s ease;
  cursor: pointer;
  pointer-events: auto;
}

.notification-badge::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid var(--notif-badge-glow);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

.notification-badge.is-updated {
  animation: badgePop 420ms ease;
}

.notification-badge.is-updated::after {
  animation: badgeRing 650ms ease-out;
}

/* ── Changelog / What's New ─────────────────────────── */
.cl-version-block  { margin-bottom: 1.1rem; }
.cl-version-header { display:flex; align-items:center; gap:.5rem; margin-bottom:.5rem; padding-bottom:.4rem; border-bottom:1px solid #e2e8f0; }
.cl-version-num    { font-weight:700; color:#4f46e5; font-size:.95rem; }
.cl-version-date   { font-size:.72rem; color:#94a3b8; margin-inline-start:auto; }
.cl-entries        { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:.45rem; }
.cl-entry          { display:flex; align-items:flex-start; gap:.45rem; font-size:.85rem; color:#334155; line-height:1.55; }
.cl-badge          { display:inline-flex; align-items:center; padding:.1rem .45rem; border-radius:.3rem; font-size:.68rem; font-weight:700; white-space:nowrap; flex-shrink:0; margin-top:.15rem; }
.cl-badge--new     { background:#ede9fe; color:#6d28d9; }
.cl-badge--improve { background:#fef9c3; color:#92400e; }
.cl-badge--fix     { background:#dcfce7; color:#166534; }

.header-icon-btn.theme-toggle-btn {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  color: #fff;
  border-color: #fcd34d;
}

.header-icon-btn.theme-toggle-btn[data-theme="dark"] {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border-color: #1f2937;
}

@keyframes badgePop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.25);
    box-shadow: 0 14px 28px var(--notif-badge-shadow);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes badgeRing {
  0% {
    opacity: 0.65;
    transform: scale(0.5);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.profile-btn i {
  font-size: 0.95rem;
}

.profile-card .btn.btn-light.profile-btn {
  background: linear-gradient(
    135deg,
    rgba(237, 26, 59, 0.07),
    rgba(237, 26, 59, 0.14)
  );
  color: #b91c1c;
  border: 1px solid rgba(237, 26, 59, 0.2);
}

.profile-card .btn.profile-btn {
  padding: 0.65rem 1.05rem;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.16s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  border: 1px solid transparent;
}

.profile-card .btn.profile-btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent 10%,
    rgba(255, 255, 255, 0.22) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.profile-card .btn.profile-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(237, 26, 59, 0.22);
}

.profile-card .btn.profile-btn:active {
  transform: translateY(0);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}

.profile-card .btn.profile-btn:hover::after {
  opacity: 1;
}

.profile-card .btn.btn-primary.profile-btn {
  background: linear-gradient(135deg, #ed1a3b 0%, #f43f5e 100%);
  color: #fff;
  border-color: #f87171;
  box-shadow: 0 16px 36px rgba(244, 63, 94, 0.25);
}

.profile-card .btn.btn-secondary.profile-btn {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.24);
}

.profile-card .btn.btn-danger.profile-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-color: #f87171;
  box-shadow: 0 14px 32px rgba(239, 68, 68, 0.24);
}

[data-theme="dark"] .profile-btn {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* Profile UI refresh */
.profile-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #ed1a3b 0%, #f472b6 100%);
  color: #fff;
  box-shadow: 0 16px 40px rgba(237, 26, 59, 0.18);
}

.profile-hero-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.profile-kicker {
  font-size: 0.85rem;
  opacity: 0.85;
}

.profile-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.profile-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.profile-pill-alt {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-pill-back {
  background: rgba(255, 255, 255, 0.92);
  color: #be123c;
  border: none;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s, transform 0.15s;
}
.profile-pill-back:hover {
  background: #fff;
  transform: translateX(2px);
}

/* ── Signature Pad ─────────────────────────────────────────────── */
.sig-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 1rem;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  margin-bottom: 1.25rem;
}
.sig-preview-img {
  max-height: 72px;
  max-width: 100%;
  border-radius: 6px;
}
.sig-preview-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

.sig-pad-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
}

.sig-pad-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.sig-pad-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}
.sig-pad-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.sig-tool-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  margin: 0 0.2rem;
}

.sig-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s;
}
.sig-color-btn.sig-color-active { border-color: #3b82f6; }
.sig-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sig-size-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.sig-size-btn.sig-size-active { border-color: #3b82f6; background: #eff6ff; }
.sig-size-dot {
  border-radius: 50%;
  background: #475569;
  display: block;
}

.sig-canvas-wrap {
  position: relative;
  background: #fff;
}
#user-sig-canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}
.sig-canvas-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  pointer-events: none;
  color: #cbd5e1;
  transition: opacity 0.3s;
}
.sig-canvas-hint i  { font-size: 1.75rem; }
.sig-canvas-hint p  { font-size: 0.85rem; margin: 0; }

.sig-pad-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.sig-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  border: 1.5px solid transparent;
}
.sig-btn-ghost {
  background: #fff;
  border-color: #e2e8f0;
  color: #475569;
}
.sig-btn-ghost:hover { background: #f1f5f9; border-color: #cbd5e1; }
.sig-btn-primary {
  background: #2563eb;
  color: #fff;
  margin-inline-start: auto;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.sig-btn-primary:hover { background: #1d4ed8; }
.sig-btn-danger {
  background: #fff;
  border-color: #fecaca;
  color: #ef4444;
}
.sig-btn-danger:hover { background: #fef2f2; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.profile-grid .span-2 {
  grid-column: span 2 / span 2;
}

.profile-card {
  background: #fff;
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
}

.profile-card-accent {
  background: linear-gradient(135deg, #fff 0%, #fff5f7 100%);
  border: 1px solid rgba(237, 26, 59, 0.2);
  box-shadow: 0 18px 40px rgba(237, 26, 59, 0.08);
}

.profile-card-primary {
  background: linear-gradient(145deg, #fff 0%, #fff7fa 45%, #fef2f4 100%);
  border: 1px solid rgba(237, 26, 59, 0.18);
  box-shadow: 0 22px 50px rgba(237, 26, 59, 0.08);
}

.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.card-kicker {
  font-size: 0.8rem;
  color: #ed1a3b;
  font-weight: 700;
}

.card-sub {
  font-size: 0.9rem;
  color: #475569;
  margin-top: 0.25rem;
}

.card-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-logo img {
  height: 70px;
  width: 70px;
  border-radius: 14px;
  border: 1px dashed rgba(237, 26, 59, 0.3);
  padding: 6px;
  background: #fff;
}

.card-logo-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.profile-form-grid .span-2 {
  grid-column: span 2 / span 2;
}

.signature-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.signature-preview {
  width: 120px;
  height: 72px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
}

.signature-empty {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  padding: 0 8px;
}

.signature-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-group label {
  font-weight: 700;
  color: #1f2937;
}

.form-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 0.65rem 0.75rem;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  font-weight: 600;
  color: #0f172a;
}

.form-input::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(237, 26, 59, 0.12);
  color: #b91c1c;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(237, 26, 59, 0.22);
}

.profile-badge i {
  color: #ef4444;
}

.profile-meta-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.25rem;
}

.profile-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 700;
}

.profile-meta i {
  color: #ed1a3b;
}

.form-input:focus {
  outline: none;
  border-color: #ed1a3b;
  box-shadow: 0 0 0 3px rgba(237, 26, 59, 0.18);
}

[data-theme="dark"] .profile-card {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .profile-card h3,
[data-theme="dark"] .card-sub,
[data-theme="dark"] .form-group label,
[data-theme="dark"] .profile-hero,
[data-theme="dark"] .profile-kicker,
[data-theme="dark"] .profile-title {
  color: #e2e8f0;
}

[data-theme="dark"] .form-input {
  background: #0b1320;
  border-color: #1f2937;
  color: #e5e7eb;
}

[data-theme="dark"] .form-input::placeholder {
  color: #94a3b8;
}

[data-theme="dark"] .profile-card-primary {
  background: linear-gradient(145deg, #0f172a 0%, #0b1320 100%);
  border-color: #1f2937;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .profile-badge {
  background: rgba(248, 113, 113, 0.15);
  color: #fecdd3;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.25);
}

[data-theme="dark"] .profile-meta {
  background: #0b1320;
  border-color: #1f2937;
  color: #e5e7eb;
}

[data-theme="dark"] .profile-meta i {
  color: #f87171;
}

[data-theme="dark"] .signature-preview {
  background: #0b1320;
  border-color: #1f2937;
}

@media (max-width: 1024px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-grid .span-2 {
    grid-column: span 1 / span 1;
  }
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
  .profile-form-grid .span-2 {
    grid-column: span 1 / span 1;
  }
  .profile-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

.header-icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #d1d5db;
}

.service-request-btn {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.enterprise-nav .app-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  min-width: 260px;
  max-width: 560px;
  width: 100%;
  color: var(--color-text-subtle);
  margin-inline: auto;
}

.enterprise-nav .app-search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--color-text-base);
}

.enterprise-nav .app-search button#global-search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: start;
  cursor: text;
}

.enterprise-nav .app-search button#global-search-btn span {
  flex: 1;
  color: var(--color-text-base);
}

.enterprise-nav .app-search i {
  color: var(--color-text-subtle);
}

.enterprise-nav .app-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--color-primary) 30%, transparent);
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-xs);
}

#documents-overview-section {
  scroll-margin-top: 120px;
}

@media (max-width: 1024px) {
  .enterprise-nav .brand-title {
    display: none;
  }
}

@media (max-width: 767px) {
  .enterprise-nav {
    padding: 0.75rem;
    gap: 0.6rem;
  }

  .app-header.enterprise-nav {
    width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 0.6rem 0.75rem;
    top: 0 !important;
  }

  #main-nav.app-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(86vw, 320px);
    max-width: 86vw;
    height: 100vh;
    border-radius: 16px 0 0 16px;
    transform: translateX(110%);
    transition: transform 0.3s ease;
    z-index: 80;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    top: 0;
  }

  #main-nav.app-sidebar.is-open {
    transform: translateX(0);
  }

  .enterprise-nav .header-left {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .enterprise-nav .header-right {
    display: none;
  }

  .header-icon-btn {
    width: 38px;
    height: 38px;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .enterprise-nav .header-center {
    order: 3;
    width: 100%;
  }

  .enterprise-nav #main-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .enterprise-nav #nav-toggle-btn {
    display: inline-flex;
  }

  .enterprise-nav .nav-dropdown {
    width: 100%;
  }

  .enterprise-nav .nav-dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 0.35rem;
    box-shadow: none;
  }

  .enterprise-nav .nav-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .enterprise-nav #user-menu-button .text-sm span[data-lang="welcome"],
  .enterprise-nav #user-menu-button .permission-badge-label {
    display: none;
  }

  .app-shell {
    width: calc(100% - 1rem);
    gap: 1rem;
  }
  .app-content {
    gap: 1rem;
  }
  .dashboard-filters {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  .dashboard-filters-title {
    width: 100%;
    min-width: 0;
  }
  .dashboard-filter-group,
  .dashboard-filter-range {
    width: 100%;
    min-width: 0;
  }

  .dashboard-filter-range-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-filter-divider {
    text-align: center;
  }

  .dashboard-grid {
    gap: 0.85rem;
  }

  .dashboard-span-3,
  .dashboard-span-4,
  .dashboard-span-8 {
    grid-column: span 12;
  }

  .dashboard-kpi,
  .dashboard-panel {
    padding: 1rem;
  }

  #documents-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #documents-controls .docs-controls-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #documents-controls .docs-controls-search {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #documents-controls .docs-controls-types,
  #documents-controls .docs-controls-actions,
  #documents-controls .docs-controls-search {
    width: 100%;
  }

  #documents-controls .doc-type-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  #documents-controls .action-btn {
    flex: 1 1 160px;
  }

  #documents-controls #printBtn,
  #documents-controls #whatsappBtn {
    flex: 0 0 auto;
  }

  #documents-controls .h-8.w-px {
    display: none;
  }

  #financial-only-control,
  #po-alt-print-control {
    flex: 1 1 240px;
  }

  #document-paper {
    padding: 1rem !important;
  }

  #document-paper-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  #document-paper-header > div {
    width: 100% !important;
  }

  #document-paper-header > div:nth-child(2) {
    text-align: center;
  }

  #document-paper-header > div:nth-child(3) {
    text-align: left;
  }

  #document-paper-header .company-logo {
    height: 4rem;
  }

  #document-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .portal-shell {
    padding: 1rem;
    gap: 1rem;
  }

  .portal-header {
    padding: 0.9rem 1rem;
  }

  .portal-brand {
    padding: 1rem;
  }

  .portal-sidebar .sidebar-item {
    margin: 0 0.5rem;
    padding: 0.65rem 1rem;
  }

  .portal-content {
    padding: 1rem;
    min-height: auto;
  }

  .enterprise-nav .user-menu-dropdown,
  #notification-dropdown,
  #settings-menu-dropdown {
    width: min(92vw, 360px);
    max-width: 92vw;
  }

  .data-table,
  .dashboard-table,
  .cms-table,
  .portal-content table,
  #products-table-container table,
  #documents-overview-section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th,
  .data-table td,
  .dashboard-table th,
  .dashboard-table td,
  .cms-table th,
  .cms-table td,
  #products-table-container th,
  #products-table-container td,
  #documents-overview-section table th,
  #documents-overview-section table td {
    white-space: nowrap;
  }

  .modal-content {
    width: min(92vw, 520px);
    max-height: 88vh;
    overflow: auto;
    padding: 1.15rem;
  }

  .user-management-modal .modal-content {
    max-height: 90vh;
    overflow: auto;
  }
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 75;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Toggle Transition */
#main-nav.app-sidebar {
  transition:
    width 0.3s ease,
    transform 0.3s ease;
}

/* Collapsed Sidebar (Desktop) */
@media (min-width: 768px) {
  body.sidebar-collapsed #main-nav.app-sidebar {
    width: 80px;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn {
    justify-content: center;
    padding: 0.7rem 0;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn span {
    display: none;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn svg,
  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn i {
    margin: 0;
    width: 24px;
    height: 24px;
    font-size: 1.25rem;
  }
}

/* Toggle Button Style */
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-top: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-text-subtle);
  margin-top: auto;
}

.sidebar-toggle-btn:hover {
  color: var(--color-primary);
  background: var(--color-surface-muted);
}

/* --- Sidebar & Collapse Styles --- */

/* Backdrop for Mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Collapsible Sidebar (Desktop) */
@media (min-width: 768px) {
  body.sidebar-collapsed #main-nav.app-sidebar {
    width: 80px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn {
    justify-content: center;
    padding-inline: 0;
    flex-direction: row;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn span {
    display: none;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn svg {
    margin: 0;
  }

  #main-nav.app-sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Sidebar Toggle Button */
#sidebar-toggle-btn {
  height: 50px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 0;
  background: var(--color-surface-muted);
  border: 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 16px 16px;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  flex-shrink: 0;
}

#sidebar-toggle-btn:hover {
  background: color-mix(
    in oklab,
    var(--color-surface-muted) 82%,
    var(--color-border) 18%
  );
  color: var(--color-primary);
}

#sidebar-toggle-btn i {
  font-size: 1.2rem;
  color: currentColor;
}

@media (max-width: 767px) {
  #sidebar-toggle-btn {
    display: none !important;
  }
}

.pdf-export-fix .header,
.pdf-export-fix .header * {
  transform: none !important;
  filter: none !important;
}

.pdf-export-fix .header {
  align-items: flex-start !important;
  gap: 14px !important;
}

.pdf-export-fix .company-details,
.pdf-export-fix .company-details-en {
  min-width: 0 !important;
  max-width: 34% !important;
}

/* Main sidebar final overrides */
#main-nav.app-sidebar {
  width: 248px;
  min-height: calc(100vh - 7rem);
  padding: 0.75rem;
  gap: 0.75rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #111827 0%, #161b25 52%, #0f1117 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

#main-nav.app-sidebar .sidebar-content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 0.45rem;
}

#main-nav.app-sidebar .nav-btn {
  min-height: 46px;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #d1d5db;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 0.9rem;
  font-weight: 800;
}

#main-nav.app-sidebar .nav-btn svg,
#main-nav.app-sidebar .nav-btn i {
  order: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex: 0 0 auto;
  color: #94a3b8;
}

#main-nav.app-sidebar .nav-btn:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}

#main-nav.app-sidebar .nav-btn.active {
  background: #ed1a3b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 10px 18px rgba(237, 26, 59, 0.22);
}

#main-nav.app-sidebar .nav-btn.active svg,
#main-nav.app-sidebar .nav-btn.active i,
#main-nav.app-sidebar .nav-btn:hover svg,
#main-nav.app-sidebar .nav-btn:hover i {
  color: #fff;
}

#sidebar-toggle-btn {
  width: 100%;
  height: 42px;
  margin-top: auto;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

#sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (min-width: 768px) {
  body.sidebar-collapsed #main-nav.app-sidebar {
    width: 76px;
    padding-inline: 0.65rem;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn {
    justify-content: center;
    padding: 0;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn span {
    display: none;
  }

  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn svg,
  body.sidebar-collapsed #main-nav.app-sidebar .nav-btn i {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
  }
}

@media (max-width: 767px) {
  #main-nav.app-sidebar {
    width: min(86vw, 320px);
    max-height: calc(100vh - 6.5rem);
    min-height: 0;
    overflow-y: auto;
  }

  #sidebar-toggle-btn {
    display: none !important;
  }
}

.pdf-export-fix .logo {
  flex: 0 0 180px !important;
}

.pdf-export-fix .company-details h2 {
  direction: rtl;
  unicode-bidi: plaintext;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  letter-spacing: normal;
  display: block;
  line-height: 1.25;
  font-size: 16px;
}

.pdf-export-fix .doc-title h1 {
  direction: rtl;
  unicode-bidi: plaintext;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  letter-spacing: normal;
  display: inline-block;
}

/* —— المنافسات الحكومية —— */
.gov-tenders-root {
  width: 100%;
}

.gov-tenders-hero.page-hero::after {
  background:
    radial-gradient(
      circle at 15% 20%,
      color-mix(in oklab, var(--color-primary) 22%, transparent),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 25%,
      color-mix(in oklab, var(--color-accent) 18%, transparent),
      transparent 50%
    );
}

.gov-tenders-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
}

.gov-tenders-title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--color-text-base);
}

.gov-tenders-sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-subtle);
  max-width: 42rem;
  line-height: 1.55;
}

.gov-tenders-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .gov-tenders-layout {
    grid-template-columns: 1fr;
  }
}

.gov-tenders-aside {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 640px);
}

.gov-tenders-aside-head {
  padding: 0.85rem 1rem;
  font-weight: 800;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in oklab, var(--color-primary) 6%, var(--color-surface));
  color: var(--color-text-base);
}

.gov-tenders-aside .gov-tenders-list-item,
.gov-tenders-aside .gov-tenders-list-empty {
  margin: 0;
}

.gov-tenders-list-empty {
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-subtle);
}

.gov-tenders-list-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  width: 100%;
  text-align: right;
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: background 0.15s ease;
  font: inherit;
}

.gov-tenders-list-item:hover {
  background: var(--color-surface-muted);
}

.gov-tenders-list-item--active {
  border-inline-end: 4px solid var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 8%, var(--color-surface));
}

.gov-tenders-list-item-title {
  font-weight: 700;
  color: var(--color-text-base);
  font-size: 0.92rem;
}

.gov-tenders-list-item-meta {
  font-size: 0.78rem;
  color: var(--color-text-subtle);
}

.gov-tenders-main {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gov-tenders-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.gov-tenders-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gov-tenders-tab {
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-base);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.gov-tenders-tab:hover {
  border-color: color-mix(in oklab, var(--color-primary) 35%, var(--color-border));
}

.gov-tenders-tab--active {
  background: color-mix(in oklab, var(--color-primary) 14%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-primary) 45%, var(--color-border));
  color: var(--color-text-base);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--color-primary) 12%, transparent);
}

.gov-tenders-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-subtle);
}

.gov-tenders-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gov-tenders-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

@media (max-width: 640px) {
  .gov-tenders-grid-2 {
    grid-template-columns: 1fr;
  }
}

.gov-tenders-span-2 {
  grid-column: 1 / -1;
}

.gov-tenders-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gov-tenders-field span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-subtle);
}

.gov-tenders-field input,
.gov-tenders-field select,
.gov-tenders-field textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-base);
  font: inherit;
}

.gov-tenders-field input:focus,
.gov-tenders-field select:focus,
.gov-tenders-field textarea:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--color-primary) 55%, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 18%, transparent);
}

.gov-tenders-span-full {
  grid-column: 1 / -1;
}

.gov-tenders-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in oklab, var(--color-border) 88%, var(--color-text-subtle));
  background: var(--color-surface);
  box-shadow: 0 10px 24px color-mix(in oklab, var(--color-text-base) 8%, transparent);
}

.gov-tenders-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  table-layout: fixed;
}

.gov-tenders-table th {
  text-align: center;
  padding: 0.72rem 0.65rem;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 0;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.76rem;
  line-height: 1.35;
}

.gov-tenders-table th:last-child {
  border-inline-end: 0;
}

.gov-tenders-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid color-mix(in oklab, var(--color-border) 88%, var(--color-surface-muted));
  border-inline-end: 1px solid color-mix(in oklab, var(--color-border) 88%, var(--color-surface-muted));
  vertical-align: middle;
  text-align: center;
  background: var(--color-surface);
}

.gov-tenders-table td:last-child {
  border-inline-end: 0;
}

.gov-tenders-table tbody tr:last-child td {
  border-bottom: 0;
}

.gov-tenders-table tbody tr:nth-child(even) td {
  background: color-mix(in oklab, var(--color-surface-muted) 70%, var(--color-surface));
}

.gov-tenders-table td:nth-child(2) {
  text-align: right;
  font-weight: 700;
}

.gov-tenders-input-table {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-base);
  font: inherit;
}

.gov-tenders-td-num {
  width: 2rem;
  color: var(--color-text-subtle);
  font-weight: 600;
}

.gov-tenders-td-money {
  font-weight: 700;
  color: var(--color-text-base);
  white-space: nowrap;
}

.gov-tenders-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
}

.gov-tenders-icon-btn:hover {
  background: color-mix(in oklab, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
}

.gov-tenders-add-line {
  margin-top: 0.65rem;
}

.gov-tenders-totals {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gov-tenders-totals > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 200px;
}

.gov-tenders-totals > label span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-subtle);
}

.gov-tenders-totals > label input {
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-base);
}

.gov-tenders-total-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--color-border);
}

.gov-tenders-total-rows > div:last-child {
  border-bottom: 0;
}

.gov-tenders-grand {
  margin-top: 0.25rem;
  padding-top: 0.5rem !important;
  font-size: 1.05rem !important;
  font-weight: 800;
}

.gov-tenders-grand strong {
  color: var(--color-primary);
}

/* مستند العرض المالي / الفني (معاينة نهائية) */
.gov-tenders-doc-page {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.gov-tenders-doc-head {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.gov-tenders-doc-head-strip {
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--color-primary-strong) 42%,
    var(--color-secondary) 100%
  );
}

.gov-tenders-doc-head-inner {
  padding: 1.1rem 1.25rem 1.15rem;
}

.gov-tenders-doc-head-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-text-base);
}

.gov-tenders-doc-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.gov-tenders-doc-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin: 0 0 0.35rem;
}

.gov-tenders-doc-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.gov-tenders-doc-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--color-text-base);
  line-height: 1.25;
}

.gov-tenders-doc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  background: color-mix(in oklab, var(--color-primary) 12%, var(--color-surface));
  color: var(--color-primary-strong);
  border: 1px solid color-mix(in oklab, var(--color-primary) 28%, var(--color-border));
}

.gov-tenders-doc-subject {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  line-height: 1.45;
}

.gov-tenders-doc-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem 1rem;
  margin: 0;
}

@media (max-width: 560px) {
  .gov-tenders-doc-meta {
    grid-template-columns: 1fr;
  }
}

.gov-tenders-doc-meta-item {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.gov-tenders-doc-meta-item dt {
  margin: 0 0 0.2rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
}

.gov-tenders-doc-meta-item dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-base);
  word-break: break-word;
}

.gov-tenders-doc-sheet {
  padding: 1.1rem 1.25rem 1.35rem;
  background: var(--color-surface);
}

.gov-tenders-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 3px solid var(--color-primary);
}

.gov-tenders-section-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.gov-tenders-section-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--color-text-base);
}

.gov-tenders-section-lead {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-subtle);
  line-height: 1.55;
}

.gov-tenders-table-wrap--doc {
  border-radius: var(--radius-md);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--color-border) 80%, transparent);
}

.gov-tenders-table--doc thead th {
  background: #0f172a;
  color: #fff;
  font-size: 0.76rem;
  text-transform: none;
  letter-spacing: 0;
}

.gov-tenders-table--doc tbody tr:nth-child(even) td {
  background: color-mix(in oklab, var(--color-surface-muted) 70%, var(--color-surface));
}

.gov-tenders-fin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1rem;
  margin-top: 1.1rem;
  align-items: start;
}

@media (max-width: 800px) {
  .gov-tenders-fin-grid {
    grid-template-columns: 1fr;
  }
}

.gov-tenders-totals-card {
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in oklab, var(--color-primary) 22%, var(--color-border));
  background: linear-gradient(
    145deg,
    color-mix(in oklab, var(--color-primary) 9%, var(--color-surface)) 0%,
    var(--color-surface) 55%
  );
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-xs);
}

.gov-tenders-totals-card-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary-strong);
}

.gov-tenders-totals-card-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.gov-tenders-totals-card-field span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-subtle);
}

.gov-tenders-totals-card-field input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-base);
  font: inherit;
}

.gov-tenders-totals-card .gov-tenders-total-rows {
  border-top: 1px dashed var(--color-border);
  padding-top: 0.5rem;
}

.gov-tenders-remarks-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  padding: 1rem 1.05rem;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
}

.gov-tenders-remarks-card-title {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gov-tenders-field--plain {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gov-tenders-remarks-textarea {
  flex: 1;
  min-height: 8rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-base);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
}

.gov-tenders-remarks-textarea:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--color-primary) 55%, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 14%, transparent);
}

.gov-tenders-tech-lead {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--color-text-subtle);
  line-height: 1.6;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--color-primary) 5%, var(--color-surface-muted));
  border: 1px solid color-mix(in oklab, var(--color-primary) 12%, var(--color-border));
}

.gov-tenders-tech-section {
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  overflow: hidden;
  border-inline-start: 4px solid var(--color-primary);
}

.gov-tenders-tech-section:last-child {
  margin-bottom: 0;
}

.gov-tenders-tech-section-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: color-mix(in oklab, var(--color-surface) 70%, var(--color-surface-muted));
  border-bottom: 1px solid var(--color-border);
}

.gov-tenders-tech-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.gov-tenders-tech-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--color-text-base);
  line-height: 1.3;
}

.gov-tenders-tech-textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text-base);
  font: inherit;
  line-height: 1.65;
  resize: vertical;
  min-height: 6.5rem;
}

.gov-tenders-tech-textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--color-primary) 35%, transparent);
}

/* Stepper styles */
.gov-stepper-container {
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.gov-stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.gov-stepper::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}

.gov-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 120px;
}

.gov-step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text-subtle);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.gov-step-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-subtle);
  text-align: center;
  transition: all 0.3s ease;
}

.gov-step-item:hover .gov-step-circle {
  border-color: color-mix(in oklab, var(--color-primary) 50%, var(--color-border));
}

.gov-step-item.active .gov-step-circle {
  border-color: var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 10%, var(--color-surface));
  color: var(--color-primary);
  transform: scale(1.1);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-primary) 15%, transparent);
}

.gov-step-item.active .gov-step-label {
  color: var(--color-text-base);
  font-weight: 800;
}

.gov-step-item.complete .gov-step-circle {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.gov-step-item.complete .gov-step-label {
  color: var(--color-text-base);
}

.gov-step-content {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.gov-step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Review & Export Step */
.gov-tenders-review {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.gov-tenders-review-header {
  text-align: center;
  background: color-mix(in oklab, var(--color-primary) 5%, transparent);
  border: 1px dashed color-mix(in oklab, var(--color-primary) 30%, var(--color-border));
  border-radius: 12px;
  padding: 2rem;
}

.gov-tenders-review-header i {
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.gov-tenders-review-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-base);
}

.gov-tenders-review-header p {
  color: var(--color-text-subtle);
  max-width: 500px;
  margin: 0 auto;
}

.gov-tenders-review-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gov-tenders-review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gov-tenders-review-card h4 {
  font-size: 1.1rem;
  color: var(--color-text-base);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.gov-tenders-review-card h4 i {
  color: var(--color-primary);
}

.gov-tenders-review-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--color-text-subtle);
}

.gov-tenders-review-stat strong {
  color: var(--color-text-base);
  font-weight: 800;
}

.gov-review-print-btn {
  margin-top: auto;
  border-radius: 12px;
  padding: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Hide old tabs */
.gov-tenders-tabs {
  display: none !important;
}

@media (max-width: 640px) {
    .gov-stepper::before {
      display: none;
    }
    .gov-stepper {
      flex-direction: column;
      gap: 1rem;
      align-items: flex-start;
    }
    .gov-step-item {
      flex-direction: row;
      width: 100%;
      justify-content: flex-start;
    }
  }

/* Gov Tenders Modal & Full Width Layout */
.gov-tenders-layout {
  display: block !important;
}

.gov-tenders-main {
  width: 100% !important;
  max-width: 100% !important;
}

.gov-tenders-aside {
  display: none !important;
}

/* Modal List Items */
.gov-tenders-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.gov-tenders-list-item:last-child {
  border-bottom: none;
}

.gov-tenders-list-item:hover {
  background: var(--color-surface-muted);
  padding-right: 1.5rem;
}

.gov-tenders-list-item::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.gov-tenders-list-item:hover::after {
  opacity: 1;
}

.gov-tenders-list-item.selected {
  background: color-mix(in oklab, var(--color-primary) 8%, var(--color-surface));
}

.gov-tenders-list-item.selected::after {
  opacity: 1;
}

.gov-tenders-list-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-base);
}

.gov-tenders-list-item-meta {
  font-size: 0.78rem;
  color: var(--color-text-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gov-tenders-list-empty {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-subtle);
  font-style: italic;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */

@keyframes skeletonShimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--color-border) 80%, var(--color-surface)) 25%,
    color-mix(in oklab, var(--color-surface) 60%, var(--color-border)) 50%,
    color-mix(in oklab, var(--color-border) 80%, var(--color-surface)) 75%
  );
  background-size: 600px 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    #1e293b 25%,
    #334155 50%,
    #1e293b 75%
  );
  background-size: 600px 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}

.skeleton-text   { height: 0.85em; border-radius: 4px; }
.skeleton-title  { height: 1.2em;  border-radius: 6px; }
.skeleton-circle { border-radius: 50%; }
.skeleton-btn    { height: 2.2rem; border-radius: var(--radius-md); }
.skeleton-badge  { height: 1.4rem; border-radius: var(--radius-pill); width: 4rem; }

/* Table skeleton rows */
.skeleton-row td { padding: 0.9rem 1rem; }
.skeleton-row td > .skeleton { display: block; }

/* Card skeleton */
.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem;
  text-align: center;
  gap: 1rem;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--color-primary) 10%, var(--color-surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

[data-theme="dark"] .empty-state-icon {
  background: color-mix(in oklab, var(--color-primary) 15%, #1e293b);
}

.empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-base);
  margin: 0;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--color-text-subtle);
  max-width: 300px;
  line-height: 1.6;
  margin: 0;
}

.empty-state-action {
  margin-top: 0.25rem;
}

/* Inline empty (inside table td) */
.empty-state-inline {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--color-text-subtle);
}

.empty-state-inline .empty-state-icon {
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
  margin: 0 auto 0.75rem;
}

.empty-state-inline .empty-state-title {
  font-size: 0.95rem;
}

.empty-state-inline .empty-state-desc {
  font-size: 0.8rem;
}

/* ============================================================
   SORTABLE TABLE HEADERS
   ============================================================ */

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.sortable-th:hover {
  color: var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 5%, transparent);
}

.sort-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  vertical-align: middle;
  margin-inline-start: 0.3em;
  opacity: 0.35;
  transition: opacity 0.15s ease;
  font-size: 0.6rem;
}

.sortable-th:hover  .sort-icon   { opacity: 0.7; }
.sortable-th.asc    .sort-icon,
.sortable-th.desc   .sort-icon   { opacity: 1; color: var(--color-primary); }

.sortable-th.asc  .sort-asc  { opacity: 1; }
.sortable-th.asc  .sort-desc { opacity: 0.25; }
.sortable-th.desc .sort-asc  { opacity: 0.25; }
.sortable-th.desc .sort-desc { opacity: 1; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumb-item a {
  color: var(--color-text-subtle);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb-item a:hover { color: var(--color-primary); }

.breadcrumb-item.active {
  color: var(--color-text-base);
  font-weight: 600;
}

.breadcrumb-sep {
  opacity: 0.4;
  font-size: 0.7rem;
}

/* ============================================================
   RESPONSIVE TABLE WRAPPER
   ============================================================ */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.table-responsive::-webkit-scrollbar {
  height: 5px;
}

.table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}

@media (max-width: 768px) {
  .table-responsive .data-table th,
  .table-responsive .data-table td {
    font-size: 0.78rem;
    padding: 0.6rem 0.65rem;
    white-space: nowrap;
  }

  .table-col-hide-mobile { display: none !important; }
}

/* ============================================================
   LOGIN PAGE ENHANCEMENTS
   ============================================================ */

@keyframes loginLogoIn {
  from { opacity: 0; transform: scale(0.85) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.company-logo {
  animation: loginLogoIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.login-card {
  animation: loginCardIn 0.4s ease both;
  transition: box-shadow 0.3s ease;
}

.login-card:hover {
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.18);
}

/* Enhanced input focus ring */
.login-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 18%, transparent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ============================================================
   DASHBOARD KPI CARDS — ENHANCED
   ============================================================ */

/* Animated counter */
@keyframes kpiCountUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Accent bar at top of card */
.dashboard-kpi::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 0 0 0;
  background: var(--color-primary);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dashboard-kpi:hover::before {
  opacity: 1;
}

/* Subtle gradient shimmer on hover */
.dashboard-kpi::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--color-primary) 4%, transparent),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dashboard-kpi:hover::after { opacity: 1; }

/* Subtitle line */
.dashboard-kpi-subtitle {
  font-size: 0.7rem;
  color: var(--dashboard-text-muted, #94a3b8);
  margin-top: 0.2rem;
  line-height: 1.4;
}

/* Icon pulse on hover */
.dashboard-kpi:hover .dashboard-kpi-icon {
  transform: scale(1.08) rotate(-3deg);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Colored top-border variant per card */
.dashboard-kpi--amber::before { background: #f59e0b; opacity: 1; }
.dashboard-kpi--blue::before  { background: #3b82f6; opacity: 1; }
.dashboard-kpi--green::before { background: #22c55e; opacity: 1; }
.dashboard-kpi--red::before   { background: var(--color-primary); opacity: 1; }

/* Dark mode adjustments */
[data-theme="dark"] .dashboard-kpi::after {
  background: linear-gradient(135deg, rgba(237,26,59,0.07), transparent 60%);
}

/* ============================================================
   DOCUMENT FORM STAMP & TYPE BUTTON
   ============================================================ */

.stamp-container {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 24px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.stamp-container img {
  max-width: 140px;
  height: auto;
  opacity: 0.85;
}

.doc-type-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f3f4f6;
  color: #9ca3af;
}

[data-theme="dark"] .doc-type-btn.disabled {
  background-color: #1e293b;
  color: #64748b;
}

/* ============================================================
   DASHBOARD DARK MODE — Comprehensive
   ============================================================ */

[data-theme="dark"] .dashboard-topbar {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.96),
    rgba(15, 23, 42, 0.92)
  );
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .dashboard-topbar::after {
  background:
    radial-gradient(
      circle at 20% 25%,
      rgba(237, 26, 59, 0.12),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 10%,
      rgba(14, 165, 233, 0.12),
      transparent 50%
    );
}

[data-theme="dark"] .dashboard-title {
  color: #f1f5f9;
}

[data-theme="dark"] .dashboard-subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .dashboard-chip {
  background: linear-gradient(
    120deg,
    rgba(30, 41, 59, 0.95),
    rgba(15, 23, 42, 0.95)
  );
  border-color: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

[data-theme="dark"] .dashboard-chip-muted {
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
}

[data-theme="dark"] .dashboard-kpi {
  background: linear-gradient(
    150deg,
    rgba(30, 41, 59, 0.95),
    rgba(15, 23, 42, 0.94)
  );
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .dashboard-kpi:hover {
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
  border-color: rgba(237, 26, 59, 0.35);
}

[data-theme="dark"] .dashboard-kpi-icon {
  background: linear-gradient(
    145deg,
    rgba(237, 26, 59, 0.18),
    rgba(237, 26, 59, 0.06)
  );
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .dashboard-kpi-icon--green {
  background: linear-gradient(
    145deg,
    rgba(34, 197, 94, 0.18),
    rgba(34, 197, 94, 0.06)
  );
}

[data-theme="dark"] .dashboard-kpi-icon--blue {
  background: linear-gradient(
    145deg,
    rgba(59, 130, 246, 0.18),
    rgba(59, 130, 246, 0.06)
  );
}

[data-theme="dark"] .dashboard-kpi-icon--amber {
  background: linear-gradient(
    145deg,
    rgba(245, 158, 11, 0.18),
    rgba(245, 158, 11, 0.06)
  );
}

[data-theme="dark"] .dashboard-panel {
  background: linear-gradient(
    145deg,
    rgba(30, 41, 59, 0.95),
    rgba(15, 23, 42, 0.95)
  );
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .dashboard-panel-title {
  color: #f1f5f9;
}

[data-theme="dark"] .dashboard-table {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.96),
    rgba(15, 23, 42, 0.95)
  );
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .dashboard-table-head {
  background: linear-gradient(
    120deg,
    rgba(148, 163, 184, 0.08),
    rgba(237, 26, 59, 0.1)
  );
  color: #e2e8f0;
}

[data-theme="dark"] #top-clients-list li {
  background: rgba(30, 41, 59, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] #top-clients-list .font-bold {
  color: #4ade80 !important;
}

[data-theme="dark"] .dashboard-activity-list > div {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.95),
    rgba(15, 23, 42, 0.92)
  );
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   DASHBOARD STAGGER ENTRANCE ANIMATIONS
   ============================================================ */

@keyframes kpiStaggerIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panelStaggerIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-kpi {
  animation: kpiStaggerIn 0.5s ease-out both;
}

.dashboard-kpi:nth-child(1) { animation-delay: 0.05s; }
.dashboard-kpi:nth-child(2) { animation-delay: 0.12s; }
.dashboard-kpi:nth-child(3) { animation-delay: 0.19s; }
.dashboard-kpi:nth-child(4) { animation-delay: 0.26s; }

.dashboard-panel {
  animation: panelStaggerIn 0.55s ease-out both;
}

.dashboard-panel:nth-child(1) { animation-delay: 0.3s; }
.dashboard-panel:nth-child(2) { animation-delay: 0.4s; }

.dashboard-filters {
  animation: panelStaggerIn 0.45s ease-out both;
  animation-delay: 0.02s;
}

.dashboard-topbar {
  animation: panelStaggerIn 0.4s ease-out both;
}

/* Activity list items stagger */
.dashboard-activity-list > div {
  animation: kpiStaggerIn 0.35s ease-out both;
}

.dashboard-activity-list > div:nth-child(1) { animation-delay: 0.1s; }
.dashboard-activity-list > div:nth-child(2) { animation-delay: 0.18s; }
.dashboard-activity-list > div:nth-child(3) { animation-delay: 0.26s; }
.dashboard-activity-list > div:nth-child(4) { animation-delay: 0.34s; }
.dashboard-activity-list > div:nth-child(5) { animation-delay: 0.42s; }

/* Dark mode for dynamic dashboard elements */
[data-theme="dark"] .dashboard-activity-list > div:hover,
[data-theme="dark"] #top-clients-list li:hover {
  background: rgba(51, 65, 85, 0.4) !important;
}

[data-theme="dark"] .dashboard-activity-list .font-bold.text-slate-800,
[data-theme="dark"] #top-clients-list .font-semibold.text-slate-700 {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .dashboard-activity-list .text-slate-500,
[data-theme="dark"] #top-clients-list .text-slate-400 {
  color: #94a3b8 !important;
}

[data-theme="dark"] .dashboard-activity-list .border-slate-100\/60 {
  border-color: rgba(148, 163, 184, 0.12) !important;
}

[data-theme="dark"] #top-clients-list .bg-slate-100 {
  background: rgba(148, 163, 184, 0.12) !important;
}

[data-theme="dark"] .dashboard-activity-list .bg-blue-100 {
  background: rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .dashboard-activity-list .bg-green-100 {
  background: rgba(34, 197, 94, 0.2) !important;
}

/* ============================================================
   LOGIN PAGE DARK MODE — Comprehensive
   ============================================================ */

[data-theme="dark"] #auth-container .login-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.94)) !important;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.25),
    0 6px 18px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] #auth-container .login-card::before {
  background: linear-gradient(90deg, transparent, rgba(237, 26, 59, 0.7) 24%, rgba(255, 73, 103, 0.65) 50%, rgba(237, 26, 59, 0.7) 76%, transparent);
}

[data-theme="dark"] #auth-container .login-card::after {
  background: radial-gradient(circle, rgba(237, 26, 59, 0.06), rgba(237, 26, 59, 0.02) 44%, transparent 68%);
}

[data-theme="dark"] .login-card h2 {
  color: #f1f5f9;
}

[data-theme="dark"] .login-input {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

[data-theme="dark"] .login-input:focus {
  background: #1e293b;
  border-color: rgba(237, 26, 59, 0.6);
  box-shadow: 0 0 0 3px rgba(237, 26, 59, 0.15);
}

[data-theme="dark"] .login-input:-webkit-autofill,
[data-theme="dark"] .login-input:-webkit-autofill:hover,
[data-theme="dark"] .login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e2e8f0;
  box-shadow:
    inset 0 0 0 1000px #1e293b,
    0 0 0 3px rgba(237, 26, 59, 0.1);
}

[data-theme="dark"] #login-form label {
  color: #94a3b8;
}

[data-theme="dark"] #toggle-password {
  color: #64748b !important;
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] #toggle-password:hover {
  color: #ed1a3b !important;
  background: #1e293b;
  border-color: rgba(237, 26, 59, 0.25);
}

[data-theme="dark"] .login-bg-switch {
  background: rgba(30, 41, 59, 0.76);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .login-bg-switch-label {
  color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .login-bg-option {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .login-bg-swatch {
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] #auth-message {
  color: #f87171;
}

[data-theme="dark"] #auth-container #login-footer {
  border-top-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] #auth-container .vision-logo {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
  opacity: 0.9;
}

/* ============================================================
   DOCUMENT FORM REDESIGN — Professional UI
   ============================================================ */

/* ============================================================
   Documents Toolbar — single-row professional layout
   ============================================================ */
.docs-toolbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.65rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 1px 0 #fff inset;
  backdrop-filter: blur(10px);
  margin-bottom: 1.5rem;
  position: sticky;
  top: 0.5rem;
  z-index: 110;
  overflow: visible;
}

/* ── Zone base ── */
.dtb-zone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0 0.75rem;
}

/* Doc type zone — leftmost */
.dtb-zone--types {
  padding-right: 0;
  gap: 0.6rem;
}

/* Primary action buttons */
.dtb-zone--actions {
  gap: 0.5rem;
}

/* Print zone */
.dtb-zone--print {
  gap: 0.45rem;
}

/* Search — grows to fill all remaining space */
.dtb-zone--search {
  flex: 1;
  min-width: 180px;
  padding: 0 0.75rem;
}

/* Toggles zone — rightmost */
.dtb-zone--toggles {
  gap: 0.65rem;
  padding: 0.3rem 0.65rem 0.3rem 0;
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  margin-right: 0.25rem;
}

/* Legacy compat */
.docs-toolbar-group { display: flex; align-items: center; gap: 0.5rem; }
.docs-toolbar-group--actions { flex: 1; justify-content: center; }
.docs-toolbar-group--toggles { gap: 0.75rem; }
.docs-toolbar-row { display: flex; align-items: center; gap: 0.6rem; }
.docs-toolbar-left, .docs-toolbar-center, .docs-toolbar-right { display: flex; align-items: center; gap: 0.5rem; }

.docs-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 1.05rem;
  border-radius: 10px;
  font-size: 0.855rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
  height: 2.5rem;
}

.docs-toolbar-btn--primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.docs-toolbar-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.docs-toolbar-btn--secondary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-color: rgba(217, 119, 6, 0.3);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.docs-toolbar-btn--secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.docs-toolbar-btn--success {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.25);
}
.docs-toolbar-btn--success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(20, 184, 166, 0.35);
}

.docs-toolbar-btn--info {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}
.docs-toolbar-btn--info:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

.docs-toolbar-btn--ghost {
  background: #fff;
  color: #475569;
  border-color: rgba(203, 213, 225, 0.8);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.docs-toolbar-btn--ghost:hover {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.6);
  transform: translateY(-1px);
}

.docs-toolbar-btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.docs-toolbar-btn--whatsapp {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border-color: rgba(22, 163, 74, 0.3);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.docs-toolbar-btn--whatsapp:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
}

.docs-toolbar-divider {
  width: 1px;
  height: 1.5rem;
  background: rgba(203, 213, 225, 0.6);
  margin: 0 0.25rem;
}

.docs-toolbar-segmented {
  display: inline-flex;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 10px;
  padding: 0.2rem;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
  height: 2.5rem;
  align-items: center;
}

.docs-toolbar-segitem {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  height: 100%;
}

.docs-toolbar-segitem:hover {
  background: rgba(241, 245, 249, 0.8);
  color: #475569;
}

.docs-toolbar-segitem.active {
  background: linear-gradient(135deg, #ed1a3b, #c9102c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(237, 26, 59, 0.25);
}

.docs-toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #64748b;
  font-size: 0.85rem;
}

.docs-toolbar-search {
  width: 100%;
  position: relative;
}

.docs-toolbar-search-input {
  width: 100%;
  height: 2.5rem;
  padding: 0 2.6rem 0 1rem;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
}

.docs-toolbar-search-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.docs-toolbar-search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

/* --- Document Header --- */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid rgba(226, 232, 240, 0.8);
  gap: 1rem;
}

.doc-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-header-info--ar {
  text-align: right;
}

.doc-header-info--en {
  text-align: left;
}

.doc-header-company {
  font-size: 1rem;
  font-weight: 800;
  color: #ed1a3b;
  line-height: 1.2;
}

.doc-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #64748b;
}

.doc-header-meta strong {
  color: #475569;
  font-weight: 700;
}

.doc-header-logo {
  flex-shrink: 0;
  text-align: center;
}

.doc-header-logo .company-logo {
  height: 5.5rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.08));
}

/* --- Client Section --- */
.doc-client-section {
  margin-top: 2rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 0.9));
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.doc-client-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.doc-client-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-client-header h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1rem;
  background: linear-gradient(180deg, #ed1a3b, #c9102c);
  border-radius: 2px;
}

.doc-client-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .doc-client-grid {
    grid-template-columns: 1fr;
  }
}

.doc-client-search {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-client-search label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
}

.doc-client-searchbox {
  position: relative;
}

.doc-client-searchbox input {
  width: 100%;
  padding: 0.6rem 2.25rem 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.2s ease;
}

.doc-client-searchbox input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.doc-client-searchbox i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
}

.doc-client-feedback {
  font-size: 0.75rem;
  color: #94a3b8;
  min-height: 1.1rem;
}

.doc-client-results {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  max-height: 10rem;
  overflow-y: auto;
}

.doc-client-addbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
  margin-top: 0.25rem;
}

.doc-client-addbtn:hover {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  transform: translateY(-1px);
}

.doc-client-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .doc-client-card {
    grid-template-columns: 1fr;
  }
}

.doc-client-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 10px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.doc-client-field:hover {
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.doc-client-field i {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(241, 245, 249, 0.8);
  color: #64748b;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.doc-client-label {
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
}

.doc-client-value {
  font-weight: 700;
  color: #1e293b;
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-client-value:empty::after {
  content: "—";
  color: #cbd5e1;
  font-weight: 700;
}

.doc-client-card.has-client .doc-client-field {
  border-color: rgba(148, 163, 184, 0.8);
  background: #ffffff;
}

.doc-client-field.has-value {
  box-shadow: inset 3px 0 0 rgba(237, 26, 59, 0.12);
}

/* ============================================================
   DOCUMENT FORM DARK MODE
   ============================================================ */

[data-theme="dark"] .docs-toolbar {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.97), rgba(15, 23, 42, 0.95));
  border-color: rgba(148, 163, 184, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .dtb-zone--toggles {
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .docs-toolbar-btn--ghost {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.2);
}
[data-theme="dark"] .docs-toolbar-btn--ghost:hover {
  background: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .docs-toolbar-segmented {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .docs-toolbar-segitem {
  color: #94a3b8;
}
[data-theme="dark"] .docs-toolbar-segitem:hover {
  background: rgba(51, 65, 85, 0.5);
  color: #e2e8f0;
}

[data-theme="dark"] .docs-toolbar-group--toggles {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .docs-toolbar-search-input {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

[data-theme="dark"] .doc-header {
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .doc-header-company {
  color: #f87171;
}

[data-theme="dark"] .doc-header-meta {
  color: #94a3b8;
}

[data-theme="dark"] .doc-client-section {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.5));
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .doc-client-header h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .doc-client-field {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

[data-theme="dark"] .doc-client-value {
  color: #e2e8f0;
}

[data-theme="dark"] .doc-client-searchbox input {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

[data-theme="dark"] .doc-client-addbtn {
  background: rgba(51, 65, 85, 0.6);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.2);
}

/* --- Items Table --- */
.doc-items-section {
  margin-top: 2rem;
}

.doc-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.doc-items-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-items-header h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1rem;
  background: linear-gradient(180deg, #ed1a3b, #c9102c);
  border-radius: 2px;
}

.doc-items-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 999px;
  color: #64748b;
}

.doc-items-table-wrapper {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.doc-items-table {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.doc-items-table thead {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
}

.doc-items-table thead th {
  padding: 0.75rem 0.5rem;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.doc-items-table thead th:first-child {
  border-radius: 0 12px 0 0;
}

.doc-items-table thead th:last-child {
  border-radius: 12px 0 0 0;
}

.doc-items-table tbody {
  background: #fff;
}

.doc-items-table tbody tr {
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: background-color 0.15s ease;
}

.doc-items-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.6);
}

.doc-items-table tbody td {
  padding: 0.6rem 0.4rem;
  color: #334155;
  font-weight: 600;
}

.doc-items-addbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, #ed1a3b, #c9102c);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(237, 26, 59, 0.25);
}

.doc-items-addbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(237, 26, 59, 0.35);
}

.doc-items-addbtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.doc-items-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.doc-items-actions .doc-items-addbtn {
  margin-top: 0;
}

.doc-items-importbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: #fff;
  color: #ed1a3b;
  border: 2px solid #ed1a3b;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.doc-items-importbtn:hover {
  background: #fff5f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(237, 26, 59, 0.18);
}

/* --- Totals Section --- */
.doc-totals-section {
  margin-top: 2rem;
}

.doc-totals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .doc-totals-grid {
    grid-template-columns: 1fr;
  }
}

.doc-terms-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.doc-terms-block {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.6), rgba(255, 255, 255, 0.8));
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.doc-terms-block h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.doc-terms-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.doc-terms-editbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.doc-terms-editbtn:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}


.doc-terms-vars {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.doc-terms-vars span {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  background: rgba(241, 245, 249, 0.8);
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
  color: #64748b;
  margin: 0.1rem;
}

.doc-terms-textarea {
  width: 100%;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  resize: vertical;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.doc-terms-textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.doc-po-extra {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.5), rgba(255, 255, 255, 0.8));
  border: 1px solid rgba(254, 202, 202, 0.4);
  border-radius: 14px;
  padding: 1rem;
}

.doc-po-extra h4 {
  font-size: 0.85rem;
  font-weight: 800;
  color: #dc2626;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(254, 202, 202, 0.4);
}

.doc-po-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.doc-po-grid .col-span-2 {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .doc-po-grid {
    grid-template-columns: 1fr;
  }
  .doc-po-grid .col-span-2 {
    grid-column: span 1;
  }
}

.doc-po-grid label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.25rem;
}

.doc-po-grid input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.2s ease;
}

.doc-po-grid input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.doc-po-auth {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.doc-po-auth h4 {
  font-size: 0.8rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.doc-po-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.doc-totals-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.09);
}

.doc-totals-card-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.doc-totals-card-header i {
  color: #10b981;
  font-size: 1rem;
}

.doc-totals-card-body {
  padding: 0.25rem 1.25rem 0.5rem;
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px dashed rgba(226, 232, 240, 0.8);
}

.doc-total-row:last-of-type {
  border-bottom: none;
}

.doc-total-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

.doc-total-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.doc-discount-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.doc-discount-input {
  width: 3.5rem;
  padding: 0.25rem 0.4rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  background: #f8fafc;
  transition: border-color 0.2s;
}

.doc-discount-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

.doc-tax-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0 0.4rem;
}

.doc-tax-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.doc-tax-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.doc-tax-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.doc-tax-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  right: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.doc-tax-switch input:checked + .doc-tax-slider {
  background: #3b82f6;
}

.doc-tax-switch input:checked + .doc-tax-slider::before {
  transform: translateX(-16px);
}

.doc-tax-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.doc-totals-card-footer {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.doc-grand-amount {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* --- Save Bar --- */
.doc-save-bar {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
}

.doc-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.doc-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
}

.doc-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* --- Signatures --- */
.doc-signatures-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.doc-signatures-grid {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 1.5rem;
  position: relative;
  min-height: 160px;
}

.doc-signature-box {
  flex: 1;
  text-align: center;
  max-width: 220px;
}

.doc-signature-line {
  height: 80px;
  border-bottom: 1px solid #475569;
  margin-bottom: 0.5rem;
}

.doc-signature-box p {
  font-weight: 800;
  font-size: 0.85rem;
  color: #1e293b;
}

/* Dark mode for items, totals, signatures */
[data-theme="dark"] .doc-items-header h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .doc-items-badge {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

[data-theme="dark"] .doc-items-table-wrapper {
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .doc-items-table thead {
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

[data-theme="dark"] .doc-items-table tbody {
  background: rgba(30, 41, 59, 0.4);
}

[data-theme="dark"] .doc-items-table tbody tr {
  border-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .doc-items-table tbody tr:hover {
  background: rgba(51, 65, 85, 0.3);
}

[data-theme="dark"] .doc-items-table tbody td {
  color: #e2e8f0;
}

[data-theme="dark"] .doc-terms-block {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.4));
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .doc-terms-block h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .doc-terms-textarea {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

[data-theme="dark"] .doc-totals-panel h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .doc-totals-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.4));
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .doc-total-row {
  color: #94a3b8;
}

[data-theme="dark"] .doc-total-row span:last-child {
  color: #e2e8f0;
}

[data-theme="dark"] .doc-total-row--grand span {
  color: #f87171 !important;
}

[data-theme="dark"] .doc-tax-toggle label {
  color: #94a3b8;
}

[data-theme="dark"] .doc-po-extra {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.2), rgba(30, 41, 59, 0.4));
  border-color: rgba(248, 113, 113, 0.2);
}

[data-theme="dark"] .doc-po-extra h4 {
  color: #f87171;
}

[data-theme="dark"] .doc-po-grid input {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

[data-theme="dark"] .doc-signature-box p {
  color: #e2e8f0;
}

[data-theme="dark"] .doc-signature-line {
  border-color: rgba(148, 163, 184, 0.3);
}

/* ============================================================
   RESPONSIVE DESIGN — Document Form Mobile Optimizations
   ============================================================ */

@media (max-width: 1200px) {
  /* Hide text labels on print/whatsapp buttons at medium widths */
  .dtb-zone--print .docs-toolbar-btn span {
    display: none;
  }
  .dtb-zone--print .docs-toolbar-btn {
    width: 2.5rem;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  .docs-toolbar {
    padding: 0.55rem 0.9rem;
    top: 0.25rem;
  }
  .dtb-zone {
    padding: 0 0.5rem;
  }
}

@media (max-width: 768px) {
  .docs-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .dtb-zone--types {
    width: 100%;
    justify-content: center;
    padding: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding-bottom: 0.5rem;
  }
  .dtb-zone--actions {
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
  }
  .dtb-zone--search {
    order: 10;
    width: 100%;
    padding: 0;
  }
  .dtb-zone--toggles {
    border-right: none;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    width: 100%;
    justify-content: center;
    padding-top: 0.4rem;
    margin-right: 0;
  }
  .docs-toolbar-segmented {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .doc-header {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  
  .doc-header-info--ar,
  .doc-header-info--en {
    text-align: center;
  }
  
  .doc-header-logo .company-logo {
    height: 4rem;
  }
  
  .doc-items-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .doc-items-table {
    min-width: 800px;
  }
  
  .doc-totals-grid {
    grid-template-columns: 1fr;
  }
  
  .doc-signatures-grid {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .doc-signature-box {
    min-width: 140px;
    flex: 1 1 40%;
  }
}

@media (max-width: 640px) {
  .docs-toolbar-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .docs-toolbar-btn--icon {
    width: 2rem;
    height: 2rem;
  }
  
  .docs-toolbar-segitem {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }
  
  .doc-client-grid {
    grid-template-columns: 1fr;
  }
  
  .doc-client-card {
    grid-template-columns: 1fr;
  }
  
  .doc-po-grid {
    grid-template-columns: 1fr;
  }
  
  .doc-po-grid .col-span-2 {
    grid-column: span 1;
  }
  
  .doc-save-bar {
    justify-content: center;
  }
  
  .doc-save-btn {
    width: 100%;
    justify-content: center;
  }
  
  .doc-signature-box {
    flex: 1 1 100%;
  }
}

/* ============================================================
   RESPONSIVE — Sidebar/Navigation Mobile
   ============================================================ */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    width: 260px;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
  
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text-base);
    cursor: pointer;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .sidebar-overlay {
    display: none;
  }
}

/* ============================================================
   RESPONSIVE — Dashboard Mobile
   ============================================================ */

@media (max-width: 768px) {
  .dashboard-topbar {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .dashboard-topbar-actions {
    justify-content: center;
  }
  
  .dashboard-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .dashboard-filters-title {
    flex-direction: row;
    justify-content: flex-start;
    border-left: none;
    border-bottom: 1px solid rgba(203, 213, 225, 0.4);
    padding-left: 0;
    padding-bottom: 0.5rem;
    margin-left: 0;
    margin-bottom: 0.25rem;
  }
  
  .dashboard-filter-group {
    min-width: auto;
  }
  
  .dashboard-filter-range {
    min-width: auto;
  }
  
  .dashboard-kpi {
    padding: 1rem;
  }
  
  .dashboard-kpi-icon {
    width: 40px;
    height: 40px;
  }
  
  .dashboard-panel {
    padding: 1rem;
  }
}

/* ============================================================
   RESPONSIVE — Login Page Mobile
   ============================================================ */

@media (max-width: 640px) {
  .login-stack {
    width: 100%;
    padding: 0 1rem;
  }
  
  #auth-container .login-card {
    padding: 1.5rem;
  }
  
  #clock-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .clock-core {
    text-align: center;
  }
  
  #clock-time {
    font-size: 2rem;
  }
  
  .clock-divider {
    width: 3rem;
    height: 1px;
  }
}

/* ============================================================
   RESPONSIVE — Tables Horizontal Scroll
   ============================================================ */

@media (max-width: 768px) {
  .data-table-wrapper,
  .dashboard-table-wrapper,
  .cms-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table,
  .dashboard-table,
  .cms-table {
    min-width: 600px;
  }
}

/* ============================================================
   OPERATIONS SECTION — Professional Redesign
   ============================================================ */

/* --- Header --- */
.ops-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.ops-header-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.ops-tabs {
  display: flex;
  gap: 0.25rem;
  background: rgba(241, 245, 249, 0.8);
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.ops-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ops-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #475569;
}

.ops-tab.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ops-tab-pulse {
  animation: ops-tab-attention 0.5s ease 3;
}
@keyframes ops-tab-attention {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.07); box-shadow: 0 0 0 4px rgba(245,158,11,0.25); }
}

/* ── Due-date progress bar ─────────────────────────────────────── */
.due-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-width: 88px;
}
.due-bar-date {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  line-height: 1;
}
.due-bar-track {
  height: 7px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.due-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease, background 0.6s ease;
}
.due-bar-label {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}
.due-bar--overdue .due-bar-fill {
  animation: due-bar-pulse 1.4s ease-in-out infinite;
}
.due-bar--overdue .due-bar-track {
  border-color: #fecaca;
}
@keyframes due-bar-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.ops-tab #ops-approval-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  background: #f59e0b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 999px;
  margin-right: -0.25rem;
}

.ops-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ops-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  min-width: 0;
}
.ops-user-badge-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.ops-user-badge-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ops-user-badge-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.ops-user-badge-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
[data-theme="dark"] .ops-user-badge {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .ops-user-badge-name { color: #f1f5f9; }

.ops-notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #64748b;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ops-notif-btn:hover {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.ops-notif-btn #ops-notif-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0 0.25rem;
}

.ops-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.05), rgba(255, 255, 255, 0.8));
}

.ops-notif-header h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ops-notif-header button {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ops-notif-header button:hover {
  color: #ef4444;
}

.ops-notif-empty {
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
}

.ops-notif-empty i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.ops-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.ops-import-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

/* --- Stats --- */
.ops-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.ops-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 6.25rem;
  padding: 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}

.ops-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.ops-stat-card p {
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 0.25rem;
  line-height: 1.35;
  white-space: normal;
}

.ops-stat-card h3 {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  font-weight: 900;
  color: #1e293b;
  line-height: 1;
}

.ops-stat-card > div:first-child {
  min-width: 0;
}

.ops-stat-card > div:last-child {
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.15rem;
}

.ops-stat-card--pending {
  border-right: 4px solid #64748b;
}
.ops-stat-card--pending > div:last-child {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.ops-stat-card--progress {
  border-right: 4px solid #3b82f6;
}
.ops-stat-card--progress > div:last-child {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.ops-stat-card--completed {
  border-right: 4px solid #10b981;
}
.ops-stat-card--completed > div:last-child {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.ops-stat-card--urgent {
  border-right: 4px solid #ef4444;
}
.ops-stat-card--urgent > div:last-child {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.ops-stat-card--approval {
  border-right: 4px solid #f59e0b;
}
.ops-stat-card--approval > div:last-child {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.ops-stat-card--ops-approval {
  border-right: 4px solid #7c3aed;
}
.ops-stat-card--ops-approval > div:last-child {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

/* --- Filters --- */
.ops-filters {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  padding: 1rem;
}

.ops-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .ops-filters-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ops-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ops-filter-group--search {
  grid-column: span 2;
}

@media (min-width: 768px) {
  .ops-filter-group--search {
    grid-column: span 1;
  }
}

.ops-filter-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.ops-filter-group select,
.ops-filter-group input {
  padding: 0.55rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.2s ease;
}

.ops-filter-group select:focus,
.ops-filter-group input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.ops-search-box {
  display: flex;
  gap: 0.4rem;
}

.ops-search-box input {
  flex: 1;
}

.ops-search-box button {
  padding: 0.55rem 0.9rem;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ops-search-box button:hover {
  background: linear-gradient(135deg, #334155, #1e293b);
  transform: translateY(-1px);
}

/* Dark mode */
[data-theme="dark"] .ops-header {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.94));
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .ops-header-title h2 {
  color: #f1f5f9;
}

[data-theme="dark"] .ops-tabs {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .ops-tab {
  color: #94a3b8;
}

[data-theme="dark"] .ops-tab:hover {
  background: rgba(51, 65, 85, 0.4);
  color: #e2e8f0;
}

[data-theme="dark"] .ops-notif-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

[data-theme="dark"] .ops-stat-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .ops-stat-card p {
  color: #94a3b8;
}

[data-theme="dark"] .ops-stat-card h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .ops-filters {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.5));
  border-color: rgba(148, 163, 184, 0.15);
}

.ops-stat-pdf-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.ops-stat-card:hover .ops-stat-pdf-btn {
  opacity: 1;
}

[data-theme="dark"] .ops-filter-group select,
[data-theme="dark"] .ops-filter-group input {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

/* --- Notification Panel Dropdown --- */
#ops-notif-panel {
  position: absolute;
  left: auto;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 20rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(226, 232, 240, 0.7);
  z-index: 50;
  overflow: hidden;
  animation: opsNotifSlide 0.2s ease-out;
}

@keyframes opsNotifSlide {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

[data-theme="dark"] #ops-notif-panel {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
}

/* --- Table --- */
.ops-table-wrapper {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.ops-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}

.ops-table thead th {
  padding: 0.85rem 1rem;
  text-align: right;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.5));
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  white-space: nowrap;
}

.ops-table thead th i {
  color: #3b82f6;
  margin-left: 0.3rem;
}

.ops-table tbody tr {
  background: #fff;
  transition: background 0.15s ease;
}

.ops-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.4);
}

.ops-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.ops-table tbody td {
  padding: 0.75rem 1rem;
  text-align: right;
  color: #334155;
  font-weight: 600;
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
  vertical-align: middle;
}

.ops-table .ops-loading {
  padding: 2rem !important;
  text-align: center;
  color: #94a3b8;
  font-weight: 500;
}

/* Status badges in table */
.ops-table .ops-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ops-badge--pending   { background: rgba(100, 116, 139, 0.1); color: #64748b; }
.ops-badge--progress  { background: rgba(59, 130, 246, 0.1);  color: #2563eb; }
.ops-badge--printing  { background: rgba(139, 92, 246, 0.1);  color: #7c3aed; }
.ops-badge--finishing { background: rgba(245, 158, 11, 0.1);  color: #d97706; }
.ops-badge--completed { background: rgba(16, 185, 129, 0.1);  color: #059669; }
.ops-badge--cancelled { background: rgba(239, 68, 68, 0.1);   color: #dc2626; }

.ops-badge--low      { background: rgba(148, 163, 184, 0.15); color: #475569; }
.ops-badge--normal   { background: rgba(59, 130, 246, 0.1);   color: #2563eb; }
.ops-badge--high     { background: rgba(245, 158, 11, 0.12);  color: #b45309; }
.ops-badge--urgent   { background: rgba(239, 68, 68, 0.1);    color: #dc2626; }

/* Action buttons in table */
.ops-table .ops-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 6px;
  border: none;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 0 0.1rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Action buttons container — force single row */
.ops-table td:last-child > div,
.ops-table td:nth-last-child(2) > div {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Ensure action columns have enough width */
.ops-table th:last-child,
.ops-table td:last-child {
  min-width: 7rem;
  white-space: nowrap;
}

/* Force action buttons to stay in one row */
.ops-table td .ops-action-btn {
  display: inline-flex !important;
}

/* Action buttons toolbar style */
.ops-table .ops-action-btn {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  font-size: 0.72rem;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ops-table .ops-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.ops-action-btn--edit   { background: rgba(59, 130, 246, 0.1);  color: #2563eb; }
.ops-action-btn--edit:hover   { background: #3b82f6; color: #fff; }

.ops-action-btn--attach { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.ops-action-btn--attach:hover { background: #f59e0b; color: #fff; }

.ops-action-btn--status { background: rgba(16, 185, 129, 0.1);  color: #059669; }
.ops-action-btn--status:hover { background: #10b981; color: #fff; }

.ops-action-btn--view   { background: rgba(100, 116, 139, 0.1); color: #475569; }
.ops-action-btn--view:hover   { background: #64748b; color: #fff; }

.ops-action-btn--approve { background: rgba(16, 185, 129, 0.1); color: #059669; width: auto !important; padding: 0 0.6rem; gap: 0.3rem; }
.ops-action-btn--approve:hover { background: #10b981; color: #fff; }

.ops-action-btn--pdf { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.ops-action-btn--pdf:hover { background: #ef4444; color: #fff; }

.ops-action-btn--reject { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.ops-action-btn--reject:hover { background: #ef4444; color: #fff; }

/* Approval header */
.ops-approval-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 14px;
}

.ops-approval-header-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.2);
  border-radius: 12px;
  color: #d97706;
  font-size: 1.1rem;
}

.ops-approval-header-info h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.ops-approval-header-info p {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

/* Pagination */
#operations-pagination,
#ops-approval-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.6), rgba(241, 245, 249, 0.3));
}

#operations-pagination button,
#ops-approval-pagination button {
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, 0.5);
  background: #fff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

#operations-pagination button:hover,
#ops-approval-pagination button:hover {
  border-color: rgba(59, 130, 246, 0.4);
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.04);
}

#operations-pagination button.active,
#ops-approval-pagination button.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.25);
}

/* Dark mode for tables */
[data-theme="dark"] .ops-table-wrapper {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.5));
  border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .ops-table thead th {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.5));
  color: #94a3b8;
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .ops-table tbody tr {
  background: rgba(30, 41, 59, 0.3);
}

[data-theme="dark"] .ops-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.3);
}

[data-theme="dark"] .ops-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .ops-table tbody td {
  color: #cbd5e1;
  border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .ops-loading {
  color: #64748b;
}

[data-theme="dark"] .ops-approval-header {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(245, 158, 11, 0.03));
  border-color: rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] .ops-approval-header-info h3 {
  color: #f1f5f9;
}

[data-theme="dark"] #operations-pagination,
[data-theme="dark"] #ops-approval-pagination {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.3));
  border-top-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] #operations-pagination button,
[data-theme="dark"] #ops-approval-pagination button {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

[data-theme="dark"] #operations-pagination button:hover,
[data-theme="dark"] #ops-approval-pagination button:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

#operations-pagination,
#ops-approval-pagination,
#ops-ops-approval-pagination,
#ops-approved-pagination {
  display: block;
  padding: 0;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.72), rgba(241, 245, 249, 0.42));
}

.ops-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  flex-wrap: wrap;
}

.ops-pagination-info,
.ops-pagination-size {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.ops-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

#operations-pagination .ops-pagination-btn,
#ops-approval-pagination .ops-pagination-btn,
#ops-ops-approval-pagination .ops-pagination-btn,
#ops-approved-pagination .ops-pagination-btn {
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, 0.65);
  background: #fff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

#operations-pagination .ops-pagination-btn:hover:not(:disabled),
#operations-pagination .ops-pagination-btn:focus-visible:not(:disabled),
#ops-approval-pagination .ops-pagination-btn:hover:not(:disabled),
#ops-approval-pagination .ops-pagination-btn:focus-visible:not(:disabled),
#ops-ops-approval-pagination .ops-pagination-btn:hover:not(:disabled),
#ops-ops-approval-pagination .ops-pagination-btn:focus-visible:not(:disabled),
#ops-approved-pagination .ops-pagination-btn:hover:not(:disabled),
#ops-approved-pagination .ops-pagination-btn:focus-visible:not(:disabled) {
  border-color: rgba(59, 130, 246, 0.55);
  color: #2563eb;
  background: rgba(59, 130, 246, 0.06);
  outline: none;
}

#operations-pagination .ops-pagination-btn.active,
#ops-approval-pagination .ops-pagination-btn.active,
#ops-ops-approval-pagination .ops-pagination-btn.active,
#ops-approved-pagination .ops-pagination-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.25);
}

#operations-pagination .ops-pagination-btn.is-disabled,
#operations-pagination .ops-pagination-btn:disabled,
#ops-approval-pagination .ops-pagination-btn.is-disabled,
#ops-approval-pagination .ops-pagination-btn:disabled,
#ops-ops-approval-pagination .ops-pagination-btn.is-disabled,
#ops-ops-approval-pagination .ops-pagination-btn:disabled,
#ops-approved-pagination .ops-pagination-btn.is-disabled,
#ops-approved-pagination .ops-pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ops-pagination-gap {
  min-width: 1.25rem;
  color: #94a3b8;
  text-align: center;
  font-weight: 800;
}

.ops-pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ops-pagination-size select {
  height: 2rem;
  min-width: 4.25rem;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0 0.55rem;
  outline: none;
}

.ops-pagination-size select:focus {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

[data-theme="dark"] #operations-pagination,
[data-theme="dark"] #ops-approval-pagination,
[data-theme="dark"] #ops-ops-approval-pagination,
[data-theme="dark"] #ops-approved-pagination {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.35));
  border-top-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .ops-pagination-info,
[data-theme="dark"] .ops-pagination-size {
  color: #94a3b8;
}

[data-theme="dark"] #operations-pagination .ops-pagination-btn,
[data-theme="dark"] #ops-approval-pagination .ops-pagination-btn,
[data-theme="dark"] #ops-ops-approval-pagination .ops-pagination-btn,
[data-theme="dark"] #ops-approved-pagination .ops-pagination-btn,
[data-theme="dark"] .ops-pagination-size select {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}

[data-theme="dark"] #operations-pagination .ops-pagination-btn:hover:not(:disabled),
[data-theme="dark"] #operations-pagination .ops-pagination-btn:focus-visible:not(:disabled),
[data-theme="dark"] #ops-approval-pagination .ops-pagination-btn:hover:not(:disabled),
[data-theme="dark"] #ops-approval-pagination .ops-pagination-btn:focus-visible:not(:disabled),
[data-theme="dark"] #ops-ops-approval-pagination .ops-pagination-btn:hover:not(:disabled),
[data-theme="dark"] #ops-ops-approval-pagination .ops-pagination-btn:focus-visible:not(:disabled),
[data-theme="dark"] #ops-approved-pagination .ops-pagination-btn:hover:not(:disabled),
[data-theme="dark"] #ops-approved-pagination .ops-pagination-btn:focus-visible:not(:disabled) {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.38);
}

@media (max-width: 768px) {
  .ops-pagination {
    justify-content: center;
  }

  .ops-pagination-info,
  .ops-pagination-size {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* --- Operations Modals --- */

/* Base modal overlay */
#ops-status-modal,
#ops-view-modal,
#ops-reject-modal,
#operations-modal,
#operations-import-modal {
  backdrop-filter: blur(6px);
}

/* Modal card base */
#ops-status-modal > div,
#ops-reject-modal > div,
#operations-modal > div,
#operations-import-modal > div,
#ops-view-modal > div {
  background: linear-gradient(180deg, #fff, #f8fafc) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2) !important;
}

/* Modal header */
#ops-status-modal > div > div:first-child,
#ops-reject-modal > div > div:first-child,
#operations-modal > div > div:first-child,
#operations-import-modal > div > div:first-child,
#ops-view-modal > div > div:first-child {
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 0.5)) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7) !important;
  border-radius: 18px 18px 0 0 !important;
  padding: 1rem 1.25rem !important;
}

#ops-status-modal h3,
#ops-reject-modal h3,
#operations-modal h3,
#operations-import-modal h3,
#ops-view-modal h3 {
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: #1e293b !important;
}

#ops-status-modal h3 i,
#ops-reject-modal h3 i,
#ops-view-modal h3 i {
  font-size: 1.1rem;
}

/* Close button */
#ops-status-modal [id$="-close"],
#ops-reject-modal [id$="-close"],
#operations-modal [id$="-close"],
#operations-import-modal [id$="-close"],
#ops-view-modal [id$="-close"] {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.15s ease;
}

#ops-status-modal [id$="-close"]:hover,
#ops-reject-modal [id$="-close"]:hover,
#operations-modal [id$="-close"]:hover,
#operations-import-modal [id$="-close"]:hover,
#ops-view-modal [id$="-close"]:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444 !important;
}

/* Modal body inputs */
#operations-modal input,
#operations-modal select,
#operations-modal textarea,
#ops-status-modal select,
#ops-reject-modal textarea,
#operations-import-modal input {
  background: #fff !important;
  border: 1px solid rgba(203, 213, 225, 0.7) !important;
  border-radius: 10px !important;
  padding: 0.65rem 0.85rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  transition: all 0.2s ease !important;
}

#operations-modal input:focus,
#operations-modal select:focus,
#operations-modal textarea:focus,
#ops-status-modal select:focus,
#ops-reject-modal textarea:focus,
#operations-import-modal input:focus {
  outline: none !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08) !important;
}

#operations-modal label,
#ops-reject-modal label {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin-bottom: 0.35rem !important;
}

/* Modal footer buttons */
#ops-status-modal [id$="-cancel"],
#ops-reject-modal [id$="-cancel"],
#operations-modal [id$="-cancel"],
#operations-import-modal [id$="-cancel"],
#ops-view-modal #ops-view-close-btn {
  padding: 0.55rem 1.1rem !important;
  background: #fff !important;
  border: 1px solid rgba(203, 213, 225, 0.7) !important;
  border-radius: 10px !important;
  color: #475569 !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

#ops-status-modal [id$="-cancel"]:hover,
#ops-reject-modal [id$="-cancel"]:hover,
#operations-modal [id$="-cancel"]:hover,
#operations-import-modal [id$="-cancel"]:hover,
#ops-view-modal #ops-view-close-btn:hover {
  background: #f1f5f9 !important;
  border-color: rgba(148, 163, 184, 0.5) !important;
}

#ops-status-confirm {
  padding: 0.55rem 1.1rem !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

#ops-status-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35) !important;
}

#ops-reject-confirm {
  padding: 0.55rem 1.1rem !important;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

#ops-reject-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35) !important;
}

#ops-form-save,
#ops-import-submit {
  padding: 0.55rem 1.1rem !important;
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

#ops-form-save:hover,
#ops-import-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35) !important;
}

#ops-view-approve-btn {
  padding: 0.55rem 1.1rem !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
}

#ops-view-reject-btn {
  padding: 0.55rem 1.1rem !important;
  background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
  border-radius: 10px !important;
  color: #dc2626 !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
}

#ops-view-reject-btn:hover {
  background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
}

/* Import modal search */
#operations-import-modal .bg-slate-50 {
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 0.5)) !important;
}

/* View modal body */
#ops-view-body {
  padding: 1.25rem !important;
}

#ops-view-body .grid {
  gap: 1rem !important;
}

#ops-view-body .bg-slate-50 {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.6), rgba(241, 245, 249, 0.4)) !important;
  border: 1px solid rgba(226, 232, 240, 0.5) !important;
  border-radius: 12px !important;
  padding: 0.85rem !important;
}

#ops-view-body .text-xs.text-slate-500 {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  margin-bottom: 0.2rem !important;
}

#ops-view-body .font-medium,
#ops-view-body .font-semibold {
  font-weight: 700 !important;
  color: #1e293b !important;
  font-size: 0.85rem !important;
}

/* Dark mode for modals */
[data-theme="dark"] #ops-status-modal > div,
[data-theme="dark"] #ops-reject-modal > div,
[data-theme="dark"] #operations-modal > div,
[data-theme="dark"] #operations-import-modal > div,
[data-theme="dark"] #ops-view-modal > div {
  background: linear-gradient(180deg, #1e293b, #0f172a) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

[data-theme="dark"] #ops-status-modal > div > div:first-child,
[data-theme="dark"] #ops-reject-modal > div > div:first-child,
[data-theme="dark"] #operations-modal > div > div:first-child,
[data-theme="dark"] #operations-import-modal > div > div:first-child,
[data-theme="dark"] #ops-view-modal > div > div:first-child {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.5)) !important;
  border-bottom-color: rgba(148, 163, 184, 0.15) !important;
}

[data-theme="dark"] #ops-status-modal h3,
[data-theme="dark"] #ops-reject-modal h3,
[data-theme="dark"] #operations-modal h3,
[data-theme="dark"] #operations-import-modal h3,
[data-theme="dark"] #ops-view-modal h3 {
  color: #f1f5f9 !important;
}

[data-theme="dark"] #operations-modal input,
[data-theme="dark"] #operations-modal select,
[data-theme="dark"] #operations-modal textarea,
[data-theme="dark"] #ops-status-modal select,
[data-theme="dark"] #ops-reject-modal textarea,
[data-theme="dark"] #operations-import-modal input {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] #operations-modal label,
[data-theme="dark"] #ops-reject-modal label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] #ops-status-modal [id$="-cancel"],
[data-theme="dark"] #ops-reject-modal [id$="-cancel"],
[data-theme="dark"] #operations-modal [id$="-cancel"],
[data-theme="dark"] #operations-import-modal [id$="-cancel"],
[data-theme="dark"] #ops-view-modal #ops-view-close-btn {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] #ops-view-reject-btn {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}

[data-theme="dark"] #ops-view-body .bg-slate-50 {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.3)) !important;
  border-color: rgba(148, 163, 184, 0.15) !important;
}

[data-theme="dark"] #ops-view-body .font-medium,
[data-theme="dark"] #ops-view-body .font-semibold {
  color: #f1f5f9 !important;
}

/* ─── Welcome Login Card ──────────────────────────────────────────── */
#login-welcome-card {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  width: 330px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  direction: rtl;
}
#login-welcome-card.show {
  transform: translateY(0);
  opacity: 1;
}
.lwc-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
}
.lwc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--font-display, 'Tajawal', sans-serif);
}
.lwc-info {
  flex: 1;
  min-width: 0;
}
.lwc-greeting {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 2px;
}
.lwc-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lwc-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  align-self: flex-start;
}
.lwc-close:hover { color: #475569; background: #f1f5f9; }
.lwc-role {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 14px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.lwc-role i { font-size: 14px; }
.lwc-message {
  margin: -4px 16px 14px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 600;
}
.lwc-progress {
  height: 3px;
  background: #e2e8f0;
}
.lwc-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: right;
  animation: lwc-shrink linear forwards;
}
@keyframes lwc-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
[data-theme="dark"] #login-welcome-card {
  background: #1e293b;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
[data-theme="dark"] .lwc-name  { color: #f1f5f9; }
[data-theme="dark"] .lwc-close { color: #64748b; }
[data-theme="dark"] .lwc-close:hover { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .lwc-progress { background: #334155; }

/* ─── Toast Notification System ──────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 80px;
  left: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 40px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  pointer-events: all;
  transform: translateX(-110%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.4,0.64,1), opacity 0.25s ease;
  overflow: hidden;
  position: relative;
  border-right: 4px solid transparent;
  direction: rtl;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}
.toast-message {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
  word-break: break-word;
}
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 6px;
  flex-shrink: 0;
  align-self: flex-start;
  line-height: 1;
}
.toast-close:hover { color: #475569; background: #f1f5f9; }
.toast-progress {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: rgba(0,0,0,0.06);
}
.toast-progress-bar {
  height: 100%;
  transform-origin: right;
  animation: toast-shrink linear forwards;
}
@keyframes toast-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
/* Types */
.toast--success { border-right-color: #22c55e; }
.toast--success .toast-icon { background: #dcfce7; color: #16a34a; }
.toast--success .toast-progress-bar { background: #22c55e; }
.toast--error   { border-right-color: #ef4444; }
.toast--error   .toast-icon { background: #fee2e2; color: #dc2626; }
.toast--error   .toast-progress-bar { background: #ef4444; }
.toast--warning { border-right-color: #f59e0b; }
.toast--warning .toast-icon { background: #fef3c7; color: #d97706; }
.toast--warning .toast-progress-bar { background: #f59e0b; }
.toast--info    { border-right-color: #3b82f6; }
.toast--info    .toast-icon { background: #dbeafe; color: #2563eb; }
.toast--info    .toast-progress-bar { background: #3b82f6; }
[data-theme="dark"] .toast {
  background: #1e293b;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .toast-title   { color: #f1f5f9; }
[data-theme="dark"] .toast-message { color: #94a3b8; }
[data-theme="dark"] .toast-close   { color: #475569; }
[data-theme="dark"] .toast-close:hover { background: #334155; color: #94a3b8; }
[data-theme="dark"] .toast-progress { background: rgba(255,255,255,0.06); }


/* Fix LTR Ops Notification Panel */
[dir="ltr"] #ops-notif-panel {
  left: 0;
  right: auto;
  transform-origin: top left;
}
[dir="rtl"] #ops-notif-panel {
  right: 0;
  left: auto;
  transform-origin: top right;
}


/* Fix LTR Header Actions Dropdowns */
[dir="ltr"] .header-actions .absolute,
[dir="ltr"] .header-actions #ops-notif-panel {
  left: 0 !important;
  right: auto !important;
  transform-origin: top left !important;
}
[dir="rtl"] .header-actions .absolute,
[dir="rtl"] .header-actions #ops-notif-panel {
  right: 0 !important;
  left: auto !important;
  transform-origin: top right !important;
}

/* Modern Ops UI Enhancements */
.ops-table-modern th {
  background-color: #f8fafc;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  padding: 1rem 1.25rem;
}

.ops-table-modern td {
  padding: 1rem 1.25rem;
  color: #334155;
  vertical-align: middle;
}

.ops-table-modern tbody tr {
  transition: all 0.2s ease-in-out;
}

.ops-table-modern tbody tr:hover {
  background-color: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  z-index: 10;
  position: relative;
}

.modern-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.modern-pill--pending { background-color: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.modern-pill--progress { background-color: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }
.modern-pill--completed { background-color: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.modern-pill--urgent { background-color: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.modern-pill--high { background-color: #ffedd5; color: #ea580c; border: 1px solid #fed7aa; }
.modern-pill--normal { background-color: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.modern-pill--low { background-color: #f3f4f6; color: #9ca3af; border: 1px solid #e5e7eb; }
.modern-pill--cancelled { background-color: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }

#ops-status-list-modal.open {
  display: flex !important;
}

#ops-status-list-modal.open #ops-status-modal-content {
  transform: scale(1);
  opacity: 1;
}

.ops-action-btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background-color: white;
  color: #64748b;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.ops-action-btn-modern:hover {
  background-color: #3b82f6;
  color: white;
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}
