/* Premium Light Theme - Columbarium Nature Aesthetics */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Warm Orange and Serene Green Theme */
  --primary-color: #f97316;
  /* Vibrant Orange */
  --primary-hover: #ea580c;
  --secondary-color: #059669;
  /* Deep Emerald Green */

  /* Lighter, pleasing background */
  --bg-gradient-start: #f8fafc;
  /* Very light slate */
  --bg-gradient-end: #ecfdf5;
  /* Very soft mint/green */

  --text-main: #1e293b;
  /* Dark Slate for high readability */
  --text-muted: #64748b;
  /* Medium Slate */

  /* Solid Surface Container */
  --surface-bg: #ffffff;
  --surface-border: rgba(0, 0, 0, 0.08);
  --surface-shadow: 0 10px 30px rgba(5, 150, 105, 0.04);

  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-focus: #f97316;
  /* Orange focus */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  background: var(--bg-gradient-start);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glass Container (Form Box) */
.surface-container {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  box-shadow: var(--surface-shadow);
  border-radius: 16px;
  padding: 3rem;
  margin: 3rem auto;
  width: 92%;
  max-width: 850px;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.surface-container.login-box {
  max-width: 420px;
  margin: auto;
  margin-top: 10vh;
  padding: 3.5rem 2.5rem;
}

h1,
h2,
h3 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.title-main {
  color: var(--text-main);
}

p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.3s;
}

.shrink-print-label {
  font-size: 0.85rem !important;
  letter-spacing: -0.2px;
}

/* PONYTAIL: Automatically add red * to labels of required inputs */
.form-group:has([required]) label::after {
  content: " *";
  color: #ef4444;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
  background: #fff;
}

.form-control:focus+label,
.form-control:focus-within+label {
  color: var(--primary-color);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  background-size: 1.2em;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

select.form-control:invalid {
  color: var(--text-muted);
}

/* Disable styles */
.form-control:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.office-note {
  background: rgba(249, 115, 22, 0.1);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  margin-bottom: 2rem;
  color: var(--text-main);
  font-weight: 500;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--secondary-color);
  color: #fff;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
  background: #047857;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(5, 150, 105, 0.25);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Mobile Optimizations */
@media screen and (max-width: 768px) {

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .surface-container {
    padding: 2rem 1.5rem;
    margin: 1.5rem auto;
    border-radius: 16px;
  }

  .surface-container.login-box {
    margin-top: 5vh;
  }

  h1 {
    font-size: 1.6rem;
  }
}

/* PONYTAIL: Utilize left/right screen space on desktop */
@media (min-width: 1024px) {
  .surface-container:not(.login-box) {
    max-width: 1400px;
    width: 95%;
  }

  #registrationForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 4rem;
    row-gap: 1rem;
    align-items: start;
  }

  .office-note,
  #registrationForm>button {
    grid-column: 1 / -1;
  }

  .form-section {
    border-bottom: none !important;
    /* Grid layout doesn't need horizontal rules */
  }
}

/* Sections */
.form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1.5px dashed var(--input-border);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}

.form-section h3 {
  color: var(--secondary-color);
  font-size: 1.1rem;
  margin-bottom: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.form-section h3::after {
  content: '';
  height: 2px;
  background: rgba(5, 150, 105, 0.15);
  /* Soft green line */
  flex: 1;
  border-radius: 2px;
}

.hidden {
  display: none !important;
}

/* Dashboard Sidebar tweaks */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--surface-border);
  padding: 2.5rem 1.5rem;
}

.sidebar h2 {
  text-align: center;
  color: var(--secondary-color);
  margin-bottom: 2.5rem;
}

.nav-link {
  display: block;
  padding: 0.85rem 1.2rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 600;
}

.nav-link:hover {
  background: rgba(249, 115, 22, 0.08);
  transform: translateX(5px);
  color: var(--primary-color);
}

.main-content {
  flex: 1;
  padding: 3rem;
  background: var(--bg-gradient-start);
}

/* PONYTAIL: Hide tracker in print */
/* PONYTAIL: Header Banner Design */
.theme-banner-container {
  position: relative;
  width: 85%;
  margin: 0 auto 1.5rem auto;
  text-align: center;
  padding: 12px 0;
}

