/* ============================================================
   theme-2026.css — Sidebar dashboard дизайн
   style.css-ийн ДАРАА ачаалагдана; хуучин загварыг дарж сайжруулна.
   ============================================================ */

/* ===== Нэгдсэн палитр (Tailwind slate + blue гэр бүл) ===== */
:root {
  --cardShadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 8px rgba(15, 23, 42, 0.06);
  --cardShadowHover: 0 4px 16px rgba(15, 23, 42, 0.1);
  --radius: 12px;
  --sidebarW: 264px;

  /* Гол өнгө */
  --green: #1e40af;         /* primary (нэр нь хуучнаараа үлдсэн) */
  --greenDark: #1e3a8a;     /* primary hover */
  --tint: #eff6ff;          /* primary-ийн цайвар дэвсгэр */
  --tintBorder: #dbeafe;

  /* Саарал масштаб */
  --ink: #0f172a;           /* гарчиг */
  --body: #475569;          /* энгийн текст */
  --muted: #94a3b8;         /* бүдэг текст */
  --line: #e2e8f0;          /* хүрээ */
  --bg: #f1f5f9;            /* хуудасны дэвсгэр */
  --surface: #f8fafc;       /* хүснэгтийн толгой, hover */
}

/* Хуучин style.css-ийн хувьсагчдыг шинэ палитраар дарна —
   бүх хуучин элемент (товч, линк, badge) автоматаар зохицно */
:root {
  --secondColor: #1e40af;
  --secondHoverColor: #1e3a8a;
  --primaryColor: #1e40af;
  --primaryHoverColor: #1e3a8a;
  --orangeColor: #d97706;
  --backgroundColor: #f1f5f9;
  --borderColor: #e2e8f0;
  --lightGrayColor: #e2e8f0;
  --lgrayColor: #f1f5f9;
  --grayColor: #e2e8f0;
  --grayColorHover: #cbd5e1;
  --textColor: #64748b;
  --baseColor: #0f172a;
}

html,
body {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
}

/* ===================== Sidebar ===================== */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebarW);
  background: #fff;
  border-right: 1px solid var(--lightGrayColor);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.2s ease;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--lightGrayColor);
}

.app-sidebar-brand img {
  height: 52px;
  width: auto;
  max-width: 100%;
}

.app-sidebar-brand .brand-text b {
  display: block;
  font-size: 14.5px;
  color: var(--baseColor);
  line-height: 1.2;
}

.app-sidebar-brand .brand-text span {
  font-size: 11px;
  color: var(--textColor);
}

.app-nav {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--body) !important;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  transition: background-color 0.13s, color 0.13s;
}

.app-nav-item i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.13s;
}

.app-nav-item:hover {
  background: var(--tint);
  text-decoration: none;
}

.app-nav-item.active {
  background: var(--green);
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(30, 64, 175, 0.35);
}

.app-nav-item.active i {
  color: #fff;
}

.app-sidebar-foot {
  margin-top: auto;
  padding: 14px;
}

.help-box {
  background: var(--tint);
  border: 1px solid var(--tintBorder);
  border-radius: 12px;
  padding: 14px;
  font-size: 12.5px;
  color: var(--greenDark);
}

.help-box b {
  display: block;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.help-box p {
  margin: 0 0 6px;
  color: var(--greenDark);
}

.help-box span {
  display: block;
  font-weight: 700;
}

.copyright {
  margin: 12px 4px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.app-sidebar-backdrop {
  display: none;
}

/* ===================== Үндсэн хэсэг ===================== */
.app-main {
  margin-left: var(--sidebarW);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main.no-sidebar {
  margin-left: 0;
}

/* ===================== Topbar ===================== */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--lightGrayColor);
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.hamburger {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.hamburger:hover {
  background: var(--greenDark);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-bell {
  position: relative;
  color: var(--body) !important;
  font-size: 19px;
  padding: 6px;
}

.topbar-bell:hover {
  color: var(--green) !important;
}

.bell-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.topbar-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background-color 0.13s;
}

.topbar-profile:hover {
  background: var(--lgrayColor);
}

.topbar-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--tint);
  flex-shrink: 0;
}

.topbar-profile .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-meta {
  line-height: 1.25;
}

.profile-meta b {
  display: block;
  font-size: 13.5px;
  color: var(--baseColor);
}

.profile-meta span {
  font-size: 11.5px;
  color: var(--textColor);
}

.topbar-profile > .fa-angle-down {
  color: var(--muted);
}

.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--lightGrayColor);
  border-radius: 12px;
  box-shadow: var(--cardShadowHover);
  min-width: 190px;
  overflow: hidden;
  z-index: 950;
}

