:root {
    --primary: #0B2A5B;
    --primary-2: #1E4AA8;
    --primary-soft: #EAF1FF;
    --background: #F3F6FA;
    --surface: #FFFFFF;
    --text: #0C2347;
    --muted: #65738A;
    --border: #D9E2F2;
    --danger: #B42318;
    --success: #067647;
    --shadow: 0 14px 35px rgba(11, 42, 91, 0.10);
    --radius: 14px;
  }

  * { box-sizing: border-box; }

  html { min-height: 100%; }

  body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--background);
  }

  button, input { font: inherit; }
  button { cursor: pointer; }

  .hidden { display: none !important; }
  .view { min-height: 100vh; }

  .login-view {
    display: grid;
    place-items: center;
    padding: 30px;
    background:
      radial-gradient(circle at 15% 20%, rgba(59, 130, 246, .16), transparent 35%),
      radial-gradient(circle at 90% 80%, rgba(11, 42, 91, .14), transparent 30%),
      #EEF3FA;
  }

  .login-shell {
    width: min(1060px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    overflow: hidden;
    border: 1px solid rgba(217, 226, 242, .9);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 30px 80px rgba(11, 42, 91, .16);
  }

  .login-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px;
    color: var(--primary);
    background: #FFFFFF;
    border-right: 1px solid var(--border);
    overflow: hidden;
  }

  .login-brand-panel::before,
  .login-brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(11, 42, 91, .11);
  }

  .login-brand-panel::before {
    width: 420px;
    height: 420px;
    right: -190px;
    top: -160px;
  }

  .login-brand-panel::after {
    width: 260px;
    height: 260px;
    left: -130px;
    bottom: -100px;
  }

  .brand-symbol {
    position: relative;
    z-index: 1;
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(11, 42, 91, .28);
    border-radius: 18px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: 26px;
    letter-spacing: 2px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  }

  .brand-symbol.small {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--primary);
    font-size: 16px;
  }

  .brand-kicker,
  .eyebrow {
    margin: 24px 0 8px;
    color: #2C63D7;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .11em;
  }

  .login-brand-panel .brand-kicker { color: var(--primary-2); }

  .login-brand-panel h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 430px;
    color: var(--primary);
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.05;
  }

  .brand-description {
    position: relative;
    z-index: 1;
    max-width: 450px;
    margin: 24px 0 34px;
    color: var(--primary-2);
    font-size: 18px;
    line-height: 1.6;
  }

  .brand-feature-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    color: var(--primary);
  }

  .brand-feature-list div { display: flex; gap: 12px; align-items: center; }
  .brand-feature-list span { color: var(--primary-2); font-weight: 900; }

  .login-form-panel {
    display: grid;
    place-items: center;
    padding: 54px;
  }

  .login-card { width: min(390px, 100%); }
  .mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 34px; }

  .login-card h2 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -.03em;
  }

  .login-help {
    margin: 10px 0 32px;
    color: var(--muted);
    line-height: 1.5;
  }

  .login-card label {
    display: block;
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
  }

  .input-wrap {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 14px;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    transition: .2s ease;
  }

  .input-wrap:focus-within {
    border-color: #5B84DF;
    box-shadow: 0 0 0 4px rgba(44,99,215,.12);
  }

  .input-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
  }

  .toggle-password {
    border: 0;
    padding: 6px;
    color: var(--primary-2);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
  }

  .primary-button,
  .secondary-button,
  .module-button {
    border-radius: 10px;
    font-weight: 800;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  }

  .primary-button {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
    padding: 0 20px;
    border: 0;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 12px 24px rgba(11,42,91,.18);
  }

  .primary-button:hover,
  .module-button:hover { transform: translateY(-1px); box-shadow: 0 12px 25px rgba(11,42,91,.22); }
  .primary-button:disabled { opacity: .65; cursor: wait; transform: none; }

  .form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }
  .login-footer { margin: 28px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

  .painel-view { padding: 40px 22px; }
  .portal-container { width: min(1320px, 100%); margin: 0 auto; }

  .portal-header {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .header-user { display: flex; align-items: center; gap: 16px; min-width: 0; }

  .portal-logo {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), #2458C5);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
  }

  .portal-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

  .header-user h1 {
    margin: 0 0 8px;
    font-size: clamp(21px, 2.5vw, 30px);
    line-height: 1.15;
  }

  .header-user p { margin: 0; color: var(--muted); }
  .header-actions { display: flex; align-items: center; gap: 10px; }

  .secondary-button {
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--border);
    color: var(--text);
    background: #fff;
  }

  .secondary-button:hover { background: #F7F9FC; }
  .laws-button { display: flex; align-items: center; gap: 9px; }
  .laws-menu-wrap { position: relative; }

  .laws-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 310px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(11,42,91,.18);
  }

  .law-item {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 0;
    border-radius: 9px;
    color: var(--text);
    text-align: left;
    background: transparent;
  }

  .law-item:hover { background: var(--primary-soft); }
  .law-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: var(--primary-soft); }
  .law-item strong { display: block; margin-bottom: 4px; }
  .law-item small { display: block; color: var(--muted); line-height: 1.3; }

  .summary-grid {
    display: grid;
    grid-template-columns: 1.35fr .9fr;
    gap: 20px;
    margin-top: 20px;
  }

  .welcome-card,
  .modules-count-card {
    min-height: 128px;
    padding: 26px;
    border-radius: var(--radius);
  }

  .welcome-card {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .welcome-card .eyebrow { margin-top: 0; }
  .welcome-card h2 { margin: 0 0 8px; font-size: 28px; }
  .welcome-card p:last-child { margin: 0; color: var(--muted); }

  .modules-count-card {
    display: grid;
    align-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #244EA6);
    box-shadow: 0 14px 30px rgba(11,42,91,.20);
  }

  .modules-count-card span { font-size: 13px; letter-spacing: .06em; }
  .modules-count-card strong { margin-top: 4px; font-size: 42px; line-height: 1; }
  .modules-count-card small { margin-top: 8px; color: #CFE0FF; }

  .modules-section { margin-top: 28px; }
  .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 16px; }
  .section-heading h2 { margin: 0 0 2px; font-size: 28px; }
  .section-heading p { margin: 0; color: var(--muted); }

  .filter-wrap input {
    width: min(280px, 100%);
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: #fff;
  }

  .filter-wrap input:focus { border-color: #5B84DF; box-shadow: 0 0 0 4px rgba(44,99,215,.10); }

  .modules-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .module-card {
    min-height: 205px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 10px 25px rgba(11,42,91,.08);
    transition: transform .18s ease, box-shadow .18s ease;
  }

  .module-card:hover { transform: translateY(-3px); box-shadow: 0 18px 35px rgba(11,42,91,.13); }

  .module-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid #CFE0FF;
    border-radius: 10px;
    background: var(--primary-soft);
    font-size: 27px;
  }

  .module-category {
    margin: 14px 0 5px;
    color: #416ABF;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
  }

  .module-card h3 { margin: 0; font-size: 20px; line-height: 1.2; }
  .module-card p { flex: 1; margin: 9px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }

  .module-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    color: #fff;
    background: var(--primary);
  }

  .empty-state {
    padding: 55px 20px;
    border: 1px dashed #BBCBE6;
    border-radius: var(--radius);
    text-align: center;
    background: rgba(255,255,255,.65);
  }

  .empty-state span { font-size: 36px; }
  .empty-state h3 { margin: 12px 0 6px; }
  .empty-state p { margin: 0; color: var(--muted); }

  .portal-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 35px;
    padding: 18px 4px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
  }

  .loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(238,243,250,.78);
    backdrop-filter: blur(4px);
  }

  .loading-box {
    min-width: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    font-weight: 700;
  }

  .spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #DDE7F6;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: girar .7s linear infinite;
  }

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

  .toast {
    position: fixed;
    z-index: 10000;
    right: 22px;
    bottom: 22px;
    max-width: min(390px, calc(100vw - 44px));
    padding: 14px 18px;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 16px 35px rgba(11,42,91,.22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
    transition: .25s ease;
  }

  .toast.show { opacity: 1; transform: translateY(0); }
  .toast.error { background: var(--danger); }
  .toast.success { background: var(--success); }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

  @media (max-width: 1080px) {
    .modules-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .login-brand-panel { padding: 50px; }
  }

  @media (max-width: 820px) {
    .login-view { padding: 16px; }
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
    .login-brand-panel { display: none; }
    .login-form-panel { padding: 42px 28px; }
    .mobile-brand { display: flex; }
    .painel-view { padding: 16px; }
    .portal-header { align-items: flex-start; }
    .header-actions { flex-direction: column; align-items: stretch; }
    .summary-grid { grid-template-columns: 1fr; }
    .modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 590px) {
    .portal-header { flex-direction: column; }
    .header-actions { width: 100%; flex-direction: row; }
    .header-actions > * { flex: 1; }
    .secondary-button { width: 100%; justify-content: center; }
    .laws-menu { left: 0; right: auto; width: min(310px, calc(100vw - 32px)); }
    .section-heading { align-items: stretch; flex-direction: column; }
    .filter-wrap input { width: 100%; }
    .modules-grid { grid-template-columns: 1fr; }
    .module-card { min-height: 185px; }
    .portal-footer { flex-direction: column; gap: 6px; }
  }

  body.modal-open { overflow: hidden; }

  .header-actions .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(7, 24, 52, .68);
    backdrop-filter: blur(5px);
  }

  .admin-window {
    width: min(1280px, 100%);
    height: min(820px, calc(100vh - 44px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 35px 90px rgba(0,0,0,.28);
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
    background: #fff;
  }

  .modal-header.compact { padding-bottom: 18px; }
  .modal-header .eyebrow { margin: 0 0 6px; }
  .modal-header h2 { margin: 0; font-size: 27px; }
  .modal-header p:last-child { margin: 7px 0 0; color: var(--muted); line-height: 1.45; }

  .icon-button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: #fff;
    font-size: 26px;
    line-height: 1;
  }

  .icon-button:hover { background: #F4F7FB; }

  .admin-layout {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .admin-users-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    border-right: 1px solid var(--border);
    background: #F6F8FC;
  }

  .admin-list-actions {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
  }

  .admin-list-actions input,
  .admin-form input,
  .admin-form select {
    width: 100%;
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    color: var(--text);
    background: #fff;
  }

  .admin-list-actions input:focus,
  .admin-form input:focus,
  .admin-form select:focus {
    border-color: #5B84DF;
    box-shadow: 0 0 0 4px rgba(44,99,215,.10);
  }

  .admin-form input:disabled {
    color: #667085;
    background: #F2F4F7;
    cursor: not-allowed;
  }

  .primary-small-button,
  .outline-small-button,
  .outline-button,
  .primary-action-button,
  .warning-button,
  .danger-button {
    border-radius: 9px;
    font-weight: 800;
  }

  .primary-small-button {
    min-height: 44px;
    border: 0;
    color: #fff;
    background: var(--primary);
  }

  .outline-small-button,
  .outline-button {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--border);
    color: var(--text);
    background: #fff;
  }

  .primary-action-button {
    min-height: 47px;
    padding: 0 22px;
    border: 0;
    color: #fff;
    background: var(--primary);
  }

  .primary-action-button.full { width: 100%; }
  .primary-action-button:disabled { opacity: .6; cursor: wait; }

  .admin-user-list {
    min-height: 0;
    flex: 1;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: auto;
    padding-right: 3px;
  }

  .admin-user-item {
    width: 100%;
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text);
    text-align: left;
    background: #fff;
  }

  .admin-user-item:hover { border-color: #BFD0ED; }
  .admin-user-item.selected { border-color: var(--primary); background: var(--primary-soft); }

  .admin-user-item-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
  }

  .admin-user-item small { color: var(--muted); }
  .mini-status,
  .status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: .04em;
  }

  .mini-status { padding: 4px 7px; font-size: 9px; }
  .status-pill { padding: 7px 11px; font-size: 11px; }
  .mini-status.active, .status-pill.active { color: #067647; background: #D1FADF; }
  .mini-status.blocked, .status-pill.blocked { color: #B42318; background: #FEE4E2; }

  .admin-list-empty {
    padding: 25px 14px;
    color: var(--muted);
    text-align: center;
  }

  .admin-editor-panel {
    min-width: 0;
    overflow: auto;
    padding: 24px 28px 32px;
  }

  .admin-form {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
  }

  .admin-form-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
  }

  .admin-form-title span:first-child {
    color: #416ABF;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
  }

  .admin-form-title h3 { margin: 5px 0 0; font-size: 25px; }

  .form-grid {
    display: grid;
    gap: 17px;
  }

  .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .admin-form label > span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 800;
  }

  .admin-form label small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
  }

  .form-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
  }

  .form-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .form-section-heading h4 { margin: 0 0 5px; font-size: 17px; }
  .form-section-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

  .switch-line,
  .checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 9px;
    cursor: pointer;
  }

  .switch-line { white-space: nowrap; }
  .switch-line input,
  .checkbox-line input,
  .permission-card input {
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    accent-color: var(--primary);
  }

  .switch-line span,
  .checkbox-line span { margin: 0 !important; font-size: 12px !important; }

  .module-permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .module-permissions-grid.disabled { opacity: .48; }

  .permission-card {
    display: grid !important;
    grid-template-columns: 18px 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 68px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
  }

  .permission-card:hover { border-color: #AFC4E7; background: #F8FAFD; }
  .permission-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--primary-soft); }
  .permission-card strong { display: block; font-size: 12px; line-height: 1.25; }
  .permission-card small { margin-top: 4px !important; font-size: 9px !important; font-weight: 800; letter-spacing: .05em; }

  .password-section { padding-bottom: 5px; }

  .password-admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 12px;
  }

  .password-field {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
  }

  .password-field:focus-within {
    border-color: #5B84DF;
    box-shadow: 0 0 0 4px rgba(44,99,215,.10);
  }

  .password-field input {
    border: 0;
    box-shadow: none !important;
  }

  .password-field button {
    height: 43px;
    padding: 0 12px;
    border: 0;
    color: var(--primary);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
  }

  .admin-error { min-height: 20px; margin-top: 15px; }

  .admin-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
  }


  .admin-user-access { margin-top: 3px; }
  .admin-user-sessions {
    color: #416ABF !important;
    font-weight: 700;
  }

  .account-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 4px 0 2px;
  }

  .account-info-grid > div {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #F8FAFD;
  }

  .account-info-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  .account-info-grid strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-form-footer {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }

  .admin-danger-actions,
  .admin-save-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .warning-button,
  .danger-button {
    min-height: 42px;
    padding: 0 15px;
  }

  .warning-button {
    border: 1px solid #F4B740;
    color: #8A4B08;
    background: #FFF7E6;
  }

  .danger-button {
    border: 1px solid #F0A6A0;
    color: #B42318;
    background: #FFF1F0;
  }

  .warning-button:hover { background: #FFEDCC; }
  .danger-button:hover { background: #FEE4E2; }

  .warning-button:disabled,
  .danger-button:disabled {
    opacity: .45;
    cursor: not-allowed;
  }

  .password-modal-card {
    width: min(500px, 100%);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
  }

  .password-self-form { padding: 22px 26px 28px; }
  .password-self-form label { display: block; margin-bottom: 16px; }

  @media (max-width: 1100px) {
    .header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .admin-layout { grid-template-columns: 285px minmax(0, 1fr); }
    .module-permissions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 820px) {
    .modal-overlay { padding: 10px; }
    .admin-window { height: calc(100vh - 20px); }
    .admin-layout { grid-template-columns: 1fr; overflow: auto; }
    .admin-users-panel { min-height: 280px; border-right: 0; border-bottom: 1px solid var(--border); }
    .admin-user-list { max-height: 260px; }
    .admin-editor-panel { overflow: visible; padding: 22px 18px 30px; }
    .form-grid.two { grid-template-columns: 1fr; }
    .header-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .header-actions > * { width: 100%; }
  }

  @media (max-width: 560px) {
    .modal-header { padding: 18px; }
    .modal-header h2 { font-size: 22px; }
    .module-permissions-grid { grid-template-columns: 1fr; }
    .form-section-heading { flex-direction: column; }
    .password-admin-row { grid-template-columns: 1fr; }
    .account-info-grid { grid-template-columns: 1fr; }
    .admin-form-footer { flex-direction: column-reverse; align-items: stretch; }
    .admin-danger-actions, .admin-save-actions { width: 100%; flex-direction: column; }
    .admin-form-footer button { width: 100%; }
    .header-actions { grid-template-columns: 1fr; }
  }
