﻿:root {
  

  --ads-bg: #F5F7F8;
  --ads-surface: #FFFFFF;
  --ads-sidebar: #FFFFFF;
  --ads-border: #DDE3E7;
  --ads-border-soft: #E9EDF0;
  
  
  --ads-icon: #5E6A73;
  --ads-accent: #246B4A;
  --ads-accent-hover: #1E5A3E;
  --ads-accent-soft: #EAF2ED;

  --bg: var(--ads-bg);
  --panel: var(--ads-surface);
  --panel-soft: #F8FAFA;

  --line: var(--ads-border);
  --line-dark: #CDD5DA;

  
  

  --green: var(--ads-accent);
  --green-dark: var(--ads-accent-hover);
  --green-soft: var(--ads-accent-soft);
  --green-hover: var(--ads-accent-hover);

  --danger: #b42318;

  --sidebar-width: 236px;
  --menu-row-height: 44px;
  --menu-row-radius: 8px;
  --menu-row-pad-x: 12px;
  --menu-icon-gap: 12px;
  --menu-hover-bg: #F2F5F4;
  --menu-active-bg: var(--ads-accent-soft);
  --menu-active-bg-legacy: var(--ads-accent-soft);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  
  
  
  
  
}

a {
  color: inherit;
  text-decoration: none;
}


/* Windowed desktop: keep the application shell in two columns until narrow mode. */
@media (min-width: 901px) and (max-width: 1279px) {
  :root { --sidebar-width: 208px; }
  .app-layout { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .app-sidebar { min-width: var(--sidebar-width); width: var(--sidebar-width); }
  .app-sidebar__inner { padding: 10px 8px; }
  .app-main, .app-content { min-width: 0; }
  .app-content { padding: 6px; }
  .app-topbar__title { font-size: var(--ui-subtitle-size); }
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--bg);
}

body.app-sidebar-collapsed .app-layout {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.app-sidebar {
  min-width: var(--sidebar-width);
  width: var(--sidebar-width);
  height: 100vh;
  overflow: hidden;
  background: var(--ads-sidebar);
  border-right: 1px solid var(--ads-border);
  box-shadow: none;
}

.app-sidebar__inner {
  height: 100vh;
  min-height: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
}

.app-brand {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--ads-border-soft);
  color: inherit;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.app-brand:hover {
  background-color: #f7f9f8;
}

.app-brand:focus-visible {
  outline: 2px solid var(--ads-accent);
  outline-offset: -2px;
  background-color: var(--ads-accent-soft);
}

.app-brand__logo {
  width: 40px;
  height: 40px;
  display: block;
  flex: 0 0 40px;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
}

.app-brand__logo .ads-app-logo,
.ads-app-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 10px;
}

.app-brand__text {
  min-width: 0;
  display: flex;
  align-items: center;
}

.app-brand__title {
  font-size: var(--ui-text-size);
  line-height: var(--ui-heading-line);
  font-weight: var(--ui-strong-weight);
  color: var(--ads-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-brand__subtitle {
  display: none;
}

.app-sidebar-toggle {
  display: none !important;
}

.app-nav-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0;
  border: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: #b8bec7 transparent;
}

.app-nav-panel::-webkit-scrollbar {
  width: 6px;
}

.app-nav-panel::-webkit-scrollbar-track {
  background: transparent;
}

.app-nav-panel::-webkit-scrollbar-thumb {
  background: #b8bec7;
  border-radius: 999px;
}

.app-nav-panel::-webkit-scrollbar-thumb:hover {
  background: #8f98a5;
}

.app-nav {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
  display: grid;
  gap: 4px;
}

.app-nav__item {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  min-height: var(--menu-row-height);
  padding: 0 var(--menu-row-pad-x);
  display: flex;
  align-items: center;
  gap: var(--menu-icon-gap, 12px);
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--menu-row-radius);
  background: transparent;
  color: var(--ads-text-secondary);
  font-size: var(--ui-text-size);
  font-weight: var(--ui-medium-weight);
  line-height: var(--ui-heading-line);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-nav__badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #F4E8D8;
  color: #7A5A2E;
  border: 1px solid #E6D5BC;
  font-size: var(--ui-muted-size);
  font-weight: var(--ui-strong-weight);
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
}