.theme-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0b3112;
  transform: skewX(-20deg);
  box-shadow:
    -10px 0 0 0 #f06a1f,
    -20px 0 0 0 #f4ead0,
    10px 0 0 0 #f06a1f,
    20px 0 0 0 #f4ead0;
  z-index: 1;
}

.theme-banner-text {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-weight: 700;
  font-family: "Times New Roman", Times, serif;
  font-size: 13pt;
  line-height: 1.3;
}

@media print {
  .password-tracker {
    display: none !important;
  }
}

/* ---------------------------------------------------
   SPA & Modals - Z-Index Fixes & UI Enhancements
--------------------------------------------------- */
.swal2-container {
  z-index: 99999 !important;
  /* Always above everything, including 9999 modals */
}

/* Inline Action Icons for Tables */
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #64748b;
  margin-right: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.action-icon-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(249, 115, 22, 0.2);
}

.action-icon-btn.delete-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.action-icon-btn.activate-btn:hover {
  background: #10b981;
  border-color: #10b981;
  color: white;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.action-icon-btn.logout-btn:hover {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

.action-icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Impeccable Action Buttons for Dashboard */
.impeccable-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.impeccable-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.impeccable-action-btn.view-btn:hover {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.impeccable-action-btn.delete-btn {
  color: #ef4444;
}

.impeccable-action-btn.delete-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* PONYTAIL: Native Print Styles for Long Bond Paper (8.5x13 in) */
@media screen {
  .print-only {
    display: none !important;
  }
}

@media print {
  .screen-only {
    display: none !important;
  }

  @page {
    size: 8.5in 13in;
    margin: 0.5in;
  }

  body {
    background: none !important;
    color: #000 !important;
    font-size: 10pt;
    /* smaller font for paper */
    line-height: 1.2;
    display: block !important;
    height: auto !important;
    min-height: auto !important;
  }

  .surface-container {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    background: none !important;
    display: block !important;
    animation: none !important;
    opacity: 1 !important;
  }

  .btn,
  .office-note,
  .swal2-container,
  .alert {
    display: none !important;
  }

  .form-section {
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
    margin-bottom: 5px;
  }

  .form-section:last-child {
    border-bottom: none;
  }

  /* Make inputs look like fillable lines on print */
  .form-control,
  select.form-control {
    border: none !important;
    border-bottom: 1px solid #000 !important;
    background: transparent !important;
    color: #000 !important;
    border-radius: 0 !important;
    padding: 2px 0 !important;
    height: auto !important;
    min-height: 1.5em !important;
    display: inline-block !important;
    width: 100% !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    font-size: 11pt !important;
  }

  /* Reset browser autofill backgrounds in print */
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:active,
  select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    background-color: transparent !important;
  }

  .hide-text-print {
    color: transparent !important;
  }

  .form-control::placeholder {
    color: transparent !important;
  }

  /* Hide dropdown text if no option is selected */
  select.form-control:has(option:checked[value=""]) {
    color: transparent !important;
  }

  /* Hide calendar icon in date inputs */
  input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
  }

  .form-control:disabled {
    background: transparent !important;
  }

  .form-group {
    margin-bottom: 5px;
  }

  .form-group label {
    color: #000 !important;
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 9pt;
    text-transform: uppercase;
  }

  /* Move placeholders to labels in print */
  .form-group label::after {
    font-weight: normal !important;
    text-transform: none !important;
    font-size: 8pt !important;
    color: #555 !important;
  }

  label[for="dec_last_name"]::after,
  label[for="kin_last_name"]::after {
    content: " (e.g. Dela Cruz)";
  }

  label[for="dec_given_name"]::after {
    content: " (e.g. Juan)";
  }

  label[for="kin_given_name"]::after {
    content: " (e.g. Maria)";
  }

  label[for="dec_middle_name"]::after,
  label[for="kin_middle_name"]::after,
  label[for="kin_contact_number_2"]::after {
    content: " (Optional)";
  }

  label[for="dec_dob"]::after,
  label[for="dec_dod"]::after,
  label[for="proposed_inurnment_date"]::after,
  label[for="proposed_cremation_date"]::after {
    content: " (mm/dd/yyyy)";
  }

  label[for="kin_email_address"]::after {
    content: " (name@example.com)";
  }

  label[for="kin_contact_number_1"]::after {
    content: " (09XX XXX XXXX)";
  }

  .shrink-print-label {
    font-size: 7pt !important;
    letter-spacing: -0.3px;
  }

  .title-main {
    background: none;
    color: #000 !important;
    -webkit-text-fill-color: #000;
  }

  h1,
  h2,
  h3 {
    color: #000 !important;
    margin-bottom: 5px;
  }

  h3 {
    font-size: 10pt;
    border-bottom: 2px solid #000;
    display: inline-block;
    padding-right: 15px;
    margin-top: 5px;
  }

  h3::after {
    display: none;
  }

  /* Print Grids Squeezed */
  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }

  .grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px;
  }

  /* PONYTAIL 3-column unwrapping for Section I & II */
  .section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    /* reset gap slightly */
  }

  .section-grid>.grid-2:not(.flex-print-group),
  .section-grid>.grid-3 {
    display: contents;
    /* Unwraps inner grids to join the parent 3-col grid */
  }

  .section-grid>.flex-print-group {
    display: flex !important;
    gap: 8px;
    grid-column: span 1;
    /* take 1 column in the 3-col grid */
  }

  .flex-print-group>.form-group {
    flex: 1;
  }

  .full-width-print {
    grid-column: 1 / -1;
  }

  .span-2-print {
    grid-column: span 2;
  }

  /* PONYTAIL 1-row layout for Section III using grid unwrapping */
  .service-flex-print {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr 1fr !important;
    gap: 8px;
  }

  .service-flex-print>.grid-3 {
    display: contents !important;
    /* unwraps the inner 3 items to become columns 2,3,4 */
  }

  /* PONYTAIL Alignment: Ensure underlines all align perfectly at the bottom even with varying label heights */
  .form-group:not(:has(input[type="checkbox"])) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    height: 100% !important;
  }

  /* PONYTAIL: Ensure Section IV checkboxes are perfectly beside their labels */
  .form-group:has(input[type="checkbox"]) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }

  .form-group:has(input[type="checkbox"])>label {
    margin-bottom: 0 !important;
    display: inline-block !important;
  }

  .form-group:has(input[type="checkbox"])>input {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Push label to top, input to bottom (only for the vertical form groups) */
  .form-group:not(:has(input[type="checkbox"]))>label {
    margin-bottom: auto !important;
  }

  .form-group input.form-control,
  .form-group select.form-control {
    margin-top: 4px !important;
  }

  /* Checkboxes */
  input[type="checkbox"] {
    -webkit-appearance: auto !important;
    appearance: auto !important;
    width: 16px;
    height: 16px;
    border: 1px solid #000;
  }

  /* Remove browser header/footer URLs */
  @page {
    margin: 0;
  }

  /* Fix overflowing right side by forcing containers to 100% and border-box */
  body {
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .surface-container {
    padding: 2mm 15mm 2mm 10mm !important;
    /* Adding a slightly larger right margin to perfectly balance it */
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  * {
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }



  /* Squeeze spaces to make it fit 1 page */
  body {
    font-size: 9.5pt;
  }

  h3 {
    font-size: 11pt;
    margin-bottom: 4px !important;
    margin-top: 12px !important;
  }

  .form-group {
    margin-bottom: 2px;
  }

  .form-control,
  select.form-control {
    font-size: 10pt !important;
    min-height: 1.2em !important;
  }

  /* Fix for Section V margins */
  .form-section:nth-of-type(5) label {
    margin-bottom: 5px !important;
  }

  /* PONYTAIL: Ensure print utilities are respected despite form-control !important */
  .d-print-none {
    display: none !important;
  }
}

/* ========================================================= */
/* IMPECCABLE MODERNIZATION STYLES (Login & Dashboard)       */
/* ========================================================= */

/* Dynamic Mesh Background for Login */
body.login-bg {
  background: linear-gradient(-45deg, #f8fafc, #ecfdf5, #fffbeb, #ffedd5);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Floating Label Inputs */
.form-floating {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-floating>.form-control {
  height: 3.5rem;
  padding: 1.25rem 1rem 0.5rem 1rem;
  font-size: 1rem;
}

.form-floating>label {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding: 1rem;
  pointer-events: none;
  border: 1px solid transparent;
  transform-origin: 0 0;
  transition: opacity .1s ease-in-out, transform .1s ease-in-out;
  color: var(--text-muted);
  font-weight: 500;
}

.form-floating>.form-control:focus,
.form-floating>.form-control:not(:placeholder-shown) {
  padding-top: 1.625rem;
  padding-bottom: 0.625rem;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
  opacity: .65;
  transform: scale(.85) translateY(-0.75rem) translateX(0.15rem);
  color: var(--primary-color);
}

/* Modern Layout Wrappers for Login */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.modern-login-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 1);
  border-radius: 30px;
  padding: 4rem 3rem;
  width: 100%;
  max-width: 480px;
  animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modern SaaS Dashboard Sidebar */
.dashboard-layout .modern-sidebar {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-right: none;
  box-shadow: 4px 0 20px rgba(5, 150, 105, 0.2);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
}

.modern-sidebar .sidebar-title {
  color: #ffffff !important;
}

.sidebar-toggle-btn {
  color: #ffffff !important;
}

.modern-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.2rem;
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none;
  border-radius: 14px;
  margin-bottom: 0.5rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: 1.5px solid transparent;
}

.modern-nav-link svg {
  stroke-width: 2.2;
  transition: stroke 0.3s;
  stroke: rgba(255, 255, 255, 0.8) !important;
}

.modern-nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3);
}

.modern-nav-link.active svg {
  stroke: #ffffff !important;
}

.modern-nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  transform: translateX(4px);
}

