:root {
  --app-primary: #2563eb;
  --app-primary-dark: #2563eb;
  --app-bg: #f8fafc;
  --app-card: #fff;
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-border: rgba(148, 163, 184, .32);
  --app-shadow: 0 18px 55px rgba(15, 23, 42, .12);
  --app-sidebar: 280px;
  --app-sidebar-closed: 76px
}
html,body,button,input,select,textarea{font-family:Poppins,system-ui,sans-serif!important}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, Segoe UI, sans-serif;
  background: linear-gradient(135deg, #f8fafc, #eef4ff 48%, #f8fafc);
  color: var(--app-text)
}

.hidden {
  display: none !important
}

:root.dark .login-card {
  background: #101b2f;
  border-color: rgba(148, 163, 184, .18);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .28)
}

:root.dark .login-card input {
  background: #101b2f;
  color: #e5edf8;
  border-color: rgba(148, 163, 184, .18)
}

:root.dark .login-card input::placeholder {
  color: #94a3b8
}

:root.dark  .auth-sidebar {
  background: #021e4b !important;
  color: #e5edf8
}

:root.dark  .auth-sidebar::after {
  background: linear-gradient(135deg, #021e4b, #102444 48%, #021e4b)
}

.login-card #btn-login {
  display: block
}

.login-card #btn-back,
.login-card #btn-next,
.login-card .wizard-indicator {
  display: none
}

.login-card .step-panel {
  display: block
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--app-sidebar) 1fr;
  transition: grid-template-columns .25s ease
}

.app-shell.sidebar-closed {
  grid-template-columns: var(--app-sidebar-closed) 1fr
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: var(--app-primary);
  color: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  transition: padding .25s ease
}

/* Scroll discreto e integrado à cor da barra lateral. */
.app-sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .26) transparent;
}

.app-sidebar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.app-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
  background-clip: padding-box;
}

.app-sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .42);
  background-clip: padding-box;
}

.app-sidebar::-webkit-scrollbar-button,
.app-sidebar::-webkit-scrollbar-corner {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 22px;
  white-space: nowrap
}

.app-logo {
  width: 50px;
  min-width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: -.04em
}

.app-brand span {
  display: block;
  color: #dbeafe;
  font-size: 12px;
  margin-top: 2px
}

.tab-group-title {
  margin: 18px 10px 8px;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap
}

.tab-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 5px 0;
  padding: 12px 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: #eaf2ff;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
  transition: .18s ease;
  white-space: nowrap
}

.tab-btn i {
  width: 18px;
  min-width: 18px;
  text-align: center
}

.tab-btn:hover {
  background: rgba(255, 255, 255, .11)
}

.tab-btn.active {
  background: rgba(255, 255, 255, .20);
  border-color: rgba(255, 255, 255, .20);
  box-shadow: 0 12px 25px rgba(15, 23, 42, .12)
}

.sidebar-footer {
  padding: 16px 10px;
  color: #dbeafe;
  font-size: 11px;
  line-height: 1.5
}

.app-shell.sidebar-closed .app-sidebar {
  padding-left: 14px;
  padding-right: 14px
}

.app-shell.sidebar-closed .app-brand div:not(.app-logo),
.app-shell.sidebar-closed .tab-btn span,
.app-shell.sidebar-closed .tab-group-title,
.app-shell.sidebar-closed .sidebar-footer {
  opacity: 0;
  pointer-events: none;
  width: 0;
  max-width: 0;
  overflow: hidden;
  margin: 0;
  padding: 0
}

.app-shell.sidebar-closed .tab-btn {
  padding-left: 0;
  padding-right: 0;
  padding-left: 10px !important;
}

.app-shell.sidebar-closed .tab-btn i {
  width: auto
}

.app-shell.sidebar-closed .app-brand .app-logo img {
  padding-left: 10px !important;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh
}

.app-topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid var(--app-border);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5
}

.topbar-left {
  min-width: 0;
  flex: 1
}

.topbar-left h1 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.topbar-left p {
  margin: 4px 0 0;
  color: var(--app-muted);
  font-size: 10px
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 550;
  border: 1px solid rgba(37, 99, 235, .13);
  white-space: nowrap
}

.icon-btn {
  height: 40px;
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 13px;
  padding: 0 12px;
  cursor: pointer;
  color: #334155;
  font-weight: 800
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px
}

