/* Somany Ceramics Limited — Ind AS 116 Lease Accounting & Compliance Suite */
@import url('https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,100..900;1,100..900&family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --font-sans: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Barlow', 'Albert Sans', monospace;
  
  /* Somany Ceramics Official Brand Tokens */
  --color-somany-red: #DD2227;
  --color-somany-red-hover: #B71C20;
  --color-somany-charcoal: #191B1C;
  --color-somany-charcoal-light: #2A2D2F;
  --color-somany-canvas: #F7F6F5;
  --color-somany-surface: #FFFFFF;
  --color-somany-border: #E6E6E6;
  --color-somany-muted: #6C6C6C;
  --color-somany-blue: #1F97D7;
  
  /* Semantic Status Colors */
  --color-emerald: #10B981;
  --color-emerald-dark: #047857;
  --color-amber: #D97706;
  --color-rose: #E11D48;
}

*, *::before, *::after {
  font-family: var(--font-sans);
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-somany-canvas);
  color: var(--color-somany-charcoal);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, span, p, div, a {
  font-family: var(--font-sans);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Sidebar Architecture & Transitions */
#app-sidebar {
  transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-expanded {
  width: 12.5rem; /* 200px compact width */
}

.sidebar-collapsed {
  width: 3.5rem; /* 56px compact rail */
}

.sidebar-collapsed .sidebar-text,
.sidebar-collapsed .sidebar-badge,
.sidebar-collapsed .sidebar-section-header,
.sidebar-collapsed .sidebar-user-info {
  display: none !important;
}

.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

/* Topnav Navigation Items (Somany Brand Header) */
.topnav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #AEB4B7;
  transition: all 0.12s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.topnav-item:focus {
  outline: none;
}

.topnav-item:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.08);
}

.topnav-item.active {
  color: #FFFFFF;
  background-color: var(--color-somany-red);
  border-color: var(--color-somany-red);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(221, 34, 39, 0.35);
}

.topnav-item.active i, .topnav-item.active svg {
  color: #FFFFFF;
}

.topnav-badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1.15;
}

/* Flaticon UIcons Standardized Alignment & Sizing */
.fi, [class*="fi-rr-"], [class*="fi-br-"], [class*="fi-sr-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}

.topnav-item i, button i, a i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Custom horizontal scrollbar suppression */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Legacy sidebar classes preserved for safety */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.12s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  outline: none;
}

.sidebar-item:focus {
  outline: none;
}

.sidebar-item:hover {
  background-color: #F1F5F9;
  color: var(--color-slate-900);
}

.sidebar-item.active {
  background-color: #EFF6FF;
  color: var(--color-blue);
  font-weight: 700;
}

/* Tabular Numerals formatting in Nunito */
.font-numeric {
  font-family: var(--font-sans) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
}

