:root {
  --sidebar-width: 290px;
  --primary-color: #0f766e;
  --primary-hover: #0b5d57;
  --accent-color: #b45309;
  --berry-color: #9f2348;
  --teal-color: #0f766e;
  --surface-color: #ffffff;
  --bg-color: #f6f7fb;
  --text-main: #1f1720;
  --text-muted: #6d6470;
  --border-color: #e7dde5;
  --radius-sm: 0.35rem;
  --radius-md: 0.45rem;
  --radius-lg: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(48 24 36 / 0.06);
  --shadow-md: 0 8px 22px -14px rgb(48 24 36 / 0.28);
  --shadow-lg: 0 18px 45px -22px rgb(48 24 36 / 0.38);
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(159, 35, 72, 0.035) 40%, rgba(246, 247, 251, 0) 72%),
    var(--bg-color);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

#wrapper {
  overflow-x: hidden;
}

/* Sidebar */
#sidebar-wrapper {
  min-height: 100vh;
  height: 100vh;
  margin-left: calc(-1 * var(--sidebar-width));
  transition: margin .25s ease-out;
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  background: linear-gradient(180deg, #122427 0%, #173034 48%, #201827 100%);
}

[dir="rtl"] #sidebar-wrapper {
  margin-left: 0;
  margin-right: calc(-1 * var(--sidebar-width));
  left: auto;
  right: 0;
}

#sidebar-wrapper::-webkit-scrollbar {
  width: 6px;
}
#sidebar-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
#sidebar-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-heading {
  padding: 1.5rem 1.25rem;
  font-size: 1.25rem;
  color: #fff;
  background: rgba(255,255,255,0.055);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.list-group-item {
  border: none;
  padding: 0.78rem 1rem;
  background-color: transparent;
  color: #cbd5e1;
  font-weight: 500;
  transition: all 0.2s;
  margin: 0.2rem 0.75rem;
  border-radius: var(--radius-sm);
}
.list-group-item:hover, .list-group-item.active {
  background-color: rgba(255, 255, 255, 0.11);
  color: #fff;
}
.list-group-item i {
  margin-right: 9px;
  width: 20px;
  text-align: center;
  font-size: 1.1em;
  flex: 0 0 20px;
}
[dir="rtl"] .list-group-item i {
  margin-right: 0;
  margin-left: 9px;
}

#wrapper.toggled #sidebar-wrapper {
  margin-left: 0;
}
[dir="rtl"] #wrapper.toggled #sidebar-wrapper {
  margin-right: 0;
}

#page-content-wrapper {
  min-width: 100vw;
  transition: margin .25s ease-out;
}

@media (min-width: 768px) {
  #sidebar-wrapper {
    margin-left: 0;
  }
  [dir="rtl"] #sidebar-wrapper {
    margin-right: 0;
  }
  #page-content-wrapper {
    min-width: 0;
    width: 100%;
    margin-left: var(--sidebar-width);
  }
  [dir="rtl"] #page-content-wrapper {
    margin-left: 0;
    margin-right: var(--sidebar-width);
  }
  #wrapper.toggled #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  [dir="rtl"] #wrapper.toggled #sidebar-wrapper {
    margin-right: calc(-1 * var(--sidebar-width));
  }
  #wrapper.toggled #page-content-wrapper {
    margin-left: 0;
  }
  [dir="rtl"] #wrapper.toggled #page-content-wrapper {
    margin-right: 0;
  }
}

/* Navbar */
.top-navbar {
  background-color: var(--surface-color);
  box-shadow: 0 10px 30px -28px rgb(48 24 36 / 0.55);
  border-bottom: 1px solid var(--border-color);
}

/* Cards & Surface */
.surface-card, .card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s;
  
}
.surface-card:hover, .card:hover {
  box-shadow: var(--shadow-md);
}
.surface-card.p-0, .card.p-0 {
  padding: 0;
}
.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  padding: 1.25rem 1.5rem;
}
.card-body, .surface-card-body {
  
}

/* Typography & Headers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-main);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }

/* Tables (Grids / Lists) */
.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-main);
  vertical-align: middle;
}
.table th {
  font-weight: 600;
  color: var(--text-muted);
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  white-space: nowrap;
}
.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.table-hover tbody tr:hover {
  background-color: #f1f5f9;
}
.table-responsive {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.table-responsive .table {
  margin-bottom: 0;
}
.table-responsive .table th {
  border-top: none;
}

/* Forms & Inputs */
.form-control, .form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s;
  background-color: #f8fafc;
}
.form-control:focus, .form-select:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.18);
}
.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.input-group-text {
  background-color: #f8fafc;
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* Buttons */
.btn {
  border-radius: var(--radius-md);
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

/* Modals */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  position: relative;
}
.modal-body {
  
}
.modal-footer {
  border-top: 1px solid var(--border-color);
  background-color: #f8fafc;
  padding: 1.25rem 1.5rem;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.modal-header .btn-close {
  margin: 0;
  position: absolute;
  top: 1.25rem;
}
[dir="rtl"] .modal-header .btn-close {
  left: 1.5rem;
  right: auto;
}
[dir="ltr"] .modal-header .btn-close {
  right: 1.5rem;
  left: auto;
}

/* Helpers */
.glassmorphism {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.filter-shell {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

body.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #f1f5f9;
}

/* Fix form-select arrow position in RTL mode */
[dir="rtl"] .form-select {
  background-position: left 0.75rem center;
  padding-right: 1rem;
  padding-left: 2.25rem;
}

/* Print specific styles */
@media print {
  #sidebar-wrapper, .top-navbar, .d-print-none {
    display: none !important;
  }
  #page-content-wrapper {
    margin: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    padding: 0 !important;
  }
  body {
    font-size: 11pt;
    background-color: #fff;
  }
  .surface-card, .card {
    box-shadow: none !important;
    border: none !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
  }
  .table-responsive {
    border: none !important;
    box-shadow: none !important;
  }
  .table th, .table td {
    padding: 0.3rem;
  }
}
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }


.eid-advanced-panel {
  border-top: 1px dashed var(--border-color);
  margin-top: 0.85rem;
  padding-top: 0.85rem;
}


.card .table-responsive, .surface-card .table-responsive {
  box-shadow: none; border: none; border-radius: 0;
  margin-bottom: 0;
}

.surface-card { padding: 1.5rem; }

.table-sm th, .table-sm td {
  padding: 0.5rem 0.75rem !important;
}