.modern-nav-link:hover svg {
  stroke: #ffffff !important;
}

/* Dashboard Header & Content Wrapper */
.modern-header-btn {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  transition: all 0.2s;
}

.modern-header-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.dashboard-content-wrapper {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 247, 237, 0.6) 100%);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(249, 115, 22, 0.05);
  padding: 2rem;
  border: 1px solid rgba(249, 115, 22, 0.1);
  min-height: calc(100vh - 350px);
}

/* ========================================================= */
/* RESPONSIVE DASHBOARD LAYOUT & MOBILE FIXES                */
/* ========================================================= */
.dashboard-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 100vh;
}

.dashboard-layout .sidebar {
  width: 280px;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 993px) {
  .dashboard-layout .sidebar.is-toggled {
    width: 80px;
  }

  .dashboard-layout .sidebar.is-toggled .sidebar-title {
    opacity: 0;
    width: 0;
  }

  .dashboard-layout .sidebar.is-toggled .sidebar-header {
    justify-content: center !important;
  }

  .dashboard-layout .sidebar.is-toggled .nav-text {
    display: none;
  }

  .dashboard-layout .sidebar.is-toggled .modern-nav-link {
    justify-content: center;
    padding: 12px;
  }
}

.dashboard-layout .main-content {
  flex: 1;
  padding: 2rem;
  overflow-x: hidden;
}