.content-wrap {
  position: relative;
  flex: 1;
  height: calc(100vh - 74px);
  min-height: 0;
  overflow: hidden;
  display: flex;
  background: #fff
}

.module-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  display: block;
  flex: 1
}

.loading-module {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--app-muted);
  font-weight: 550;
  background: #fff;
  z-index: 1000
}

@media(max-width:980px) {

  .app-shell,
  .app-shell.sidebar-closed {
    grid-template-columns: 1fr
  }

  .app-sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: 300px;
    transform: translateX(-105%);
    transition: .2s ease
  }

  .app-sidebar.open {
    transform: translateX(0)
  }

  .content-wrap {
    height: calc(100vh - 74px)
  }

  .app-topbar {
    padding: 0 14px
  }

  .topbar-left h1 {
    font-size: 18px
  }

  .pill {
    display: none
  }
}

@media(max-width:560px) {
  .auth-main {
    padding: 14px
  }

  .login-card {
    padding: 22px
  }

  .auth-sidebar {
    display: none
  }

  .auth-shell {
    grid-template-columns: 1fr
  }

  .content-wrap {
    min-height: 520px
  }
}

/* Ajustes integração: tema global e módulos sem header próprio */
:root.dark {
  --app-bg: #08111f;
  --app-card: #101b2f;
  --app-text: #e5edf8;
  --app-muted: #94a3b8;
  --app-border: rgba(148, 163, 184, .18);
  --app-shadow: 0 18px 55px rgba(0, 0, 0, .28)
}

:root.dark body {
  background: linear-gradient(135deg, #08111f, #0f1f38 48%, #08111f);
  color: var(--app-text)
}

:root.dark .app-topbar {
  background: rgba(15, 23, 42, .82)
}

:root.dark .content-wrap,
:root.dark .module-frame,
:root.dark .loading-module {
  background: #08111f;
  color: var(--app-muted)
}

:root.dark .icon-btn {
  background: #101b2f;
  color: #e5edf8;
  border-color: var(--app-border)
}

:root.dark .pill {
  background: rgba(96, 165, 250, .12);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, .22)
}

.system-theme-btn {
  height: 40px;
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 13px;
  padding: 0 13px;
  cursor: pointer;
  color: #334155;
  font-weight: 550;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
  white-space: nowrap
}

:root.dark .system-theme-btn {
  background: #101b2f;
  color: #e5edf8;
  border-color: var(--app-border)
}

.content-wrap {
  background: transparent
}

.module-frame {
  background: transparent
}

/* Oculta o status do módulo por enquanto*/
#module-status { display: none; }

@media(max-width:760px) {

  .system-theme-btn span,
  #module-status {
    display: none !important
  }
}

/* Sidebar compatível com o modo escuro do app (:root.dark) */
:root.dark .app-sidebar {
  /* background: #08111f !important; */
  background: #042f75 !important;
  background-image: none !important;
  border-right: 1px solid rgba(148, 163, 184, .18) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .03);
}

:root.dark .app-brand span,
:root.dark .sidebar-footer {
  color: #94a3b8;
}

:root.dark .tab-group-title {
  color: #7da4d8;
}

:root.dark .tab-btn {
  color: #dbeafe;
}

:root.dark .tab-btn:hover {
  background: rgba(96, 165, 250, .12);
  border-color: rgba(96, 165, 250, .14);
}

:root.dark .tab-btn.active {
  background: #128fe35b;
  border-color: rgba(147, 197, 253, .24);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .22);
}

.app-shell.sidebar-closed .app-sidebar {
  overflow-y: hidden;
}

.app-shell.sidebar-closed .app-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app-shell.sidebar-closed .tab-btn {
  width: 48px;
  height: 48px;
  margin: 6px auto;
  padding: 0;
  justify-content: center;
  align-items: center;
}

.app-shell.sidebar-closed .tab-btn i {
  width: 18px;
  min-width: 18px;
  text-align: center;
}

/* Perfil do usuário */
.user-profile {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-profile-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 16px;
  padding: 5px 9px 5px 14px;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.user-greeting {
  display: grid;
  gap: 1px;
  text-align: left;
  line-height: 1.05;
}

.user-greeting small {
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
}

.user-greeting strong {
  font-size: 13px;
  font-weight: 650;
}

.user-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  border: 1px solid rgba(233, 240, 255, 0.13);
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

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

.user-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-chevron {
  color: #94a3b8;
  font-size: 10px;
  transition: transform .16s ease;
}

.user-profile-btn[aria-expanded="true"] .user-profile-chevron {
  transform: rotate(180deg);
}

.user-profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 260px;
  padding: 8px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-card);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 30;
}