.profile-dropdown.open {
  display: block;
}

.pd-org {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--textColor);
  border-bottom: 1px solid var(--lightGrayColor);
}

.pd-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #d9534f;
  cursor: pointer;
  text-align: left;
}

.pd-logout:hover {
  background: #fdf3f2;
}

/* ===================== Контент ===================== */
main.main.__dg {
  padding: 22px 24px 30px;
  background: transparent;
}

main.main.__dg .full_container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

/* Хуудасны толгой */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.page-title h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 2px;
  line-height: 1.25;
}

.page-crumbs {
  font-size: 12.5px;
  color: var(--textColor);
}

.page-crumbs a {
  color: var(--green) !important;
  font-weight: 600;
}

/* ===================== Карт ===================== */
.box_item {
  border-radius: var(--radius);
  border: 1px solid var(--lightGrayColor);
  box-shadow: var(--cardShadow);
  background: #fff;
}

/* ===================== Статистик картууд ===================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--lightGrayColor);
  border-radius: var(--radius);
  box-shadow: var(--cardShadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.ic-green { background: var(--tint); color: var(--green); }
.stat-icon.ic-blue { background: #eef2ff; color: #4f46e5; }
.stat-icon.ic-orange { background: #fffbeb; color: #d97706; }
.stat-icon.ic-pink { background: #fff1f2; color: #e11d48; }
.stat-icon.ic-red { background: #fef2f2; color: #dc2626; }

.stat-body .lbl {
  font-size: 12.5px;
  color: var(--textColor);
  margin-bottom: 2px;
}

.stat-body .num {
  font-size: 23px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}

.stat-body .sub {
  font-size: 11.5px;
  color: var(--muted);
}

/* ===================== Хүснэгт ===================== */
.table_wrap {
  border-radius: 10px;
  border: 1px solid var(--lightGrayColor);
  overflow: auto;
}

.n_table {
  border-collapse: separate;
  border-spacing: 0;
}

.n_table thead th {
  background: var(--surface);
  color: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--lightGrayColor);
  padding: 11px 14px;
  white-space: nowrap;
}

.n_table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--lightGrayColor);
  font-size: 13.5px;
  vertical-align: middle;
  transition: background-color 0.1s;
}

.n_table tbody tr:last-child td {
  border-bottom: none;
}

.n_table tbody tr:hover td {
  background-color: var(--surface);
}

.n_table tfoot th {
  background: var(--surface);
  padding: 11px 14px;
  border-top: 1px solid var(--lightGrayColor);
}

/* ===================== Товч ===================== */
.__btn,
.__btn_m {
  border-radius: 9px;
  font-weight: 600;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.__btn:active {
  transform: translateY(1px);
}

.green_btn:hover {
  box-shadow: 0 2px 10px rgba(30, 64, 175, 0.35);
}

.__primary:hover {
  box-shadow: 0 2px 10px rgba(30, 64, 175, 0.3);
}

/* ===================== Форм ===================== */
.__input,
.__select,
.__input_text {
  border-radius: 9px;
  border: 1px solid var(--borderColor);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.__input:focus,
.__select:focus,
.__input_text:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.14);
}

.__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--body);
  letter-spacing: 0.2px;
}

/* ===================== Pagination ===================== */
.n_pagination {
  display: flex;
  justify-content: flex-end;
  padding: 12px 24px 26px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.n_pagination .pagination {
  gap: 4px;
}

.n_pagination .page-link {
  border-radius: 9px !important;
  border: 1px solid var(--lightGrayColor);
  color: var(--baseColor);
  min-width: 36px;
  text-align: center;
  transition: all 0.12s;
}

.n_pagination .page-link:hover {
  background: var(--lgrayColor);
  border-color: var(--grayColorHover);
}

.n_pagination .page-item.active .page-link {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Footer (хуучин footer_wrap ашиглаж буй хуудсуудад) */
.footer_wrap {
  display: none;
}

/* ===================== Жижиг дэлгэц ===================== */
@media (max-width: 992px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }

  .app-sidebar-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.45);
    z-index: 999;
  }

  .app-main {
    margin-left: 0;
  }

  main.main.__dg {
    padding: 16px 14px 24px;
  }

  .profile-meta span {
    display: none;
  }
}