.app-nav__item:hover {
  background: var(--menu-hover-bg);
  border-color: transparent;
  color: var(--ads-text-secondary);
}

.app-nav__item.is-active {
  background: var(--menu-active-bg);
  border-left-color: var(--ads-accent);
  color: var(--ads-accent-hover);
  box-shadow: none;
  font-weight: var(--ui-strong-weight);
}

.app-nav__item--create {
  background: transparent;
}

.app-nav__item:focus-visible,
.app-sidebar-settings-link:focus-visible {
  outline: 2px solid rgba(36, 107, 74, 0.35);
  outline-offset: 1px;
}

.app-nav__icon {
  /* Back-compat wrapper: MenuIcon is the real badge */
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
  display: contents;
  color: inherit;
}

.app-nav__icon svg:not(.menu-icon__svg) {
  display: none;
}

.app-nav__label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: var(--ui-heading-line);
}

.app-nav__group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: grid;
  gap: 4px;
  padding-top: 6px;
}

.app-nav__group-title {
  padding: 10px 14px 4px;
  color: var(--ads-text-muted);
  font-size: var(--ui-muted-size);
  font-weight: var(--ui-medium-weight);
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-nav__item--sub {
  min-height: var(--menu-row-height);
  margin-left: 0;
  width: 100%;
}

.app-sidebar__foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--ads-border-soft);
}

.app-sidebar-settings-link {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 0;
  border-radius: var(--menu-row-radius);
  background: transparent;
  color: var(--ads-text-secondary);
  font-size: var(--ui-text-size);
  font-weight: var(--ui-medium-weight);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-sidebar-settings-link:hover {
  background: var(--menu-hover-bg);
  color: var(--ads-text-secondary);
}

.app-sidebar-settings-link.is-active {
  background: var(--menu-active-bg);
  color: var(--ads-accent-hover);
  box-shadow: none;
  font-weight: var(--ui-strong-weight);
}


.app-sidebar__logout { margin: 0; }

.app-sidebar-logout-button {
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: #9E332B;
  font: inherit;
}

.app-sidebar-logout-button:hover,
.app-sidebar-logout-button:focus-visible {
  background: #FFF1F0;
  color: #7F251F;
  outline: none;
}

.ads-logout-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 20px;
}

.ads-logout-dialog {
  position: fixed;
  inset: 0;
  width: min(470px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  color: #17211c;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}
.ads-logout-dialog::backdrop {
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(3px);
}
.ads-logout-dialog__panel {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
  background: #fff;
}
.ads-logout-dialog__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff1f0;
  color: #b42318;
}
.ads-logout-dialog__icon svg {
  width: 27px;
  height: 27px;
}
.ads-logout-dialog__content {
  min-width: 0;
}
.ads-logout-dialog__content h2 {
  margin: 1px 0 8px;
  font-size: 21px;
  line-height: 1.25;
  font-weight: var(--ui-strong-weight);
  color: #17211c;
}
.ads-logout-dialog__content p {
  margin: 0;
  color: #5f6d66;
  font-size: 14px;
  line-height: 1.5;
}
.ads-logout-dialog__notice {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #e2e7e4;
  border-radius: 9px;
  background: #f7f9f8;
  color: #3b4942;
  font-size: 13px;
  line-height: 1.4;
}
.ads-logout-dialog__error {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid #f0b7b2;
  border-radius: 8px;
  background: #fff4f2;
  color: #a12820;
  font-size: 13px;
  line-height: 1.4;
}
.ads-logout-dialog__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}
.ads-logout-dialog__button {
  min-width: 112px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #cbd5d0;
  border-radius: 8px;
  background: #fff;
  color: #26332d;
  font-family:var(--ui-font);font-size:14px;font-weight:var(--ui-strong-weight);
  cursor: pointer;
}
.ads-logout-dialog__button:hover,
.ads-logout-dialog__button:focus-visible {
  border-color: #9caaa3;
  background: #f5f7f6;
  outline: none;
}
.ads-logout-dialog__button--danger {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}
.ads-logout-dialog__button--danger:hover,
.ads-logout-dialog__button--danger:focus-visible {
  border-color: #8f1e16;
  background: #8f1e16;
}
.ads-logout-dialog__button:disabled {
  opacity: .68;
  cursor: wait;
}
.ads-logout-dialog__button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 440px) {
  .ads-logout-dialog__panel {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }
  .ads-logout-dialog__icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }
  .ads-logout-dialog__content h2 { font-size: 19px; }
  .ads-logout-dialog__actions { flex-direction: column-reverse; }
  .ads-logout-dialog__button { width: 100%; }
}