.user-profile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.user-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 9px 11px;
}

.user-menu-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-menu-copy small {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 500;
}

.user-menu-copy strong {
  overflow: hidden;
  color: var(--app-text);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.user-menu-divider {
  height: 1px;
  margin: 2px 5px 6px;
  background: var(--app-border);
}

.user-menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 11px;
  padding: 0 11px;
  background: transparent;
  color: var(--app-text);
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}

.user-menu-item i {
  width: 18px;
  color: var(--app-muted);
  text-align: center;
}

.user-menu-item:hover {
  background: #eff6ff;
  color: #2563eb;
}

.user-menu-item:hover i { color: currentColor; }
.user-menu-item.danger:hover { background: #fff1f2; color: #e11d48; }

@media(max-width:700px) {
  .user-greeting,
  .user-profile-chevron,
  .system-theme-btn span,
  #module-status { display: none; }
  .user-profile-btn { padding: 5px; border-radius: 999px; }
}

:root.dark .user-greeting small { color: #94a3b8; }
:root.dark .user-greeting strong { color: #bfdbfe; }
:root.dark .user-avatar {
  background: rgba(96, 165, 250, .18);
  color: #dbeafe;
  border-color: rgba(255, 255, 255, .12);
}
:root.dark .user-profile-menu {
  background: #101b2f;
  border-color: var(--app-border);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .30);
}
:root.dark .user-menu-item:hover { background: rgba(96, 165, 250, .12); color: #bfdbfe; }
:root.dark .user-menu-item.danger:hover { background: rgba(244, 63, 94, .12); color: #fda4af; }

/* Rotinas - layout inspirado no módulo de Documentações */
.rotinas-body {
  margin: 0;
  background: #f8fafc;
  color: #202938;
  font-family: Poppins, system-ui, -apple-system, Segoe UI, sans-serif
}

.rotinas-page {
  padding: 24px
}

.rotinas-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px
}

.rotinas-topbar h1,
.rotinas-modal-head h2 {
  margin: 8px 0 5px;
  font-size: 34px;
  letter-spacing: -.06em
}

.rotinas-topbar p,
.rotinas-modal-head p {
  margin: 0;
  color: #64748b
}

.rotinas-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.rotinas-primary-btn,
.rotinas-secondary-btn,
.rotinas-icon-btn {
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 14px;
  padding: 11px 15px;
  font-weight: 900;
  cursor: pointer;
  transition: .18s ease
}

.rotinas-primary-btn {
  background: #1686e8;
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 134, 232, .18)
}

.rotinas-secondary-btn,
.rotinas-icon-btn {
  background: #fff;
  color: #1686e8
}

.rotinas-primary-btn:hover,
.rotinas-secondary-btn:hover,
.rotinas-icon-btn:hover {
  transform: translateY(-1px)
}

.rotinas-frequency-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 22px
}

.rotinas-chip {
  min-height: 92px;
  border: 1px solid #d9e3ef;
  background: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 550;
  color: #202938;
  cursor: pointer
}

.rotinas-chip i {
  font-size: 22px;
  color: #1686e8
}

.rotinas-chip span {
  font-size: 14px
}

.rotinas-chip.active {
  background: #eaf6ff;
  border-color: #9ed0ff;
  color: #0f69b3
}

.rotinas-content-section {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px
}

.rotinas-documents-panel,
.rotinas-viewer,
.rotinas-modal-card {
  background: #fff;
  border: 1px solid #d9e3ef;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, .04)
}

.rotinas-documents-panel {
  padding: 12px;
  height: calc(100vh - 190px);
  overflow: hidden;
  display: flex;
  flex-direction: column
}

.rotinas-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  padding: 0 12px;
  height: 44px
}

.rotinas-search-box i {
  color: #1686e8
}

.rotinas-search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  font: inherit
}

.rotinas-sector-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 900;
  color: #64748b
}

.rotinas-sector-select select {
  height: 42px;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: #202938;
  font: inherit;
  font-weight: 700;
  outline: 0
}

.rotinas-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid #e6edf5
}

.rotinas-list-head h3 {
  margin: 0;
  font-size: 16px
}

.rotinas-list-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px
}

.rotinas-list-head i {
  color: #1686e8
}

.rotinas-list {
  padding-top: 12px;
  overflow: auto
}

