/* Django Unfold RTL + Persian font + icons */
@charset "UTF-8";

/* Global RTL and Persian font */
html { direction: rtl !important; }
body { direction: rtl !important; text-align: right !important; }
html, body, * { font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif !important; }

/* Material Symbols as icons (so ligature text like "dashboard" renders as icon) */
.material-symbols-outlined,
.material-symbols-rounded {
    font-family: 'Material Symbols Outlined', 'Material Symbols Rounded' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 20px;  /* Preferred icon size */
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr; /* Icons should remain LTR */
    -webkit-font-feature-settings: 'liga';
        font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Legacy material-icons class */
.material-icons {
    font-family: 'Material Icons' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Unfold sidebar: place icon on the right of label */
nav[aria-label="Sidebar"] .inline-flex { flex-direction: row-reverse !important; }
nav[aria-label="Sidebar"] a { text-align: right !important; }

/* Breadcrumbs and tables */
nav[aria-label="Breadcrumb"] ol { direction: rtl !important; }
table { direction: rtl !important; }
table th, table td { text-align: right !important; }

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
    direction: rtl !important; text-align: right !important;
}

/* jQuery UI datepicker visibility and stacking */
.ui-datepicker { 
  z-index: 99999 !important; 
  direction: rtl !important; 
  position: absolute !important;
}
.ui-datepicker .ui-datepicker-prev { right: auto; left: 10px; }
.ui-datepicker .ui-datepicker-next { left: auto; right: 10px; }
#ui-datepicker-div { 
  z-index: 99999 !important; 
  direction: rtl !important;
}

/* Fix button panel layout and functionality */
.ui-datepicker .ui-datepicker-buttonpane {
  direction: rtl !important;
  text-align: left !important;
  border-top: 1px solid #ddd !important;
  padding: 8px !important;
}

.ui-datepicker .ui-datepicker-buttonpane button {
  float: left !important;
  margin: 0 5px !important;
  padding: 4px 8px !important;
  cursor: pointer !important;
  border: 1px solid #ccc !important;
  background: #f6f6f6 !important;
  border-radius: 3px !important;
}

.ui-datepicker .ui-datepicker-buttonpane button:hover {
  background: #e6e6e6 !important;
  border-color: #999 !important;
}

.ui-datepicker .ui-datepicker-close {
  float: left !important;
}

.ui-datepicker .ui-datepicker-current {
  float: right !important;
}

/* Ensure date input fields are properly styled */
.vDateField, input[data-role="jdate"], input.jdate {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="%23666" d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: left 8px center !important;
  padding-left: 30px !important;
  cursor: pointer !important;
}

/* Primary blue palette touches */
.text-primary-600 { color: #2563eb !important; }
.bg-primary-600 { background-color: #2563eb !important; }
.bg-primary-700 { background-color: #1d4ed8 !important; }

/* Minor cards and grid alignments */
.grid > div, .bg-white { direction: rtl !important; text-align: right !important; }
