/* =========================================================
   OJA EDE — DASHBOARD CORE CSS
   Shared dashboard system
   ========================================================= */


/* =========================================================
   1. RESET
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  background: #f6f8f5;
  color: #17221a;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}


/* =========================================================
   2. OJA EDE DASHBOARD
   ========================================================= */

.oja-dashboard {
  width: 100%;
  min-height: 100vh;

  background: #f6f8f5;
  color: #17221a;
}


/* =========================================================
   3. MAIN SHELL
   ========================================================= */

.dashboard-shell {
  position: relative;

  display: flex;

  width: 100%;
  min-height: 100vh;
}


/* =========================================================
   4. SIDEBAR
   ========================================================= */

.sidebar {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  width: 250px;

  display: flex;
  flex-direction: column;

  padding: 22px 14px;

  background: #ffffff;

  border-right: 1px solid #e4e9e3;

  z-index: 1000;

  overflow-x: hidden;
  overflow-y: auto;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}


/* =========================================================
   5. SIDEBAR BRAND
   ========================================================= */

.sidebar-brand {
  display: flex;
  align-items: center;

  width: 100%;

  gap: 11px;

  padding: 4px 8px 22px;

  margin-bottom: 16px;

  border-bottom: 1px solid #edf0ec;
}

.brand-mark {
  flex: 0 0 43px;

  width: 43px;
  height: 43px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  background: #123c2a;
  color: #ffffff;

  font-size: 13px;
  font-weight: 800;

  letter-spacing: 0.4px;
}

.sidebar-brand > div:last-child {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 3px;
}

.sidebar-brand strong {
  display: block;

  color: #123c2a;

  font-size: 17px;
  font-weight: 800;

  line-height: 1.1;
}

.sidebar-brand span {
  display: block;

  max-width: 155px;

  color: #7a837b;

  font-size: 7px;
  font-weight: 700;

  line-height: 1.25;

  letter-spacing: 0.6px;

  white-space: nowrap;
}


/* =========================================================
   6. SIDEBAR NAV
   ========================================================= */

.sidebar-nav {
  width: 100%;

  display: flex;
  flex-direction: column;

  gap: 5px;
}


/* =========================================================
   7. NAV ITEM
   ========================================================= */