/* Make tables horizontally scrollable if needed */
.table-container {
  overflow-x: auto;
  width: 100%;
}

/* Impeccable Welcome Widget styles */
.welcome-widget {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.welcome-heading {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.welcome-greeting {
  color: #1e293b;
}

.welcome-name {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-wave {
  display: inline-block;
  animation: waveAnimation 2.5s infinite;
  transform-origin: 70% 70%;
}

@keyframes waveAnimation {
  0% {
    transform: rotate(0deg);
  }

  10% {
    transform: rotate(14deg);
  }

  20% {
    transform: rotate(-8deg);
  }

  30% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(10deg);
  }

  60%,
  100% {
    transform: rotate(0deg);
  }
}

.welcome-subtitle {
  margin: 0;
  font-size: 1rem;
  color: #64748b;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-layout .main-content {
    padding: 1.5rem;
  }
}

@media screen and (max-width: 992px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .dashboard-layout .sidebar {
    width: 100%;
    min-height: auto;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .dashboard-layout .sidebar-header {
    margin-bottom: 0 !important;
  }

  .dashboard-layout .sidebar .sidebar-links {
    display: none;
    flex-direction: column;
    margin-top: 1rem;
    gap: 8px;
  }

  .dashboard-layout .sidebar.is-toggled .sidebar-links {
    display: flex;
  }

  .dashboard-layout .main-content {
    padding: 1rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Generic Modals and Swal Alerts */
  .impeccable-modal-box,
  .impeccable-swal-popup,
  .swal2-popup,
  .impeccable-modal {
    width: 95% !important;
    max-width: 95% !important;
    padding: 1.25rem !important;
    margin: 10px auto !important;
    box-sizing: border-box !important;
  }

  /* Modal Headers and Footers */
  .modal-header-impeccable,
  .modal-footer-impeccable {
    padding: 1rem !important;
  }

  .modal-body-impeccable {
    padding: 1rem !important;
  }

  /* Swal Actions and Buttons */
  .impeccable-swal-popup .swal2-actions,
  .swal2-actions,
  .impeccable-modal-actions,
  .modal-footer-impeccable {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .impeccable-btn,
  .swal2-confirm,
  .swal2-cancel,
  .swal2-deny {
    width: 100% !important;
    margin: 4px 0 !important;
  }

  /* Form Grids Stacking */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  #areaSelect {
    width: 100% !important;
    margin-top: 0.5rem !important;
  }

  .dashboard-layout .main-content>div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .dashboard-content-wrapper {
    padding: 1rem;
    border-radius: 16px;
  }

  /* Stack header (Welcome & Buttons) on mobile */
  .main-content>div:first-child {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    margin-bottom: 1.5rem !important;
    text-align: center;
  }

  .main-content h1 {
    font-size: 1.5rem !important;
  }

  #filterOffcanvas .grid-3,
  #filterUserOffcanvas .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ========================================================= */
/* IMPECCABLE OFFCANVAS FILTER STYLES                        */
/* ========================================================= */
.modern-offcanvas {
  position: fixed;
  top: 0;
  right: -400px;
  /* Start hidden off-screen */
  width: 350px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
  z-index: 10000;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--surface-border);
}

.modern-offcanvas.open {
  right: 0;
  /* Slide in */
}

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

.offcanvas-header h4 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-main);
  font-weight: 600;
}

.offcanvas-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.offcanvas-close:hover {
  color: #ef4444;
}

.offcanvas-body {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
}

.offcanvas-body .grid-3 {
  grid-template-columns: 1fr !important;
  /* Stack elements vertically in offcanvas */
}

/* ---------------------------------------------------
   DataTables Modern Overrides
--------------------------------------------------- */
table.dataTable {
  border-collapse: collapse !important;
  border-spacing: 0;
  width: 100% !important;
  border: none !important;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

table.dataTable thead th {
  border-bottom: 2px solid var(--surface-border) !important;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1rem 1.5rem !important;
  background: transparent !important;
}

table.dataTable tbody td {
  padding: 1rem 1.5rem !important;
  vertical-align: middle;
  border-bottom: 1px solid var(--surface-border) !important;
  color: var(--text-color);
  font-size: 0.95rem;
}

table.dataTable tbody tr {
  background: transparent !important;
  transition: background-color 0.2s ease;
}

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

/* Remove default DataTables sorting classes borders */
table.dataTable.no-footer {
  border-bottom: none !important;
}

/* Search & Length Inputs */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  outline: none;
  background: var(--input-bg);
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Pagination Pills */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-color) !important;
  padding: 0.5rem 1rem !important;
  margin: 0 0.2rem !important;
  transition: all 0.2s ease !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f1f5f9 !important;
  color: var(--primary-color) !important;
  box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary-color) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2) !important;
  /* Emerald green shadow for current pagination */
}