.rotina-item {
  width: 100%;
  text-align: left;
  border: 1px solid #d9e3ef;
  background: #fff;
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 9px;
  cursor: pointer
}

.rotina-item.active {
  background: #eaf6ff;
  border-color: #9ed0ff
}

.rotina-item h3 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.35
}

.rotina-meta,
.rotinas-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.rotina-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eaf6ff;
  color: #1686e8;
  border: 1px solid #b8dcff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900
}

.rotinas-viewer {
  min-height: calc(100vh - 190px);
  padding: 14px
}

.routine-detail-head {
  padding: 18px 10px 16px;
  border-bottom: 1px solid #e6edf5
}

.routine-detail-head h2 {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -.06em;
  margin: 12px 0 8px
}

.routine-detail-head p {
  margin: 0;
  color: #64748b
}

.occurrence-toolbar {
  display: grid;
  grid-template-columns: 180px 180px auto;
  gap: 10px;
  padding: 12px 0
}

.occurrence-toolbar label,
.rotinas-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #64748b;
  font-weight: 550;
  font-size: 12px
}

.occurrence-toolbar input,
.occurrence-toolbar select,
.rotinas-form input,
.rotinas-form select,
.rotinas-form textarea {
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: #202938;
  background: #fff
}

.occurrence-list {
  display: grid;
  gap: 10px
}

.occurrence-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  padding: 12px;
  background: #fff
}

.occurrence-item.done {
  background: #f2fbf6
}

.occurrence-check {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eaf6ff;
  color: #1686e8;
  display: grid;
  place-items: center
}

.occurrence-check input {
  width: 19px;
  height: 19px;
  accent-color: #1686e8;
  cursor: pointer
}

.occurrence-info {
  display: flex;
  flex-direction: column;
  gap: 3px
}

.occurrence-info span {
  color: #64748b;
  font-size: 13px
}

.occurrence-done-btn {
  border: 0;
  background: #1686e8;
  color: #fff;
  border-radius: 11px;
  padding: 10px 13px;
  font-weight: 900;
  cursor: pointer
}

.occurrence-done-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed
}

.rotinas-alert,
.rotinas-empty-state {
  border: 1px dashed #b8c7d9;
  border-radius: 15px;
  padding: 18px;
  color: #64748b;
  background: #fbfdff
}

.rotinas-alert.error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c
}

.rotinas-empty-state {
  min-height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center
}

.rotinas-empty-state i {
  font-size: 38px;
  color: #1686e8
}

.rotinas-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 100
}

.rotinas-modal[hidden] {
  display: none
}

.rotinas-modal-card {
  width: min(860px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 18px
}

.rotinas-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #e6edf5;
  padding-bottom: 14px;
  margin-bottom: 14px
}

.rotinas-icon-btn {
  width: 42px;
  height: 42px;
  padding: 0
}

.rotinas-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px
}

.rotinas-form .span-2 {
  grid-column: span 2
}

.weekday-wrap {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d9e3ef;
  border-radius: 14px
}

.weekday-wrap>span {
  font-size: 12px;
  font-weight: 900;
  color: #64748b
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 9px
}

.weekday-grid label {
  align-items: center;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  padding: 9px;
  background: #fbfdff;
  color: #202938
}

.rotinas-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px
}

.rotinas-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #0f172a;
  color: #fff;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  z-index: 200
}

@media(max-width:900px) {
  .rotinas-page {
    padding: 14px
  }

  .rotinas-frequency-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .rotinas-topbar,
  .rotinas-modal-head {
    align-items: stretch;
    flex-direction: column
  }

  .rotinas-content-section {
    grid-template-columns: 1fr
  }

  .rotinas-documents-panel {
    height: auto;
    max-height: 420px
  }

  .occurrence-toolbar,
  .rotinas-form-grid {
    grid-template-columns: 1fr
  }

  .rotinas-form .span-2 {
    grid-column: auto
  }

  .weekday-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

/* Ajuste solicitado: sem botão de tema extra; conteúdo usa melhor largura útil */
.app-main { background: var(--app-bg); }
.content-wrap { padding: 0; background: var(--app-bg); }
.module-frame { width: 100%; min-width: 0; }
.app-topbar { height: 68px; padding: 0 20px; }
.topbar-actions { gap: 8px; }
@media(max-width:980px){ .app-topbar{height:64px;} .content-wrap{height:calc(100vh - 64px);} }