.font-mono, [class*='font-mono'] {
  font-family: var(--font-sans) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Precision Financial Grid Cards */
.ledger-card {
  background: var(--color-surface);
  border: 1px solid var(--color-slate-200);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
}

/* Input Fields */
.input-field {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-sans);
}
.input-field:focus {
  border-color: var(--color-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Fade In transition */
.fade-in {
  animation: fadeIn 0.16s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Financial Grid Column Tinting */
.col-tint-interest {
  background-color: rgba(254, 243, 199, 0.35); /* Soft Amber */
}

.col-tint-payment {
  background-color: rgba(239, 246, 255, 0.45); /* Soft Blue */
}

.col-tint-depreciation {
  background-color: rgba(236, 253, 245, 0.45); /* Soft Mint/Emerald */
}

.col-tint-liability-part {
  background-color: rgba(241, 245, 249, 0.5); /* Soft Slate */
}

/* Toast Notification Styles - Top and Middle of Screen */
#toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: #191B1C;
  color: #FFFFFF;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
  animation: slideToastDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 90vw;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-item:hover {
  opacity: 0.92;
  transform: scale(0.98);
}

@keyframes slideToastDown {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Custom Styled Select Dropdown (Matching Reference Design with SVG Chevron)
   ========================================================================== */
.custom-select, select.input-field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 2rem; /* 32px standard control height, exact match with py-1.5 buttons and inputs */
  line-height: 2rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0.65rem !important;
  padding-right: 2rem !important;
  border: 1px solid #E2E8F0;
  border-radius: 0.375rem; /* 6px rounded-md */
  font-size: 0.75rem; /* 12px text-xs */
  font-weight: 600;
  color: #191B1C;
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748B'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  box-sizing: border-box;
}

.custom-select:hover, select.input-field:hover {
  border-color: #CBD5E1;
  background-color: #F8FAFC;
}

.custom-select:focus, select.input-field:focus {
  outline: none;
  border-color: var(--color-somany-red, #DD2227);
  box-shadow: 0 0 0 2px rgba(221, 34, 39, 0.12);
}

.control-h8 {
  height: 2rem !important; /* 32px standard control height */
  box-sizing: border-box !important;
}

input.control-h8 {
  height: 2rem !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
}

button.control-h8 {
  height: 2rem !important;
  box-sizing: border-box !important;
  display: inline-flex;
  align-items: center;
}

/* Master Contracts Row Clickable Affordance */
tr.cursor-pointer:hover td {
  background-color: #F8FAFC !important;
}

tr.cursor-pointer:hover td:first-child {
  border-left: 3px solid #DD2227;
}

/* Dark variant for Top Command Bar Global FY Dropdown */
.custom-select-dark {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #1E293B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394A3B8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 1rem;
  padding-left: 0.55rem !important;
  padding-right: 1.85rem !important;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #F8FAFC;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.custom-select-dark:hover {
  border-color: #475569;
  background-color: #243248;
}

.custom-select-dark:focus {
  outline: none;
  border-color: #38BDF8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.custom-select-dark option {
  background-color: #0B132B;
  color: #FFFFFF;
}

/* Interactive Executive KPI Cards */
.kpi-card-interactive {
  cursor: pointer;
  position: relative;
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #E2E8F0;
}

.kpi-card-interactive:hover {
  border-color: #93C5FD;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.kpi-card-interactive:active {
  transform: translateY(0);
}

.kpi-card-interactive .kpi-arrow-indicator {
  opacity: 0;
  transform: translateX(-3px);
  transition: all 0.15s ease-in-out;
}

.kpi-card-interactive:hover .kpi-arrow-indicator {
  opacity: 1;
  transform: translateX(0);
}

/* Responsive Viewport & Base Canvas (Eliminates bottom blank space) */
html, body {
  height: 100%;
  min-height: 100%;
  background-color: #F8FAFC;
}

/* Fluid Table Container (Utilizes full screen viewport, removes blank void) */
.table-viewport-fluid {
  max-height: calc(100vh - 215px);
  min-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
}

/* Accounting Journal Voucher Cards */
.voucher-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.voucher-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.dr-tag {
  color: #15803D;
  font-weight: 800;
  font-size: 0.6875rem;
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  display: inline-block;
  min-width: 1.75rem;
  text-align: center;
}

.cr-tag {
  color: #1D4ED8;
  font-weight: 800;
  font-size: 0.6875rem;
  background-color: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  display: inline-block;
  min-width: 1.75rem;
  text-align: center;
}

.cr-indent {
  padding-left: 1.75rem !important;
}

.voucher-divider-row {
  border-top: 2px solid #94A3B8 !important;
}

/* Modal Architecture & Glassmorphism Backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 19, 43, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.hidden,
.modal-overlay.hidden {
  display: none !important;
}

.modal-container {
  background: #FFFFFF;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #CBD5E1;
  transform: scale(0.96);
  transition: transform 0.2s ease-in-out;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

/* ==========================================================================
   Ionic Segmented Controls & Micro-Interactions (References: ionicframework.com, uiverse.io)
   ========================================================================== */
.ionic-segment-container {
  display: inline-flex;
  background: #E2E8F0;
  padding: 3px;
  border-radius: 0.5rem;
  gap: 2px;
  user-select: none;
}

.ionic-segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  white-space: nowrap;
}

.ionic-segment-btn:hover {
  color: #0F172A;
}

.ionic-segment-btn.active {
  background: var(--color-somany-red);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(221, 34, 39, 0.35);
}

.ionic-segment-btn .segment-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}

.ionic-segment-btn:not(.active) .segment-badge {
  background: #CBD5E1;
  color: #334155;
}

/* Stepper Component for Onboarding Modal */
.stepper-container {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #E6E6E6;
  background: #FDFDFD;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}

.stepper-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6C6C6C;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.stepper-step:hover {
  color: var(--color-somany-charcoal);
  background: #F1F5F9;
}

.stepper-step.active {
  color: var(--color-somany-red);
  background: rgba(221, 34, 39, 0.08);
  border-color: rgba(221, 34, 39, 0.2);
}

.stepper-step .step-circle {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  background: #E2E8F0;
  color: #475569;
}

.stepper-step.active .step-circle {
  background: var(--color-somany-red);
  color: #FFFFFF;
}

.stepper-step.completed .step-circle {
  background: var(--color-emerald);
  color: #FFFFFF;
}

/* Somany Brand Helper Utility Classes */
.bg-somany-red { background-color: var(--color-somany-red) !important; }
.hover\:bg-somany-red-hover:hover { background-color: var(--color-somany-red-hover) !important; }
.text-somany-red { color: var(--color-somany-red) !important; }
.border-somany-red { border-color: var(--color-somany-red) !important; }
.bg-somany-charcoal { background-color: var(--color-somany-charcoal) !important; }
.bg-somany-canvas { background-color: var(--color-somany-canvas) !important; }

/* Uiverse Tactile Status Buttons */
.tactile-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
}

.tactile-status-btn.pending {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FDE68A;
}

.tactile-status-btn.pending:hover {
  background: #FDE68A;
  transform: translateY(-1px);
}

.tactile-status-btn.settled {
  background: #ECFDF5;
  color: #047857;
  border-color: #A7F3D0;
}

.tactile-status-btn.settled:hover {
  background: #D1FAE5;
  transform: translateY(-1px);
}

/* Spectrum UI Fintech High-Contrast Journal Card */
.spectrum-jv-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 0.625rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.spectrum-jv-card:hover {
  border-color: #94A3B8;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Tactile Click Effect */
.btn-tactile:active {
  transform: scale(0.97);
}