.sidebar-nav .nav-item {
  position: relative;

  width: 100%;
  min-height: 47px;

  display: flex;
  align-items: center;

  gap: 12px;

  padding: 0 12px;

  border-radius: 11px;

  color: #69736b;

  text-decoration: none;

  font-size: 14px;
  font-weight: 600;

  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.sidebar-nav .nav-item > span:first-child {
  flex: 0 0 24px;

  width: 24px;
  height: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #7a847b;

  font-size: 17px;

  line-height: 1;
}

.sidebar-nav .nav-item > span:last-child {
  min-width: 0;

  overflow: hidden;

  white-space: nowrap;

  text-overflow: ellipsis;
}


/* =========================================================
   8. NAV HOVER
   ========================================================= */

.sidebar-nav .nav-item:hover {
  background: #f0f5f1;

  color: #123c2a;

  transform: translateX(2px);
}

.sidebar-nav .nav-item:hover > span:first-child {
  color: #123c2a;
}


/* =========================================================
   9. ACTIVE NAV
   ========================================================= */

.sidebar-nav .nav-item.active {
  background: #123c2a;

  color: #ffffff;

  font-weight: 700;

  box-shadow:
    0 5px 14px rgba(18, 60, 42, 0.12);
}

.sidebar-nav .nav-item.active > span:first-child {
  color: #ffffff;
}

.sidebar-nav .nav-item.active::before {
  content: "";

  position: absolute;

  left: 0;
  top: 50%;

  width: 4px;
  height: 22px;

  transform: translateY(-50%);

  background: #d6a84f;

  border-radius: 0 4px 4px 0;
}


/* =========================================================
   10. LOGOUT
   ========================================================= */

.sidebar-logout {
  width: 100%;
  min-height: 45px;

  margin-top: auto;
  padding: 0 12px;

  display: flex;
  align-items: center;
  justify-content: flex-start;

  border: 1px solid #e3e8e2;
  border-radius: 11px;

  background: #ffffff;

  color: #687169;

  font-size: 13px;
  font-weight: 700;

  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.sidebar-logout:hover {
  background: #fff5f3;

  border-color: #f0d8d3;

  color: #b83c32;
}

.sidebar-logout:active {
  transform: translateY(1px);
}


/* =========================================================
   11. MAIN CONTENT
   ========================================================= */

.dashboard-content {
  width: calc(100% - 250px);

  min-width: 0;
  min-height: 100vh;

  margin-left: 250px;

  padding:
    0 30px 40px;

  overflow-x: hidden;
}


/* =========================================================
   12. HEADER
   ========================================================= */

.dashboard-header {
  width: 100%;
  min-height: 82px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 28px;

  border-bottom: 1px solid #e5eae4;
}

.header-left {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 13px;
}

.header-left > div:last-child {
  min-width: 0;
}

.header-left h1 {
  margin: 0;

  color: #17221a;

  font-size: 25px;
  font-weight: 800;

  line-height: 1.15;
}

.eyebrow {
  margin: 0 0 5px;

  color: #7b847c;

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 1.1px;

  line-height: 1.2;
}


/* =========================================================
   13. MOBILE MENU BUTTON
   ========================================================= */

.menu-btn {
  width: 42px;
  height: 42px;

  flex: 0 0 42px;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid #e1e7e0;
  border-radius: 10px;

  background: #ffffff;

  color: #123c2a;

  font-size: 20px;

  line-height: 1;
}

.menu-btn:hover {
  background: #f0f5f1;
}

.menu-btn:active {
  transform: scale(0.97);
}


/* =========================================================
   14. HEADER ACTIONS
   ========================================================= */

.header-actions {
  position: relative;

  flex: 0 0 auto;

  display: flex;
  align-items: center;

  gap: 9px;
}

.icon-btn {
  width: 41px;
  height: 41px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid #e1e7e0;
  border-radius: 10px;

  background: #ffffff;

  color: #526056;

  font-size: 19px;

  line-height: 1;
}

.icon-btn:hover {
  background: #f0f5f1;

  color: #123c2a;
}

.icon-btn:active {
  transform: scale(0.97);
}


/* =========================================================
   15. HEADER AVATAR
   ========================================================= */

.header-avatar {
  width: 41px;
  height: 41px;

  flex: 0 0 41px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #123c2a;

  color: #ffffff;

  font-size: 14px;
  font-weight: 800;

  text-transform: uppercase;
}


/* =========================================================
   16. NOTIFICATION COUNT
   ========================================================= */

.notification-count {
  position: absolute;

  top: -4px;
  right: 40px;

  min-width: 17px;
  height: 17px;

  padding: 0 4px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px solid #f6f8f5;
  border-radius: 20px;

  background: #c63d32;

  color: #ffffff;

  font-size: 8px;
  font-weight: 800;

  line-height: 1;
}


/* =========================================================
   17. MOBILE SIDEBAR OVERLAY
   ========================================================= */

.sidebar-overlay {
  position: fixed;

  inset: 0;

  background: rgba(10, 25, 17, 0.42);

  z-index: 999;

  opacity: 0;
  visibility: hidden;

  pointer-events: none;

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;

  pointer-events: auto;
}


/* =========================================================
   18. COMMON BUTTONS
   ========================================================= */

.primary-button,
.secondary-button,
.danger-button {
  min-height: 43px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  padding: 0 17px;

  border-radius: 10px;

  font-size: 13px;
  font-weight: 700;

  text-decoration: none;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.primary-button {
  border: 1px solid #123c2a;

  background: #123c2a;

  color: #ffffff;
}

.primary-button:hover {
  background: #0e3021;
  border-color: #0e3021;
}

.secondary-button {
  border: 1px solid #dce3dc;

  background: #ffffff;

  color: #3f4b42;
}

.secondary-button:hover {
  background: #f1f5f1;

  border-color: #cfd8cf;
}

.danger-button {
  border: 1px solid #d7a49f;

  background: #fff7f6;

  color: #b33b31;
}

.danger-button:hover {
  background: #ffefed;

  border-color: #ca8982;
}

.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: translateY(1px);
}


/* =========================================================
   19. FULL WIDTH BUTTON
   ========================================================= */

.full-button {
  width: 100%;
}


/* =========================================================
   20. LOADING OVERLAY
   ========================================================= */

.dashboard-loading {
  position: fixed;

  inset: 0;

  z-index: 3000;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(246, 248, 245, 0.78);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.loading-card {
  min-width: 180px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 11px;

  padding: 15px 18px;

  border: 1px solid #e1e7e0;
  border-radius: 13px;

  background: #ffffff;

  color: #435046;

  font-size: 13px;
  font-weight: 700;

  box-shadow:
    0 12px 35px rgba(18, 60, 42, 0.10);
}

.loading-spinner {
  width: 19px;
  height: 19px;

  display: block;

  border: 2px solid #dfe7df;

  border-top-color: #123c2a;

  border-radius: 50%;

  animation:
    dashboardSpin 0.75s linear infinite;
}

@keyframes dashboardSpin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================================================
   21. TOAST
   ========================================================= */

.dashboard-toast {
  position: fixed;

  left: 50%;
  bottom: 24px;

  z-index: 4000;

  max-width: calc(100vw - 32px);

  padding: 12px 16px;

  border: 1px solid #dfe5df;
  border-radius: 10px;

  background: #ffffff;

  color: #253128;

  font-size: 13px;
  font-weight: 600;

  box-shadow:
    0 10px 30px rgba(18, 60, 42, 0.14);

  transform:
    translate(-50%, 20px);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.dashboard-toast.show {
  opacity: 1;
  visibility: visible;

  transform:
    translate(-50%, 0);
}


/* =========================================================
   22. GENERIC DASHBOARD CARD
   ========================================================= */

.dashboard-card {
  min-width: 0;

  background: #ffffff;

  border: 1px solid #e4e9e3;

  border-radius: 15px;

  padding: 20px;

  box-shadow:
    0 3px 15px rgba(18, 60, 42, 0.035);
}


/* =========================================================
   23. CARD HEADING
   ========================================================= */

.card-heading {
  margin-bottom: 18px;
}

.card-heading h2 {
  margin: 4px 0 0;

  color: #17221a;

  font-size: 18px;
  font-weight: 800;

  line-height: 1.25;
}

.section-kicker {
  display: block;

  color: #8a938b;

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 1.1px;

  line-height: 1.2;
}


/* =========================================================
   24. STATE CARDS
   ========================================================= */

.state-card {
  width: 100%;

  max-width: 600px;

  margin: 40px auto;

  padding: 35px 24px;

  text-align: center;

  background: #ffffff;

  border: 1px solid #e4e9e3;

  border-radius: 16px;

  box-shadow:
    0 5px 20px rgba(18, 60, 42, 0.04);
}

.state-icon {
  width: 48px;
  height: 48px;

  margin: 0 auto 15px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #f1f5f1;

  color: #123c2a;

  font-size: 20px;
  font-weight: 800;
}

.state-card h2 {
  margin: 0 0 8px;

  font-size: 19px;
  font-weight: 800;
}

.state-card p {
  margin: 0 0 20px;

  color: #727c73;

  font-size: 13px;

  line-height: 1.6;
}


/* =========================================================
   25. FORM CONTROLS
   ========================================================= */

input,
select,
textarea {
  max-width: 100%;

  border: 1px solid #dfe5de;

  border-radius: 10px;

  background: #ffffff;

  color: #17221a;

  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #123c2a;

  box-shadow:
    0 0 0 3px rgba(18, 60, 42, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #9aa29b;
}


/* =========================================================
   26. RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 950px) {

  .sidebar {
    width: 225px;
  }

  .dashboard-content {
    width: calc(100% - 225px);

    margin-left: 225px;

    padding-left: 22px;
    padding-right: 22px;
  }

  .sidebar-brand {
    padding-left: 6px;
    padding-right: 6px;
  }

  .sidebar-brand span {
    font-size: 6.5px;
  }

  .sidebar-nav .nav-item {
    font-size: 13px;
  }

}


/* =========================================================
   27. RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 700px) {

  .dashboard-shell {
    display: block;
  }


  /* sidebar becomes drawer */

  .sidebar {
    width: 275px;

    transform: translateX(-100%);

    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);

    box-shadow:
      12px 0 35px rgba(0, 0, 0, 0.13);
  }


  /* content becomes full width */

  .dashboard-content {
    width: 100%;

    margin-left: 0;

    padding:
      0 16px 30px;
  }


  /* menu button appears */

  .menu-btn {
    display: flex;
  }


  .dashboard-header {
    min-height: 70px;

    margin-bottom: 20px;

    gap: 10px;
  }


  .header-left {
    gap: 9px;
  }


  .header-left h1 {
    font-size: 21px;
  }


  .eyebrow {
    font-size: 8px;
  }


  .header-actions {
    gap: 6px;
  }


  .icon-btn {
    width: 38px;
    height: 38px;
  }


  .header-avatar {
    width: 38px;
    height: 38px;
  }


  .notification-count {
    right: 37px;
  }


  .dashboard-card {
    padding: 16px;
  }

}


/* =========================================================
   28. RESPONSIVE — SMALL PHONE
   ========================================================= */

@media (max-width: 430px) {

  .dashboard-content {
    padding-left: 12px;
    padding-right: 12px;
  }


  .dashboard-header {
    min-height: 64px;

    gap: 7px;
  }


  .menu-btn {
    width: 38px;
    height: 38px;

    flex-basis: 38px;

    font-size: 18px;
  }


  .header-left {
    gap: 7px;
  }


  .header-left h1 {
    font-size: 19px;
  }


  .eyebrow {
    font-size: 7px;

    letter-spacing: 0.8px;
  }


  .icon-btn {
    width: 35px;
    height: 35px;

    font-size: 17px;
  }


  .header-avatar {
    width: 35px;
    height: 35px;

    flex-basis: 35px;
  }


  .header-actions {
    gap: 4px;
  }


  .notification-count {
    right: 34px;
  }


  .dashboard-card {
    padding: 14px;

    border-radius: 13px;
  }


  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 41px;

    padding-left: 14px;
    padding-right: 14px;
  }

}


/* =========================================================
   29. VERY SMALL PHONE
   ========================================================= */

@media (max-width: 360px) {

  .dashboard-content {
    padding-left: 10px;
    padding-right: 10px;
  }


  .sidebar {
    width: 260px;
  }


  .header-left h1 {
    font-size: 18px;
  }


  .icon-btn {
    width: 33px;
    height: 33px;
  }


  .header-avatar {
    width: 33px;
    height: 33px;

    flex-basis: 33px;
  }

}


/* =========================================================
   30. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }

}