/* Info Text */
.dataTables_wrapper .dataTables_info {
  color: var(--text-muted) !important;
  font-size: 0.875rem;
  padding-top: 1rem !important;
}

/* ========================================================= */
/* IMPECCABLE TABLE COMPONENTS                               */
/* ========================================================= */

.badge {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  /* Pill shape */
  white-space: nowrap;
}

.badge-success,
.badge-active {
  background-color: #d1fae5;
  /* Emerald 100 */
  color: #065f46;
  /* Emerald 800 */
}

.badge-inactive {
  background-color: #fee2e2;
  /* Red 100 */
  color: #991b1b;
  /* Red 800 */
}

.badge-warning {
  background-color: #ffedd5;
  /* Orange 100 */
  color: #9a3412;
  /* Orange 800 */
}

.avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2);
}

.table-header-modern {
  display: flex;
  justify-content: flex-end;
  /* Push search to the right */
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--surface-border);
}

.table-footer-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  margin-top: 1rem;
}

/* ========================================================= */
/* IMPECCABLE METRIC CARDS                                   */
/* ========================================================= */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.metric-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-primary {
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary-color);
}

.metric-icon-secondary {
  background: rgba(5, 150, 105, 0.1);
  color: var(--secondary-color);
}

.metric-icon-accent {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  /* Blue */
}

