
:root {
  --radius: 1rem;
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --background: #f4f6f8;
  --foreground: #1a1d24;
  --card: #ffffff;
  --card-foreground: #1a1d24;
  --popover: #ffffff;
  --popover-foreground: #1a1d24;
  --primary: #0d7c8c;
  --primary-foreground: #f4f6f8;
  --secondary: #eef0f3;
  --secondary-foreground: #2a2e38;
  --muted: #f0f2f5;
  --muted-foreground: #6b7280;
  --accent: #d1f0e8;
  --accent-foreground: #1a5c6e;
  --destructive: #c44d3d;
  --destructive-foreground: #f8f9fa;
  --success: #2da179;
  --success-foreground: #f8f9fa;
  --warning: #d4a72c;
  --warning-foreground: #3d2f0a;
  --info: #4a8ac5;
  --info-foreground: #f8f9fa;
  --border: #d8dce2;
  --input: #e0e4e9;
  --ring: #2a8fa8;
  --chart-1: #2a8fa8;
  --chart-2: #2da179;
  --chart-3: #d4a72c;
  --chart-4: #c44d3d;
  --chart-5: #8b5cf6;
  --sidebar: #1f2833;
  --sidebar-foreground: #eef0f3;
  --sidebar-primary: #3da89c;
  --sidebar-primary-foreground: #0f1419;
  --sidebar-accent: #3a4550;
  --sidebar-accent-foreground: #eef0f3;
  --sidebar-border: #3a4550;
  --sidebar-ring: #3da89c;

  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-success: var(--success);
  --color-success-foreground: var(--success-foreground);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-info: var(--info);
  --color-info-foreground: var(--info-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

* {
  border-color: var(--color-border);
  box-sizing: border-box;
}

html {
  direction: rtl;
  font-size: 16px;
}

body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "ss02";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.nums-fa {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 0.875rem;
}

/* Custom utilities */
.card-elevated {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 2px rgba(26, 29, 36, 0.04),
    0 4px 16px rgba(26, 29, 36, 0.04);
}

.stage-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 4px;
  border: 2px solid var(--color-border);
  background-color: var(--color-background);
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.btn:hover {
  opacity: 0.9;
}
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}
.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
}
.btn-secondary:hover {
  background-color: var(--color-muted);
}
.btn-destructive {
  background-color: var(--color-destructive);
  color: var(--color-destructive-foreground);
}
.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-input);
  border-radius: var(--radius-md);
  background-color: transparent;
  color: var(--color-foreground);
  font-family: inherit;
  font-size: 0.875rem;
}

.input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-ring);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: left 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-left: 2.5rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  background-color: var(--color-muted);
  padding: 0.5rem 0.75rem;
  text-align: right;
  font-weight: 500;
  color: var(--color-muted-foreground);
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.table tr:hover td {
  background-color: rgba(240, 242, 245, 0.5);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge-success {
  background-color: rgba(45, 161, 121, 0.15);
  color: var(--color-success);
  border-color: rgba(45, 161, 121, 0.3);
}

.badge-warning {
  background-color: rgba(212, 167, 44, 0.15);
  color: var(--color-warning);
  border-color: rgba(212, 167, 44, 0.3);
}

.badge-info {
  background-color: rgba(74, 138, 197, 0.15);
  color: var(--color-info);
  border-color: rgba(74, 138, 197, 0.3);
}

.badge-destructive {
  background-color: rgba(196, 77, 61, 0.15);
  color: var(--color-destructive);
  border-color: rgba(196, 77, 61, 0.3);
}

.badge-secondary {
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
}

.table tr.dt-selected td {
  background-color: rgba(13, 124, 140, 0.08);
}

.table td.dt-cell-saving {
  background-color: rgba(13, 124, 140, 0.06);
}

.table td.dt-cell-success {
  background-color: rgba(45, 161, 121, 0.12);
}

.table td.dt-cell-error {
  background-color: rgba(196, 77, 61, 0.12);
}

.dt-batch-toolbar {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  transition:
    opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
    max-height 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
    margin 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
    padding 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dt-batch-toolbar.visible {
  opacity: 1;
  visibility: visible;
  max-height: 80px;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.dt-toolbar {
  direction: rtl;
  animation: dtFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes dtFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dt-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.dt-sort-asc::after {
  content: "▲";
  font-size: 0.6rem;
  margin-right: 0.25rem;
  opacity: 0.5;
}

.dt-sort-desc::after {
  content: "▼";
  font-size: 0.6rem;
  margin-right: 0.25rem;
  opacity: 0.5;
}

.print-area {
  display: none;
}

#sidebar {
  z-index: 100;
  transition:
    transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

@media (max-width: 1023px) {
  #sidebar.closed {
    position: fixed !important;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
  }
}

#sidebar {
  transition:
    width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#sidebar.collapsed {
  width: 4.5rem !important;
}

#sidebar.collapsed .sidebar-label,
#sidebar.collapsed .sidebar-user-label {
  opacity: 0;
  overflow: hidden;
  width: 0;
  display: none;
}

#sidebar.collapsed .sidebar-icon-center,
#sidebar.collapsed .sidebar-link svg {
  margin-left: auto;
  margin-right: auto;
}

#sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#sidebar-overlay {
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
