/* Based on devtec.nl. Frappe v15 light mode; dark mode keeps its native palette. */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-extrabold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --dt-blue: #5d6fa7;
  --dt-blue-hover: #4d6099;
  --dt-ink: #293349;
  --dt-line: #dce3ef;
  --dt-muted: #647089;
  --dt-bg: #f5f9ff;
}

html[data-theme="light"] {
  --primary: var(--dt-blue);
  --primary-color: var(--dt-blue);
  --text-color: var(--dt-ink);
  --heading-color: var(--dt-ink);
  --text-muted: var(--dt-muted);
  --bg-color: var(--dt-bg);
  --subtle-fg: #eceef6;
  --control-bg: #f0f3fa;
  --border-color: var(--dt-line);
  --dark-border-color: #c8cfe7;
  --sidebar-select-color: #e8eaf2;
  --btn-primary: var(--dt-blue);
  --btn-primary-hover: var(--dt-blue-hover);
  --border-radius: 12px;
  --border-radius-md: 14px;
  --border-radius-lg: 18px;
}

body { font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.navbar .app-logo { width: auto; max-width: 108px; height: 28px; max-height: 28px; object-fit: contain; }
.navbar .navbar-brand { margin-right: 22px; }

html[data-theme="light"] .navbar {
  background: #fff;
  border-bottom: 1px solid var(--dt-line);
  box-shadow: 0 3px 18px rgba(41, 51, 73, .035);
}
html[data-theme="light"] .page-head { background: var(--dt-bg); }
html[data-theme="light"] .page-title .title-text { font-weight: 800; letter-spacing: -.035em; }
html[data-theme="light"] .search-bar .form-control { border-radius: 12px; background: #f0f3fa; }
html[data-theme="light"] .btn-primary {
  background: var(--dt-blue);
  border-color: var(--dt-blue);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
}
html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .btn-primary:focus-visible { background: var(--dt-blue-hover); border-color: var(--dt-blue-hover); }
html[data-theme="light"] .btn-default { background: #eceef6; color: var(--dt-ink); border-radius: 12px; }
html[data-theme="light"] .form-control:focus { border-color: var(--dt-blue); box-shadow: 0 0 0 3px rgba(93,111,167,.15); }
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible { outline: 2px solid var(--dt-blue); outline-offset: 3px; }
html[data-theme="light"] .layout-main-section {
  border: 1px solid var(--dt-line);
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(41,51,73,.035);
}
html[data-theme="light"] .widget { border: 1px solid var(--dt-line); border-radius: 16px; }
html[data-theme="light"] .widget .widget-title { color: var(--dt-ink); font-weight: 700; }
html[data-theme="light"] .desk-sidebar-item.selected,
html[data-theme="light"] .standard-sidebar-item.selected { background: #e8eaf2; border-radius: 12px; }
html[data-theme="light"] .desk-sidebar-item.selected a,
html[data-theme="light"] .standard-sidebar-item.selected a { color: var(--dt-blue-hover); font-weight: 700; }
html[data-theme="light"] .list-row:hover { background: #f5f7fc; }
html[data-theme="light"] .modal-content,
html[data-theme="light"] .dropdown-menu { border-color: var(--dt-line); border-radius: 16px; }

/* Portal/login: scope to the login page, preserving portal business content. */
body[data-path="login"] { background: var(--dt-bg); color: var(--dt-ink); }
body[data-path="login"] .for-login .page-card,
body[data-path="login"] .for-forgot .page-card {
  border: 1px solid var(--dt-line);
  border-radius: 24px;
  box-shadow: 0 14px 45px rgba(41,51,73,.065);
}
body[data-path="login"] .btn-primary { background: var(--dt-blue); border-color: var(--dt-blue); border-radius: 12px; }
body[data-path="login"] .page-card-head h4 { font-weight: 800; letter-spacing: -.03em; }

@media (max-width: 767px) {
  .navbar .app-logo { width: auto; max-width: 84px; height: 24px; }
  .navbar .navbar-brand { margin-right: 10px; }
  html[data-theme="light"] .layout-main-section { border-radius: 12px; }
}