.metric-icon-danger {
  background: rgba(239, 68, 68, 0.1);
  /* Red 500 at 10% */
  color: #ef4444;
  /* Red 500 */
}

.metric-icon-purple {
  background: rgba(139, 92, 246, 0.1);
  /* Violet 500 at 10% */
  color: #8b5cf6;
  /* Violet 500 */
}

.metric-icon-wrapper svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

/* Impeccable Modal Styles */
.impeccable-modal {
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideInUp 0.3s ease-out forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.btn-close-impeccable {
  color: var(--text-muted);
  transition: color 0.2s;
}

.btn-close-impeccable:hover {
  color: #ef4444;
}

/* Tabs */
.modal-tabs-container {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--surface-border);
  padding: 0 2rem;
  gap: 1.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Admin Cards */
.admin-card {
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary-color);
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 0.5rem;
}

/* Buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Form tweaks inside modal */
.modal-body-impeccable .form-control {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.9rem;
}

.modal-body-impeccable .form-control:focus {
  background: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.modal-body-impeccable label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Impeccable User Management Specifics */
.metric-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.metric-icon-primary {
  filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.3));
}

.metric-icon-secondary {
  filter: drop-shadow(0 0 12px rgba(5, 150, 105, 0.3));
}

.metric-icon-accent {
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.3));
}

.metric-icon-purple {
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.3));
}

.metric-icon-danger {
  filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.3));
}

/* Badges */
.badge-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #6d28d9;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

.badge-gray {
  background: #f1f5f9;
  color: #475569;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

/* SaaS-style DataTable Overrides */
table.dataTable.display tbody tr {
  background-color: #fff;
  transition: background-color 0.2s;
}

table.dataTable.display tbody tr:hover {
  background-color: #f8fafc !important;
}

table.dataTable.display tbody td {
  border-top: none;
  border-bottom: 1px solid #f1f5f9;
  padding: 1rem 0.5rem;
  vertical-align: middle;
}

table.dataTable.display thead th {
  border-bottom: 2px solid #e2e8f0;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding-bottom: 1rem;
}

table.dataTable.no-footer {
  border-bottom: 1px solid #e2e8f0;
}

.action-icon-btn {
  padding: 6px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}

.action-icon-btn svg {
  width: 18px;
  height: 18px;
}

.action-icon-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.action-icon-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.action-icon-btn.logout-btn:hover {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
}

/* --- VAULTS INVENTORY --- */
.vault-area {
  margin-bottom: 2rem;
}

.vault-block {
  margin-bottom: 1.5rem;
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vault-levels {
  display: grid;
  grid-template-rows: repeat(7, 40px);
  /* 7 Levels */
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.vault {
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px;
  width: 40px;
  height: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.2s;
  position: relative;
}

.vault-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  color: #1e293b;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  padding: 0 2px;
}

.vault:hover {
  border-color: var(--primary-color);
}

.slot {
  background: #e2e8f0;
  border-radius: 2px;
  transition: opacity 0.2s, background 0.2s;
}

.slot.occupied {
  background: #ef4444;
  cursor: not-allowed;
}

.slot:hover {
  opacity: 0.7;
}

/* PONYTAIL: Hide the form container styling to use full width if needed */
#module-vaults .surface-container {
  max-width: 95%;
}

/* IMPECCABLE: Modern SweetAlert Styling */
.impeccable-swal-popup {
  border-radius: 16px !important;
  padding: 2rem !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  font-family: inherit;
}

.impeccable-swal-popup .swal2-title {
  padding: 0 !important;
  margin-bottom: 1.5rem !important;
}

.impeccable-swal-popup .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
}

.impeccable-swal-popup .swal2-actions {
  margin-top: 2rem !important;
  gap: 12px;
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
}

/* Custom Modal Styling for Impeccable Design */
.impeccable-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.impeccable-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.impeccable-modal-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.impeccable-modal-overlay.show .impeccable-modal-box {
  transform: translateY(0) scale(1);
}

.impeccable-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.impeccable-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.impeccable-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  display: flex;
}

.impeccable-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.impeccable-modal-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.8rem;
}

.impeccable-modal-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}

.impeccable-modal-value {
  color: #0f172a;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.impeccable-modal-value:last-child {
  margin-bottom: 0;
}

.impeccable-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.impeccable-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.impeccable-btn-outline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.impeccable-btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.impeccable-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.impeccable-btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}