.app-sidebar-settings-icon {
  display: contents;
}

.app-sidebar-settings-icon svg:not(.menu-icon__svg) {
  display: none;
}

.app-main {
  min-width: 0;
  overflow: hidden;
}

.app-topbar {
  height: 44px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ads-surface);
  border-bottom: 1px solid var(--ads-border);
}

.app-topbar__title {
  color: var(--ads-text);
  font-size: var(--ui-heading-sm);
  line-height: var(--ui-heading-line);
  font-weight: var(--ui-strong-weight);
}

.app-topbar__subtitle {
  margin-top: 2px;
  font-size: var(--ui-muted-size);
  color: var(--ads-text-muted);
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-content {
  height: calc(100vh - 44px);
  padding: 4px 6px 6px;
  overflow: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.app-body,
.app-layout,
.app-main,
.app-content {
  min-width: 0;
  max-width: 100%;
}

.app-btn,
button,
input,
select,
textarea {
  max-width: 100%;
}

.app-btn,
.app-topbar__actions a,
.app-topbar__actions button {
  white-space: normal;
  text-align: center;
}

.app-topbar__actions .app-btn {
  min-height: 32px;
  line-height: var(--ui-heading-line);
}

@media (min-width: 981px) {
  .app-topbar__actions > a,
  .app-topbar__actions > button,
  .app-topbar__actions .app-btn,
  .app-topbar__actions .he-btn {
    min-height: 34px;
    height: 34px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: var(--ui-label-size);
  }
}

.app-card {
  background: var(--panel);
  border: 1px solid var(--line);
}

.app-card--pad {
  padding: 8px;
}

.app-btn {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #CDD5DA;
  border-radius: 6px;
  background: #fff;
  color: var(--ads-text-secondary);
  font-size: var(--ui-label-size);
  font-weight: var(--ui-medium-weight);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-btn:hover {
  background: #F4F6F7;
}

.app-btn--primary {
  background: var(--ads-accent);
  border-color: var(--ads-accent);
  color: #fff;
  font-weight: var(--ui-strong-weight);
}

.app-btn--primary:hover {
  background: var(--ads-accent-hover);
  border-color: var(--ads-accent-hover);
  color: #fff;
}

.app-btn--ghost {
  background: #fff;
}

.app-btn--secondary {
  background: #fff;
  border-color: #CDD5DA;
  color: var(--ads-text-secondary);
  font-weight: var(--ui-strong-weight);
}

.app-btn--danger {
  background: #d92d20;
  border-color: #912018;
  color: #fff;
  font-weight: var(--ui-strong-weight);
}

.app-input,
.app-select,
.app-textarea,
input,
select,
textarea {
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--ads-text-secondary);
  font-size: var(--ui-text-size);
}

.app-input,
.app-select,
input,
select {
  height: 30px;
  padding: 3px 7px;
}

textarea,
.app-textarea {
  min-height: 64px;
  padding: 6px 7px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 1px solid var(--green);
  border-color: var(--green);
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  body.app-sidebar-collapsed .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .app-sidebar__inner {
    height: auto;
    position: static;
    display: block;
  }

  .app-brand {
    margin-bottom: 5px;
  }

  .app-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-sidebar__foot {
    display: block;
  }

  .app-topbar {
    height: auto;
    min-height: 48px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .app-topbar__actions {
    flex-wrap: wrap;
  }

  .app-content {
    height: auto;
    min-height: calc(100vh - 44px);
    padding: 7px;
    overflow-x: auto;
  }
}


